Merge
authorysr
Wed, 21 Jul 2010 09:57:21 -0700
changeset 6061 30da66e3cac8
parent 6060 f93277335d21 (current diff)
parent 6036 88db80c8e49c (diff)
child 6066 3046588b1ba8
child 6069 7c7d1bb51db4
Merge
corba/make/com/sun/corba/minclude/ioser_io.jmk
jdk/make/com/sun/inputmethods/Makefile
jdk/make/com/sun/inputmethods/indicim/Makefile
jdk/make/com/sun/inputmethods/thaiim/Makefile
jdk/src/linux/doc/man/ja/kinit.1
jdk/src/linux/doc/man/ja/klist.1
jdk/src/linux/doc/man/ja/ktab.1
jdk/src/share/classes/com/sun/inputmethods/internal/indicim/DevanagariInputMethodDescriptor.java
jdk/src/share/classes/com/sun/inputmethods/internal/indicim/DevanagariTables.java
jdk/src/share/classes/com/sun/inputmethods/internal/indicim/IndicInputMethod.java
jdk/src/share/classes/com/sun/inputmethods/internal/indicim/IndicInputMethodImpl.java
jdk/src/share/classes/com/sun/inputmethods/internal/indicim/java.awt.im.spi.InputMethodDescriptor
jdk/src/share/classes/com/sun/inputmethods/internal/indicim/resources/DisplayNames.properties
jdk/src/share/classes/com/sun/inputmethods/internal/indicim/resources/DisplayNames_de.properties
jdk/src/share/classes/com/sun/inputmethods/internal/indicim/resources/DisplayNames_es.properties
jdk/src/share/classes/com/sun/inputmethods/internal/indicim/resources/DisplayNames_fr.properties
jdk/src/share/classes/com/sun/inputmethods/internal/indicim/resources/DisplayNames_it.properties
jdk/src/share/classes/com/sun/inputmethods/internal/indicim/resources/DisplayNames_ja.properties
jdk/src/share/classes/com/sun/inputmethods/internal/indicim/resources/DisplayNames_ko.properties
jdk/src/share/classes/com/sun/inputmethods/internal/indicim/resources/DisplayNames_sv.properties
jdk/src/share/classes/com/sun/inputmethods/internal/indicim/resources/DisplayNames_zh_CN.properties
jdk/src/share/classes/com/sun/inputmethods/internal/indicim/resources/DisplayNames_zh_TW.properties
jdk/src/share/classes/com/sun/inputmethods/internal/thaiim/ThaiInputMethod.java
jdk/src/share/classes/com/sun/inputmethods/internal/thaiim/ThaiInputMethodDescriptor.java
jdk/src/share/classes/com/sun/inputmethods/internal/thaiim/ThaiInputMethodImpl.java
jdk/src/share/classes/com/sun/inputmethods/internal/thaiim/ThaiRules.java
jdk/src/share/classes/com/sun/inputmethods/internal/thaiim/java.awt.im.spi.InputMethodDescriptor
jdk/src/share/classes/com/sun/inputmethods/internal/thaiim/resources/DisplayNames.properties
jdk/src/share/classes/javax/swing/text/html/parser/html32.bdtd
jdk/src/share/classes/sun/security/tools/PolicyTool.java
jdk/test/java/nio/channels/ServerSocketChannel/AcceptAddress.java
jdk/test/java/nio/charset/coders/Surrogate.java
jdk/test/tools/launcher/Makefile.SolarisRunpath
jdk/test/tools/launcher/lib/i386/lib32/lib32/liblibrary.so
jdk/test/tools/launcher/lib/i386/lib32/liblibrary.so
jdk/test/tools/launcher/lib/sparc/lib32/lib32/liblibrary.so
jdk/test/tools/launcher/lib/sparc/lib32/liblibrary.so
jdk/test/tools/launcher/lib/sparc/lib64/lib64/liblibrary.so
jdk/test/tools/launcher/lib/sparc/lib64/liblibrary.so
--- a/.hgtags	Tue Jul 20 16:09:44 2010 -0700
+++ b/.hgtags	Wed Jul 21 09:57:21 2010 -0700
@@ -70,3 +70,9 @@
 b5dab6a313fdff4c043250e4d9c8f66fd624d27e jdk7-b93
 8bb281f0f91582104d65d032be22522bfd2d8110 jdk7-b94
 654298d26561b76dfe3cfcffbbd7078080837300 jdk7-b95
+d260f892491e040ae385a8e6df59557a7d721abf jdk7-b96
+7e406ebed9a5968b584f3c3e6b60893b5d6d9741 jdk7-b97
+db6e660120446c407e2d908d52ec046592b21726 jdk7-b98
+c4c8a5bc54f66abc68cd185d9294042121922154 jdk7-b99
+2d6ba7a221915bdf0311acc5641c7f3875cb793e jdk7-b100
+2548ac036b8fca3326d058d758e6df8355a42469 jdk7-b101
--- a/.hgtags-top-repo	Tue Jul 20 16:09:44 2010 -0700
+++ b/.hgtags-top-repo	Wed Jul 21 09:57:21 2010 -0700
@@ -70,3 +70,9 @@
 5fc102ff48f0e787ce9cc77249841d5ff0941b75 jdk7-b93
 d7f35c61afa092b6357c2c4bce3f298f16620f71 jdk7-b94
 fd3663286e77b9f13c39eee124db2beb079b3ca6 jdk7-b95
+cf71cb5151166f35433afebaf67dbf34a704a170 jdk7-b96
+5e197c942c6ebd8b92f324a31049c5f1d26d40ef jdk7-b97
+6cea9984d73d74de0cd01f30d07ac0a1ed196117 jdk7-b98
+e7f18db469a3e947b7096bfd12e87380e5a042cd jdk7-b99
+b218a53ec7d3d42be61d31d6917a6c5c037b6f56 jdk7-b100
+4193eaf5f1b82794c6a0fb1a8d11af43d1b1d611 jdk7-b101
--- a/Makefile	Tue Jul 20 16:09:44 2010 -0700
+++ b/Makefile	Wed Jul 21 09:57:21 2010 -0700
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 1995, 2009, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 1995, 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
@@ -29,10 +29,6 @@
   TOPDIR:=.
 endif
 
-ifndef CONTROL_TOPDIR
-  CONTROL_TOPDIR=$(TOPDIR)
-endif
-
 # Openjdk sources (only used if SKIP_OPENJDK_BUILD!=true)
 OPENJDK_SOURCETREE=$(TOPDIR)/openjdk
 OPENJDK_BUILDDIR:=$(shell \
@@ -120,7 +116,7 @@
 all_product_build:: 
 	@$(FINISH_ECHO)
 
-# Generis build of basic repo series
+# Generic build of basic repo series
 generic_build_repo_series::
 	$(MKDIR) -p $(OUTPUTDIR)
 	$(MKDIR) -p $(OUTPUTDIR)/j2sdk-image
@@ -179,11 +175,15 @@
 #     The install process needs to know what the DEBUG_NAME is, so
 #     look for INSTALL_DEBUG_NAME in the install rules.
 #
+#   NOTE: On windows, do not use $(ABS_BOOTDIR_OUTPUTDIR)-$(DEBUG_NAME).
+#         Due to the use of short paths in $(ABS_OUTPUTDIR), this may 
+#         not be the same location.
+#
 
 # Location of fresh bootdir output
 ABS_BOOTDIR_OUTPUTDIR=$(ABS_OUTPUTDIR)/bootjdk
 FRESH_BOOTDIR=$(ABS_BOOTDIR_OUTPUTDIR)/j2sdk-image
-FRESH_DEBUG_BOOTDIR=$(ABS_BOOTDIR_OUTPUTDIR)-$(DEBUG_NAME)/j2sdk-image
+FRESH_DEBUG_BOOTDIR=$(ABS_BOOTDIR_OUTPUTDIR)/../$(PLATFORM)-$(ARCH)-$(DEBUG_NAME)/j2sdk-image
   
 create_fresh_product_bootdir: FRC
 	@$(START_ECHO)
@@ -248,10 +248,14 @@
 	        generic_build_repo_series
 	@$(FINISH_ECHO)
 
+#   NOTE: On windows, do not use $(ABS_OUTPUTDIR)-$(DEBUG_NAME).
+#         Due to the use of short paths in $(ABS_OUTPUTDIR), this may 
+#         not be the same location.
+
 generic_debug_build:
 	@$(START_ECHO)
 	$(MAKE) \
-		ALT_OUTPUTDIR=$(ABS_OUTPUTDIR)-$(DEBUG_NAME) \
+		ALT_OUTPUTDIR=$(ABS_OUTPUTDIR)/../$(PLATFORM)-$(ARCH)-$(DEBUG_NAME) \
 	        DEBUG_NAME=$(DEBUG_NAME) \
 		GENERATE_DOCS=false \
 	        $(BOOT_CYCLE_DEBUG_SETTINGS) \
@@ -348,8 +352,8 @@
 
 clobber::
 	$(RM) -r $(OUTPUTDIR)/*
-	$(RM) -r $(OUTPUTDIR)-debug/*
-	$(RM) -r $(OUTPUTDIR)-fastdebug/*
+	$(RM) -r $(OUTPUTDIR)/../$(PLATFORM)-$(ARCH)-debug/*
+	$(RM) -r $(OUTPUTDIR)/../$(PLATFORM)-$(ARCH)-fastdebug/*
 	-($(RMDIR) -p $(OUTPUTDIR) > $(DEV_NULL) 2>&1; $(TRUE))
 
 clean: clobber
@@ -551,6 +555,56 @@
 endif
 
 ################################################################
+# rule to test
+################################################################
+
+.NOTPARALLEL: test
+
+test: test_clean test_start test_summary
+
+test_start:
+	@$(ECHO) "Tests started at `$(DATE)`"
+
+test_clean:
+	$(RM) $(OUTPUTDIR)/test_failures.txt $(OUTPUTDIR)/test_log.txt
+
+test_summary: $(OUTPUTDIR)/test_failures.txt
+	@$(ECHO) "#################################################"
+	@$(ECHO) "Tests completed at `$(DATE)`"
+	@( $(EGREP) '^TEST STATS:' $(OUTPUTDIR)/test_log.txt \
+          || $(ECHO) "No TEST STATS seen in log" )
+	@$(ECHO) "For complete details see: $(OUTPUTDIR)/test_log.txt"
+	@$(ECHO) "#################################################"
+	@if [ -s $< ] ; then                                           \
+          $(ECHO) "ERROR: Test failure count: `$(CAT) $< | $(WC) -l`"; \
+          $(CAT) $<;                                                   \
+          exit 1;                                                      \
+        else                                                           \
+          $(ECHO) "Success! No failures detected";                     \
+        fi
+
+# Get failure list from log
+$(OUTPUTDIR)/test_failures.txt: $(OUTPUTDIR)/test_log.txt
+	@$(RM) $@
+	@( $(EGREP) '^FAILED:' $< || $(ECHO) "" ) > $@
+
+# Get log file of all tests run
+JDK_TO_TEST := $(shell 							\
+  if [ -d "$(ABS_OUTPUTDIR)/j2sdk-image" ] ; then 			\
+    $(ECHO) "$(ABS_OUTPUTDIR)/j2sdk-image"; 				\
+  elif [ -d "$(ABS_OUTPUTDIR)/bin" ] ; then 				\
+    $(ECHO) "$(ABS_OUTPUTDIR)"; 					\
+  elif [ "$(PRODUCT_HOME)" != "" -a -d "$(PRODUCT_HOME)/bin" ] ; then 	\
+    $(ECHO) "$(PRODUCT_HOME)"; 						\
+  fi 									\
+)
+$(OUTPUTDIR)/test_log.txt:
+	$(RM) $@
+	( $(CD) test &&                                     \
+          $(MAKE) NO_STOPPING=- PRODUCT_HOME=$(JDK_TO_TEST) \
+        ) | tee $@
+
+################################################################
 # JPRT rule to build
 ################################################################
 
@@ -560,7 +614,7 @@
 #  PHONY
 ################################################################
 
-.PHONY: all \
+.PHONY: all  test test_start test_summary test_clean \
 	generic_build_repo_series \
 	what clobber insane \
         dev dev-build dev-sanity dev-clobber \
--- a/README-builds.html	Tue Jul 20 16:09:44 2010 -0700
+++ b/README-builds.html	Wed Jul 21 09:57:21 2010 -0700
@@ -65,8 +65,9 @@
                             <li><a href="#cacerts">Certificate Authority File (cacert)</a> </li>
                             <li><a href="#compilers">Compilers</a> 
                                 <ul>
-                                    <li><a href="#msvc">Microsoft Visual Studio</a> </li>
-                                    <li><a href="#mssdk">Microsoft Platform SDK</a> </li>
+                                    <li><a href="#msvc32">Microsoft Visual Studio Professional/Express for 32 bit</a> </li>
+                                    <li><a href="#msvc64">Microsoft Visual Studio Professional for 64 bit</a> </li>
+                                    <li><a href="#mssdk64">Microsoft Windows SDK for 64 bit</a> </li>
                                     <li><a href="#gcc">Linux gcc/binutils</a> </li>
                                     <li><a href="#studio">Sun Studio</a> </li>
                                 </ul>
@@ -789,11 +790,11 @@
                 </li>
                 <li>
                     Install the
-                    <a href="#msvc">Microsoft Visual Studio Compilers</a>).
+                    <a href="#msvc32">Microsoft Visual Studio Compilers</a>).
                 </li>
                 <li>
                     Setup all environment variables for compilers 
-                    (see <a href="#msvc">compilers</a>).
+                    (see <a href="#msvc32">compilers</a>).
                 </li>
                 <li>
                     Install 
@@ -958,7 +959,7 @@
                     are also an option, although these compilers have not
                     been extensively used yet.
                 </blockquote>
-                <strong><a name="msvc">Windows i586: Microsoft Visual Studio Compilers</a></strong>
+                <strong><a name="msvc32">Windows i586: Microsoft Visual Studio 2010 Compilers</a></strong>
                 <blockquote>
 <p>
 <b>BEGIN WARNING</b>: At this time (Spring/Summer 2010) JDK 7 is starting a transition to
@@ -971,14 +972,13 @@
 We do not guarantee that VS2008 will work, although there is sufficient
 makefile support to make at least basic JDK builds plausible.
 Visual Studio 2010 Express compilers are now able to build all the
-open source repositories, but this is 32 bit only, since
-we have not yet seen the 7.1 Windows SDK with the 64 bit
-compilers. <b>END WARNING.</b>
+open source repositories, but this is 32 bit only. To build 64 bit
+Windows binaries use the the 7.1 Windows SDK.<b>END WARNING.</b>
 <p>
                     The 32-bit OpenJDK Windows build
                     requires 
                     Microsoft Visual Studio C++ 2010 (VS2010) Professional
-                    Edition compiler. 
+                    Edition or Express compiler.
                     The compiler and other tools are expected to reside
                     in the location defined by the variable 
                     <tt>VS100COMNTOOLS</tt> which
@@ -1001,14 +1001,33 @@
                     The path <tt>/usr/bin</tt> must be after the path to the
                     Visual Studio product.
                 </blockquote>
-                <strong><a name="mssdk">Windows x64: Microsoft Visual Studio Compilers</a></strong>
+                <strong><a name="msvc64">Windows x64: Microsoft Visual Studio 2010 Professional Compiler</a></strong>
                 <blockquote>
-                    On <b>X64</b>, the set up is much the same in VS2010
+                    For <b>X64</b>, builds, when using the VS2010 Professional
+                    compiler, the 64 bit build set up is much the same as 32 bit
                     except that you run <tt>amd64\VCVARS64.BAT</tt>
                     to set the compiler environment variables.
-                    Previously 64 builds had used the 64 bit compiler in
-                    an unbundled Windows SDK but this is no longer necessary.
+                    Previously 64 bit builds had used the 64 bit compiler in
+                    an unbundled Windows SDK but this is no longer necessary if
+                    you have VS2010 Professional.
                 </blockquote>
+                <strong><a name="mssdk64">Windows x64: Microsoft Windows 7.1 SDK 64 bit compilers.</a></strong>
+                   For a free alternative for 64 bit builds, use the 7.1 SDK.
+                   Microsoft say that to set up your paths for this run
+<pre>
+    c:\Program Files\Microsoft SDKs\Windows\v7.1\bin\setenv.cmd /x64.
+</pre>
+                   What was tested is just directly setting up LIB, INCLUDE,
+                   PATH and based on the installation directories using the
+                   DOS short name appropriate for the system, (you will
+                   need to set them for yours, not just blindly copy this) eg :
+<pre>
+    set VSINSTALLDIR=c:\PROGRA~2\MICROS~1.0
+    set WindowsSdkDir=c:\PROGRA~1\MICROS~1\Windows\v7.1
+    set PATH=%VSINSTALLDIR%\vc\bin\amd64;%VSINSTALLDIR%\Common7\IDE;%WindowsSdkDir%\bin;%PATH%
+    set INCLUDE=%VSINSTALLDIR%\vc\include;%WindowsSdkDir%\include
+    set LIB=%VSINSTALLDIR%\vc\lib\amd64;%WindowsSdkDir%\lib\x64
+</pre>
             </blockquote>
             <!-- ------------------------------------------------------ --> 
             <h4><a name="zip">Zip and Unzip</a></h4>
--- a/corba/.hgtags	Tue Jul 20 16:09:44 2010 -0700
+++ b/corba/.hgtags	Wed Jul 21 09:57:21 2010 -0700
@@ -70,3 +70,9 @@
 9718d624864c29dca44373d541e93cdd309a994f jdk7-b93
 533c11186b44e3a02d6c5fe69a73260505fcfe5e jdk7-b94
 06dbf406818c789bb586c1de4c002024cd26ecd2 jdk7-b95
+edc2a2659c77dabc55cb55bb617bad89e3a05bb3 jdk7-b96
+4ec9d59374caa1e5d72fa802291b4d66955a4936 jdk7-b97
+3b99409057e4c255da946f9f540d051a5ef4ab23 jdk7-b98
+95db968660e7d87c345d5cf3dc2e3db037fb7220 jdk7-b99
+a56d734a1e970e1a21a8f4feb13053e9a33674c7 jdk7-b100
+86a239832646a74811695428984b6947c0bd6dc8 jdk7-b101
--- a/corba/make/com/sun/corba/minclude/ioser_io.jmk	Tue Jul 20 16:09:44 2010 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,31 +0,0 @@
-#
-# Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved.
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# This code is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License version 2 only, as
-# published by the Free Software Foundation.  Oracle designates this
-# particular file as subject to the "Classpath" exception as provided
-# by Oracle in the LICENSE file that accompanied this code.
-#
-# This code is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
-# version 2 for more details (a copy is included in the LICENSE file that
-# accompanied this code).
-#
-# You should have received a copy of the GNU General Public License version
-# 2 along with this work; if not, write to the Free Software Foundation,
-# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-#
-# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
-# or visit www.oracle.com if you need additional information or have any
-# questions.
-#
-
-IOSER_IO_java = \
-	com/sun/corba/se/internal/io/ObjectStreamClass.java \
-	com/sun/corba/se/internal/io/IIOPInputStream.java \
-	com/sun/corba/se/internal/io/IIOPOutputStream.java \
-	com/sun/corba/se/internal/io/LibraryManager.java 
-	
--- a/corba/make/common/Defs-linux.gmk	Tue Jul 20 16:09:44 2010 -0700
+++ b/corba/make/common/Defs-linux.gmk	Wed Jul 21 09:57:21 2010 -0700
@@ -176,7 +176,16 @@
   CXXFLAGS_DBG	+= $(CC_LOWER_OPT)
 endif
 
-CPPFLAGS_COMMON = -D$(ARCH) -DARCH='"$(ARCH)"' -DLINUX $(VERSION_DEFINES) \
+CPP_ARCH_FLAGS = -DARCH='"$(ARCH)"'
+
+# Alpha arch does not like "alpha" defined (potential general arch cleanup issue here)
+ifneq ($(ARCH),alpha)
+  CPP_ARCH_FLAGS += -D$(ARCH)
+else
+  CPP_ARCH_FLAGS += -D_$(ARCH)_
+endif
+
+CPPFLAGS_COMMON = $(CPP_ARCH_FLAGS) -DLINUX $(VERSION_DEFINES) \
 		  -D_LARGEFILE64_SOURCE -D_GNU_SOURCE -D_REENTRANT
 
 ifeq ($(ARCH_DATA_MODEL), 64)
--- a/corba/make/sun/corba/Makefile	Tue Jul 20 16:09:44 2010 -0700
+++ b/corba/make/sun/corba/Makefile	Wed Jul 21 09:57:21 2010 -0700
@@ -30,7 +30,7 @@
 BUILDDIR = ../..
 include $(BUILDDIR)/common/Defs.gmk
 
-SUBDIRS = org
+SUBDIRS = org core
 all build clean clobber::
 	$(SUBDIRS-loop)
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/corba/make/sun/corba/core/Makefile	Wed Jul 21 09:57:21 2010 -0700
@@ -0,0 +1,72 @@
+#
+# Copyright (c) 1997, 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.
+#
+
+#
+# Makefile for building RMI/IIOP
+#
+
+BUILDDIR = ../../..
+PRODUCT = sun
+include $(BUILDDIR)/common/Defs.gmk
+
+#
+# Files to compile.
+#
+CORBA_JMK_DIRECTORY=$(TOPDIR)/make/com/sun/corba/minclude/
+include $(CORBA_JMK_DIRECTORY)javax_rmi.jmk
+include $(CORBA_JMK_DIRECTORY)javax_rmi_CORBA.jmk
+include $(CORBA_JMK_DIRECTORY)javax_transaction.jmk
+include $(CORBA_JMK_DIRECTORY)javax_activity.jmk
+include $(CORBA_JMK_DIRECTORY)sun_corba.jmk
+
+FILES_java = \
+	$(javax_rmi_java) \
+	$(javax_rmi_CORBA_java) \
+	$(javax_transaction_java) \
+	$(javax_activity_java) \
+	$(sun_corba_java)
+
+#
+# Resources
+#
+LOCALE_SET_DEFINITION = jre
+RESOURCE_BUNDLES_PROPERTIES = \
+      com/sun/corba/se/impl/orbutil/resources/sunorb.properties
+
+#
+# Rules
+#
+include $(BUILDDIR)/common/Classes.gmk
+
+
+#
+# Extra clean rules because we build more than one package.
+#
+clean:: classheaders.clean objects.clean
+	$(RM) -r $(CLASSBINDIR)/javax/rmi
+	$(RM) -r $(CLASSBINDIR)/javax/transaction
+	$(RM) -r $(CLASSBINDIR)/javax/activity
+	$(RM) -r $(CLASSBINDIR)/com/sun/corba/se/impl
+
--- a/corba/make/sun/rmi/rmic/FILES.gmk	Tue Jul 20 16:09:44 2010 -0700
+++ b/corba/make/sun/rmi/rmic/FILES.gmk	Wed Jul 21 09:57:21 2010 -0700
@@ -70,7 +70,4 @@
 	com/sun/corba/se/internal/util/IdentityHashtable.java \
 	com/sun/corba/se/internal/util/Utility.java \
 	com/sun/corba/se/internal/util/JDKBridge.java \
-	com/sun/corba/se/internal/io/LibraryManager.java \
-	com/sun/corba/se/internal/io/ObjectStreamClass.java \
-	com/sun/corba/se/internal/io/TypeMismatchException.java \
 	com/sun/corba/se/internal/util/RepositoryId.java
--- a/corba/src/share/classes/com/sun/corba/se/impl/orbutil/CorbaResourceUtil.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/corba/src/share/classes/com/sun/corba/se/impl/orbutil/CorbaResourceUtil.java	Wed Jul 21 09:57:21 2010 -0700
@@ -75,7 +75,7 @@
         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);
     }
 
     private static boolean resourcesInitialized = false;
--- a/corba/src/share/classes/com/sun/corba/se/impl/orbutil/ObjectUtility.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/corba/src/share/classes/com/sun/corba/se/impl/orbutil/ObjectUtility.java	Wed Jul 21 09:57:21 2010 -0700
@@ -350,7 +350,7 @@
 
         if (useToString) {
             try {
-                cls.getDeclaredMethod( "toString", null ) ;
+                cls.getDeclaredMethod( "toString", (Class[])null ) ;
                 return true ;
             } catch (Exception exc) {
                 return false ;
--- a/corba/src/share/classes/com/sun/corba/se/impl/presentation/rmi/ExceptionHandlerImpl.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/corba/src/share/classes/com/sun/corba/se/impl/presentation/rmi/ExceptionHandlerImpl.java	Wed Jul 21 09:57:21 2010 -0700
@@ -108,8 +108,8 @@
 
             try {
                 helperClass = Class.forName( helperName, true, loader ) ;
-                Method idMethod = helperClass.getDeclaredMethod( "id", null ) ;
-                setId( (String)idMethod.invoke( null, null ) ) ;
+                Method idMethod = helperClass.getDeclaredMethod( "id", (Class[])null ) ;
+                setId( (String)idMethod.invoke( null, (Object[])null ) ) ;
             } catch (Exception ex) {
                 throw wrapper.badHelperIdMethod( ex, helperName ) ;
             }
--- a/corba/src/share/classes/org/omg/CORBA/ORB.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/corba/src/share/classes/org/omg/CORBA/ORB.java	Wed Jul 21 09:57:21 2010 -0700
@@ -589,7 +589,7 @@
                 this.getClass().getMethod("create_operation_list", argc);
 
             // OK, the method exists, so invoke it and be happy.
-            Object[] argx = { oper };
+            java.lang.Object[] argx = { oper };
             return (org.omg.CORBA.NVList)meth.invoke(this, argx);
         }
         catch( java.lang.reflect.InvocationTargetException exs ) {
--- a/corba/src/share/classes/sun/corba/Bridge.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/corba/src/share/classes/sun/corba/Bridge.java	Wed Jul 21 09:57:21 2010 -0700
@@ -187,7 +187,7 @@
         try {
             // Invoke the ObjectInputStream.latestUserDefinedLoader method
             return (ClassLoader)latestUserDefinedLoaderMethod.invoke(null,
-                                                                     NO_ARGS);
+                                                                     (Object[])NO_ARGS);
         } catch (InvocationTargetException ite) {
             Error err = new Error(
                 "sun.corba.Bridge.latestUserDefinedLoader: " + ite ) ;
--- a/hotspot/.hgtags	Tue Jul 20 16:09:44 2010 -0700
+++ b/hotspot/.hgtags	Wed Jul 21 09:57:21 2010 -0700
@@ -98,3 +98,11 @@
 d38f45079fe98792a7381dbb4b64f5b589ec8c58 jdk7-b94
 8bfe9058ca4661779ac1d0572329f3943e68362e hs19-b01
 91d861ba858daca645993a1ab6ba2fa06a8f4a5b jdk7-b95
+573e8ea5fd68e8e51eb6308d283ac3b3889d15e0 jdk7-b96
+573e8ea5fd68e8e51eb6308d283ac3b3889d15e0 hs19-b02
+5f42499e57adc16380780f40541e1a66cd601891 jdk7-b97
+8a045b3f5c13eaad92ff4baf15ca671845fcad1a jdk7-b98
+6a236384a379642b5a2398e2819db9ab4e711e9b jdk7-b99
+ad1977f08c4d69162a0775fe3f9576b9fd521d10 jdk7-b100
+6c3a919105b68c15b7db923ec9a00006e9560910 jdk7-b101
+ad1977f08c4d69162a0775fe3f9576b9fd521d10 hs19-b03
--- a/hotspot/make/hotspot_version	Tue Jul 20 16:09:44 2010 -0700
+++ b/hotspot/make/hotspot_version	Wed Jul 21 09:57:21 2010 -0700
@@ -35,7 +35,7 @@
 
 HS_MAJOR_VER=19
 HS_MINOR_VER=0
-HS_BUILD_NUMBER=02
+HS_BUILD_NUMBER=04
 
 JDK_MAJOR_VER=1
 JDK_MINOR_VER=7
--- a/hotspot/make/windows/makefiles/defs.make	Tue Jul 20 16:09:44 2010 -0700
+++ b/hotspot/make/windows/makefiles/defs.make	Wed Jul 21 09:57:21 2010 -0700
@@ -32,6 +32,17 @@
 PATH_SEP = ;
 
 # Need PLATFORM (os-arch combo names) for jdk and hotspot, plus libarch name
+ifeq ($(ARCH_DATA_MODEL),32)
+  ARCH_DATA_MODEL=32
+  PLATFORM=windows-i586
+  VM_PLATFORM=windows_i486
+  HS_ARCH=x86
+  MAKE_ARGS += ARCH=x86
+  MAKE_ARGS += BUILDARCH=i486
+  MAKE_ARGS += Platform_arch=x86
+  MAKE_ARGS += Platform_arch_model=x86_32
+endif
+
 ifneq ($(shell $(ECHO) $(PROCESSOR_IDENTIFIER) | $(GREP) x86),)
   ARCH_DATA_MODEL=32
   PLATFORM=windows-i586
@@ -43,43 +54,57 @@
   MAKE_ARGS += Platform_arch_model=x86_32
 endif
 
-ifneq ($(shell $(ECHO) $(PROCESSOR_IDENTIFIER) | $(GREP) ia64),)
-  ARCH_DATA_MODEL=64
-  PLATFORM=windows-ia64
-  VM_PLATFORM=windows_ia64
-  HS_ARCH=ia64
-  MAKE_ARGS += LP64=1
-  MAKE_ARGS += ARCH=ia64
-  MAKE_ARGS += BUILDARCH=ia64
-  MAKE_ARGS += Platform_arch=ia64
-  MAKE_ARGS += Platform_arch_model=ia64
-endif
+ifneq ($(ARCH_DATA_MODEL),32)
+  ifneq ($(shell $(ECHO) $(PROCESSOR_IDENTIFIER) | $(GREP) ia64),)
+    ARCH_DATA_MODEL=64
+    PLATFORM=windows-ia64
+    VM_PLATFORM=windows_ia64
+    HS_ARCH=ia64
+    MAKE_ARGS += LP64=1
+    MAKE_ARGS += ARCH=ia64
+    MAKE_ARGS += BUILDARCH=ia64
+    MAKE_ARGS += Platform_arch=ia64
+    MAKE_ARGS += Platform_arch_model=ia64
+  endif
 
 # http://support.microsoft.com/kb/888731 : this can be either
 # AMD64 for AMD, or EM64T for Intel chips.
-ifneq ($(shell $(ECHO) $(PROCESSOR_IDENTIFIER) | $(GREP) AMD64),)
-  ARCH_DATA_MODEL=64
-  PLATFORM=windows-amd64
-  VM_PLATFORM=windows_amd64
-  HS_ARCH=x86
-  MAKE_ARGS += LP64=1
-  MAKE_ARGS += ARCH=x86
-  MAKE_ARGS += BUILDARCH=amd64
-  MAKE_ARGS += Platform_arch=x86
-  MAKE_ARGS += Platform_arch_model=x86_64
-endif
+  ifneq ($(shell $(ECHO) $(PROCESSOR_IDENTIFIER) | $(GREP) AMD64),)
+    ARCH_DATA_MODEL=64
+    PLATFORM=windows-amd64
+    VM_PLATFORM=windows_amd64
+    HS_ARCH=x86
+    MAKE_ARGS += LP64=1
+    MAKE_ARGS += ARCH=x86
+    MAKE_ARGS += BUILDARCH=amd64
+    MAKE_ARGS += Platform_arch=x86
+    MAKE_ARGS += Platform_arch_model=x86_64
+  endif
+
+ifneq ($(shell $(ECHO) $(PROCESSOR_IDENTIFIER) | $(GREP) EM64T),)
+    ARCH_DATA_MODEL=64
+    PLATFORM=windows-amd64
+    VM_PLATFORM=windows_amd64
+    HS_ARCH=x86
+    MAKE_ARGS += LP64=1
+    MAKE_ARGS += ARCH=x86
+    MAKE_ARGS += BUILDARCH=amd64
+    MAKE_ARGS += Platform_arch=x86
+    MAKE_ARGS += Platform_arch_model=x86_64
+  endif
 
 # NB later OS versions than 2003 may report "Intel64"
-ifneq ($(shell $(ECHO) $(PROCESSOR_IDENTIFIER) | $(GREP) "EM64T\|Intel64"),)
-  ARCH_DATA_MODEL=64
-  PLATFORM=windows-amd64
-  VM_PLATFORM=windows_amd64
-  HS_ARCH=x86
-  MAKE_ARGS += LP64=1
-  MAKE_ARGS += ARCH=x86
-  MAKE_ARGS += BUILDARCH=amd64
-  MAKE_ARGS += Platform_arch=x86
-  MAKE_ARGS += Platform_arch_model=x86_64
+  ifneq ($(shell $(ECHO) $(PROCESSOR_IDENTIFIER) | $(GREP) Intel64),)
+    ARCH_DATA_MODEL=64
+    PLATFORM=windows-amd64
+    VM_PLATFORM=windows_amd64
+    HS_ARCH=x86
+    MAKE_ARGS += LP64=1
+    MAKE_ARGS += ARCH=x86
+    MAKE_ARGS += BUILDARCH=amd64
+    MAKE_ARGS += Platform_arch=x86
+    MAKE_ARGS += Platform_arch_model=x86_64
+  endif
 endif
 
 JDK_INCLUDE_SUBDIR=win32
--- a/jaxp/.hgtags	Tue Jul 20 16:09:44 2010 -0700
+++ b/jaxp/.hgtags	Wed Jul 21 09:57:21 2010 -0700
@@ -70,3 +70,9 @@
 c725ca829c5aa4b50a8ed5728579ec8809fbfb1d jdk7-b93
 2de307cd3b4e71127e75dff70809c1b1fbc1a494 jdk7-b94
 07050840f98cda357aa6a8d416fdccbd03038d35 jdk7-b95
+9510ed0e1c7ab46a8b6659234e1dc7786407a72b jdk7-b96
+ca01ec32561fee1855630b68a2fcd0042257a8ef jdk7-b97
+d4adf4f2d14c7b79df0a81de884b6b57c6850802 jdk7-b98
+7ef8469021fbc824ac49d57c83a14b1bb08f1766 jdk7-b99
+d524be5ef62e8b8cb890c59a5d2c19ef0ab50d45 jdk7-b100
+17f62a566a2020fd908e77106ed885e0c4e7c14d jdk7-b101
--- a/jaxp/build-defs.xml	Tue Jul 20 16:09:44 2010 -0700
+++ b/jaxp/build-defs.xml	Wed Jul 21 09:57:21 2010 -0700
@@ -55,9 +55,29 @@
     <drop-import name="jaxp_src"/>
     <!-- <drop-import name="jaxp_tests"/> -->
 
+    <!-- Fail and print helpful messages if source does not exist. -->
+    <target name="-src-help">
+      <fail message="${failed.url.src.message}">
+	<condition>
+	    <and>
+                <not>
+	            <available file="${jaxp_src.src.dir}" type="dir"/>
+	        </not>
+	        <istrue value="${allow.downloads}"/>
+	    </and>
+	</condition>
+      </fail>
+      <fail message="${failed.nourl.src.message}">
+	<condition>
+            <not>
+	        <available file="${jaxp_src.src.dir}" type="dir"/>
+	    </not>
+	</condition>
+      </fail>
+    </target>
 
-    <!-- Special build area preparation. -->
-    <target name="-drop-build-prep" depends="init, -init-src-dirs">
+    <!-- Special build area setup. -->
+    <target name="-drop-build-setup" depends="init, -init-src-dirs">
         <mkdir dir="${build.classes.dir}"/>
         <copy todir="${build.classes.dir}">
             <fileset dir="${primary.src.dir}"
@@ -84,7 +104,7 @@
 
     <!-- Source directory selection. -->
     <target name="-init-src-dirs"
-	    depends="init, -use-drop">
+	    depends="init, -use-drop,-src-help">
         <echo message="Using primary.src.dir=${primary.src.dir}"/>
         <pathconvert property="src.list.id" refid="src.dir.id"/>
         <echo message="Using src.dir.id=${src.list.id}"/>
--- a/jaxp/build-drop-template.xml	Tue Jul 20 16:09:44 2010 -0700
+++ b/jaxp/build-drop-template.xml	Wed Jul 21 09:57:21 2010 -0700
@@ -75,6 +75,7 @@
     <target name="-@DROP@-url-should-be-used" unless="@DROP@.url.should.be.used">
         <condition property="@DROP@.url.should.be.used">
             <and>
+                <istrue value="${allow.downloads}"/>
                 <not>
                     <isset property="@DROP@.master.bundle.copy.exists"/>
                 </not>
--- a/jaxp/build.properties	Tue Jul 20 16:09:44 2010 -0700
+++ b/jaxp/build.properties	Wed Jul 21 09:57:21 2010 -0700
@@ -104,4 +104,24 @@
   drops.dir=${drops.dir}${line.separator}\
 ${line.separator}
 
+# Failure messages when source cannot be found on the file system
+failed.nourl.src.message=\
+ERROR: Cannot find source for project ${ant.project.name}.\
+${line.separator}${line.separator}\
+HINT: Try setting drops.dir to indicate where the bundles can be found, \
+or try setting the ant property allow.downloads=true to download the bundle from the URL.\
+${line.separator}\
+e.g. ant -Dallow.downloads=true -OR- ant -Ddrops.dir=some_directory \
+${line.separator}
+
+# Failure message when source cannot be downloaded
+failed.url.src.message=\
+ERROR: Cannot find source for project ${ant.project.name}.\
+${line.separator}${line.separator}\
+HINT: Try setting drops.dir to indicate where the bundles can be found, \
+or try checking the URL with your browser.\
+${line.separator}\
+e.g. ant -Ddrops.dir=some_directory \
+${line.separator}
+
 #------------------------------------------------------------
--- a/jaxp/build.xml	Tue Jul 20 16:09:44 2010 -0700
+++ b/jaxp/build.xml	Wed Jul 21 09:57:21 2010 -0700
@@ -36,6 +36,11 @@
       javac.debug          - true or false for debug classfiles
       javac.target         - classfile version target
       javac.source         - source version
+      drops.dir            - directory that holds source drop bundles
+      allow.download       - permit downloads from public url (default is false)
+                             (used if bundles not found in drops.dir)
+
+      Run 'make help' for help using the Makefile.
     </description>
 
     <!-- Mac is special, need to downgrade these before build.properties. -->
@@ -106,16 +111,20 @@
         <jar file="${dist.classes.jar}" basedir="${build.classes.dir}"/>
     </target>
 
-    <target name="-build-prep"
-	    depends="init, -init-src-dirs, -drop-build-prep">
+    <target name="-build-setup"
+	    depends="init, -init-src-dirs, -drop-build-setup">
     </target>
 
     <!-- Build (compilation) of sources to class files. -->
     <target name="build"
-	    depends="init, -init-src-dirs, -build-prep">
+	    depends="compile, -build-setup">
+    </target>
+    <target name="compile"
+	    depends="init, -init-src-dirs">
+        <mkdir dir="${build.classes.dir}"/>
         <javac 
-	     includeAntRuntime="false"
-	     classpath="${build.classes.dir}"
+	     includeAntRuntime="false" 
+	     classpath="${build.classes.dir}:${tools.jar}"
 	     fork="true"
              destdir="${build.classes.dir}"
              memoryInitialSize="${javac.memoryInitialSize}"
--- a/jaxp/jaxp.properties	Tue Jul 20 16:09:44 2010 -0700
+++ b/jaxp/jaxp.properties	Wed Jul 21 09:57:21 2010 -0700
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2007, 2009, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2007, 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
@@ -24,13 +24,13 @@
 #
 
 drops.master.copy.base=${drops.dir}
-drops.master.url.base=https://jaxp.dev.java.net/files/documents/913/147490
 
-jaxp_src.bundle.name=jdk7-jaxp-m6.zip
-jaxp_src.bundle.md5.checksum=080827d779c114365f8504bd79b34604
+jaxp_src.bundle.name=jdk7-jaxp-m7.zip
+jaxp_src.bundle.md5.checksum=22e95fbdb9fb7d8b6b6fc0a1d76d1fbd
 jaxp_src.master.bundle.dir=${drops.master.copy.base}
-jaxp_src.master.bundle.url.base=${drops.master.url.base}
+jaxp_src.master.bundle.url.base=https://jaxp.dev.java.net/files/documents/913/150785
 
-jaxp_tests.bundle.name=jdk7-jaxp-tests-2009_08_28.zip
-jaxp_tests.master.bundle.dir=${drops.master.copy.base}
-jaxp_tests.master.bundle.url.base=${drops.master.url.base}
+#jaxp_tests.bundle.name=jdk7-jaxp-tests-2009_08_28.zip
+#jaxp_tests.master.bundle.dir=${drops.master.copy.base}
+#jaxp_tests.master.bundle.url.base=https://jaxp.dev.java.net/files/documents/913/147490
+
--- a/jaxp/make/Makefile	Tue Jul 20 16:09:44 2010 -0700
+++ b/jaxp/make/Makefile	Wed Jul 21 09:57:21 2010 -0700
@@ -65,6 +65,11 @@
   endif
 endif 
 
+# If downloads are allowed
+ifeq ($(ALLOW_DOWNLOADS),true)
+  ANT_OPTIONS += -Dallow.downloads=true
+endif
+
 # Figure out the platform we are using
 _SYSTEM_UNAME := $(shell uname)
 _PLATFORM_KIND = unix
@@ -159,6 +164,8 @@
 	@echo "    $(ANT_TARGETS)"
 	@echo " "
 	@echo "  Environment or command line variables (all optional):"
+	$(call helpenvline, ALT_DROPS_DIR,\
+	       "Directory that contains the drop source bundles i.e. drops.dir")
 	$(call helpenvline, ALT_BOOTDIR,\
 	       "JAVA_HOME to use when running ant")
 	$(call helpenvline, ALT_LANGTOOLS_DIST,\
--- a/jaxws/.hgtags	Tue Jul 20 16:09:44 2010 -0700
+++ b/jaxws/.hgtags	Wed Jul 21 09:57:21 2010 -0700
@@ -70,3 +70,9 @@
 797bef19197566ffb056edaa1b34db43bd9bf7b0 jdk7-b93
 8515e093efd14ac054e941ef743f76561a393a70 jdk7-b94
 ee06cfb113d554b5c8a9a53383bae2b168533829 jdk7-b95
+208fd4451232f7a522ddb20334c598656844ccb7 jdk7-b96
+dac23846092ad4956ed41b5278f8686476ae46ef jdk7-b97
+4571098071094e705e680db5324bfa15a57b1290 jdk7-b98
+818366ce23d8919cafaa4db4c51605ee2a7c8eaf jdk7-b99
+bd26d0ce0c3cb43e58a8e2770cc03f26d96ffe5c jdk7-b100
+b55ce274490082712f5e002b38d2eed505ca863d jdk7-b101
--- a/jaxws/build-defs.xml	Tue Jul 20 16:09:44 2010 -0700
+++ b/jaxws/build-defs.xml	Wed Jul 21 09:57:21 2010 -0700
@@ -55,9 +55,36 @@
     <drop-import name="jaxws_src"/>
     <drop-import name="jaf_src"/>
     <!-- <drop-import name="jaxws_tests"/> -->
+    
+    <!-- Fail and print helpful messages if source does not exist. -->
+    <target name="-src-help">
+      <fail message="${failed.url.src.message}">
+	<condition>
+	    <and>
+                <not>
+                    <and>
+	                <available file="${jaxws_src.src.dir}" type="dir"/>
+                        <available file="${jaf_src.src.dir}" type="dir"/>
+	            </and>
+	        </not>
+	        <istrue value="${allow.downloads}"/>
+	    </and>
+	</condition>
+      </fail>
+      <fail message="${failed.nourl.src.message}">
+	<condition>
+            <not>
+                <and>
+	            <available file="${jaxws_src.src.dir}" type="dir"/>
+                    <available file="${jaf_src.src.dir}" type="dir"/>
+	        </and>
+	    </not>
+	</condition>
+      </fail>
+    </target>
 
-    <!-- Special build area preparation. -->
-    <target name="-drop-build-prep" depends="init, -init-src-dirs">
+    <!-- Special build area setup. -->
+    <target name="-drop-build-setup" depends="init, -init-src-dirs">
         <mkdir dir="${build.classes.dir}"/>
         <copy todir="${build.classes.dir}">
             <fileset dir="${primary.src.dir}"
@@ -99,7 +126,7 @@
 
     <!-- Source directory selection. -->
     <target name="-init-src-dirs"
-	    depends="init, -use-drop">
+	    depends="init, -use-drop,-src-help">
         <echo message="Using primary.src.dir=${primary.src.dir}"/>
         <pathconvert property="src.list.id" refid="src.dir.id"/>
         <echo message="Using src.dir.id=${src.list.id}"/>
--- a/jaxws/build-drop-template.xml	Tue Jul 20 16:09:44 2010 -0700
+++ b/jaxws/build-drop-template.xml	Wed Jul 21 09:57:21 2010 -0700
@@ -75,6 +75,7 @@
     <target name="-@DROP@-url-should-be-used" unless="@DROP@.url.should.be.used">
         <condition property="@DROP@.url.should.be.used">
             <and>
+                <istrue value="${allow.downloads}"/>
                 <not>
                     <isset property="@DROP@.master.bundle.copy.exists"/>
                 </not>
--- a/jaxws/build.properties	Tue Jul 20 16:09:44 2010 -0700
+++ b/jaxws/build.properties	Wed Jul 21 09:57:21 2010 -0700
@@ -104,4 +104,24 @@
   drops.dir=${drops.dir}${line.separator}\
 ${line.separator}
 
+# Failure messages when source cannot be found on the file system
+failed.nourl.src.message=\
+ERROR: Cannot find source for project ${ant.project.name}.\
+${line.separator}${line.separator}\
+HINT: Try setting drops.dir to indicate where the bundles can be found, \
+or try setting the ant property allow.downloads=true to download the bundle from the URL.\
+${line.separator}\
+e.g. ant -Dallow.downloads=true -OR- ant -Ddrops.dir=some_directory \
+${line.separator}
+
+# Failure message when source cannot be downloaded
+failed.url.src.message=\
+ERROR: Cannot find source for project ${ant.project.name}.\
+${line.separator}${line.separator}\
+HINT: Try setting drops.dir to indicate where the bundles can be found, \
+or try checking the URL with your browser.\
+${line.separator}\
+e.g. ant -Ddrops.dir=some_directory \
+${line.separator}
+
 #------------------------------------------------------------
--- a/jaxws/build.xml	Tue Jul 20 16:09:44 2010 -0700
+++ b/jaxws/build.xml	Wed Jul 21 09:57:21 2010 -0700
@@ -36,6 +36,11 @@
       javac.debug          - true or false for debug classfiles
       javac.target         - classfile version target
       javac.source         - source version
+      drops.dir            - directory that holds source drop bundles
+      allow.download       - permit downloads from public url (default is false)
+                             (used if bundles not found in drops.dir)
+
+      Run 'make help' for help using the Makefile.
     </description>
 
     <!-- Mac is special, need to downgrade these before build.properties. -->
@@ -106,13 +111,17 @@
         <jar file="${dist.classes.jar}" basedir="${build.classes.dir}"/>
     </target>
 
-    <target name="-build-prep"
-	    depends="init, -init-src-dirs, -drop-build-prep">
+    <target name="-build-setup"
+	    depends="init, -init-src-dirs, -drop-build-setup">
     </target>
 
     <!-- Build (compilation) of sources to class files. -->
     <target name="build"
-	    depends="init, -init-src-dirs, -build-prep">
+	    depends="compile, -build-setup">
+    </target>
+    <target name="compile"
+	    depends="init, -init-src-dirs">
+        <mkdir dir="${build.classes.dir}"/>
         <javac 
 	     includeAntRuntime="false" 
 	     classpath="${build.classes.dir}:${tools.jar}"
--- a/jaxws/jaxws.properties	Tue Jul 20 16:09:44 2010 -0700
+++ b/jaxws/jaxws.properties	Wed Jul 21 09:57:21 2010 -0700
@@ -24,19 +24,18 @@
 #
 
 drops.master.copy.base=${drops.dir}
-drops.master.url.base=http://kenai.com/projects/jdk7-drops/downloads/download
 
-jaxws_src.bundle.name=jdk7-jaxws-2009_09_28.zip
-jaxws_src.bundle.md5.checksum=f5010ebf636db9f465a61a7a74944543
+jaxws_src.bundle.name=jdk7-jaxws-b100.zip
+jaxws_src.bundle.md5.checksum=e4fea255c6222b118bb1d0d3054d36e1
 jaxws_src.master.bundle.dir=${drops.master.copy.base}
-#jaxws_src.bundle.url.base=https://jaxws.dev.java.net/files/documents/913/142147
-jaxws_src.master.bundle.url.base=${drops.master.url.base}
+jaxws_src.master.bundle.url.base=https://jax-ws.dev.java.net/files/documents/4202/150896
 
 jaf_src.bundle.name=jdk7-jaf-2009_08_28.zip
 jaf_src.bundle.md5.checksum=eb8cb7a4a7f14e211fbe2354878a2472
 jaf_src.master.bundle.dir=${drops.master.copy.base}
-jaf_src.master.bundle.url.base=${drops.master.url.base}
+jaf_src.master.bundle.url.base=http://kenai.com/projects/jdk7-drops/downloads/download
 
-jaxws_tests.bundle.name=jdk7-jaxws-tests-2009_08_28.zip
-jaxws_tests.master.bundle.dir=${drops.master.copy.base}
-jaxws_tests.master.bundle.url.base=${drops.master.url.base}
+#jaxws_tests.bundle.name=jdk7-jaxws-tests-2009_08_28.zip
+#jaxws_tests.master.bundle.dir=${drops.master.copy.base}
+#jaxws_tests.master.bundle.url.base=http://kenai.com/projects/jdk7-drops/downloads/download
+
--- a/jaxws/make/Makefile	Tue Jul 20 16:09:44 2010 -0700
+++ b/jaxws/make/Makefile	Wed Jul 21 09:57:21 2010 -0700
@@ -65,6 +65,11 @@
   endif
 endif 
 
+# If downloads are allowed
+ifeq ($(ALLOW_DOWNLOADS),true)
+  ANT_OPTIONS += -Dallow.downloads=true
+endif
+
 # Figure out the platform we are using
 _SYSTEM_UNAME := $(shell uname)
 _PLATFORM_KIND = unix
@@ -159,6 +164,8 @@
 	@echo "    $(ANT_TARGETS)"
 	@echo " "
 	@echo "  Environment or command line variables (all optional):"
+	$(call helpenvline, ALT_DROPS_DIR,\
+	       "Directory that contains the drop source bundles i.e. drops.dir")
 	$(call helpenvline, ALT_BOOTDIR,\
 	       "JAVA_HOME to use when running ant")
 	$(call helpenvline, ALT_LANGTOOLS_DIST,\
--- a/jdk/.hgtags	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/.hgtags	Wed Jul 21 09:57:21 2010 -0700
@@ -70,3 +70,9 @@
 219b84b9533ae4fe3c6c2083f8a8962cb579f1de jdk7-b93
 cf44386c8fe3fbdb9da14346be25d19fd1092f71 jdk7-b94
 db951e984ccf50756160fee3078c791300b0917e jdk7-b95
+51b9e5dbc2da0631414484b934ac3fb62e48a2c6 jdk7-b96
+b1903d7528d33b521df42bc9291bdcdd2f444a29 jdk7-b97
+82593186fa54ab12f17af31f86a7bf364efaf4df jdk7-b98
+2587c9f0b60dc3146b4247b8674ada456a643d6f jdk7-b99
+820b4e843d5168370a3bf166d19751a3271d8575 jdk7-b100
+d58354a69011f3d3354765fa3167567c4c4a9612 jdk7-b101
--- a/jdk/make/com/sun/Makefile	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/make/com/sun/Makefile	Wed Jul 21 09:57:21 2010 -0700
@@ -42,7 +42,7 @@
 SUBDIRS = java security net/ssl jarsigner
 
 SUBDIRS_management = jmx
-SUBDIRS_desktop    = image inputmethods
+SUBDIRS_desktop    = image
 SUBDIRS_enterprise = crypto/provider jndi \
                      org xml rowset net/httpserver
 SUBDIRS_misc       = $(SCRIPT_SUBDIR) tracing servicetag nio demo
--- a/jdk/make/com/sun/inputmethods/Makefile	Tue Jul 20 16:09:44 2010 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,39 +0,0 @@
-#
-# Copyright (c) 2002, 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.
-#
-
-#
-# Makefile for building Java input methods
-#
-
-BUILDDIR = ../../..
-PRODUCT = sun
-include $(BUILDDIR)/common/Defs.gmk
-
-SUBDIRS = indicim thaiim
-include $(BUILDDIR)/common/Subdirs.gmk
-
-all build clean clobber::
-	$(SUBDIRS-loop)
-
--- a/jdk/make/com/sun/inputmethods/indicim/Makefile	Tue Jul 20 16:09:44 2010 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,79 +0,0 @@
-#
-# Copyright (c) 2002, 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.
-#
-
-#
-# Makefile for indic input method.
-#
-
-BUILDDIR = ../../../..
-
-PACKAGE = com.sun.inputmethods.internal.indicim
-PRODUCT = sun
-
-CLASSDESTDIR = $(TEMPDIR)/classes
-SERVICESDIR=META-INF/services
-IMJAR = $(IMJARDIR)/indicim.jar
-IMJARDIR=$(LIBDIR)/im
-include $(BUILDDIR)/common/Defs.gmk
-
-#
-# Files
-#
-AUTO_FILES_JAVA_DIRS = com/sun/inputmethods/internal/indicim
-
-FILES_copy = \
-	$(CLASSDESTDIR)/com/sun/inputmethods/internal/indicim/resources/DisplayNames.properties
-
-PROVIDER_CONF_FILE = \
-	$(CLASSDESTDIR)/$(SERVICESDIR)/java.awt.im.spi.InputMethodDescriptor
-
-#
-# Rules
-#
-include $(BUILDDIR)/common/Classes.gmk
-
-build: $(IMJAR)
-
-#
-# Extra rules to build im.
-#
-
-$(CLASSDESTDIR)/com/sun/inputmethods/internal/indicim/resources/% : $(SHARE_SRC)/classes/com/sun/inputmethods/internal/indicim/resources/%
-	$(install-file)
-
-$(CLASSDESTDIR)/$(SERVICESDIR)/java.awt.im.spi.InputMethodDescriptor : $(SHARE_SRC)/classes/com/sun/inputmethods/internal/indicim/java.awt.im.spi.InputMethodDescriptor
-	$(install-file)
-
-$(IMJAR): $(FILES_class) $(FILES_copy) $(PROVIDER_CONF_FILE)
-	$(prep-target)
-	$(BOOT_JAR_CMD) -cf $@ \
-	     -C $(CLASSDESTDIR) com \
-	     -C $(CLASSDESTDIR) $(SERVICESDIR) \
-	     $(BOOT_JAR_JFLAGS)
-	@$(java-vm-cleanup)
-
-clean::
-	$(RM) -r $(CLASSDESTDIR)
-	$(RM) $(IMJAR)
--- a/jdk/make/com/sun/inputmethods/thaiim/Makefile	Tue Jul 20 16:09:44 2010 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,79 +0,0 @@
-#
-# Copyright (c) 2002, 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.
-#
-
-#
-# Makefile for thai input method.
-#
-
-BUILDDIR = ../../../..
-
-PACKAGE = com.sun.inputmethods.internal.thaiim
-PRODUCT = sun
-
-CLASSDESTDIR = $(TEMPDIR)/classes
-SERVICESDIR=META-INF/services
-IMJAR = $(IMJARDIR)/thaiim.jar
-IMJARDIR=$(LIBDIR)/im
-include $(BUILDDIR)/common/Defs.gmk
-
-#
-# Files
-#
-AUTO_FILES_JAVA_DIRS = com/sun/inputmethods/internal/thaiim
-
-FILES_copy = \
-	$(CLASSDESTDIR)/com/sun/inputmethods/internal/thaiim/resources/DisplayNames.properties
-
-PROVIDER_CONF_FILE = \
-	$(CLASSDESTDIR)/$(SERVICESDIR)/java.awt.im.spi.InputMethodDescriptor
-
-#
-# Rules
-#
-include $(BUILDDIR)/common/Classes.gmk
-
-build: $(IMJAR)
-
-#
-# Extra rules to build im.
-#
-
-$(CLASSDESTDIR)/com/sun/inputmethods/internal/thaiim/resources/% : $(SHARE_SRC)/classes/com/sun/inputmethods/internal/thaiim/resources/%
-	$(install-file)
-
-$(CLASSDESTDIR)/$(SERVICESDIR)/java.awt.im.spi.InputMethodDescriptor : $(SHARE_SRC)/classes/com/sun/inputmethods/internal/thaiim/java.awt.im.spi.InputMethodDescriptor
-	$(install-file)
-
-$(IMJAR): $(FILES_class) $(FILES_copy) $(PROVIDER_CONF_FILE)
-	$(prep-target)
-	$(BOOT_JAR_CMD) -cf $@ \
-	     -C $(CLASSDESTDIR) com \
-	     -C $(CLASSDESTDIR) $(SERVICESDIR) \
-	     $(BOOT_JAR_JFLAGS)
-	@$(java-vm-cleanup)
-
-clean::
-	$(RM) -r $(CLASSDESTDIR)
-	$(RM) $(IMJAR)
--- a/jdk/make/common/Defs-linux.gmk	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/make/common/Defs-linux.gmk	Wed Jul 21 09:57:21 2010 -0700
@@ -194,7 +194,16 @@
   CXXFLAGS_DBG	+= $(CC_OPT/$(FASTDEBUG_OPTIMIZATION_LEVEL))
 endif
 
-CPPFLAGS_COMMON = -D$(ARCH) -DARCH='"$(ARCH)"' -DLINUX $(VERSION_DEFINES) \
+CPP_ARCH_FLAGS = -DARCH='"$(ARCH)"'
+
+# Alpha arch does not like "alpha" defined (potential general arch cleanup issue here)
+ifneq ($(ARCH),alpha)
+  CPP_ARCH_FLAGS += -D$(ARCH)
+else
+  CPP_ARCH_FLAGS += -D_$(ARCH)_
+endif
+
+CPPFLAGS_COMMON = $(CPP_ARCH_FLAGS) -DLINUX $(VERSION_DEFINES) \
 		  -D_LARGEFILE64_SOURCE -D_GNU_SOURCE -D_REENTRANT
 
 ifeq ($(ARCH_DATA_MODEL), 64)
@@ -311,6 +320,7 @@
 endif
 override LIBPOSIX4               =
 override LIBSOCKET               =
+override LIBNSL                  =
 override LIBTHREAD               =
 override MOOT_PRIORITIES         = true
 override NO_INTERRUPTIBLE_IO     = true
--- a/jdk/make/common/Defs-solaris.gmk	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/make/common/Defs-solaris.gmk	Wed Jul 21 09:57:21 2010 -0700
@@ -639,25 +639,15 @@
 #    in general this is ok to continue to do.
 LIBCXX = /usr/lib$(ISA_DIR)/libCrun.so.1
 
-# Math Library (libm.so), do not use -lm.
-#    There might be two versions of libm.so on the build system:
-#    libm.so.1 and libm.so.2, and we want libm.so.1.
-#    Depending on the Solaris release being used to build with,
-#    /usr/lib/libm.so could point at a libm.so.2, so we are
-#    explicit here so that the libjvm.so you have built will work on an
-#    older Solaris release that might not have libm.so.2.
-#    This is a critical factor in allowing builds on Solaris 10 or newer
-#    to run on Solaris 8 or 9.
-#
-#    Note: Historically there was also a problem picking up a static version
-#          of libm.a from the compiler area, but that problem has gone away
-#          with the newer compilers. Use of libm.a would cause .so bloat.
-#
-LIBM = /usr/lib$(ISA_DIR)/libm.so.1
+# JDK now requires Solaris 10, so pick up libm.so.2
+LIBM = /usr/lib$(ISA_DIR)/libm.so.2
 
 # Socket library
 LIBSOCKET = -lsocket
 
+# Network Services library
+LIBNSL = -lnsl
+
 # GLOBAL_KPIC: If set means all libraries are PIC, position independent code
 #    EXCEPT for select compiles
 #    If a .o file is compiled non-PIC then it should be forced
--- a/jdk/make/common/Release.gmk	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/make/common/Release.gmk	Wed Jul 21 09:57:21 2010 -0700
@@ -47,14 +47,20 @@
 # Swing has taken this approach only as a temporary measure to avoid
 # the compiler warnings until we can properly document these packages.
 # This is covered under 6491853.
-EXCLUDE_PROPWARN_PKGS = com.sun.java.swing.plaf          \
-                        com.sun.java.swing.plaf.windows  \
+EXCLUDE_PROPWARN_PKGS = com.sun.java.swing.plaf.windows  \
                         com.sun.java.swing.plaf.motif    \
                         com.sun.java.swing.plaf.gtk
 
 # This is a stopgap until 6839872 is fixed.
 EXCLUDE_PROPWARN_PKGS += sun.dyn
 
+#
+# Include the exported private packages in ct.sym.
+# This is an interim solution until the ct.sym is replaced
+# with a new module system (being discussed for JDK 7).
+#
+EXPORTED_PRIVATE_PKGS = com.sun.servicetag
+
 # 64-bit solaris has a few special cases. We define the variable
 # SOLARIS64 for use in this Makefile to easily test those cases
 ifeq ($(PLATFORM), solaris)
@@ -983,7 +989,7 @@
 	    -processor com.sun.tools.javac.sym.CreateSymbols \
 	    -Acom.sun.tools.javac.sym.Jar=$(RT_JAR) \
 	    -Acom.sun.tools.javac.sym.Dest=$(OUTPUTDIR)/symbols/META-INF/sym/rt.jar \
-	    $(CORE_PKGS) $(NON_CORE_PKGS) $(EXCLUDE_PROPWARN_PKGS)
+	    $(CORE_PKGS) $(NON_CORE_PKGS) $(EXCLUDE_PROPWARN_PKGS) $(EXPORTED_PRIVATE_PKGS)
 	$(BOOT_JAR_CMD) c0f $(LIBDIR)/ct.sym \
 	    -C $(OUTPUTDIR)/symbols META-INF $(BOOT_JAR_JFLAGS)
 	@$(java-vm-cleanup)
--- a/jdk/make/common/shared/Defs-control.gmk	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/make/common/shared/Defs-control.gmk	Wed Jul 21 09:57:21 2010 -0700
@@ -35,9 +35,6 @@
   JDK_MAKE_SHARED_DIR = $(JDK_TOPDIR)/make/common/shared
 endif
 
-ifndef CONTROL_TOPDIR
-  CONTROL_TOPDIR=$(TOPDIR)
-endif
 ifndef HOTSPOT_TOPDIR
   HOTSPOT_TOPDIR=$(TOPDIR)/hotspot
 endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/make/common/shared/Defs-javadoc.gmk	Wed Jul 21 09:57:21 2010 -0700
@@ -0,0 +1,93 @@
+#
+# Copyright (c) 1997, 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.
+#
+
+# Copyright year for beginning of Java and some of the apis
+#   (Needed when creating the javadocs)
+FIRST_COPYRIGHT_YEAR                = 1993
+DOMAPI_FIRST_COPYRIGHT_YEAR         = 2005
+MIRROR_FIRST_COPYRIGHT_YEAR         = 2004
+DOCLETAPI_FIRST_COPYRIGHT_YEAR      = 1993
+TAGLETAPI_FIRST_COPYRIGHT_YEAR      = 1993
+JDI_FIRST_COPYRIGHT_YEAR            = 1999
+JAAS_FIRST_COPYRIGHT_YEAR           = 1998
+JGSS_FIRST_COPYRIGHT_YEAR           = 2000
+SMARTCARDIO_FIRST_COPYRIGHT_YEAR    = 2005
+HTTPSERVER_FIRST_COPYRIGHT_YEAR     = 2005
+MGMT_FIRST_COPYRIGHT_YEAR           = 2003
+ATTACH_FIRST_COPYRIGHT_YEAR         = 2005
+JCONSOLE_FIRST_COPYRIGHT_YEAR       = 2006
+SCTPAPI_FIRST_COPYRIGHT_YEAR        = 2009
+TRACING_FIRST_COPYRIGHT_YEAR        = 2008
+TREEAPI_FIRST_COPYRIGHT_YEAR        = 2005
+JNLP_FIRST_COPYRIGHT_YEAR           = 1998
+PLUGIN2_FIRST_COPYRIGHT_YEAR        = 2007
+
+# Oracle name
+COMPANY_NAME = Oracle and/or its affiliates
+
+# Copyright address
+COMPANY_ADDRESS = 500 Oracle Parkway<br>Redwood Shores, CA 94065 USA.
+
+# The trademark symbol
+TRADEMARK = &trade;
+
+# Common copyright lines used
+#   The word "Copyright" might optionally be a link to the file cpyr.html.
+#   The first year of copyright may vary or not be available.
+#   The address to the company might be optional.
+COMMA:= ,
+EMPTY:=
+SPACE:=$(EMPTY) $(EMPTY)
+COPYRIGHT_SYMBOL = &\#x00a9;
+# Macros to handle the optional empty args.
+#   (The GNU make 3.78.1 "if" conditional is broken, fixed in GNU make 3.81)
+define OptionalCopyrightUrl # url
+$(shell \
+  if [ "$1" != "" ] ; then \
+    printf "<a href=\"%s\">Copyright</a>" "$1"; \
+  else \
+    printf "Copyright"; \
+  fi)
+endef
+define OptionalCopyrightFirstYear # year
+$(shell \
+  if [ "$1" != "" ] ; then \
+    printf "%s," "$1";\
+  fi)
+endef
+define OptionalCompanyAddress # address
+$(shell \
+  if [ "$1" != "" ] ; then \
+    printf "%s" "$1";\
+  fi)
+endef
+define CopyrightLine # optionalurl optionalfirstyear optionaladdress
+$(call OptionalCopyrightUrl,$1) $(COPYRIGHT_SYMBOL)\
+$(call OptionalCopyrightFirstYear,$2) $(COPYRIGHT_YEAR),\
+$(COMPANY_NAME).\
+$(call OptionalCompanyAddress,$3)\
+All rights reserved.
+endef
+
--- a/jdk/make/common/shared/Defs-windows.gmk	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/make/common/shared/Defs-windows.gmk	Wed Jul 21 09:57:21 2010 -0700
@@ -230,7 +230,8 @@
 
 # Compilers, SDK, and Visual Studio (MSDEV) [32bit is different from 64bit]
 ifeq ($(ARCH_DATA_MODEL), 32)
-  # Try looking in MSVCDIR or MSVCDir area first (set by vcvars32.bat)
+  # Try looking in MSVCDIR or MSVCDir area first 
+  # (set by vcvars32.bat for VC .NET, not defined in the VC 2008/2010)
   ifdef MSVCDIR
     xMSVCDIR  :="$(subst \,/,$(MSVCDIR))"
     _msvc_dir :=$(call FullPath,$(xMSVCDIR))
@@ -238,11 +239,6 @@
     ifdef MSVCDir
       xMSVCDIR  :="$(subst \,/,$(MSVCDir))"
       _msvc_dir :=$(call FullPath,$(xMSVCDIR))
-    else
-      ifneq ($(_program_files),)
-        xMSVCDIR  :="$(_program_files)/Microsoft Visual Studio .NET 2003/Vc7"
-        _msvc_dir :=$(call FullPath,$(xMSVCDIR))
-      endif
     endif
   endif
   # If we still don't have it, look for VSnnCOMNTOOLS (newest first),
@@ -331,23 +327,50 @@
   endif
 endif
 
-# Compilers for 64bit may be from SDK. For VS 2010 we use those.
-# The Express compilers don't contain 64 bit compilers, so in
-# that case, you additionally need the SDK. At this time,
-# there's no 64 bit SDK available that has VS 2010.
-# Presumably SDK v7.1 will provide that and we may want to update
-# the logic here to work with that.
-# However official builds will use the Professional version.
+# Compilers for 64bit may be from the free SDK, or Visual Studio Professional
+# The free Express compilers don't contain 64 bit compilers, which is why
+# you instead need the SDK.
+# So for VS2010 based builds, either VS2010 Pro with the 7.0a SDK, or
+# the Windows 7.1 standalone SDK with compilers may be used.
+# Release enginering will use VS2010 Pro, so the frequency of testing of
+# SDK based builds will depend entirely on individual usage.
 ifeq ($(ARCH_DATA_MODEL), 64)
   ifdef VS100COMNTOOLS  # /Common7/Tools directory, use ../../Vc
+    # VS2010 default location is used when building 64 bit using the 7.1 SDK
+    # This is safe to hardwire as the SDK installer won't let you change it
+    # and the VS2010 variable is only used if the compilers are from the SDK
+    xVS2010 :="$(_program_files32)/Microsoft Visual Studio 10.0/"
+    VS2010 :=$(call FullPath,$(xVS2010))
     xVS100COMNTOOLS :="$(subst \,/,$(VS100COMNTOOLS))"
     _vs100tools     :=$(call FullPath,$(xVS100COMNTOOLS))
   endif
   ifneq ($(_vs100tools),)
     _compiler_bin :=$(_vs100tools)/../../Vc/bin/amd64
-    _redist_sdk   :=$(_vs100tools)/../../Vc/redist/x64/Microsoft.VC100.CRT
-    xMSSDK70      :="$(_program_files32)/Microsoft SDKs/Windows/v7.0a/"
-    MSSDK70       :=$(call FullPath,$(xMSSDK70))
+    x_redist_sdk   :=$(_vs100tools)/../../Vc/redist/x64/Microsoft.VC100.CRT
+    _redist_sdk    :=$(call FullPath,$(x_redist_sdk))
+    # The SDK doesn't have the redist directory, but the DLL is installed
+    # into the windows directory.
+    ifeq ($(_redist_sdk),)
+      _redist_sdk   :=c:/windows/system32
+    endif
+    # Not currently using MSSDK7n, but maybe we can make use of it for
+    # doing default location lookup to find some SDK tools that presently
+    # require the developer to explicitly set the path.
+    # The 7.0a path is from VS2010 Pro, the 7.1 path is the standalone SDK.
+    # Either will work for us.
+    # If a developer chooses to install the standalone SDK in some other
+    # location, then this will fail to find it, which won't matter so long as
+    # we aren't using this variable. If we do they'd still need to set the
+    # ALT_MSDEVTOOLS_PATH as now.
+    # %WindowsSdkDir% could be referenced instead but the SDK installer
+    # doesn't set it and in the case of the VS2010 compilers,
+    # you can't change this location in the installer anyway.
+    xMSSDK7n      :="$(_program_files32)/Microsoft SDKs/Windows/v7.0a/"
+    MSSDK7n       :=$(call FullPath,$(xMSSDK7n))
+    ifeq ($(MSSDK7n),)
+      xMSSDK7n      :="$(_program_files32)/Microsoft SDKs/Windows/v7.1/"
+      MSSDK7n       :=$(call FullPath,$(xMSSDK7n))
+    endif
   else
     xVS2008 :="$(_program_files32)/Microsoft Visual Studio 9.0/"
     VS2008 :=$(call FullPath,$(xVS2008))
@@ -355,7 +378,7 @@
       _compiler_bin :=$(VS2008)/VC/Bin/$(ARCH)
       xMSSDK61      :="$(_program_files)/Microsoft SDKs/Windows/v6.1/"
       MSSDK61       :=$(call FullPath,$(xMSSDK61))
-      _redist_sdk   :=$(VS2008)/VC/redist/x86/Microsoft.VC90.CRT
+      _redist_sdk   :=$(VS2008)/VC/redist/x64/Microsoft.VC90.CRT
     else
       ifneq ($(_ms_sdk),)
         ifeq ($(ARCH), ia64)
--- a/jdk/make/common/shared/Platform.gmk	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/make/common/shared/Platform.gmk	Wed Jul 21 09:57:21 2010 -0700
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 1997, 2008, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 1997, 20010, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -231,15 +231,35 @@
   # Temporary disk area
   TEMP_DISK=C:/temp
   # GNU Make or MKS overrides $(PROCESSOR_ARCHITECTURE) to always
-  # return "x86". Use the first word of $(PROCESSOR_IDENTIFIER) instead.
-  PROC_ARCH:=$(word 1, $(PROCESSOR_IDENTIFIER))
-  PROC_ARCH:=$(subst x86,X86,$(PROC_ARCH))
-  PROC_ARCH:=$(subst Intel64,X64,$(PROC_ARCH))
-  PROC_ARCH:=$(subst em64t,X64,$(PROC_ARCH))
-  PROC_ARCH:=$(subst EM64T,X64,$(PROC_ARCH))
-  PROC_ARCH:=$(subst amd64,X64,$(PROC_ARCH))
-  PROC_ARCH:=$(subst AMD64,X64,$(PROC_ARCH))
-  PROC_ARCH:=$(subst ia64,IA64,$(PROC_ARCH))
+  #  return "x86". Use the first word of $(PROCESSOR_IDENTIFIER) instead.
+  #  And sometimes PROCESSOR_IDENTIFIER is not defined at all
+  #  (in some restricted shells), so we use uname if we have to.
+  ifeq ($(PROCESSOR_IDENTIFIER),)
+    PROC_ARCH:=$(shell uname -m)
+  else
+    PROC_ARCH:=$(word 1, $(PROCESSOR_IDENTIFIER))
+  endif
+  # Cover all the possibilities, MKS uname, CYGWIN uname, PROCESSOR_IDENTIFIER
+  #    Get: X86, X64, or IA64
+  PROC_ARCH:=$(patsubst 386,X86,$(PROC_ARCH))
+  PROC_ARCH:=$(patsubst 486,X86,$(PROC_ARCH))
+  PROC_ARCH:=$(patsubst 586,X86,$(PROC_ARCH))
+  PROC_ARCH:=$(patsubst 686,X86,$(PROC_ARCH))
+  PROC_ARCH:=$(patsubst i386,X86,$(PROC_ARCH))
+  PROC_ARCH:=$(patsubst i486,X86,$(PROC_ARCH))
+  PROC_ARCH:=$(patsubst i586,X86,$(PROC_ARCH))
+  PROC_ARCH:=$(patsubst i686,X86,$(PROC_ARCH))
+  PROC_ARCH:=$(patsubst x86,X86,$(PROC_ARCH))
+  PROC_ARCH:=$(patsubst intel64,X64,$(PROC_ARCH))
+  PROC_ARCH:=$(patsubst Intel64,X64,$(PROC_ARCH))
+  PROC_ARCH:=$(patsubst INTEL64,X64,$(PROC_ARCH))
+  PROC_ARCH:=$(patsubst em64t,X64,$(PROC_ARCH))
+  PROC_ARCH:=$(patsubst EM64T,X64,$(PROC_ARCH))
+  PROC_ARCH:=$(patsubst amd64,X64,$(PROC_ARCH))
+  PROC_ARCH:=$(patsubst AMD64,X64,$(PROC_ARCH))
+  PROC_ARCH:=$(patsubst 8664,X64,$(PROC_ARCH))
+  PROC_ARCH:=$(patsubst x86_64,X64,$(PROC_ARCH))
+  PROC_ARCH:=$(patsubst ia64,IA64,$(PROC_ARCH))
   ifndef ARCH_DATA_MODEL
     ifeq ($(PROC_ARCH),IA64)
       ARCH_DATA_MODEL=64
--- a/jdk/make/docs/CORE_PKGS.gmk	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/make/docs/CORE_PKGS.gmk	Wed Jul 21 09:57:21 2010 -0700
@@ -234,6 +234,7 @@
   javax.xml.ws.http                              \
   javax.xml.ws.soap                              \
   javax.xml.ws.spi                               \
+  javax.xml.ws.spi.http                          \
   javax.xml.ws.wsaddressing                      \
   javax.xml.transform                            \
   javax.xml.transform.sax                        \
--- a/jdk/make/docs/Makefile	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/make/docs/Makefile	Wed Jul 21 09:57:21 2010 -0700
@@ -1,5 +1,4 @@
-#
-# Copyright (c) 1997, 2009, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 1997, 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
@@ -30,6 +29,41 @@
 PRODUCT=docs
 include $(BUILDDIR)/common/Defs.gmk
 
+# Get CopyrightLine macro and other shared variables
+include $(BUILDDIR)/common/shared/Defs-javadoc.gmk
+
+# Url to root of documents
+DOCSDIR_URL = {@docroot}/$(GET2DOCSDIR)
+
+# Url to copyright html file
+COPYRIGHT_URL-7 = $(DOCSDIR_URL)/legal/cpyr.html
+COPYRIGHT_URL = $(COPYRIGHT_URL-$(JDK_MINOR_VERSION))
+
+# Url to bug filing site
+BUG_SUBMIT_URL = http://bugs.sun.com/services/bugreport/index.jsp
+
+# Common line for how to submit a bug or rfe
+BUG_SUBMIT_LINE = <a href=\"$(BUG_SUBMIT_URL)\">Submit a bug or feature</a>
+
+# 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
+DEV_DOCS_URL-6 = http://download.oracle.com/docs/cd/E17409_01/javase/6/docs
+DEV_DOCS_URL-7 = http://download.oracle.com/docs/cd/E17409_01/javase/7/docs
+DEV_DOCS_URL = $(DEV_DOCS_URL-$(JDK_MINOR_VERSION))
+
+# Url to Java Language Spec
+JLS3_URL = http://java.sun.com/docs/books/jls/
+
+# Common Java trademark line
+JAVA_TRADEMARK_LINE = Java is a trademark or registered trademark of \
+$(COMPANY_NAME) in the US and other countries.
+
+#
+# Definitions for imported components
+#
+include $(BUILDDIR)/common/internal/ImportComponents.gmk
+
 # We override whatever the max VM memory setting is here.
 #    NOTE: javadoc will not complete without these larger settings.
 #    WARNING: This could cause thrashing on low memory machines.
@@ -39,418 +73,155 @@
   MAX_VM_MEMORY = 512
 endif
 
-#
-# Variables used by docs target
+# List of all possible directories for javadoc to look for sources
+#    NOTE: Quotes are required around sourcepath argument only on Windows.
+#          Otherwise, you get "No packages or classes specified." due 
+#          to $(CLASSPATH_SEPARATOR) being interpreted as an end of 
+#          command (newline or shell ; character)
+ALL_SOURCE_DIRS = $(SHARE_SRC)/classes \
+                  $(IMPORTSRCDIR) \
+                  $(GENSRCDIR) \
+                  $(SHARE_SRC)/../solaris/classes \
+	          $(SHARE_SRC)/../windows/classes \
+		  $(SHARE_SRC)/doc/stub
+EMPTY:=
+SPACE:= $(EMPTY) $(EMPTY)
+RELEASEDOCS_SOURCEPATH = \
+    $(subst $(SPACE),$(CLASSPATH_SEPARATOR),$(strip $(ALL_SOURCE_DIRS)))
+
+# Prep for javadoc creation, assumes $@ is an index.html file
+define prep-javadoc
+@if [ -f "$@" -a "$?" != "" ] ; then \
+  $(ECHO) "# Dependencies have changed: $?"; \
+fi
+$(RM) -r $(@D)
+$(MKDIR) -p $(@D)
+endef
+
+# A cache of the directories in ALL_SOURCE_DIRS
+DIRECTORY_CACHE = $(DOCSTMPDIR)/directory.cache
+
+# Given a list of packages, return a list of files or dirs to be dependent on
+#   (Currently only returning a list of directories)
+define PackageDependencies # packages
+$(shell							\
+  if [ "$1" != "" -a -f $(DIRECTORY_CACHE) ] ; then	\
+    for p in $1 ; do 					\
+      pd=`$(ECHO) $${p} | $(SED) -e 's@[.]@/@g'`;	\
+      $(CAT) $(DIRECTORY_CACHE) | $(GREP) "/$${pd}/" ; 	\
+    done; 						\
+  fi							\
+)
+endef
+
+# Given a list of packages, add packages that exist to $@, print summary
+define PackageFilter # packages
+@if [ "$1" != "" ] ; then 				\
+  for p in $1 ; do 					\
+    pd=`$(ECHO) $${p} | $(SED) -e 's@[.]@/@g'`; 	\
+    found="false"; 					\
+    for cp in $(ALL_SOURCE_DIRS) ; do 			\
+      if [ -d $${cp}/$${pd} ] ; then 			\
+        $(ECHO) "$${p}" >> $@; 				\
+	found="true";					\
+	break; 						\
+      fi; 						\
+    done; 						\
+    if [ "$${found}" = "false" ] ; then 		\
+      $(ECHO) "WARNING: Package not found: $${p}"; 	\
+    fi; 						\
+  done; 						\
+fi
+endef
+
+# Print out a summary of the javadoc command about to be run
+define JavadocSummary # optionsfile packagesfile
+@$(ECHO) "# Summary for $@";\
+ $(ECHO) "# Options (`$(BASENAME) $1`):"; $(SED) -e 's@^@#   @' $1; \
+ $(ECHO) "# Packages (`$(BASENAME) $2`):";$(SED) -e 's@^@#   @' $2
+endef
+
 #
-DOCSTMPDIR          = $(TEMPDIR)/doctmp
+# Temporary directory for javadoc creation
+#
+DOCSTMPDIR = $(TEMPDIR)/doctmp
+
+#
+# Different api directories created from root directory
+#
+COREAPI_DOCSDIR   = $(DOCSDIR)/api
+JDK_API_DOCSDIR   = $(DOCSDIR)/jdk/api
+JRE_API_DOCSDIR   = $(DOCSDIR)/jre/api
+PLATFORM_DOCSDIR  = $(DOCSDIR)/platform
+
+# The non-core api javadocs need to be able to access the root of the core
+#   api directory, so for jdk/api or jre/api to get to the core api/
+#   directory we would use this:
+JDKJRE2COREAPI    = ../../api
+
+# Common bottom argument
+define CommonBottom # year
+<font size=\"-1\"><p> $(call CopyrightLine,,$1,)</font>
+endef
 
+# Common trademark bottom argument (Not sure why this is used sometimes)
+define CommonTrademarkBottom # year
+<font size=\"-1\">\
+$(BUG_SUBMIT_LINE)<br>$(JAVA_TRADEMARK_LINE)<br>\
+$(call CopyrightLine,,$1,$(COMPANY_ADDRESS))\
+</font>
+endef
+
+# Core api bottom argument (with special sauce)
+COREAPI_BOTTOM = <font size=\"-1\"> $(BUG_SUBMIT_LINE)\
+<br>For further API reference and developer documentation, \
+see <a href=\"$(DEV_DOCS_URL)\" target=\"_blank\">Java SE Documentation</a>. \
+That documentation contains more detailed, developer-targeted descriptions, \
+with conceptual overviews, definitions of terms, workarounds, \
+and working code examples.<p>\
+$(call CopyrightLine,$(COPYRIGHT_URL),$(FIRST_COPYRIGHT_YEAR),)\
+</font>
+
+# Common javadoc options used by all
 COMMON_JAVADOCFLAGS =					\
-		$(NO_PROPRIETARY_API_WARNINGS)		\
+                $(NO_PROPRIETARY_API_WARNINGS)          \
 		-source 1.5				\
 		-quiet					\
                 -use					\
                 -keywords				\
-		$(JAVADOC_VM_MEMORY_FLAGS)		\
 		$(ADDITIONAL_JAVADOCFLAGS)
 ADDITIONAL_JAVADOCFLAGS =
 
-CORE_JAVADOCFLAGS  = $(COMMON_JAVADOCFLAGS)		\
-		$(TAGS)					\
-		-encoding ISO-8859-1			\
-		-splitIndex				\
-		-doctitle $(DOCTITLE_SWITCH)		\
-		-windowtitle $(WINDOWTITLE_SWITCH)	\
-		-header $(HEADER_SWITCH)		\
-		$(TOPOPTION) 				\
-		-bottom $(JAVADOCBOTTOM_SWITCH)		\
-		$(OVERVIEW_OPTION)
-
-DRAFT = '<br><strong>DRAFT&nbsp;'$(MILESTONE)-$(BUILD_NUMBER)'</strong>'
-THIS_YEAR := $(shell $(DATE) | $(SED) -e 's/  / /g' | $(CUT) -d' ' -f6)
-TRADEMARK = &\#x2122;
-
-IGNORED_TAGS =	beaninfo revised since.unbundled spec specdefault Note ToDo
-
-JLS3_URL = http://java.sun.com/docs/books/jls/
-JLS3_CITE = <a href="$(JLS3_URL)"> \
-		The Java Language Specification, Third Edition</a>
-TAG_JLS3 = -tag 'jls3:a:See <cite>$(JLS3_CITE)</cite>:'
-
-TAGS = $(IGNORED_TAGS:%=-tag %:X) $(TAG_JLS3)
-
-ifeq ($(MILESTONE), fcs)
-    DOCTITLE_SWITCH = $(JAVADOCTITLE)
-    WINDOWTITLE_SWITCH = $(JAVADOCWINDOWTITLE)
-    HEADER_SWITCH = $(JAVADOCHEADER)
-    TOPOPTION=
-    JAVADOCBOTTOM_SWITCH= $(JAVADOCBOTTOM)
-    OVERVIEW_OPTION = -overview $(JAVADOCOVERVIEW)
-else
-    DOCTITLE_SWITCH = $(JAVADOCTITLE_EARLYACCESS)$(DRAFT)
-    WINDOWTITLE_SWITCH = $(JAVADOCWINDOWTITLE)" $(BUILD_NUMBER)"
-    HEADER_SWITCH = $(JAVADOCHEADER)$(DRAFT)
-    JAVADOCBOTTOM_SWITCH= $(JAVADOCBOTTOM_EARLYACCESS)
-    TOPOPTION= -top $(JAVADOCTOP_EARLYACCESS)
-    OVERVIEW_OPTION =
+# Draft used for non-fcs documents
+JDK_IS_FCS = false
+DRAFT_HEADER =
+ifeq ($(JDK_MINOR_VERSION),5)
+  JDK_IS_FCS = true
+endif
+ifeq ($(JDK_MINOR_VERSION),6)
+  JDK_IS_FCS = true
+endif
+ifeq ($(JDK_IS_FCS),false)
+  ifneq ($(MILESTONE), fcs)
+    DRAFT_HEADER = <br><strong>DRAFT&nbsp;$(MILESTONE)-$(BUILD_NUMBER)</strong>
+    DRAFT_BOTTOM = <br><strong>DRAFT&nbsp;$(MILESTONE)-$(BUILD_NUMBER)</strong>
+    DRAFT_WINTITLE = $(BUILD_NUMBER)
+    # Early access top text (not used in FCS releases)
+    COREAPI_TOP_EARLYACCESS = \
+<div style=\"background-color: \#EEEEEE\"> \
+<div style=\"padding: 6px; margin-top: 2px; margin-bottom: 6px; \
+margin-left: 6px; margin-right: 6px; text-align: justify; \
+font-size: 80%; font-family: Helvetica, Arial, sans-serif; \
+font-weight: normal;\"> \
+Please note that the specifications and other information \
+contained herein are not final and are subject to change. \
+The information is being made available to you solely for purpose of \
+evaluation. \
+</div> </div>
+  endif
 endif
 
-JAVADOCTITLE  = 'Java$(TRADEMARK) Platform, Standard Edition $(JDK_MINOR_VERSION)<br>API Specification'
-JAVADOCWINDOWTITLE  = 'Java Platform SE $(JDK_MINOR_VERSION)'
-JAVADOCHEADER = '<strong>Java$(TRADEMARK)&nbsp;Platform<br>Standard&nbsp;Ed.&nbsp;$(JDK_MINOR_VERSION)</strong>'
-JAVADOCBOTTOM = '<font size="-1"><a href="http://bugs.sun.com/services/bugreport/index.jsp">Submit a bug or feature</a><br>For further API reference and developer documentation, see <a href="{@docroot}/../../webnotes/devdocs-vs-specs.html">Java SE Developer Documentation</a>. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples. <p>Copyright $(THIS_YEAR) Sun Microsystems, Inc. All Rights Reserved. Use is subject to <a href="{@docroot}/../legal/license.html">license terms</a>. Also see the <a href="http://java.sun.com/docs/redist.html">documentation redistribution policy</a>.</font>'
-JAVADOCOVERVIEW = $(SHARE_SRC)/classes/overview-core.html
-
-#
-# Early access top and bottom text (for snapshots, beta and rc)
-#
-JAVADOCTOP_EARLYACCESS = '<div style="background-color: \#EEEEEE"> <div style="padding: 6px; margin-top: 2px; margin-bottom: 6px; margin-left: 6px; margin-right: 6px; text-align: justify; font-size: 80%; font-family: Helvetica, Arial, sans-serif; font-weight: normal;"> Please note that this documentation is not final and is subject to change. </div> </div>'
-JAVADOCBOTTOM_EARLYACCESS = '<font size="-1"><a href="http://bugs.sun.com/services/bugreport/index.jsp">Submit a bug or feature</a> <p>Copyright $(THIS_YEAR) Sun Microsystems, Inc. All Rights Reserved. Use is subject to <a href="{@docroot}/../legal/license.html">license terms</a>.</font>'
-JAVADOCTITLE_EARLYACCESS = $(subst Specification,Documentation,$(JAVADOCTITLE))
-
-#
-# Variables used by domapidocs target
-#
-
-DOMAPI_JAVADOCFLAGS = $(COMMON_JAVADOCFLAGS)		      \
-		    -encoding ascii			      \
-                    -splitIndex                               \
-                    -doctitle $(DOMAPI_JAVADOCTITLE)          \
-                    -windowtitle $(DOMAPI_JAVADOCWINDOWTITLE) \
-                    -header $(DOMAPI_JAVADOCHEADER)           \
-                    -bottom $(DOMAPI_JAVADOCBOTTOM)           \
-                    -group $(DOMAPI_GROUPNAME) $(DOMAPI_REGEXP)
-DOMAPI_JAVADOCTITLE  = 'Common DOM API'
-DOMAPI_JAVADOCWINDOWTITLE  = 'Common DOM API'
-DOMAPI_JAVADOCHEADER = '<strong>Common DOM API</strong>'
-DOMAPI_JAVADOCBOTTOM = '<font size="-1"><a href="http://bugs.sun.com/services/bugreport/index.jsp">Submit a bug or feature</a><br>Java is a trademark or registered trademark of Sun Microsystems, Inc. in the US and other countries.<br>Copyright $(THIS_YEAR) Sun Microsystems, Inc. 4150 Network Circle<br>Santa Clara, California, 95054, U.S.A.  All Rights Reserved.</font>'
-DOMAPI_GROUPNAME = "Packages"
-DOMAPI_REGEXP = "com.sun.java.browser.dom:org.w3c.dom*"
-# DOMAPI_PKGS is located in NON_CORE_PKGS.gmk
-
-#
-# Variables used by mirrordocs target
-#
-
-MIRROR_JAVADOCFLAGS = $(COMMON_JAVADOCFLAGS)		        \
-                    -encoding ascii			        \
-                    -doctitle $(MIRROR_JAVADOCTITLE)            \
-                    -windowtitle $(MIRROR_JAVADOCWINDOWTITLE)   \
-                    -header $(MIRROR_JAVADOCHEADER)             \
-                    -bottom $(MIRROR_JAVADOCBOTTOM)             \
-                    -group $(MIRROR_GROUPNAME) $(MIRROR_REGEXP) \
-                    -overview $(MIRROR_OVERVIEW)
-MIRROR_JAVADOCTITLE = 'Mirror API'
-MIRROR_JAVADOCWINDOWTITLE = 'Mirror API'
-MIRROR_JAVADOCHEADER = '<strong>Mirror API</strong>'
-MIRROR_JAVADOCBOTTOM = '<font size="-1"><a href="http://bugs.sun.com/services/bugreport/index.jsp">Report a bug or request a feature.</a><br>Copyright $(THIS_YEAR) Sun Microsystems, Inc. All Rights Reserved. Use is subject to license terms.</font>'
-MIRROR_GROUPNAME = "Packages"
-MIRROR_OVERVIEW = $(IMPORTSRCDIR)/com/sun/mirror/overview.html
-MIRROR_REGEXP = "com.sun.mirror.*"
-MIRROR_DESTDIR = $(DOCSDIR)/jdk/api/apt/mirror
-MIRROR_LINKOPT = -linkoffline ../../../../api $(DOCSDIR)/api/
-# MIRROR_PKGS is located in NON_CORE_PKGS.gmk
-
-#
-# Variables used by docletapidocs target
-#
-
-DOCLETAPI_JAVADOCFLAGS = $(COMMON_JAVADOCFLAGS)			 \
-		    -breakiterator				 \
-		    -encoding ascii			         \
-                    -doctitle $(DOCLETAPI_JAVADOCTITLE)          \
-                    -windowtitle $(DOCLETAPI_JAVADOCWINDOWTITLE) \
-                    -header $(DOCLETAPI_JAVADOCHEADER)           \
-                    -bottom $(DOCLETAPI_JAVADOCBOTTOM)           \
-                    -group $(DOCLETAPI_GROUPNAME) $(DOCLETAPI_REGEXP)
-DOCLETAPI_JAVADOCTITLE  = 'Doclet API'
-DOCLETAPI_JAVADOCWINDOWTITLE  = 'Doclet API'
-DOCLETAPI_JAVADOCHEADER = '<strong>Doclet API</strong>'
-DOCLETAPI_JAVADOCBOTTOM = '<font size="-1"><a href="http://bugs.sun.com/services/bugreport/index.jsp">Submit a bug or feature</a><br>Java is a trademark or registered trademark of Sun Microsystems, Inc. in the US and other countries.<br>Copyright 1993-$(THIS_YEAR) Sun Microsystems, Inc. 4150 Network Circle<br>Santa Clara, California, 95054, U.S.A.  All Rights Reserved.</font>'
-DOCLETAPI_GROUPNAME = "Packages"
-DOCLETAPI_REGEXP = "com.sun.javadoc"
-DOCLETAPI_LINKOPT = -linkoffline ../../../../api $(DOCSDIR)/api/
-# DOCLETAPI_PKGS is located in NON_CORE_PKGS.gmk
-
-#
-# Variables used by tagletapidocs target
-#
-
-TAGLETAPI_JAVADOCFLAGS = $(COMMON_JAVADOCFLAGS)			\
-		    -encoding ascii			        \
-                    -nonavbar                                   \
-                    -noindex                                    \
-                    -bottom $(TAGLETAPI_JAVADOCBOTTOM)
-TAGLETAPI_JAVADOCBOTTOM = '<font size="-1"><a href="http://bugs.sun.com/services/bugreport/index.jsp">Submit a bug or feature</a><br>Java is a trademark or registered trademark of Sun Microsystems, Inc. in the US and other countries.<br>Copyright 1993-$(THIS_YEAR) Sun Microsystems, Inc. 4150 Network Circle<br>Santa Clara, California, 95054, U.S.A.  All Rights Reserved.</font>'
-# TAGLETAPI_FILE is located in NON_CORE_PKGS.gmk
-
-#
-# Variables used by jdi target
-#
-
-JPDA_SOURCEPATH  = $(TOPDIR)/src/share/classes
-
-JDI_JAVADOCFLAGS = $(COMMON_JAVADOCFLAGS)			 \
-		   -encoding ascii			         \
-                   -nodeprecatedlist                             \
-                   -d $(DOCSDIR)/jdk/api/jpda/jdi                  \
-                   -sourcepath $(JPDA_SOURCEPATH)                \
-                   -windowtitle $(JDI_WINDOWTITLE)               \
-                   -doctitle $(JDI_DOCTITLE)                     \
-                   -header $(JDI_HEADER)                         \
-                   -linkoffline ../../../../api $(DOCSDIR)/api/     \
-                   -overview $(JPDA_SOURCEPATH)/jdi-overview.html
-JDI_WINDOWTITLE = "Java Debug Interface"
-JDI_DOCTITLE    = "Java$(TRADEMARK) Debug Interface"
-JDI_HEADER      = "Java Debug Interface"
-# JDI_PKGS is located in NON_CORE_PKGS.gmk
-
-# Variables used by security components
-SECURITYAPI_JAVADOCBOTTOM = '<font size="-1"><a href="http://bugs.sun.com/services/bugreport/index.jsp">Report a bug or request a feature.</a><br>Copyright $(THIS_YEAR) Sun Microsystems, Inc. All Rights Reserved. Use is subject to license terms.</font>'
-
-#
-# Variables used by JAAS target
-#
-# NOTE: Quotes are required around sourcepath argument only on Windows.  Otherwise,
-#       you get "No packages or classes specified." due to $(CLASSPATH_SEPARATOR)
-#       being interpreted as an end of command (newline)
-
-JAAS_SOURCEPATH  = "$(TOPDIR)/src/share/classes$(CLASSPATH_SEPARATOR)$(TOPDIR)/src/solaris/classes$(CLASSPATH_SEPARATOR)$(TOPDIR)/src/windows/classes$(CLASSPATH_SEPARATOR)$(TOPDIR)/src/linux/classes"
-JAAS_DOCDIR	 = $(DOCSDIR)/jre/api/security/jaas/spec
-JAAS_JAVADOCFLAGS = $(COMMON_JAVADOCFLAGS)			 \
-		   -encoding ascii			         \
-                   -nodeprecatedlist                             \
-                   -d $(JAAS_DOCDIR)				 \
-                   -sourcepath $(JAAS_SOURCEPATH)                \
-                   -windowtitle $(JAAS_WINDOWTITLE)              \
-                   -doctitle $(JAAS_DOCTITLE)                    \
-                   -header $(JAAS_JAVADOCHEADER)                 \
-                   -bottom $(SECURITYAPI_JAVADOCBOTTOM)                      \
-                   -linkoffline ../../../../../api $(DOCSDIR)/api/	 \
-                   -overview $(TOPDIR)/src/share/classes/com/sun/security/auth/jaas-overview.html
-JAAS_WINDOWTITLE = "Java Authentication and Authorization Service "
-JAAS_DOCTITLE    = "Java$(TRADEMARK) Authentication and Authorization Service"
-JAAS_JAVADOCHEADER      = "JAAS"
-# JAAS_PKGS is located in NON_CORE_PKGS.gmk
-
-#
-# Variables used by JGSS target
-#
-
-JGSS_SOURCEPATH  = $(TOPDIR)/src/share/classes
-JGSS_DOCDIR	 = $(DOCSDIR)/jre/api/security/jgss/spec
-
-JGSS_JAVADOCFLAGS = $(COMMON_JAVADOCFLAGS)			\
-		   -encoding ascii			        \
-                   -nodeprecatedlist                            \
-                   -d $(JGSS_DOCDIR)				\
-                   -sourcepath $(JGSS_SOURCEPATH)               \
-                   -windowtitle $(JGSS_WINDOWTITLE)             \
-                   -doctitle $(JGSS_DOCTITLE)                   \
-                   -header $(JGSS_JAVADOCHEADER)                \
-                   -bottom $(SECURITYAPI_JAVADOCBOTTOM)                      \
-                   -linkoffline ../../../../../api $(DOCSDIR)/api/ \
-                   -overview $(JGSS_SOURCEPATH)/com/sun/security/jgss/jgss-overview.html
-
-JGSS_WINDOWTITLE = "Java GSS-API Utilities "
-JGSS_DOCTITLE    = "Java$(TRADEMARK) GSS-API Utilities"
-JGSS_JAVADOCHEADER      = "Java GSS-API Utilities"
-# JGSS_PKGS is located in NON_CORE_PKGS.gmk
-
-#
-# Variables used by SMARTCARDIO target
-#
-
-SMARTCARDIO_SOURCEPATH  = $(TOPDIR)/src/share/classes
-SMARTCARDIO_DOCDIR	 = $(DOCSDIR)/jre/api/security/smartcardio/spec
-
-SMARTCARDIO_JAVADOCFLAGS = $(COMMON_JAVADOCFLAGS)			\
-		   -encoding ascii			        \
-                   -nodeprecatedlist                            \
-                   -d $(SMARTCARDIO_DOCDIR)				\
-                   -sourcepath $(SMARTCARDIO_SOURCEPATH)               \
-                   -windowtitle $(SMARTCARDIO_WINDOWTITLE)             \
-                   -doctitle $(SMARTCARDIO_DOCTITLE)                   \
-                   -header $(SMARTCARDIO_JAVADOCHEADER)                \
-                   -bottom $(SECURITYAPI_JAVADOCBOTTOM)                      \
-                   -linkoffline ../../../../../api $(DOCSDIR)/api/
-
-SMARTCARDIO_WINDOWTITLE = "Java Smart Card I/O"
-SMARTCARDIO_DOCTITLE    = "Java$(TRADEMARK) Smart Card I/O"
-SMARTCARDIO_JAVADOCHEADER      = "Java Smart Card I/O"
-# SMARTCARDIO_PKGS is located in NON_CORE_PKGS.gmk
-
-#
-# Variables used by TRACING target
-#
-
-TRACING_SOURCEPATH  = $(TOPDIR)/src/share/classes
-TRACING_DOCDIR	 = $(DOCSDIR)/jre/api/tracing
-
-TRACING_JAVADOCFLAGS = $(COMMON_JAVADOCFLAGS)			    \
-		   -encoding ascii			            \
-                   -nodeprecatedlist                                \
-                   -d $(TRACING_DOCDIR)				    \
-                   -sourcepath $(TRACING_SOURCEPATH)                \
-                   -windowtitle $(TRACING_WINDOWTITLE)              \
-                   -doctitle $(TRACING_DOCTITLE)                    \
-                   -header $(TRACING_JAVADOCHEADER)                 \
-                   -linkoffline ../../../../../api $(DOCSDIR)/api/
-
-TRACING_WINDOWTITLE = "Tracing"
-TRACING_DOCTITLE    = "Java$(TRADEMARK) Platform Tracing"
-TRACING_JAVADOCHEADER      = "Platform Tracing"
-# TRACING_PKGS is located in NON_CORE_PKGS.gmk
-
-#
-# Variables used by HTTPSERVER target
-#
-
-HTTPSERVER_SOURCEPATH  = $(TOPDIR)/src/share/classes
-HTTPSERVER_DOCDIR	 = $(DOCSDIR)/jre/api/net/httpserver/spec
-
-HTTPSERVER_JAVADOCFLAGS = $(COMMON_JAVADOCFLAGS)			\
-		   -encoding ascii			        \
-                   -nodeprecatedlist                            \
-                   -d $(HTTPSERVER_DOCDIR)				\
-                   -sourcepath $(HTTPSERVER_SOURCEPATH)               \
-                   -windowtitle $(HTTPSERVER_WINDOWTITLE)             \
-                   -doctitle $(HTTPSERVER_DOCTITLE)                   \
-                   -header $(HTTPSERVER_JAVADOCHEADER)                \
-                   -linkoffline ../../../../../api $(DOCSDIR)/api/
-
-HTTPSERVER_WINDOWTITLE = "Java HTTP Server"
-HTTPSERVER_DOCTITLE    = "Java$(TRADEMARK) HTTP Server"
-HTTPSERVER_JAVADOCHEADER      = "Java HTTP Server"
-# HTTPSERVER_PKGS is located in NON_CORE_PKGS.gmk
-
-#
-# Variables used by sctp target
-#
-
-SCTPAPI_SOURCEPATH  = $(TOPDIR)/src/share/classes
-SCTPAPI_DOCDIR   = $(DOCSDIR)/jre/api/nio/sctp/spec
-
-SCTPAPI_JAVADOCFLAGS = $(COMMON_JAVADOCFLAGS)                           \
-                   -encoding ascii                                      \
-                   -nodeprecatedlist                                    \
-                   -d $(SCTPAPI_DOCDIR)                                 \
-                   -sourcepath $(SCTPAPI_SOURCEPATH)                    \
-                   -windowtitle $(SCTPAPI_WINDOWTITLE)                  \
-                   -doctitle $(SCTPAPI_DOCTITLE)                        \
-                   -header $(SCTPAPI_JAVADOCHEADER)                     \
-                   -bottom $(SCTPAPI_JAVADOCBOTTOM)			\
-                   -linkoffline ../../../../../api $(DOCSDIR)/api/
-
-SCTPAPI_WINDOWTITLE = "SCTP API"
-SCTPAPI_DOCTITLE    = "SCTP API"
-SCTPAPI_JAVADOCHEADER      = "SCTP API"
-SCTPAPI_JAVADOCBOTTOM = '<font size="-1"><a href="http://bugs.sun.com/services/bugreport/index.jsp">Report a bug or request a feature.</a><br>Copyright $(THIS_YEAR) Sun Microsystems, Inc. All Rights Reserved. Use is subject to license terms.</font>'
-# SCTPAPI_PKGS is located in NON_CORE_PKGS.gmk
-
-#
-# Variables used by jvmti target
-#
-JVMTI_DOCS_SUBDIR = platform/jvmti
-JVMTI_HTML        = $(HOTSPOT_DOCS_IMPORT_PATH)/$(JVMTI_DOCS_SUBDIR)/jvmti.html
-
-#
-# Variables used by mgmt target
-#
-MGMT_DOCDIR	   = $(DOCSDIR)/jre/api/management/
-MGMT_EXT_DIR	   = $(MGMT_DOCDIR)/extension
-MGMT_SOURCEPATH    = $(TOPDIR)/src/share/classes
-JVM_MIB_NAME       = JVM-MANAGEMENT-MIB.mib
-JVM_MIB_SRC        = $(CLOSED_SRC)/share/classes/sun/management/snmp/$(JVM_MIB_NAME)
-
-ifdef OPENJDK
-   COPY-MIB-TARGET =
-else
-   COPY-MIB-TARGET = copy-mib
-endif
-MGMT_JAVADOCFLAGS  = $(COMMON_JAVADOCFLAGS)			   \
-		     -encoding ascii			           \
-                     -nodeprecatedlist                             \
-                     -d $(MGMT_EXT_DIR) 		  	   \
-                     -sourcepath $(MGMT_SOURCEPATH)                \
-                     -windowtitle $(MGMT_WINDOWTITLE)              \
-                     -doctitle $(MGMT_DOCTITLE)                    \
-                     -header $(MGMT_HEADER)                        \
-		     -linkoffline ../../../../api $(DOCSDIR)/api/  \
-                     -overview $(MGMT_SOURCEPATH)/com/sun/management/mgmt-overview.html
-MGMT_WINDOWTITLE = "Monitoring and Management Interface for the Java Platform"
-MGMT_DOCTITLE    = "Monitoring and Management Interface for the Java$(TRADEMARK) Platform"
-MGMT_HEADER      = "Monitoring and Management Interface for the Java Platform"
-# MGMT_PKGS is located in NON_CORE_PKGS.gmk
-
-#
-# Variables used by attach target
-#
-
-ATTACH_SOURCEPATH  = $(TOPDIR)/src/share/classes
-ATTACH_DOCDIR      = $(DOCSDIR)/jdk/api/attach/spec
-ATTACH_JAVADOCFLAGS = $(COMMON_JAVADOCFLAGS)                        	\
-		   -encoding ascii                               	\
-                   -nodeprecatedlist                             	\
-		   -d $(ATTACH_DOCDIR)					\
-                   -sourcepath $(ATTACH_SOURCEPATH)                	\
-                   -windowtitle $(ATTACH_WINDOWTITLE)               	\
-                   -doctitle $(ATTACH_DOCTITLE)                     	\
-                   -header $(ATTACH_HEADER)                         	\
-		   -linkoffline ../../../../api $(DOCSDIR)/api/
-ATTACH_WINDOWTITLE = "Attach API"
-ATTACH_DOCTITLE    = "Attach API"
-ATTACH_HEADER      = "Attach API"
-# ATTACH_PKGS is located in NON_CORE_PKGS.gmk
-
-#
-# Variables used by jconsole target
-#
-
-JCONSOLE_SOURCEPATH  = $(TOPDIR)/src/share/classes
-JCONSOLE_DOCDIR      = $(DOCSDIR)/jdk/api/jconsole/spec
-JCONSOLE_JAVADOCFLAGS = $(COMMON_JAVADOCFLAGS)                        	\
-		   -encoding ascii                               	\
-                   -nodeprecatedlist                             	\
-		   -d $(JCONSOLE_DOCDIR)				\
-                   -sourcepath $(JCONSOLE_SOURCEPATH)                	\
-                   -windowtitle $(JCONSOLE_WINDOWTITLE)               	\
-                   -doctitle $(JCONSOLE_DOCTITLE)                     	\
-                   -header $(JCONSOLE_HEADER)                         	\
-		   -linkoffline ../../../../api $(DOCSDIR)/api/
-JCONSOLE_WINDOWTITLE = "JConsole API"
-JCONSOLE_DOCTITLE    = "JConsole API"
-JCONSOLE_HEADER      = "JConsole API"
-# JCONSOLE_PKGS is located in NON_CORE_PKGS.gmk
-
-#
-# Variables used by treeapidocs target
-#
-
-TREEAPI_JAVADOCFLAGS = $(COMMON_JAVADOCFLAGS)		        \
-                    -encoding ascii			        \
-                    -doctitle $(TREEAPI_JAVADOCTITLE)            \
-                    -windowtitle $(TREEAPI_JAVADOCWINDOWTITLE)   \
-                    -header $(TREEAPI_JAVADOCHEADER)             \
-                    -bottom $(TREEAPI_JAVADOCBOTTOM)             \
-                    -group $(TREEAPI_GROUPNAME) $(TREEAPI_REGEXP) 
-#
-#	            -overview $(TREEAPI_OVERVIEW)
-#
-TREEAPI_JAVADOCTITLE = 'Compiler Tree API'
-TREEAPI_JAVADOCWINDOWTITLE = 'Compiler Tree API'
-TREEAPI_JAVADOCHEADER = '<strong>Compiler Tree API</strong>'
-TREEAPI_JAVADOCBOTTOM = '<font size="-1"><a href="http://bugs.sun.com/services/bugreport/index.jsp">Report a bug or request a feature.</a><br>Copyright $(THIS_YEAR) Sun Microsystems, Inc. All Rights Reserved. Use is subject to license terms.</font>'
-TREEAPI_GROUPNAME = "Packages"
-TREEAPI_OVERVIEW = $(SHARE_SRC)/classes/com/sun/source/overview.html
-TREEAPI_REGEXP = "com.sun.source.*"
-TREEAPI_DESTDIR = $(DOCSDIR)/jdk/api/javac/tree
-TREEAPI_LINKOPT = -linkoffline ../../../../api $(DOCSDIR)/api/
-# TREEAPI_PKGS is located in NON_CORE_PKGS.gmk
-
-#
-# Path where javadoc should find source files for release docs
-#
-RELEASEDOCS_SRCPATH = "$(SHARE_SRC)/classes$(CLASSPATH_SEPARATOR)$(PLATFORM_SRC)/classes$(CLASSPATH_SEPARATOR)$(GENSRCDIR)$(CLASSPATH_SEPARATOR)$(SHARE_SRC)/doc/stub$(CLASSPATH_SEPARATOR)$(CLOSED_SRC)/share/classes$(CLASSPATH_SEPARATOR)$(IMPORTSRCDIR)"
+#################################################################
 
 #
 # CORE_PKGS environment variable has been moved to the following file
@@ -463,30 +234,13 @@
 #
 include NON_CORE_PKGS.gmk
 
-# Targets for all APIs other than the core platform APIs
-ALL_OTHER_TARGETS = \
-    mirrordocs \
-    docletapidocs \
-    tagletapidocs \
-    domapidocs \
-    jpdadocs \
-    jaasdocs \
-    jgssdocs \
-    smartcardiodocs \
-    tracingdocs \
-    httpserverdocs  \
-    sctpdocs \
-    mgmtdocs \
-    attachdocs \
-    jconsoledocs \
-    treeapidocs
+#################################################################
 
-.PHONY: all docs
-all docs: coredocs otherdocs
+#
+# Default target is same as docs target, create core api and all others it can
+#
 
-.PHONY: otherdocs
-otherdocs: ${ALL_OTHER_TARGETS}
-
+all docs: coredocs otherdocs
 
 #################################################################
 # Production Targets -- USE THESE TARGETS WHEN:
@@ -496,9 +250,9 @@
 #       the downloaded doc bundle.
 #
 # See:  Notes.html#releaseTargets
-# Note: Spaces preceed ifdef/ifndef indents. Tabs preceed target commands (!)
+# Note: Spaces precede ifdef/ifndef indents. Tabs precede target commands (!)
 #
-.PHONY: sanitycheckcoredocs
+
 sanitycheckcoredocs:
 	@$(ECHO) ""
 	@$(ECHO) "Building core api docs with these values:"
@@ -512,199 +266,942 @@
 	exit 1
   endif
 
-# Maximize performance and ensure that build number & milestone are set.
-.PHONY: rel-coredocs
-rel-coredocs: sanitycheckcoredocs
-	@# ######## release version of core packages ########
-	$(MAKE) coredocs
+#############################################################
+#
+# coredocs
+#
+COREAPI_DOCTITLE  = Java$(TRADEMARK) Platform, Standard Edition \
+$(JDK_MINOR_VERSION)<br>API Specification
+COREAPI_WINDOWTITLE  = Java Platform SE $(JDK_MINOR_VERSION)
+COREAPI_HEADER = \
+<strong>Java$(TRADEMARK)&nbsp;Platform<br>Standard&nbsp;Ed.&nbsp;$(JDK_MINOR_VERSION)</strong>
+
+# Ignored tags
+IGNORED_TAGS =	beaninfo revised since.unbundled spec specdefault Note ToDo
+
+# Java language specification cite
+JLS3_CITE = <a href=\"$(JLS3_URL)\"> \
+		The Java Language Specification, Third Edition</a>
+TAG_JLS3 = -tag 'jls3:a:See <cite>$(JLS3_CITE)</cite>:'
+
+TAGS = $(IGNORED_TAGS:%=-tag %:X) $(TAG_JLS3)
+
+# Overview file for core apis
+COREAPI_OVERVIEW = $(SHARE_SRC)/classes/overview-core.html
+
+# The index.html, options, and packages files
+COREAPI_INDEX_FILE    = $(COREAPI_DOCSDIR)/index.html
+COREAPI_OPTIONS_FILE  = $(DOCSTMPDIR)/coredocs.options
+COREAPI_PACKAGES_FILE = $(DOCSTMPDIR)/coredocs.packages
+
+coredocs: $(COREAPI_INDEX_FILE)
+
+# Set relative location to core api document root
+$(COREAPI_INDEX_FILE): GET2DOCSDIR=..
 
-.PHONY: rel-docs
-rel-docs: rel-coredocs ${ALL_OTHER_TARGETS}
+# Run javadoc if the index file is out of date or missing
+$(COREAPI_INDEX_FILE): $(COREAPI_OPTIONS_FILE) $(COREAPI_PACKAGES_FILE)
+	$(prep-javadoc)
+	$(call JavadocSummary,$(COREAPI_OPTIONS_FILE),$(COREAPI_PACKAGES_FILE))
+	$(JAVADOC_CMD) $(JAVADOC_VM_MEMORY_FLAGS) -d $(@D) \
+	  @$(COREAPI_OPTIONS_FILE) @$(COREAPI_PACKAGES_FILE)
+
+# Create file with javadoc options in it
+$(COREAPI_OPTIONS_FILE): $(COREAPI_OVERVIEW)
+	$(prep-target)
+	@($(ECHO) "$(COMMON_JAVADOCFLAGS)"				; \
+	  $(ECHO) "-sourcepath \"$(RELEASEDOCS_SOURCEPATH)\""		; \
+	  $(ECHO) "$(TAGS)"						; \
+	  $(ECHO) "-encoding ISO-8859-1"				; \
+	  $(ECHO) "-splitIndex"						; \
+	  $(ECHO) "-overview $(COREAPI_OVERVIEW)" 			; \
+	  $(ECHO) "-doctitle '$(COREAPI_DOCTITLE)'"			; \
+	  $(ECHO) "-windowtitle '$(COREAPI_WINDOWTITLE) $(DRAFT_WINTITLE)'";\
+	  $(ECHO) "-header '$(COREAPI_HEADER)$(DRAFT_HEADER)'"		; \
+	  $(ECHO) "-bottom '$(COREAPI_BOTTOM)$(DRAFT_BOTTOM)'"		; \
+        ) >> $@
+ifdef COREAPI_TOP_EARLYACCESS
+	@$(ECHO) "-top '$(COREAPI_TOP_EARLYACCESS)'" >> $@
+endif
+
+# Create a file with the package names in it
+$(COREAPI_PACKAGES_FILE): $(DIRECTORY_CACHE) $(call PackageDependencies,$(CORE_PKGS))
+	$(prep-target)
+	$(call PackageFilter,$(CORE_PKGS))
+
+#############################################################
 #
-# end of production targets
-#############################################################
+# mirrordocs
+#
+
+# Part of langtools
+ifdef LANGTOOLS_DIST
+  ALL_OTHER_TARGETS += mirrordocs
+endif
 
-.PHONY: coredocs
-coredocs:
-	@# ######## core packages #######################
-	$(RM) -r $(DOCSDIR)/api
-	$(MKDIR) -p $(DOCSDIR)/api
-	$(JAVADOC_CMD) $(CORE_JAVADOCFLAGS)            \
-                   -d $(DOCSDIR)/api                   \
-                   -sourcepath $(RELEASEDOCS_SRCPATH)  \
-                   $(CORE_PKGS)
+MIRROR_DOCDIR      := $(JDK_API_DOCSDIR)/apt/mirror
+MIRROR2COREAPI     := ../../$(JDKJRE2COREAPI)
+MIRROR_DOCTITLE    := Mirror API
+MIRROR_WINDOWTITLE := Mirror API
+MIRROR_HEADER      := <strong>Mirror API</strong>
+MIRROR_BOTTOM      := $(call CommonBottom,$(MIRROR_FIRST_COPYRIGHT_YEAR))
+MIRROR_GROUPNAME   := Packages
+MIRROR_OVERVIEW    := $(IMPORTSRCDIR)/com/sun/mirror/overview.html
+MIRROR_REGEXP      := com.sun.mirror.*
+# MIRROR_PKGS is located in NON_CORE_PKGS.gmk
+
+# The index.html, options, and packages files
+MIRROR_INDEX_FILE    = $(MIRROR_DOCDIR)/index.html
+MIRROR_OPTIONS_FILE  = $(DOCSTMPDIR)/mirror.options
+MIRROR_PACKAGES_FILE = $(DOCSTMPDIR)/mirror.packages
+
+mirrordocs: $(MIRROR_INDEX_FILE)
+
+# Set relative location to core api document root
+$(MIRROR_INDEX_FILE): GET2DOCSDIR=$(MIRROR2COREAPI)/..
+
+# Run javadoc if the index file is out of date or missing
+$(MIRROR_INDEX_FILE): $(MIRROR_OPTIONS_FILE) $(MIRROR_PACKAGES_FILE)
+	$(prep-javadoc)
+	$(call JavadocSummary,$(MIRROR_OPTIONS_FILE),$(MIRROR_PACKAGES_FILE))
+	$(JAVADOC_CMD) $(JAVADOC_VM_MEMORY_FLAGS) -d $(@D) \
+	  @$(MIRROR_OPTIONS_FILE) @$(MIRROR_PACKAGES_FILE)
 
-.PHONY: mirrordocs
-mirrordocs:
-	@# ######## mirror api for apt ##################
-	$(RM) -r $(MIRROR_DESTDIR)
-	$(MKDIR) -p $(MIRROR_DESTDIR)
-	$(JAVADOC_CMD) $(MIRROR_JAVADOCFLAGS)             \
-		   -d $(MIRROR_DESTDIR)               \
-		   -sourcepath $(RELEASEDOCS_SRCPATH) \
-		   $(MIRROR_LINKOPT)                  \
-		   $(MIRROR_PKGS)
+# Create file with javadoc options in it
+$(MIRROR_OPTIONS_FILE): $(MIRROR_OVERVIEW)
+	$(prep-target)
+	@($(ECHO) "$(COMMON_JAVADOCFLAGS)"				; \
+	  $(ECHO) "-sourcepath \"$(RELEASEDOCS_SOURCEPATH)\""		; \
+	  $(ECHO) "-encoding ascii"					; \
+	  $(ECHO) "-overview $(MIRROR_OVERVIEW)" 			; \
+	  $(ECHO) "-doctitle '$(MIRROR_DOCTITLE)'"			; \
+	  $(ECHO) "-windowtitle '$(MIRROR_WINDOWTITLE) $(DRAFT_WINTITLE)'";\
+	  $(ECHO) "-header '$(MIRROR_HEADER)$(DRAFT_HEADER)'"		; \
+	  $(ECHO) "-bottom '$(MIRROR_BOTTOM)$(DRAFT_BOTTOM)'"		; \
+	  $(ECHO) "-group $(MIRROR_GROUPNAME) $(MIRROR_REGEXP)"		; \
+	  $(ECHO) "-linkoffline $(MIRROR2COREAPI) $(COREAPI_DOCSDIR)/"; \
+        ) >> $@
+
+# Create a file with the package names in it
+$(MIRROR_PACKAGES_FILE): $(DIRECTORY_CACHE) $(call PackageDependencies,$(MIRROR_PKGS))
+	$(prep-target)
+	$(call PackageFilter,$(MIRROR_PKGS))
+
+#############################################################
+#
+# docletapidocs
+#
+
+# Part of langtools
+ifdef LANGTOOLS_DIST
+  ALL_OTHER_TARGETS += docletapidocs
+endif
+
+DOCLETAPI_DOCDIR       := $(JDK_API_DOCSDIR)/javadoc/doclet
+DOCLETAPI2COREAPI      := ../../$(JDKJRE2COREAPI)
+DOCLETAPI_DOCTITLE     := Doclet API
+DOCLETAPI_WINDOWTITLE  := Doclet API
+DOCLETAPI_HEADER       := <strong>Doclet API</strong>
+DOCLETAPI_BOTTOM       := $(call CommonTrademarkBottom,$(DOCLETAPI_FIRST_COPYRIGHT_YEAR))
+DOCLETAPI_GROUPNAME    := Packages
+DOCLETAPI_REGEXP       := com.sun.javadoc
+# DOCLETAPI_PKGS is located in NON_CORE_PKGS.gmk
+
+# The index.html, options, and packages files
+DOCLETAPI_INDEX_FILE    = $(DOCLETAPI_DOCDIR)/index.html
+DOCLETAPI_OPTIONS_FILE  = $(DOCSTMPDIR)/docletapi.options
+DOCLETAPI_PACKAGES_FILE = $(DOCSTMPDIR)/docletapi.packages
+
+docletapidocs: $(DOCLETAPI_INDEX_FILE)
 
-.PHONY: docletapidocs
-docletapidocs:
-	@# ######## doclet api ############################
-	$(RM) -r $(DOCSDIR)/jdk/api/javadoc/doclet
-	$(MKDIR) -p $(DOCSDIR)/jdk/api/javadoc/doclet
-	$(JAVADOC_CMD) $(DOCLETAPI_JAVADOCFLAGS)                 \
-                   -d $(DOCSDIR)/jdk/api/javadoc/doclet      \
-                   -sourcepath $(RELEASEDOCS_SRCPATH)        \
-                   $(DOCLETAPI_LINKOPT)                      \
-                   $(DOCLETAPI_PKGS)
+# Set relative location to core api document root
+$(DOCLETAPI_INDEX_FILE): GET2DOCSDIR=$(DOCLETAPI2COREAPI)/..
+
+# Run javadoc if the index file is out of date or missing
+$(DOCLETAPI_INDEX_FILE): $(DOCLETAPI_OPTIONS_FILE) $(DOCLETAPI_PACKAGES_FILE)
+	$(prep-javadoc)
+	$(call JavadocSummary,$(DOCLETAPI_OPTIONS_FILE),$(DOCLETAPI_PACKAGES_FILE))
+	$(JAVADOC_CMD) $(JAVADOC_VM_MEMORY_FLAGS) -d $(@D) \
+	  @$(DOCLETAPI_OPTIONS_FILE) @$(DOCLETAPI_PACKAGES_FILE)
+
+# Create file with javadoc options in it
+$(DOCLETAPI_OPTIONS_FILE):
+	$(prep-target)
+	@($(ECHO) "$(COMMON_JAVADOCFLAGS)"				; \
+	  $(ECHO) "-sourcepath \"$(RELEASEDOCS_SOURCEPATH)\""		; \
+	  $(ECHO) "-breakiterator"					; \
+	  $(ECHO) "-encoding ascii"					; \
+	  $(ECHO) "-doctitle '$(DOCLETAPI_DOCTITLE)'"			; \
+	  $(ECHO) "-windowtitle '$(DOCLETAPI_WINDOWTITLE) $(DRAFT_WINTITLE)'";\
+	  $(ECHO) "-header '$(DOCLETAPI_HEADER)$(DRAFT_HEADER)'"	; \
+	  $(ECHO) "-bottom '$(DOCLETAPI_BOTTOM)$(DRAFT_BOTTOM)'"	; \
+	  $(ECHO) "-group $(DOCLETAPI_GROUPNAME) $(DOCLETAPI_REGEXP)"	; \
+	  $(ECHO) "-linkoffline $(DOCLETAPI2COREAPI) $(COREAPI_DOCSDIR)/"; \
+        ) >> $@
+
+# Create a file with the package names in it
+$(DOCLETAPI_PACKAGES_FILE): $(DIRECTORY_CACHE) $(call PackageDependencies,$(DOCLETAPI_PKGS))
+	$(prep-target)
+	$(call PackageFilter,$(DOCLETAPI_PKGS))
+
+#############################################################
+#
+# tagletapidocs
+#
+
+# Part of langtools
+ifdef LANGTOOLS_DIST
+  ALL_OTHER_TARGETS += tagletapidocs
+endif
+
+TAGLETAPI_DOCDIR   := $(JDK_API_DOCSDIR)/javadoc/taglet
+TAGLETAPI2COREAPI  := ../../$(JDKJRE2COREAPI)
+TAGLETAPI_BOTTOM   := $(call CommonTrademarkBottom,$(TAGLETAPI_FIRST_COPYRIGHT_YEAR))
+# TAGLETAPI_FILE is located in NON_CORE_PKGS.gmk
+
+# Temporary directory (special generation rules)
+TAGLETAPI_TEMPDIR       = $(DOCSTMPDIR)/taglets_temp
+
+# The index.html, options, and packages files
+TAGLETAPI_INDEX_FILE    = $(TAGLETAPI_DOCDIR)/index.html
+TAGLETAPI_OPTIONS_FILE  = $(DOCSTMPDIR)/tagletapi.options
+TAGLETAPI_PACKAGES_FILE = $(DOCSTMPDIR)/tagletapi.packages
+
+tagletapidocs: $(TAGLETAPI_INDEX_FILE)
+
+# Set relative location to core api document root
+$(TAGLETAPI_INDEX_FILE): GET2DOCSDIR=$(TAGLETAPI2COREAPI)/..
+
+# Run javadoc if the index file is out of date or missing
+$(TAGLETAPI_INDEX_FILE): $(TAGLETAPI_OPTIONS_FILE) $(TAGLETAPI_PACKAGES_FILE)
+	$(prep-javadoc)
+	$(RM) -r $(TAGLETAPI_TEMPDIR)
+	$(MKDIR) -p $(TAGLETAPI_TEMPDIR)
+	$(call JavadocSummary,$(TAGLETAPI_OPTIONS_FILE),$(TAGLETAPI_PACKAGES_FILE))
+	$(JAVADOC_CMD) $(JAVADOC_VM_MEMORY_FLAGS) -d $(TAGLETAPI_TEMPDIR) \
+	  @$(TAGLETAPI_OPTIONS_FILE) @$(TAGLETAPI_PACKAGES_FILE)
+	cp -r $(TAGLETAPI_TEMPDIR)/com $(@D)
+	cp $(TAGLETAPI_TEMPDIR)/stylesheet.css $(@D)
+	$(RM) -r $(TAGLETAPI_TEMPDIR)
 
-.PHONY: tagletapidocs
-tagletapidocs:
-	@# ######## taglet api ############################
-	$(RM) -r $(DOCSDIR)/jdk/api/javadoc/taglet
-	$(MKDIR) -p $(DOCSDIR)/jdk/api/javadoc/taglet
-	$(RM) -r $(DOCSTMPDIR)
-	$(MKDIR) -p $(DOCSTMPDIR)
-	$(JAVADOC_CMD) $(TAGLETAPI_JAVADOCFLAGS)                 \
-                   -d $(DOCSTMPDIR)                          \
-                   -linkoffline ../../../../api $(DOCSDIR)/api/ \
-                   $(IMPORTSRCDIR)/$(TAGLETAPI_FILE)
-	cp -r $(DOCSTMPDIR)/com $(DOCSDIR)/jdk/api/javadoc/taglet
-	cp $(DOCSTMPDIR)/stylesheet.css $(DOCSDIR)/jdk/api/javadoc/taglet
-	$(RM) -r $(DOCSTMPDIR)
+# Create file with javadoc options in it
+$(TAGLETAPI_OPTIONS_FILE):
+	$(prep-target)
+	@($(ECHO) "$(COMMON_JAVADOCFLAGS)"				; \
+	  $(ECHO) "-sourcepath \"$(RELEASEDOCS_SOURCEPATH)\""		; \
+	  $(ECHO) "-encoding ascii"					; \
+	  $(ECHO) "-nonavbar"						; \
+	  $(ECHO) "-noindex"						; \
+	  $(ECHO) "-bottom '$(TAGLETAPI_BOTTOM)$(DRAFT_BOTTOM)'"			; \
+	  $(ECHO) "-linkoffline $(TAGLETAPI2COREAPI) $(COREAPI_DOCSDIR)/"; \
+        ) >> $@
+
+# Create a file with the package names in it
+$(TAGLETAPI_PACKAGES_FILE): $(IMPORTSRCDIR)/$(TAGLETAPI_FILE)
+	$(prep-target)
+	@($(ECHO) "$(IMPORTSRCDIR)/$(TAGLETAPI_FILE)" ) > $@
+
+#############################################################
+#
+# domapidocs
+#
+
+ALL_OTHER_TARGETS += domapidocs
+
+DOMAPI_DOCDIR       := $(JRE_API_DOCSDIR)/plugin/dom
+DOMAPI2COREAPI      := ../../$(JDKJRE2COREAPI)
+DOMAPI_DOCTITLE     := Common DOM API
+DOMAPI_WINDOWTITLE  := Common DOM API
+DOMAPI_HEADER       := <strong>Common DOM API</strong>
+DOMAPI_BOTTOM       := $(call CommonTrademarkBottom,$(DOMAPI_FIRST_COPYRIGHT_YEAR))
+DOMAPI_GROUPNAME    := Packages
+DOMAPI_REGEXP       := com.sun.java.browser.dom:org.w3c.dom*
+# DOMAPI_PKGS is located in NON_CORE_PKGS.gmk
+
+# The index.html, options, and packages files
+DOMAPI_INDEX_FILE    = $(DOMAPI_DOCDIR)/index.html
+DOMAPI_OPTIONS_FILE  = $(DOCSTMPDIR)/domapi.options
+DOMAPI_PACKAGES_FILE = $(DOCSTMPDIR)/domapi.packages
 
-.PHONY: domapidocs
-domapidocs:
-	@# ######## dom api ############################
-	$(RM) -r $(DOCSDIR)/jre/api/plugin/dom
-	$(MKDIR) -p $(DOCSDIR)/jre/api/plugin/dom
-	$(JAVADOC_CMD) $(DOMAPI_JAVADOCFLAGS)		     \
-                   -d $(DOCSDIR)/jre/api/plugin/dom            \
-                   -sourcepath $(RELEASEDOCS_SRCPATH)        \
-                   -linkoffline ../../../../api $(DOCSDIR)/api/ \
-                   $(DOMAPI_PKGS)
+domapidocs: $(DOMAPI_INDEX_FILE)
+
+# Set relative location to core api document root
+$(DOMAPI_INDEX_FILE): GET2DOCSDIR=$(DOMAPI2COREAPI)/..
+
+# Run javadoc if the index file is out of date or missing
+$(DOMAPI_INDEX_FILE): $(DOMAPI_OPTIONS_FILE) $(DOMAPI_PACKAGES_FILE)
+	$(prep-javadoc)
+	$(call JavadocSummary,$(DOMAPI_OPTIONS_FILE),$(DOMAPI_PACKAGES_FILE))
+	$(JAVADOC_CMD) $(JAVADOC_VM_MEMORY_FLAGS) -d $(@D) \
+	  @$(DOMAPI_OPTIONS_FILE) @$(DOMAPI_PACKAGES_FILE)
 
-.PHONY: jpdadocs
+# Create file with javadoc options in it
+$(DOMAPI_OPTIONS_FILE):
+	$(prep-target)
+	@($(ECHO) "$(COMMON_JAVADOCFLAGS)"				; \
+	  $(ECHO) "-sourcepath \"$(RELEASEDOCS_SOURCEPATH)\""		; \
+	  $(ECHO) "-encoding ascii"					; \
+	  $(ECHO) "-splitIndex"						; \
+	  $(ECHO) "-doctitle '$(DOMAPI_DOCTITLE)'"			; \
+	  $(ECHO) "-windowtitle '$(DOMAPI_WINDOWTITLE) $(DRAFT_WINTITLE)'";\
+	  $(ECHO) "-header '$(DOMAPI_HEADER)$(DRAFT_HEADER)'"		; \
+	  $(ECHO) "-bottom '$(DOMAPI_BOTTOM)$(DRAFT_BOTTOM)'"		; \
+	  $(ECHO) "-group $(DOMAPI_GROUPNAME) $(DOMAPI_REGEXP)"		; \
+	  $(ECHO) "-linkoffline $(DOMAPI2COREAPI) $(COREAPI_DOCSDIR)/" 	; \
+        ) >> $@
+
+# Create a file with the package names in it
+$(DOMAPI_PACKAGES_FILE): $(DIRECTORY_CACHE) $(call PackageDependencies,$(DOMAPI_PKGS))
+	$(prep-target)
+	$(call PackageFilter,$(DOMAPI_PKGS))
+
+#############################################################
+#
+# jpdadocs
+#
+
+ALL_OTHER_TARGETS += jpdadocs
+
 jpdadocs: jdidocs jdwpdocs jvmtidocs
 
-.PHONY: jdidocs
-jdidocs:
-	@# ######## jdi #################################
-	$(RM) -r $(DOCSDIR)/jdk/api/jpda/jdi
-	$(MKDIR) -p $(DOCSDIR)/jdk/api/jpda/jdi
-	$(JAVADOC_CMD) $(JDI_JAVADOCFLAGS)                       \
-                   $(JDI_PKGS)
+#############################################################
+#
+# jdidocs
+#
+
+ALL_OTHER_TARGETS += jdidocs
+
+JDI_DOCDIR      := $(JDK_API_DOCSDIR)/jpda/jdi
+JDI2COREAPI     := ../../$(JDKJRE2COREAPI)
+JDI_DOCTITLE    := Java$(TRADEMARK) Debug Interface
+JDI_WINDOWTITLE := Java Debug Interface
+JDI_HEADER      := <strong>Java Debug Interface</strong>
+JDI_BOTTOM      := $(call CommonBottom,$(JDI_FIRST_COPYRIGHT_YEAR))
+JDI_OVERVIEW    := $(SHARE_SRC)/classes/jdi-overview.html
+# JDI_PKGS is located in NON_CORE_PKGS.gmk
+
+# The index.html, options, and packages files
+JDI_INDEX_FILE    = $(JDI_DOCDIR)/index.html
+JDI_OPTIONS_FILE  = $(DOCSTMPDIR)/jdi.options
+JDI_PACKAGES_FILE = $(DOCSTMPDIR)/jdi.packages
+
+jdidocs: $(JDI_INDEX_FILE)
+
+# Set relative location to core api document root
+$(JDI_INDEX_FILE): GET2DOCSDIR=$(JDI2COREAPI)/..
 
+# Run javadoc if the index file is out of date or missing
+$(JDI_INDEX_FILE): $(JDI_OPTIONS_FILE) $(JDI_PACKAGES_FILE)
+	$(prep-javadoc)
+	$(call JavadocSummary,$(JDI_OPTIONS_FILE),$(JDI_PACKAGES_FILE))
+	$(JAVADOC_CMD) $(JAVADOC_VM_MEMORY_FLAGS) -d $(@D) \
+	  @$(JDI_OPTIONS_FILE) @$(JDI_PACKAGES_FILE)
+
+# Create file with javadoc options in it
+$(JDI_OPTIONS_FILE): $(JDI_OVERVIEW)
+	$(prep-target)
+	@($(ECHO) "$(COMMON_JAVADOCFLAGS)"				; \
+	  $(ECHO) "-sourcepath \"$(RELEASEDOCS_SOURCEPATH)\""		; \
+	  $(ECHO) "-encoding ascii"					; \
+	  $(ECHO) "-overview $(JDI_OVERVIEW)" 				; \
+	  $(ECHO) "-doctitle '$(JDI_DOCTITLE)'"				; \
+	  $(ECHO) "-windowtitle '$(JDI_WINDOWTITLE) $(DRAFT_WINTITLE)'"	; \
+	  $(ECHO) "-header '$(JDI_HEADER)$(DRAFT_HEADER)'"		; \
+	  $(ECHO) "-bottom '$(JDI_BOTTOM)$(DRAFT_BOTTOM)'"		; \
+	  $(ECHO) "-linkoffline $(JDI2COREAPI) $(COREAPI_DOCSDIR)/" 	; \
+        ) >> $@
+
+# Create a file with the package names in it
+$(JDI_PACKAGES_FILE): $(DIRECTORY_CACHE) $(call PackageDependencies,$(JDI_PKGS))
+	$(prep-target)
+	$(call PackageFilter,$(JDI_PKGS))
+
+#############################################################
+#
+# jdwpdocs
+#
+
+ALL_OTHER_TARGETS += jdwpdocs
+
+JDWP_DOCDIR     = $(PLATFORM_DOCSDIR)/jpda/jdwp
 JDWP_SPEC       = $(BUILDDIR)/jpda/jdwp/jdwp.spec
-JDWP_DOC        = $(DOCSDIR)/platform/jpda/jdwp/jdwp-protocol.html
 JDWPGEN_JARFILE = $(BUILDTOOLJARDIR)/jdwpgen.jar
 
-.PHONY: jdwpdocs
-jdwpdocs: $(JDWP_DOC)
+jdwpdocs: $(JDWP_DOCDIR)/jdwp-protocol.html
+$(JDWP_DOCDIR)/jdwp-protocol.html: $(JDWPGEN_JARFILE) $(JDWP_SPEC)
+	$(prep-javadoc)
+	$(BOOT_JAVA_CMD) -jar $(JDWPGEN_JARFILE) $(JDWP_SPEC) -doc $@
 
-$(JDWP_DOC): $(JDWPGEN_JARFILE) $(JDWP_SPEC)
-	$(prep-target)
-	$(BOOT_JAVA_CMD) -jar $(JDWPGEN_JARFILE) $(JDWP_SPEC) -doc $(JDWP_DOC)
+#############################################################
+#
+# jvmtidocs
+#
+
+ALL_OTHER_TARGETS += jvmtidocs
 
-.PHONY: jvmtidocs
-jvmtidocs:
-	@# ######## jvmti #################################
-	@if [ -f $(JVMTI_HTML) ] ; then \
-	  $(RM) -r $(DOCSDIR)/$(JVMTI_DOCS_SUBDIR); \
-	  $(MKDIR) -p $(DOCSDIR)/$(JVMTI_DOCS_SUBDIR); \
-	  $(ECHO) $(CP) $(JVMTI_HTML) $(DOCSDIR)/$(JVMTI_DOCS_SUBDIR); \
-	  $(CP) $(JVMTI_HTML) $(DOCSDIR)/$(JVMTI_DOCS_SUBDIR); \
-	else \
-	  $(ECHO) "WARNING: Generated jvmti file does not exist: $(JVMTI_HTML)"; \
+JVMTI_DOCDIR      = $(PLATFORM_DOCSDIR)/jvmti
+JVMTI_HTML        = $(HOTSPOT_DOCS_IMPORT_PATH)/platform/jvmti/jvmti.html
+
+jvmtidocs:  $(JVMTI_DOCDIR)/jvmti.html
+$(JVMTI_DOCDIR)/jvmti.html:
+	@$(prep-javadoc)
+	@if [ -f $(JVMTI_HTML) ] ; then		                           \
+	  $(ECHO) "$(CP) $(JVMTI_HTML) $@";                 	           \
+	  $(CP) $(JVMTI_HTML) $@; 	                 	           \
+	else 						                   \
+	  $(ECHO) "WARNING: Generated file does not exist: $(JVMTI_HTML)"; \
 	fi
 
-.PHONY: jaasdocs
-jaasdocs:
-	@# ######## api-jaas ############################
-	$(RM) -r $(JAAS_DOCDIR)
-	$(MKDIR) -p $(JAAS_DOCDIR)
-	$(JAVADOC_CMD) $(JAAS_JAVADOCFLAGS)                     \
-		   $(JAAS_PKGS)
+#############################################################
+#
+# jaasdocs
+#
+
+ALL_OTHER_TARGETS += jaasdocs
+
+JAAS_DOCDIR	 := $(JRE_API_DOCSDIR)/security/jaas/spec
+JAAS2COREAPI     := ../../../$(JDKJRE2COREAPI)
+JAAS_DOCTITLE    := Java$(TRADEMARK) Authentication and Authorization Service
+JAAS_WINDOWTITLE := Java Authentication and Authorization Service
+JAAS_HEADER      := <strong>Java Authentication and Authorization Service</strong>
+JAAS_BOTTOM      := $(call CommonBottom,$(JAAS_FIRST_COPYRIGHT_YEAR))
+# JAAS_PKGS is located in NON_CORE_PKGS.gmk
+JAAS_OVERVIEW    := $(SHARE_SRC)/classes/com/sun/security/auth/jaas-overview.html
+
+# The index.html, options, and packages files
+JAAS_INDEX_FILE    = $(JAAS_DOCDIR)/index.html
+JAAS_OPTIONS_FILE  = $(DOCSTMPDIR)/jaas.options
+JAAS_PACKAGES_FILE = $(DOCSTMPDIR)/jaas.packages
+
+jaasdocs: $(JAAS_INDEX_FILE)
+
+# Set relative location to core api document root
+$(JAAS_INDEX_FILE): GET2DOCSDIR=$(JAAS2COREAPI)/..
+
+# Run javadoc if the index file is out of date or missing
+$(JAAS_INDEX_FILE): $(JAAS_OPTIONS_FILE) $(JAAS_PACKAGES_FILE)
+	$(prep-javadoc)
+	$(call JavadocSummary,$(JAAS_OPTIONS_FILE),$(JAAS_PACKAGES_FILE))
+	$(JAVADOC_CMD) $(JAVADOC_VM_MEMORY_FLAGS) -d $(@D) \
+	  @$(JAAS_OPTIONS_FILE) @$(JAAS_PACKAGES_FILE)
+
+# Create file with javadoc options in it
+$(JAAS_OPTIONS_FILE): $(JAAS_OVERVIEW)
+	$(prep-target)
+	@($(ECHO) "$(COMMON_JAVADOCFLAGS)"				; \
+	  $(ECHO) "-sourcepath \"$(RELEASEDOCS_SOURCEPATH)\""		; \
+	  $(ECHO) "-encoding ascii"					; \
+	  $(ECHO) "-overview $(JAAS_OVERVIEW)" 				; \
+	  $(ECHO) "-doctitle '$(JAAS_DOCTITLE)'"			; \
+	  $(ECHO) "-windowtitle '$(JAAS_WINDOWTITLE) $(DRAFT_WINTITLE)'"; \
+	  $(ECHO) "-header '$(JAAS_HEADER)$(DRAFT_HEADER)'"		; \
+	  $(ECHO) "-bottom '$(JAAS_BOTTOM)$(DRAFT_BOTTOM)'"		; \
+	  $(ECHO) "-linkoffline $(JAAS2COREAPI) $(COREAPI_DOCSDIR)/" 	; \
+        ) >> $@
+
+# Create a file with the package names in it
+$(JAAS_PACKAGES_FILE): $(DIRECTORY_CACHE) $(call PackageDependencies,$(JAAS_PKGS))
+	$(prep-target)
+	$(call PackageFilter,$(JAAS_PKGS))
+
+#############################################################
+#
+# jgssdocs
+#
+
+ALL_OTHER_TARGETS += jgssdocs
+
+JGSS_DOCDIR	 := $(JRE_API_DOCSDIR)/security/jgss/spec
+JGSS2COREAPI     := ../../../$(JDKJRE2COREAPI)
+JGSS_DOCTITLE    := Java$(TRADEMARK) GSS-API Utilities
+JGSS_WINDOWTITLE := Java GSS-API Utilities
+JGSS_HEADER      := <strong>Java GSS-API Utilities</strong>
+JGSS_BOTTOM      := $(call CommonBottom,$(JGSS_FIRST_COPYRIGHT_YEAR))
+JGSS_OVERVIEW    := $(SHARE_SRC)/classes/com/sun/security/jgss/jgss-overview.html
+# JGSS_PKGS is located in NON_CORE_PKGS.gmk
 
-.PHONY: jgssdocs
-jgssdocs:
-	@# ######## api-jgss ############################
-	$(RM) -r $(JGSS_DOCDIR)
-	$(MKDIR) -p $(JGSS_DOCDIR)
-	$(JAVADOC_CMD) $(JGSS_JAVADOCFLAGS)                     \
-		   $(JGSS_PKGS)
+# The index.html, options, and packages files
+JGSS_INDEX_FILE    = $(JGSS_DOCDIR)/index.html
+JGSS_OPTIONS_FILE  = $(DOCSTMPDIR)/jgss.options
+JGSS_PACKAGES_FILE = $(DOCSTMPDIR)/jgss.packages
+
+jgssdocs: $(JGSS_INDEX_FILE)
+
+# Set relative location to core api document root
+$(JGSS_INDEX_FILE): GET2DOCSDIR=$(JGSS2COREAPI)/..
+
+# Run javadoc if the index file is out of date or missing
+$(JGSS_INDEX_FILE): $(JGSS_OPTIONS_FILE) $(JGSS_PACKAGES_FILE)
+	$(prep-javadoc)
+	$(call JavadocSummary,$(JGSS_OPTIONS_FILE),$(JGSS_PACKAGES_FILE))
+	$(JAVADOC_CMD) $(JAVADOC_VM_MEMORY_FLAGS) -d $(@D) \
+	  @$(JGSS_OPTIONS_FILE) @$(JGSS_PACKAGES_FILE)
+
+# Create file with javadoc options in it
+$(JGSS_OPTIONS_FILE): $(JGSS_OVERVIEW)
+	$(prep-target)
+	@($(ECHO) "$(COMMON_JAVADOCFLAGS)"				; \
+	  $(ECHO) "-sourcepath \"$(RELEASEDOCS_SOURCEPATH)\""		; \
+	  $(ECHO) "-encoding ascii"					; \
+	  $(ECHO) "-nodeprecatedlist"					; \
+	  $(ECHO) "-overview $(JGSS_OVERVIEW)" 				; \
+	  $(ECHO) "-doctitle '$(JGSS_DOCTITLE)'"			; \
+	  $(ECHO) "-windowtitle '$(JGSS_WINDOWTITLE) $(DRAFT_WINTITLE)'"; \
+	  $(ECHO) "-header '$(JGSS_HEADER)$(DRAFT_HEADER)'"		; \
+	  $(ECHO) "-bottom '$(JGSS_BOTTOM)$(DRAFT_BOTTOM)'"		; \
+	  $(ECHO) "-linkoffline $(JGSS2COREAPI) $(COREAPI_DOCSDIR)/" 	; \
+        ) >> $@
+
+# Create a file with the package names in it
+$(JGSS_PACKAGES_FILE): $(DIRECTORY_CACHE) $(call PackageDependencies,$(JGSS_PKGS))
+	$(prep-target)
+	$(call PackageFilter,$(JGSS_PKGS))
+
+#############################################################
+#
+# smartcardiodocs
+#
+
+ALL_OTHER_TARGETS += smartcardiodocs
+
+SMARTCARDIO_DOCDIR	:= $(JRE_API_DOCSDIR)/security/smartcardio/spec
+SMARTCARDIO2COREAPI     := ../../../$(JDKJRE2COREAPI)
+SMARTCARDIO_DOCTITLE    := Java$(TRADEMARK) Smart Card I/O
+SMARTCARDIO_WINDOWTITLE := Java Smart Card I/O
+SMARTCARDIO_HEADER      := <strong>Java Smart Card I/O</strong>
+SMARTCARDIO_BOTTOM      := $(call CommonBottom,$(SMARTCARDIO_FIRST_COPYRIGHT_YEAR))
+# SMARTCARDIO_PKGS is located in NON_CORE_PKGS.gmk
+
+# The index.html, options, and packages files
+SMARTCARDIO_INDEX_FILE    = $(SMARTCARDIO_DOCDIR)/index.html
+SMARTCARDIO_OPTIONS_FILE  = $(DOCSTMPDIR)/smartcardio.options
+SMARTCARDIO_PACKAGES_FILE = $(DOCSTMPDIR)/smartcardio.packages
+
+smartcardiodocs: $(SMARTCARDIO_INDEX_FILE)
+
+# Set relative location to core api document root
+$(SMARTCARDIO_INDEX_FILE): GET2DOCSDIR=$(SMARTCARDIO2COREAPI)/..
+
+# Run javadoc if the index file is out of date or missing
+$(SMARTCARDIO_INDEX_FILE): $(SMARTCARDIO_OPTIONS_FILE) $(SMARTCARDIO_PACKAGES_FILE)
+	$(prep-javadoc)
+	$(call JavadocSummary,$(SMARTCARDIO_OPTIONS_FILE),$(SMARTCARDIO_PACKAGES_FILE))
+	$(JAVADOC_CMD) $(JAVADOC_VM_MEMORY_FLAGS) -d $(@D) \
+	  @$(SMARTCARDIO_OPTIONS_FILE) @$(SMARTCARDIO_PACKAGES_FILE)
 
-.PHONY: smartcardiodocs
-smartcardiodocs:
-	@# ######## api-smartcardio ############################
-	$(RM) -r $(SMARTCARDIO_DOCDIR)
-	$(MKDIR) -p $(SMARTCARDIO_DOCDIR)
-	$(JAVADOC_CMD) $(SMARTCARDIO_JAVADOCFLAGS)                     \
-		   $(SMARTCARDIO_PKGS)
+# Create file with javadoc options in it
+$(SMARTCARDIO_OPTIONS_FILE):
+	$(prep-target)
+	@($(ECHO) "$(COMMON_JAVADOCFLAGS)"				; \
+	  $(ECHO) "-sourcepath \"$(RELEASEDOCS_SOURCEPATH)\""		; \
+	  $(ECHO) "-encoding ascii"					; \
+	  $(ECHO) "-nodeprecatedlist"					; \
+	  $(ECHO) "-doctitle '$(SMARTCARDIO_DOCTITLE)'"			; \
+	  $(ECHO) "-windowtitle '$(SMARTCARDIO_WINDOWTITLE) $(DRAFT_WINTITLE)'";\
+	  $(ECHO) "-header '$(SMARTCARDIO_HEADER)$(DRAFT_HEADER)'"	; \
+	  $(ECHO) "-bottom '$(SMARTCARDIO_BOTTOM)$(DRAFT_BOTTOM)'"	; \
+	  $(ECHO) "-linkoffline $(SMARTCARDIO2COREAPI) $(COREAPI_DOCSDIR)/"; \
+        ) >> $@
+
+# Create a file with the package names in it
+$(SMARTCARDIO_PACKAGES_FILE): $(DIRECTORY_CACHE) $(call PackageDependencies,$(SMARTCARDIO_PKGS))
+	$(prep-target)
+	$(call PackageFilter,$(SMARTCARDIO_PKGS))
+
+#############################################################
+#
+# httpserverdocs
+#
+
+ALL_OTHER_TARGETS += httpserverdocs
+
+HTTPSERVER_DOCDIR      := $(JRE_API_DOCSDIR)/net/httpserver/spec
+HTTPSERVER2COREAPI     := ../../../$(JDKJRE2COREAPI)
+HTTPSERVER_DOCTITLE    := Java$(TRADEMARK) HTTP Server
+HTTPSERVER_WINDOWTITLE := Java HTTP Server
+HTTPSERVER_HEADER      := <strong>Java HTTP Server</strong>
+HTTPSERVER_BOTTOM      := $(call CommonBottom,$(HTTPSERVER_FIRST_COPYRIGHT_YEAR))
+# HTTPSERVER_PKGS is located in NON_CORE_PKGS.gmk
+
+HTTPSERVER_INDEX_HTML    = $(HTTPSERVER_DOCDIR)/index.html
+HTTPSERVER_OPTIONS_FILE  = $(DOCSTMPDIR)/httpserver.options
+HTTPSERVER_PACKAGES_FILE = $(DOCSTMPDIR)/httpserver.packages
+
+httpserverdocs: $(HTTPSERVER_INDEX_HTML)
+
+# Set relative location to core api document root
+$(HTTPSERVER_INDEX_HTML): GET2DOCSDIR=$(HTTPSERVER2COREAPI)/..
+
+# Run javadoc if the index file is out of date or missing
+$(HTTPSERVER_INDEX_HTML): $(HTTPSERVER_OPTIONS_FILE) $(HTTPSERVER_PACKAGES_FILE)
+	$(prep-javadoc)
+	$(call JavadocSummary,$(HTTPSERVER_OPTIONS_FILE),$(HTTPSERVER_PACKAGES_FILE))
+	$(JAVADOC_CMD) $(JAVADOC_VM_MEMORY_FLAGS) -d $(@D) \
+	  @$(HTTPSERVER_OPTIONS_FILE) @$(HTTPSERVER_PACKAGES_FILE)
+
+# Create file with javadoc options in it
+$(HTTPSERVER_OPTIONS_FILE):
+	$(prep-target)
+	@($(ECHO) "$(COMMON_JAVADOCFLAGS)"				; \
+	  $(ECHO) "-sourcepath \"$(RELEASEDOCS_SOURCEPATH)\""		; \
+	  $(ECHO) "-encoding ascii"					; \
+	  $(ECHO) "-nodeprecatedlist"					; \
+	  $(ECHO) "-doctitle '$(HTTPSERVER_DOCTITLE)'"			; \
+	  $(ECHO) "-windowtitle '$(HTTPSERVER_WINDOWTITLE) $(DRAFT_WINTITLE)'";\
+	  $(ECHO) "-header '$(HTTPSERVER_HEADER)$(DRAFT_HEADER)'"	; \
+	  $(ECHO) "-bottom '$(HTTPSERVER_BOTTOM)$(DRAFT_BOTTOM)'"	; \
+	  $(ECHO) "-linkoffline $(HTTPSERVER2COREAPI) $(COREAPI_DOCSDIR)/"; \
+        ) >> $@
 
-.PHONY: tracingdocs
-tracingdocs:
-	@# ######## api-tracing ############################
-	$(RM) -r $(TRACING_DOCDIR)
-	$(MKDIR) -p $(TRACING_DOCDIR)
-	$(JAVADOC_CMD) $(TRACING_JAVADOCFLAGS)                     \
-		   $(TRACING_PKGS)
+# Create a file with the package names in it
+$(HTTPSERVER_PACKAGES_FILE): $(DIRECTORY_CACHE) $(call PackageDependencies,$(HTTPSERVER_PKGS))
+	$(prep-target)
+	$(call PackageFilter,$(HTTPSERVER_PKGS))
+
+#############################################################
+#
+# mgmtdocs
+#
+
+ALL_OTHER_TARGETS += mgmtdocs
+
+MGMT_DOCDIR	 := $(JRE_API_DOCSDIR)/management/extension
+MGMT2COREAPI     := ../../$(JDKJRE2COREAPI)
+JVM_MIB_NAME     := JVM-MANAGEMENT-MIB.mib
+JVM_MIB_SRC      := $(CLOSED_SRC)/share/classes/sun/management/snmp/$(JVM_MIB_NAME)
+MGMT_DOCTITLE    := Monitoring and Management Interface for the Java$(TRADEMARK) Platform
+MGMT_WINDOWTITLE := Monitoring and Management Interface for the Java Platform
+MGMT_HEADER      := <strong>Monitoring and Management Interface for the Java Platform</strong>
+MGMT_BOTTOM      := $(call CommonBottom,$(MGMT_FIRST_COPYRIGHT_YEAR))
+MGMT_OVERVIEW    := $(SHARE_SRC)/classes/com/sun/management/mgmt-overview.html
+# MGMT_PKGS is located in NON_CORE_PKGS.gmk
+
+# The index.html, options, and packages files
+MGMT_INDEX_FILE    = $(MGMT_DOCDIR)/index.html
+MGMT_OPTIONS_FILE  = $(DOCSTMPDIR)/mgmt.options
+MGMT_PACKAGES_FILE = $(DOCSTMPDIR)/mgmt.packages
+
+mgmtdocs: $(MGMT_INDEX_FILE)
+
+# Set relative location to core api document root
+$(MGMT_INDEX_FILE): GET2DOCSDIR=$(MGMT2COREAPI)/..
 
-.PHONY: httpserverdocs
-httpserverdocs:
-	@# ######## api-httpserver #######################
-	$(RM) -r $(HTTPSERVER_DOCDIR)
-	$(MKDIR) -p $(HTTPSERVER_DOCDIR)
-	$(JAVADOC_CMD) $(HTTPSERVER_JAVADOCFLAGS)                     \
-		   $(HTTPSERVER_PKGS)
+# Run javadoc if the index file is out of date or missing
+$(MGMT_INDEX_FILE): $(MGMT_OPTIONS_FILE) $(MGMT_PACKAGES_FILE)
+	$(prep-javadoc)
+	@if [ -f $(JVM_MIB_SRC) ] ; then 				\
+	  $(ECHO) "$(CP) $(JVM_MIB_SRC) $(@D)/.."; 			\
+	  $(CP) $(JVM_MIB_SRC) $(@D)/.. ; 				\
+	else 								\
+	  $(ECHO) "WARNING: File $(JVM_MIB_NAME) not available."; 	\
+	fi
+	$(call JavadocSummary,$(MGMT_OPTIONS_FILE),$(MGMT_PACKAGES_FILE))
+	$(JAVADOC_CMD) $(JAVADOC_VM_MEMORY_FLAGS) -d $(@D) \
+	  @$(MGMT_OPTIONS_FILE) @$(MGMT_PACKAGES_FILE)
+
+# Create file with javadoc options in it
+$(MGMT_OPTIONS_FILE): $(MGMT_OVERVIEW)
+	$(prep-target)
+	@($(ECHO) "$(COMMON_JAVADOCFLAGS)"				; \
+	  $(ECHO) "-sourcepath \"$(RELEASEDOCS_SOURCEPATH)\""		; \
+	  $(ECHO) "-encoding ascii"					; \
+	  $(ECHO) "-nodeprecatedlist"					; \
+	  $(ECHO) "-overview $(MGMT_OVERVIEW)" 				; \
+	  $(ECHO) "-doctitle '$(MGMT_DOCTITLE)'"			; \
+	  $(ECHO) "-windowtitle '$(MGMT_WINDOWTITLE) $(DRAFT_WINTITLE)'"; \
+	  $(ECHO) "-header '$(MGMT_HEADER)$(DRAFT_HEADER)'"		; \
+	  $(ECHO) "-bottom '$(MGMT_BOTTOM)$(DRAFT_BOTTOM)'"		; \
+	  $(ECHO) "-linkoffline $(MGMT2COREAPI) $(COREAPI_DOCSDIR)/" 	; \
+        ) >> $@
+
+# Create a file with the package names in it
+$(MGMT_PACKAGES_FILE): $(DIRECTORY_CACHE) $(call PackageDependencies,$(MGMT_PKGS))
+	$(prep-target)
+	$(call PackageFilter,$(MGMT_PKGS))
+
+#############################################################
+#
+# attachdocs
+#
+
+ALL_OTHER_TARGETS += attachdocs
 
-.PHONY: sctpdocs
-sctpdocs:
-	@# ######## api-sctp #######################
-	$(RM) -r $(SCTPAPI_DOCDIR)
-	$(MKDIR) -p $(SCTPAPI_DOCDIR)
-	$(JAVADOC_CMD) $(SCTPAPI_JAVADOCFLAGS)                     \
-		$(SCTPAPI_PKGS)
+ATTACH_DOCDIR      := $(JDK_API_DOCSDIR)/attach/spec
+ATTACH2COREAPI     := ../../$(JDKJRE2COREAPI)
+ATTACH_DOCTITLE    := Attach API
+ATTACH_WINDOWTITLE := Attach API
+ATTACH_HEADER      := <strong>Attach API</strong>
+ATTACH_BOTTOM      := $(call CommonBottom,$(ATTACH_FIRST_COPYRIGHT_YEAR))
+# ATTACH_PKGS is located in NON_CORE_PKGS.gmk
+
+ATTACH_INDEX_HTML    = $(ATTACH_DOCDIR)/index.html
+ATTACH_OPTIONS_FILE  = $(DOCSTMPDIR)/attach.options
+ATTACH_PACKAGES_FILE = $(DOCSTMPDIR)/attach.packages
+
+attachdocs: $(ATTACH_INDEX_HTML)
+
+# Set relative location to core api document root
+$(ATTACH_INDEX_HTML): GET2DOCSDIR=$(ATTACH2COREAPI)/..
+
+# Run javadoc if the index file is out of date or missing
+$(ATTACH_INDEX_HTML): $(ATTACH_OPTIONS_FILE) $(ATTACH_PACKAGES_FILE)
+	$(prep-javadoc)
+	$(call JavadocSummary,$(ATTACH_OPTIONS_FILE),$(ATTACH_PACKAGES_FILE))
+	$(JAVADOC_CMD) $(JAVADOC_VM_MEMORY_FLAGS) -d $(@D) \
+	  @$(ATTACH_OPTIONS_FILE) @$(ATTACH_PACKAGES_FILE)
+
+# Create file with javadoc options in it
+$(ATTACH_OPTIONS_FILE):
+	$(prep-target)
+	@($(ECHO) "$(COMMON_JAVADOCFLAGS)"				; \
+	  $(ECHO) "-sourcepath \"$(RELEASEDOCS_SOURCEPATH)\""		; \
+	  $(ECHO) "-encoding ascii"					; \
+	  $(ECHO) "-nodeprecatedlist"					; \
+	  $(ECHO) "-doctitle '$(ATTACH_DOCTITLE)'"			; \
+	  $(ECHO) "-windowtitle '$(ATTACH_WINDOWTITLE) $(DRAFT_WINTITLE)'";\
+	  $(ECHO) "-header '$(ATTACH_HEADER)$(DRAFT_HEADER)'"		; \
+	  $(ECHO) "-bottom '$(ATTACH_BOTTOM)$(DRAFT_BOTTOM)'"		; \
+	  $(ECHO) "-linkoffline $(ATTACH2COREAPI) $(COREAPI_DOCSDIR)/"	; \
+        ) >> $@
+
+# Create a file with the package names in it
+$(ATTACH_PACKAGES_FILE): $(DIRECTORY_CACHE) $(call PackageDependencies,$(ATTACH_PKGS))
+	$(prep-target)
+	$(call PackageFilter,$(ATTACH_PKGS))
+
+#############################################################
+#
+# jconsoledocs
+#
+
+ALL_OTHER_TARGETS += jconsoledocs
+
+JCONSOLE_DOCDIR      := $(JDK_API_DOCSDIR)/jconsole/spec
+JCONSOLE2COREAPI     := ../../$(JDKJRE2COREAPI)
+JCONSOLE_DOCTITLE    := JConsole API
+JCONSOLE_WINDOWTITLE := JConsole API
+JCONSOLE_HEADER      := <strong>JConsole API</strong>
+JCONSOLE_BOTTOM      := $(call CommonBottom,$(JCONSOLE_FIRST_COPYRIGHT_YEAR))
+# JCONSOLE_PKGS is located in NON_CORE_PKGS.gmk
+
+JCONSOLE_INDEX_HTML    = $(JCONSOLE_DOCDIR)/index.html
+JCONSOLE_OPTIONS_FILE  = $(DOCSTMPDIR)/jconsole.options
+JCONSOLE_PACKAGES_FILE = $(DOCSTMPDIR)/jconsole.packages
+
+jconsoledocs: $(JCONSOLE_INDEX_HTML)
 
-.PHONY: mgmtdocs
-mgmtdocs: $(COPY-MIB-TARGET)
-	@# ######## api-management ############################
-	$(RM) -r $(MGMT_EXT_DIR)
-	$(MKDIR) -p $(MGMT_EXT_DIR)
-	$(JAVADOC_CMD) $(MGMT_JAVADOCFLAGS)                     \
-		   $(MGMT_PKGS)
+# Set relative location to core api document root
+$(JCONSOLE_INDEX_HTML): GET2DOCSDIR=$(JCONSOLE2COREAPI)/..
+
+# Run javadoc if the index file is out of date or missing
+$(JCONSOLE_INDEX_HTML): $(JCONSOLE_OPTIONS_FILE) $(JCONSOLE_PACKAGES_FILE)
+	$(prep-javadoc)
+	$(call JavadocSummary,$(JCONSOLE_OPTIONS_FILE),$(JCONSOLE_PACKAGES_FILE))
+	$(JAVADOC_CMD) $(JAVADOC_VM_MEMORY_FLAGS) -d $(@D) \
+	  @$(JCONSOLE_OPTIONS_FILE) @$(JCONSOLE_PACKAGES_FILE)
+
+# Create file with javadoc options in it
+$(JCONSOLE_OPTIONS_FILE):
+	$(prep-target)
+	@($(ECHO) "$(COMMON_JAVADOCFLAGS)"				; \
+	  $(ECHO) "-sourcepath \"$(RELEASEDOCS_SOURCEPATH)\""		; \
+	  $(ECHO) "-encoding ascii"					; \
+	  $(ECHO) "-nodeprecatedlist"					; \
+	  $(ECHO) "-doctitle '$(JCONSOLE_DOCTITLE)'"			; \
+	  $(ECHO) "-windowtitle '$(JCONSOLE_WINDOWTITLE) $(DRAFT_WINTITLE)'";\
+	  $(ECHO) "-header '$(JCONSOLE_HEADER)$(DRAFT_HEADER)'"		; \
+	  $(ECHO) "-bottom '$(JCONSOLE_BOTTOM)$(DRAFT_BOTTOM)'"		; \
+	  $(ECHO) "-linkoffline $(JCONSOLE2COREAPI) $(COREAPI_DOCSDIR)/"; \
+        ) >> $@
+
+# Create a file with the package names in it
+$(JCONSOLE_PACKAGES_FILE): $(DIRECTORY_CACHE) $(call PackageDependencies,$(JCONSOLE_PKGS))
+	$(prep-target)
+	$(call PackageFilter,$(JCONSOLE_PKGS))
 
-copy-mib:
-	@# ######## copy-snmp-mib ############################
-	$(RM) $(MGMT_DOCDIR)/$(JVM_MIB_NAME)
-	$(MKDIR) -p $(MGMT_DOCDIR)
-	$(CP) $(JVM_MIB_SRC) $(MGMT_DOCDIR)
+#############################################################
+#
+# treeapidocs
+#
+
+# Part of langtools
+ifdef LANGTOOLS_DIST
+  ALL_OTHER_TARGETS += treeapidocs
+endif
+
+TREEAPI_DOCDIR       := $(JDK_API_DOCSDIR)/javac/tree
+TREEAPI2COREAPI      := ../../$(JDKJRE2COREAPI)
+TREEAPI_DOCTITLE     := Compiler Tree API
+TREEAPI_WINDOWTITLE  := Compiler Tree API
+TREEAPI_HEADER       := <strong>Compiler Tree API</strong>
+TREEAPI_BOTTOM       := $(call CommonBottom,$(TREEAPI_FIRST_COPYRIGHT_YEAR))
+TREEAPI_GROUPNAME    := Packages
+TREEAPI_REGEXP       := com.sun.source.*
+# TREEAPI_PKGS is located in NON_CORE_PKGS.gmk
+
+TREEAPI_INDEX_HTML    = $(TREEAPI_DOCDIR)/index.html
+TREEAPI_OPTIONS_FILE  = $(DOCSTMPDIR)/treeapi.options
+TREEAPI_PACKAGES_FILE = $(DOCSTMPDIR)/treeapi.packages
+
+treeapidocs: $(TREEAPI_INDEX_HTML)
+
+# Set relative location to core api document root
+$(TREEAPI_INDEX_HTML): GET2DOCSDIR=$(TREEAPI2COREAPI)/..
+
+# Run javadoc if the index file is out of date or missing
+$(TREEAPI_INDEX_HTML): $(TREEAPI_OPTIONS_FILE) $(TREEAPI_PACKAGES_FILE)
+	$(prep-javadoc)
+	$(call JavadocSummary,$(TREEAPI_OPTIONS_FILE),$(TREEAPI_PACKAGES_FILE))
+	$(JAVADOC_CMD) $(JAVADOC_VM_MEMORY_FLAGS) -d $(@D) \
+	  @$(TREEAPI_OPTIONS_FILE) @$(TREEAPI_PACKAGES_FILE)
 
-.PHONY: attachdocs
-attachdocs:
-	@# ######## api-attach ############################
-	$(RM) -r $(ATTACH_DOCDIR)
-	$(MKDIR) -p $(ATTACH_DOCDIR)
-	$(JAVADOC_CMD) $(ATTACH_JAVADOCFLAGS)                     \
-		   $(ATTACH_PKGS)
+# Create file with javadoc options in it
+$(TREEAPI_OPTIONS_FILE):
+	$(prep-target)
+	@($(ECHO) "$(COMMON_JAVADOCFLAGS)"				; \
+	  $(ECHO) "-sourcepath \"$(RELEASEDOCS_SOURCEPATH)\""		; \
+	  $(ECHO) "-encoding ascii"					; \
+	  $(ECHO) "-doctitle '$(TREEAPI_DOCTITLE)'"			; \
+	  $(ECHO) "-windowtitle '$(TREEAPI_WINDOWTITLE) $(DRAFT_WINTITLE)'";\
+	  $(ECHO) "-header '$(TREEAPI_HEADER)$(DRAFT_HEADER)'"		; \
+	  $(ECHO) "-bottom '$(TREEAPI_BOTTOM)$(DRAFT_BOTTOM)'"		; \
+	  $(ECHO) "-group $(TREEAPI_GROUPNAME) $(TREEAPI_REGEXP)"	; \
+	  $(ECHO) "-linkoffline $(TREEAPI2COREAPI) $(COREAPI_DOCSDIR)/"	; \
+        ) >> $@
+
+# Create a file with the package names in it
+$(TREEAPI_PACKAGES_FILE): $(DIRECTORY_CACHE) $(call PackageDependencies,$(TREEAPI_PKGS))
+	$(prep-target)
+	$(call PackageFilter,$(TREEAPI_PKGS))
+
+#############################################################
+#
+# sctpdocs
+#
+
+ALL_OTHER_TARGETS += sctpdocs
+
+SCTPAPI_DOCDIR      := $(JRE_API_DOCSDIR)/nio/sctp/spec
+SCTPAPI2COREAPI     := ../../../$(JDKJRE2COREAPI)
+SCTPAPI_DOCTITLE    := SCTP API
+SCTPAPI_WINDOWTITLE := SCTP API
+SCTPAPI_HEADER      := <strong>SCTP API</strong>
+SCTPAPI_BOTTOM      := $(call CommonBottom,$(SCTPAPI_FIRST_COPYRIGHT_YEAR))
+# SCTPAPI_PKGS is located in NON_CORE_PKGS.gmk
+
+SCTPAPI_INDEX_HTML    = $(SCTPAPI_DOCDIR)/index.html
+SCTPAPI_OPTIONS_FILE  = $(DOCSTMPDIR)/sctp.options
+SCTPAPI_PACKAGES_FILE = $(DOCSTMPDIR)/sctp.packages
+
+sctpdocs: $(SCTPAPI_INDEX_HTML)
+
+# Set relative location to core api document root
+$(SCTSCTSCTP: GET2DOCSDIR=$(SCTPAPI2COREAPI)/..
+
+# Run javadoc if the index file is out of date or missing
+$(SCTPAPI_INDEX_HTML): $(SCTPAPI_OPTIONS_FILE) $(SCTPAPI_PACKAGES_FILE)
+	$(prep-javadoc)
+	$(call JavadocSummary,$(SCTPAPI_OPTIONS_FILE),$(SCTPAPI_PACKAGES_FILE))
+	$(JAVADOC_CMD) $(JAVADOC_VM_MEMORY_FLAGS) -d $(@D) \
+	  @$(SCTPAPI_OPTIONS_FILE) @$(SCTPAPI_PACKAGES_FILE)
+
+# Create file with javadoc options in it
+$(SCTPAPI_OPTIONS_FILE):
+	$(prep-target)
+	@($(ECHO) "$(COMMON_JAVADOCFLAGS)"				; \
+	  $(ECHO) "-sourcepath \"$(RELEASEDOCS_SOURCEPATH)\""		; \
+	  $(ECHO) "-encoding ascii"					; \
+	  $(ECHO) "-nodeprecatedlist"					; \
+	  $(ECHO) "-doctitle '$(SCTPAPI_DOCTITLE)'"			; \
+	  $(ECHO) "-windowtitle '$(SCTPAPI_WINDOWTITLE) $(DRAFT_WINTITLE)'";\
+	  $(ECHO) "-header '$(SCTPAPI_HEADER)$(DRAFT_HEADER)'"		; \
+	  $(ECHO) "-bottom '$(SCTPAPI_BOTTOM)$(DRAFT_BOTTOM)'"		; \
+	  $(ECHO) "-linkoffline $(SCTPAPI2COREAPI) $(COREAPI_DOCSDIR)/"	; \
+        ) >> $@
+
+# Create a file with the package names in it
+$(SCTPAPI_PACKAGES_FILE): $(DIRECTORY_CACHE) $(call PackageDependencies,$(SCTPAPI_PKGS))
+	$(prep-target)
+	$(call PackageFilter,$(SCTPAPI_PKGS))
+
+#############################################################
+#
+# tracingdocs
+#
 
-.PHONY: jconsoledocs
-jconsoledocs:
-	@# ######## api-jconsole ############################
-	$(RM) -r $(JCONSOLE_DOCDIR)
-	$(MKDIR) -p $(JCONSOLE_DOCDIR)
-	$(JAVADOC_CMD) $(JCONSOLE_JAVADOCFLAGS)                     \
-		   $(JCONSOLE_PKGS)
+ALL_OTHER_TARGETS += tracingdocs
+
+TRACING_DOCDIR      := $(JRE_API_DOCSDIR)/tracing
+TRACING2COREAPI     := ../$(JDKJRE2COREAPI)
+TRACING_DOCTITLE    := Java$(TRADEMARK) Platform Tracing
+TRACING_WINDOWTITLE := Platform Tracing
+TRACING_HEADER      := <strong>Platform Tracing</strong>
+TRACING_BOTTOM      := $(call CommonBottom,$(TRACING_FIRST_COPYRIGHT_YEAR))
+# TRACING_PKGS is located in NON_CORE_PKGS.gmk
+
+TRACING_INDEX_HTML    = $(TRACING_DOCDIR)/index.html
+TRACING_OPTIONS_FILE  = $(DOCSTMPDIR)/tracing.options
+TRACING_PACKAGES_FILE = $(DOCSTMPDIR)/tracing.packages
+
+tracingdocs: $(TRACING_INDEX_HTML)
+
+# Set relative location to core api document root
+$(TRACING_INDEX_HTML): GET2DOCSDIR=$(TRACING2COREAPI)/..
+
+# Run javadoc if the index file is out of date or missing
+$(TRACING_INDEX_HTML): $(TRACING_OPTIONS_FILE) $(TRACING_PACKAGES_FILE)
+	$(prep-javadoc)
+	$(call JavadocSummary,$(TRACING_OPTIONS_FILE),$(TRACING_PACKAGES_FILE))
+	$(JAVADOC_CMD) $(JAVADOC_VM_MEMORY_FLAGS) -d $(@D) \
+	  @$(TRACING_OPTIONS_FILE) @$(TRACING_PACKAGES_FILE)
 
-.PHONY: treeapidocs
-treeapidocs:
-	@# ######## tree api for javac ##################
-	$(RM) -r $(TREEAPI_DESTDIR)
-	$(MKDIR) -p $(TREEAPI_DESTDIR)
-	$(JAVADOC_CMD) $(TREEAPI_JAVADOCFLAGS)             \
-		   -d $(TREEAPI_DESTDIR)               \
-		   -sourcepath $(RELEASEDOCS_SRCPATH) \
-		   $(TREEAPI_LINKOPT)                  \
-		   $(TREEAPI_PKGS)
+# Create file with javadoc options in it
+$(TRACING_OPTIONS_FILE):
+	$(prep-target)
+	@($(ECHO) "$(COMMON_JAVADOCFLAGS)"				; \
+	  $(ECHO) "-sourcepath \"$(RELEASEDOCS_SOURCEPATH)\""		; \
+	  $(ECHO) "-encoding ascii"					; \
+	  $(ECHO) "-nodeprecatedlist"					; \
+	  $(ECHO) "-doctitle '$(TRACING_DOCTITLE)'"			; \
+	  $(ECHO) "-windowtitle '$(TRACING_WINDOWTITLE) $(DRAFT_WINTITLE)'";\
+	  $(ECHO) "-header '$(TRACING_HEADER)$(DRAFT_HEADER)'"		; \
+	  $(ECHO) "-bottom '$(TRACING_BOTTOM)$(DRAFT_BOTTOM)'"		; \
+	  $(ECHO) "-linkoffline $(TRACING2COREAPI) $(COREAPI_DOCSDIR)/"	; \
+        ) >> $@
+
+# Create a file with the package names in it
+$(TRACING_PACKAGES_FILE): $(DIRECTORY_CACHE) $(call PackageDependencies,$(TRACING_PKGS))
+	$(prep-target)
+	$(call PackageFilter,$(TRACING_PKGS))
+
+#############################################################
+#
+# Get a cache of all the directories
 
+$(DIRECTORY_CACHE): $(ALL_SOURCE_DIRS)
+	$(prep-target)
+	@for cp in $(ALL_SOURCE_DIRS) ; do 		\
+	  $(ECHO) "$(FIND) $${cp} -type f >> $@"; 	\
+	  $(FIND) $${cp} -type f >> $@; 		\
+	done
+
+#############################################################
+#release version of core packages ########
+# Maximize performance and ensure that build number & milestone are set.
+
+rel-coredocs: sanitycheckcoredocs
+	$(MAKE) coredocs
+
+rel-docs: rel-coredocs $(ALL_OTHER_TARGETS)
+#
+# end of production targets
+
+otherdocs: $(ALL_OTHER_TARGETS)
+
+clean:
+	$(RM) -r $(DOCSDIR) $(DOCSTMPDIR)
+
+#############################################################
 # DEBUG TARGET
 # List the values defined in the makefile hierarchy, to make sure everything
 # is set properly, and to help identify values we can use instead of making new ones.
@@ -714,9 +1211,14 @@
 #    * BUILD_NUMBER defaults to b00 if not set on command line with BUILD_NUMBER=<value>
 #    * MILESTONE defaults to internal unless set to beta, rc, or fcs on command line
 #
-.PHONY: echovalues
+
 echovalues:
 	@$(ECHO) ""
+	@$(ECHO) --------------Imports---------------------------
+	@$(ECHO) "IMPORT_PACKAGES = $(IMPORT_PACKAGES)"
+	@$(ECHO) "IMPORT_PACKAGE_FILTER = $(IMPORT_PACKAGE_FILTER)"
+	@$(ECHO) --------------Imports---------------------------
+	@$(ECHO) ""
 	@$(ECHO) --------------Shared---------------------------
 	@$(ECHO) BUILD_NUMBER = $(BUILD_NUMBER)
 	@$(ECHO) FULL_VERSION = $(FULL_VERSION)
@@ -736,11 +1238,16 @@
 	@$(ECHO) --------------Shared---------------------------
 	@$(ECHO) ""
 	@$(ECHO) --------------common/Defs---------------------------
-	@$(ECHO) "RELEASEDOCS_SRCPATH"
+	@$(ECHO) "RELEASEDOCS_SOURCEPATH"
 	@$(ECHO) "   SHARE_SRC/classes: $(SHARE_SRC)/classes"
 	@$(ECHO) "   PLATFORM_SRC/classes: $(PLATFORM_SRC)/classes"
 	@$(ECHO) "   GENSRCDIR: $(GENSRCDIR)"
+	@$(ECHO) "   SHARE_SRC/doc/stub: $(SHARE_SRC)/doc/stub"
 	@$(ECHO) "   IMPORTSRCDIR: $(IMPORTSRCDIR)"
-	@$(ECHO) "   SHARE_SRC/doc/stub: $(SHARE_SRC)/doc/stub"
 	@$(ECHO) --------------common/Defs---------------------------
 	@$(ECHO) ""
+
+#############################################################
+.PHONY: all docs coredocs rel-docs echovalues otherdocs rel-coredocs \
+        sanitycheckcoredocs $(ALL_OTHER_TARGETS)
+
--- a/jdk/make/java/hpi/hpi_common.gmk	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/make/java/hpi/hpi_common.gmk	Wed Jul 21 09:57:21 2010 -0700
@@ -86,5 +86,5 @@
 # Things that must be linked in.
 #
 ifneq ($(PLATFORM), windows)
-OTHER_LDLIBS += $(LIBSOCKET) -lnsl $(LIBM) -ldl
+OTHER_LDLIBS += $(LIBSOCKET) $(LIBNSL) $(LIBM) -ldl
 endif
--- a/jdk/make/java/java/FILES_java.gmk	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/make/java/java/FILES_java.gmk	Wed Jul 21 09:57:21 2010 -0700
@@ -30,10 +30,12 @@
 #
 JAVA_JAVA_java = \
     java/lang/Object.java \
+    java/lang/AutoCloseable.java \
     java/lang/Class.java \
     java/lang/Thread.java \
     java/lang/Character.java \
     java/lang/CharacterData.java \
+    java/lang/CharacterName.java \
     sun/misc/ASCIICaseInsensitiveComparator.java \
     sun/misc/VM.java \
     sun/misc/Signal.java \
--- a/jdk/make/java/java/Makefile	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/make/java/java/Makefile	Wed Jul 21 09:57:21 2010 -0700
@@ -204,7 +204,7 @@
 OTHER_LDLIBS += $(JVMLIB) -libpath:$(OBJDIR)/../../../fdlibm/$(OBJDIRNAME) fdlibm.lib \
 		       -libpath:$(OBJDIR)/../../../verify/$(OBJDIRNAME) verify.lib
 else
-OTHER_LDLIBS += $(JVMLIB) -lverify $(LIBSOCKET) -lnsl -ldl \
+OTHER_LDLIBS += $(JVMLIB) -lverify $(LIBSOCKET) $(LIBNSL) -ldl \
 		-L$(OBJDIR)/../../../fdlibm/$(OBJDIRNAME) -lfdlibm.$(ARCH)
 endif
 
@@ -385,6 +385,27 @@
 	$(RM) $(GENSRCDIR)/java/lang/CharacterDataPrivateUse.java
 
 #
+# Rules to generate classes/java/lang/uniName.dat
+#
+
+
+
+UNINAME = $(CLASSBINDIR)/java/lang/uniName.dat
+GENERATEUNINAME_JARFILE = $(BUILDTOOLJARDIR)/generatecharacter.jar
+
+build: $(UNINAME)
+
+$(UNINAME): $(UNICODEDATA)/UnicodeData.txt \
+	$(GENERATECHARACTER_JARFILE)
+	@$(prep-target)
+	$(BOOT_JAVA_CMD) -classpath $(GENERATECHARACTER_JARFILE) \
+	build.tools.generatecharacter.CharacterName \
+		$(UNICODEDATA)/UnicodeData.txt $(UNINAME)
+
+clean:: 
+	$(RM) $(UNINAME)
+
+#
 # End of rules to create $(GENSRCDIR)/java/lang/CharacterDataXX.java
 #
 
--- a/jdk/make/java/java_hprof_demo/Makefile	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/make/java/java_hprof_demo/Makefile	Wed Jul 21 09:57:21 2010 -0700
@@ -84,7 +84,7 @@
 ifeq ($(PLATFORM), windows)
   OTHER_LDLIBS += wsock32.lib winmm.lib
 else
-  OTHER_LDLIBS += $(LIBSOCKET) -lnsl -ldl
+  OTHER_LDLIBS += $(LIBSOCKET) $(LIBNSL) -ldl
 endif
 
 #
--- a/jdk/make/java/net/Makefile	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/make/java/net/Makefile	Wed Jul 21 09:57:21 2010 -0700
@@ -96,7 +96,7 @@
 ifeq ($(PLATFORM), windows)
   OTHER_LDLIBS = ws2_32.lib $(JVMLIB)
 else
-  OTHER_LDLIBS = $(LIBSOCKET) -lnsl -ldl $(JVMLIB)
+  OTHER_LDLIBS = $(LIBSOCKET) $(LIBNSL) -ldl $(JVMLIB)
 endif
 ifeq ($(PLATFORM), linux)
   OTHER_LDLIBS += -lpthread
--- a/jdk/make/java/security/Makefile	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/make/java/security/Makefile	Wed Jul 21 09:57:21 2010 -0700
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 1996, 2005, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 1996, 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
@@ -62,6 +62,11 @@
 CACERTS_SRC =	$(CACERTS_FILE)
 CACERTS_BUILD = $(LIBDIR)/security/cacerts
 
+ifndef OPENJDK
+  BLACKLIST_SRC =	$(CLOSED_SHARE_SRC)/lib/security/blacklist
+  BLACKLIST_BUILD = $(LIBDIR)/security/blacklist
+endif
+
 FILES_class = $(FILES_java:%.java=$(CLASSBINDIR)/%.class)
 
 #
@@ -69,7 +74,11 @@
 #
 include $(BUILDDIR)/common/Rules.gmk
 
+ifdef OPENJDK
 build: properties policy cacerts
+else
+build: properties policy cacerts blacklist
+endif
 
 install: all
 
@@ -79,6 +88,8 @@
 
 cacerts: classes $(CACERTS_BUILD)
 
+blacklist: classes $(BLACKLIST_BUILD)
+
 $(PROPS_BUILD): $(PROPS_SRC)
 	$(install-file)
 
@@ -88,9 +99,12 @@
 $(CACERTS_BUILD): $(CACERTS_SRC)
 	$(install-file)
 
+$(BLACKLIST_BUILD): $(BLACKLIST_SRC)
+	$(install-file)
+
 clean clobber:: .delete.classlist
 	$(RM) -r $(CLASSBINDIR)/java/security
-	$(RM) $(PROPS_BUILD) $(POLICY_BUILD) $(CACERTS_BUILD)
+	$(RM) $(PROPS_BUILD) $(POLICY_BUILD) $(CACERTS_BUILD) $(BLACKLIST_BUILD)
 
 # Additional Rule for building sun.security.util
 $(CLASSBINDIR)/%.class: $(SHARE_SRC)/sun/%.java
--- a/jdk/make/javax/swing/FILES.gmk	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/make/javax/swing/FILES.gmk	Wed Jul 21 09:57:21 2010 -0700
@@ -25,7 +25,6 @@
 
 MISC_FILES = \
         $(CLASSBINDIR)/javax/swing/text/html/default.css 			\
-        $(CLASSBINDIR)/javax/swing/text/html/parser/html32.bdtd 		\
         $(CLASSBINDIR)/javax/swing/text/rtf/charsets/NeXT.txt 			\
         $(CLASSBINDIR)/javax/swing/text/rtf/charsets/ansi.txt 			\
         $(CLASSBINDIR)/javax/swing/text/rtf/charsets/cpg437.txt 		\
--- a/jdk/make/javax/swing/Makefile	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/make/javax/swing/Makefile	Wed Jul 21 09:57:21 2010 -0700
@@ -59,9 +59,6 @@
 $(CLASSBINDIR)/%.css: $(SHARE_SRC)/classes/%.css
 	$(install-file)
 
-$(CLASSBINDIR)/%.bdtd: $(SHARE_SRC)/classes/%.bdtd
-	$(install-file)
-
 $(CLASSBINDIR)/%.txt: $(SHARE_SRC)/classes/%.txt
 	$(install-file)
 
--- a/jdk/make/jdk_generic_profile.sh	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/make/jdk_generic_profile.sh	Wed Jul 21 09:57:21 2010 -0700
@@ -174,7 +174,7 @@
    
   # Check CYGWIN (should have already been done)
   #   Assumption here is that you are in a shell window via cygwin.
-  proc_arch=`echo "$(PROCESSOR_IDENTIFIER)" | expand | cut -d' ' -f1 | sed -e 's@x86@X86@g' -e 's@Intel64@X64@g' -e 's@em64t@X64@g' -e 's@EM64T@X64@g' -e 's@amd64@X64@g' -e 's@AMD64@X64@g' -e 's@ia64@IA64@g'`
+  proc_arch=`echo "${PROCESSOR_IDENTIFIER}" | expand | cut -d' ' -f1 | sed -e 's@x86@X86@g' -e 's@Intel64@X64@g' -e 's@em64t@X64@g' -e 's@EM64T@X64@g' -e 's@amd64@X64@g' -e 's@AMD64@X64@g' -e 's@ia64@IA64@g'`
   if [ "${proc_arch}" = "X64" ] ; then
     windows_arch=amd64
   else
--- a/jdk/make/jpda/transport/socket/Makefile	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/make/jpda/transport/socket/Makefile	Wed Jul 21 09:57:21 2010 -0700
@@ -38,11 +38,11 @@
 include $(BUILDDIR)/common/Defs.gmk
 
 ifeq ($(PLATFORM), linux)
-  OTHER_LDLIBS += -lnsl $(LIBSOCKET) -lpthread
+  OTHER_LDLIBS += $(LIBNSL) $(LIBSOCKET) -lpthread
 endif
 
 ifeq ($(PLATFORM), solaris)
-  OTHER_LDLIBS += -lnsl $(LIBSOCKET)
+  OTHER_LDLIBS += $(LIBNSL) $(LIBSOCKET)
 endif
 
 ifeq ($(PLATFORM), windows)
--- a/jdk/make/mkdemo/Makefile	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/make/mkdemo/Makefile	Wed Jul 21 09:57:21 2010 -0700
@@ -46,11 +46,11 @@
 	$(RM) -r $(DEMODIR)/nbproject
 	$(MKDIR) -p $(DEMODIR)
 	( $(CD) $(SHARE_SRC)/demo && $(TAR) -cf - \
-	  `find nbproject $(SCM_DIRS_prune) -o -type f -print` ) | \
+	  `$(FIND) nbproject $(SCM_DIRS_prune) -o -type f -print` ) | \
 	  ( $(CD) $(DEMODIR) && $(TAR) -xf - )
 ifndef OPENJDK
 	( $(CD) $(CLOSED_SHARE_SRC)/demo && $(TAR) -cf - \
-	  `find nbproject $(SCM_DIRS_prune) -o -type f -print` ) | \
+	  `$(FIND) nbproject $(SCM_DIRS_prune) -o -type f -print` ) | \
 	  ( $(CD) $(DEMODIR) && $(TAR) -xf - )
 endif
 
--- a/jdk/make/mkdemo/jvmti/hprof/Makefile	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/make/mkdemo/jvmti/hprof/Makefile	Wed Jul 21 09:57:21 2010 -0700
@@ -39,10 +39,10 @@
   EXTRA_LIBS += wsock32.lib winmm.lib
 endif
 ifeq ($(PLATFORM), solaris)
-  OTHER_LDLIBS += $(LIBSOCKET) -lnsl -ldl
+  OTHER_LDLIBS += $(LIBSOCKET) $(LIBNSL) -ldl
 endif
 ifeq ($(PLATFORM), linux)
-  OTHER_LDLIBS += $(LIBSOCKET) -lnsl -ldl -lpthread
+  OTHER_LDLIBS += $(LIBSOCKET) $(LIBNSL) -ldl -lpthread
 endif
 
 #
--- a/jdk/make/modules/modules.config	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/make/modules/modules.config	Wed Jul 21 09:57:21 2010 -0700
@@ -823,6 +823,10 @@
     include sun.tools.jar.**;
 }
 
+module policytool {
+    include sun.security.tools.policytool.*;
+}
+
 module security-tools {
     include sun.security.tools.**;
 
--- a/jdk/make/netbeans/README	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/make/netbeans/README	Wed Jul 21 09:57:21 2010 -0700
@@ -204,8 +204,8 @@
         note that pretty much regardless of your hardware, this *will* take
         a long time, and use *lots* of disk space (more than 3GB). The
         results of the build are in
-        *install-dir*/control/build/*platform*-*arch* and
-        *install-dir*/control/build/*platform*-*arch*-fastdebug.
+        *install-dir*/build/*platform*-*arch* and
+        *install-dir*/build/*platform*-*arch*-fastdebug.
 
         Consult the project's README file for details.
 
--- a/jdk/make/netbeans/world/README	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/make/netbeans/world/README	Wed Jul 21 09:57:21 2010 -0700
@@ -10,6 +10,6 @@
 Please note: the results of building this project are *not* put in the place
 used by other projects.  In this case, the results are place in
 
-    <install-dir>/control/build/<platform>-<arch>
+    <install-dir>/build/<platform>-<arch>
 and
-    <install-dir>/control/build/<platform>-<arch>-fastdebug
+    <install-dir>/build/<platform>-<arch>-fastdebug
--- a/jdk/make/netbeans/world/build.xml	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/make/netbeans/world/build.xml	Wed Jul 21 09:57:21 2010 -0700
@@ -34,11 +34,11 @@
     <import file="../common/shared.xml"/>
 
     <target name="-build-make" depends="-make.init" if="use.make">
-        <make-run target="dev" dir="${root}/../control/make" opts="SKIP_COMPARE_IMAGES=true"/>
+        <make-run target="dev" dir="${root}/.." opts="SKIP_COMPARE_IMAGES=true"/>
     </target>
 
     <target name="-clean-make" depends="-make.init" if="use.make">
-        <make-run target="clean" dir="${root}/../control/make"/>
+        <make-run target="clean" dir="${root}/.."/>
     </target>
 
 </project>
--- a/jdk/make/sun/awt/mapfile-mawt-vers	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/make/sun/awt/mapfile-mawt-vers	Wed Jul 21 09:57:21 2010 -0700
@@ -312,6 +312,7 @@
                 Java_sun_awt_X11GraphicsEnvironment_initGLX;
 		Java_sun_awt_X11GraphicsEnvironment_pRunningXinerama;
 		Java_sun_awt_X11GraphicsEnvironment_getXineramaCenterPoint;
+		Java_sun_awt_X11GraphicsEnvironment_initXRender;
                 #Java_sun_awt_motif_MEmbedCanvasPeer_initXEmbedServer;
                 #Java_sun_awt_motif_MEmbedCanvasPeer_destroyXEmbedServer;
                 #Java_sun_awt_motif_MEmbedCanvasPeer_isXEmbedActive;
@@ -406,18 +407,53 @@
 		Java_sun_java2d_x11_X11SurfaceData_initIDs;
 		Java_sun_java2d_x11_X11SurfaceData_initOps;
 		Java_sun_java2d_x11_X11SurfaceData_initSurface;
-		Java_sun_java2d_x11_X11SurfaceData_isDrawableValid;
 		Java_sun_java2d_x11_X11SurfaceData_isDgaAvailable;
 		Java_sun_java2d_x11_X11SurfaceData_isShmPMAvailable;
-		Java_sun_java2d_x11_X11SurfaceData_setInvalid;
-		Java_sun_java2d_x11_X11SurfaceData_flushNativeSurface;
-                Java_sun_java2d_x11_X11SurfaceData_XCreateGC;
-                Java_sun_java2d_x11_X11SurfaceData_XResetClip;
-                Java_sun_java2d_x11_X11SurfaceData_XSetClip;
                 Java_sun_java2d_x11_X11SurfaceData_XSetCopyMode;
                 Java_sun_java2d_x11_X11SurfaceData_XSetXorMode;
                 Java_sun_java2d_x11_X11SurfaceData_XSetForeground;
-                Java_sun_java2d_x11_X11SurfaceData_XSetGraphicsExposures;
+
+		Java_sun_java2d_x11_XSurfaceData_initOps;
+		Java_sun_java2d_x11_XSurfaceData_XCreateGC;
+		Java_sun_java2d_x11_XSurfaceData_XResetClip;
+		Java_sun_java2d_x11_XSurfaceData_XSetClip;
+		Java_sun_java2d_x11_XSurfaceData_flushNativeSurface;
+		Java_sun_java2d_x11_XSurfaceData_isDrawableValid;
+		Java_sun_java2d_x11_XSurfaceData_setInvalid;
+		Java_sun_java2d_x11_XSurfaceData_XSetGraphicsExposures;
+		Java_sun_java2d_xr_XRSurfaceData_initXRPicture;
+		Java_sun_java2d_xr_XRSurfaceData_initIDs;
+		Java_sun_java2d_xr_XRSurfaceData_XRInitSurface;
+		Java_sun_java2d_xr_XRBackendNative_initIDs;
+		Java_sun_java2d_xr_XIDGenerator_bufferXIDs;
+		Java_sun_java2d_xr_XRBackendNative_freeGC;
+		Java_sun_java2d_xr_XRBackendNative_createGC;
+		Java_sun_java2d_xr_XRBackendNative_createPixmap;
+		Java_sun_java2d_xr_XRBackendNative_createPictureNative;
+		Java_sun_java2d_xr_XRBackendNative_freePicture;
+		Java_sun_java2d_xr_XRBackendNative_freePixmap;
+		Java_sun_java2d_xr_XRBackendNative_setPictureRepeat;
+		Java_sun_java2d_xr_XRBackendNative_setGCExposures;
+		Java_sun_java2d_xr_XRBackendNative_setGCForeground;
+		Java_sun_java2d_xr_XRBackendNative_copyArea;
+		Java_sun_java2d_xr_XRBackendNative_renderComposite;
+		Java_sun_java2d_xr_XRBackendNative_renderRectangle;
+		Java_sun_java2d_xr_XRBackendNative_XRenderRectanglesNative;
+		Java_sun_java2d_xr_XRBackendNative_XRSetTransformNative;
+		Java_sun_java2d_xr_XRBackendNative_XRCreateLinearGradientPaintNative;
+		Java_sun_java2d_xr_XRBackendNative_XRCreateRadialGradientPaintNative;
+		Java_sun_java2d_xr_XRBackendNative_setFilter;
+		Java_sun_java2d_xr_XRBackendNative_XRSetClipNative;
+		Java_sun_java2d_xr_XRBackendNative_putMaskNative;
+		Java_sun_java2d_xr_XRBackendNative_XRAddGlyphsNative;
+		Java_sun_java2d_xr_XRBackendNative_XRFreeGlyphsNative;
+		Java_sun_java2d_xr_XRBackendNative_XRenderCreateGlyphSetNative;
+		Java_sun_java2d_xr_XRBackendNative_XRenderCompositeTextNative;
+		Java_sun_java2d_xr_XRBackendNative_setGCMode;
+		Java_sun_java2d_xr_XRBackendNative_GCRectanglesNative;
+		Java_sun_java2d_xr_XRUtils_initFormatPtrs;
+		Java_sun_java2d_xr_XRBackendNative_renderCompositeTrapezoidsNative;
+		XRT_DrawGlyphList;
 
                 Java_sun_java2d_opengl_OGLContext_getOGLIdString;
                 Java_sun_java2d_opengl_OGLMaskFill_maskFill;
--- a/jdk/make/sun/awt/mapfile-vers-linux	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/make/sun/awt/mapfile-vers-linux	Wed Jul 21 09:57:21 2010 -0700
@@ -425,6 +425,7 @@
 		Java_sun_awt_X11GraphicsEnvironment_initDisplay;
 		Java_sun_awt_X11GraphicsEnvironment_pRunningXinerama;
 		Java_sun_awt_X11GraphicsEnvironment_getXineramaCenterPoint;
+		Java_sun_awt_X11GraphicsEnvironment_initXRender;
         
         
 
--- a/jdk/make/sun/headless/mapfile-vers	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/make/sun/headless/mapfile-vers	Wed Jul 21 09:57:21 2010 -0700
@@ -46,17 +46,20 @@
 		Java_sun_java2d_x11_X11Renderer_XFillRoundRect;
 		Java_sun_java2d_x11_X11Renderer_devCopyArea;
 		Java_sun_java2d_x11_X11SurfaceData_initIDs;
-		Java_sun_java2d_x11_X11SurfaceData_initOps;
-		Java_sun_java2d_x11_X11SurfaceData_isDrawableValid;
 		Java_sun_java2d_x11_X11SurfaceData_initSurface;
-		Java_sun_java2d_x11_X11SurfaceData_setInvalid;
-                Java_sun_java2d_x11_X11SurfaceData_XCreateGC;
-                Java_sun_java2d_x11_X11SurfaceData_XResetClip;
-                Java_sun_java2d_x11_X11SurfaceData_XSetClip;
                 Java_sun_java2d_x11_X11SurfaceData_XSetCopyMode;
                 Java_sun_java2d_x11_X11SurfaceData_XSetXorMode;
                 Java_sun_java2d_x11_X11SurfaceData_XSetForeground;
 
+		Java_sun_java2d_x11_XSurfaceData_initOps;
+                Java_sun_java2d_x11_XSurfaceData_XCreateGC;
+                Java_sun_java2d_x11_XSurfaceData_XResetClip;
+                Java_sun_java2d_x11_XSurfaceData_XSetClip;
+                Java_sun_java2d_x11_XSurfaceData_flushNativeSurface;
+		Java_sun_java2d_x11_XSurfaceData_isDrawableValid;
+		Java_sun_java2d_x11_XSurfaceData_setInvalid;
+		Java_sun_java2d_x11_XSurfaceData_XSetGraphicsExposures;
+
 		X11SurfaceData_GetOps;
 		Java_java_awt_Font_initIDs;
                 Java_sun_font_FontConfigManager_getFontConfig;
--- a/jdk/make/sun/jawt/Makefile	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/make/sun/jawt/Makefile	Wed Jul 21 09:57:21 2010 -0700
@@ -113,7 +113,7 @@
 # Libraries to link in.
 #
 ifeq ($(PLATFORM), solaris)
-OTHER_LDLIBS = -L$(LIBDIR)/$(LIBARCH) -L$(OPENWIN_LIB) -L$(LIBDIR)/$(LIBARCH)/xawt -lmawt
+OTHER_LDLIBS = -L$(LIBDIR)/$(LIBARCH) -L$(OPENWIN_LIB) -L$(LIBDIR)/$(LIBARCH)/xawt -lmawt -L/usr/openwin/sfw/lib$(ISA_DIR) -lXrender
 endif # PLATFORM
 
 ifeq ($(PLATFORM), linux)
--- a/jdk/make/sun/nio/cs/Makefile	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/make/sun/nio/cs/Makefile	Wed Jul 21 09:57:21 2010 -0700
@@ -37,7 +37,7 @@
 # This re-directs all the class files to a separate location
 CLASSDESTDIR = $(TEMPDIR)/classes
 
-OTHER_JAVACFLAGS += -Xlint:serial -Werror
+OTHER_JAVACFLAGS += -Xlint:serial,-deprecation -Werror
 include $(BUILDDIR)/common/Defs.gmk
 
 #
--- a/jdk/make/sun/pisces/Makefile	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/make/sun/pisces/Makefile	Wed Jul 21 09:57:21 2010 -0700
@@ -52,5 +52,11 @@
 
 copy-files: $(FILES_copy)
 
-$(SERVICEDIR)/%: $(SHARE_SRC)/classes/sun/java2d/pisces/META-INF/services/%
+ifneq ($(PLATFORM), windows)
+ SERVICE_SRC = $(PLATFORM_SRC)
+else
+ SERVICE_SRC = $(SHARE_SRC)
+endif
+
+$(SERVICEDIR)/%: $(SERVICE_SRC)/classes/sun/java2d/pisces/META-INF/services/%
 	$(install-file)
--- a/jdk/make/sun/security/mscapi/Makefile	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/make/sun/security/mscapi/Makefile	Wed Jul 21 09:57:21 2010 -0700
@@ -150,6 +150,7 @@
 # Rules
 #
 CLASSDESTDIR = $(TEMPDIR)/classes
+JAVAHFLAGS += -classpath $(CLASSDESTDIR)
 
 include $(BUILDDIR)/common/Mapfile-vers.gmk
 
--- a/jdk/make/sun/security/pkcs11/Makefile	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/make/sun/security/pkcs11/Makefile	Wed Jul 21 09:57:21 2010 -0700
@@ -148,6 +148,7 @@
 # Rules
 #
 CLASSDESTDIR = $(TEMPDIR)/classes
+JAVAHFLAGS += -classpath $(CLASSDESTDIR)
 
 include $(BUILDDIR)/common/Mapfile-vers.gmk
 
--- a/jdk/make/sun/security/tools/Makefile	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/make/sun/security/tools/Makefile	Wed Jul 21 09:57:21 2010 -0700
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 1997, 2005, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 1997, 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
@@ -47,5 +47,5 @@
 
 build:
 	$(call make-launcher, keytool, sun.security.tools.KeyTool, , )
-	$(call make-launcher, policytool, sun.security.tools.PolicyTool, , )
+	$(call make-launcher, policytool, sun.security.tools.policytool.PolicyTool, , )
 
--- a/jdk/make/sun/tools/Makefile	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/make/sun/tools/Makefile	Wed Jul 21 09:57:21 2010 -0700
@@ -49,7 +49,8 @@
 
 # Extra jstat files
 FILES_copy += \
-  $(CLASSDESTDIR)/sun/tools/jstat/resources/jstat_options
+  $(CLASSDESTDIR)/sun/tools/jstat/resources/jstat_options \
+  $(CLASSDESTDIR)/sun/tools/jstat/resources/jstat_unsupported_options
 
 # Extra jhat files
 JHAT_RESOURCEDIR = $(CLASSDESTDIR)/com/sun/tools/hat/resources
--- a/jdk/make/sun/xawt/FILES_c_unix.gmk	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/make/sun/xawt/FILES_c_unix.gmk	Wed Jul 21 09:57:21 2010 -0700
@@ -80,4 +80,6 @@
         swing_GTKEngine.c \
         swing_GTKStyle.c \
         rect.c \
-	sun_awt_X11_GtkFileDialogPeer.c
+	sun_awt_X11_GtkFileDialogPeer.c \
+	XRSurfaceData.c \
+	XRBackendNative.c
--- a/jdk/make/sun/xawt/Makefile	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/make/sun/xawt/Makefile	Wed Jul 21 09:57:21 2010 -0700
@@ -49,6 +49,11 @@
 
 LDFLAGS += -L$(OPENWIN_LIB)
 
+# For Xrender extension.
+ifeq ($(PLATFORM), solaris)
+LDFLAGS += -L/usr/openwin/sfw/lib$(ISA_DIR) -R/usr/openwin/sfw/lib$(ISA_DIR)
+endif
+
 ifeq ($(PLATFORM), linux)
 LDFLAGS += -lpthread
 dummy := $(shell $(MKDIR) -p $(LIB_LOCATION))
@@ -88,7 +93,7 @@
 vpath %.c   $(PLATFORM_SRC)/native/sun/java2d/opengl
 vpath %.c   $(PLATFORM_SRC)/native/sun/java2d/x11
 
-OTHER_LDLIBS = $(LIBM) -lawt -lXext -lX11 -ldl \
+OTHER_LDLIBS = $(LIBM) -lawt -lXext -lX11 -lXrender -ldl \
                    $(LDFLAGS_COMMON) $(AWT_RUNPATH) $(OTHER_LDFLAGS) -lXtst -lXi
 
 ifeq  ($(PLATFORM), solaris)
@@ -122,7 +127,7 @@
 	-I$(PLATFORM_SRC)/native/sun/awt/medialib \
         -I$(PLATFORM_SRC)/native/sun/font \
         -I$(SHARE_SRC)/native/sun/awt \
-        -I$(PLATFORM_SRC)/native/sun/awt 
+        -I$(PLATFORM_SRC)/native/sun/awt
 
 ifeq ($(PLATFORM), linux)
 # Allows for builds on Debian GNU Linux, X11 is in a different place 
--- a/jdk/make/sun/xawt/mapfile-vers	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/make/sun/xawt/mapfile-vers	Wed Jul 21 09:57:21 2010 -0700
@@ -192,6 +192,7 @@
 	Java_sun_font_X11FontManager_setNativeFontPath;
         Java_sun_awt_X11GraphicsEnvironment_initDisplay;
         Java_sun_awt_X11GraphicsEnvironment_initGLX;
+	Java_sun_awt_X11GraphicsEnvironment_initXRender;
         Java_sun_awt_X11GraphicsEnvironment_checkShmExt;
         Java_sun_awt_X11GraphicsEnvironment_getNumScreens;
         Java_sun_awt_X11GraphicsEnvironment_getDefaultScreenNum;
@@ -355,21 +356,52 @@
 	Java_sun_java2d_x11_X11Renderer_XFillRect;
 	Java_sun_java2d_x11_X11Renderer_XFillRoundRect;
         Java_sun_java2d_x11_X11Renderer_devCopyArea;
-        Java_sun_java2d_x11_X11SurfaceData_setInvalid;
         Java_sun_java2d_x11_X11SurfaceData_initIDs;
-	Java_sun_java2d_x11_X11SurfaceData_isDrawableValid;
         Java_sun_java2d_x11_X11SurfaceData_isDgaAvailable;
 	Java_sun_java2d_x11_X11SurfaceData_isShmPMAvailable;
-        Java_sun_java2d_x11_X11SurfaceData_initOps;
         Java_sun_java2d_x11_X11SurfaceData_initSurface;
-        Java_sun_java2d_x11_X11SurfaceData_flushNativeSurface;
-        Java_sun_java2d_x11_X11SurfaceData_XCreateGC;
-        Java_sun_java2d_x11_X11SurfaceData_XResetClip;
-        Java_sun_java2d_x11_X11SurfaceData_XSetClip;
         Java_sun_java2d_x11_X11SurfaceData_XSetCopyMode;
         Java_sun_java2d_x11_X11SurfaceData_XSetXorMode;
         Java_sun_java2d_x11_X11SurfaceData_XSetForeground;
-        Java_sun_java2d_x11_X11SurfaceData_XSetGraphicsExposures;
+
+        Java_sun_java2d_x11_XSurfaceData_initOps;
+        Java_sun_java2d_x11_XSurfaceData_XCreateGC;
+        Java_sun_java2d_x11_XSurfaceData_XResetClip;
+        Java_sun_java2d_x11_XSurfaceData_XSetClip;
+        Java_sun_java2d_x11_XSurfaceData_flushNativeSurface;
+	Java_sun_java2d_x11_XSurfaceData_isDrawableValid;
+        Java_sun_java2d_x11_XSurfaceData_setInvalid;
+        Java_sun_java2d_x11_XSurfaceData_XSetGraphicsExposures;
+        Java_sun_java2d_xr_XRSurfaceData_initXRPicture;
+        Java_sun_java2d_xr_XRSurfaceData_initIDs;
+        Java_sun_java2d_xr_XRSurfaceData_XRInitSurface;
+	Java_sun_java2d_xr_XRBackendNative_initIDs;
+	Java_sun_java2d_xr_XRBackendNative_freeGC;
+	Java_sun_java2d_xr_XRBackendNative_createGC;
+	Java_sun_java2d_xr_XRBackendNative_createPixmap;
+	Java_sun_java2d_xr_XRBackendNative_createPictureNative;
+	Java_sun_java2d_xr_XRBackendNative_freePicture;
+	Java_sun_java2d_xr_XRBackendNative_freePixmap;
+	Java_sun_java2d_xr_XRBackendNative_setPictureRepeat;
+	Java_sun_java2d_xr_XRBackendNative_setGCExposures;
+	Java_sun_java2d_xr_XRBackendNative_setGCForeground;
+	Java_sun_java2d_xr_XRBackendNative_copyArea;
+	Java_sun_java2d_xr_XRBackendNative_renderComposite;
+	Java_sun_java2d_xr_XRBackendNative_renderRectangle;
+	Java_sun_java2d_xr_XRBackendNative_XRenderRectanglesNative;
+	Java_sun_java2d_xr_XRBackendNative_XRSetTransformNative;
+	Java_sun_java2d_xr_XRBackendNative_XRCreateLinearGradientPaintNative;
+	Java_sun_java2d_xr_XRBackendNative_XRCreateRadialGradientPaintNative;
+	Java_sun_java2d_xr_XRBackendNative_setFilter;
+	Java_sun_java2d_xr_XRBackendNative_XRSetClipNative;
+	Java_sun_java2d_xr_XRBackendNative_putMaskNative;
+	Java_sun_java2d_xr_XRBackendNative_XRAddGlyphsNative;
+	Java_sun_java2d_xr_XRBackendNative_XRFreeGlyphsNative;
+	Java_sun_java2d_xr_XRBackendNative_XRenderCreateGlyphSetNative;
+	Java_sun_java2d_xr_XRBackendNative_XRenderCompositeTextNative;
+	Java_sun_java2d_xr_XRBackendNative_setGCMode;
+	Java_sun_java2d_xr_XRBackendNative_GCRectanglesNative;
+	Java_sun_java2d_xr_XRBackendNative_renderCompositeTrapezoidsNative;
 
         Java_com_sun_java_swing_plaf_gtk_GTKEngine_native_1paint_1arrow;
         Java_com_sun_java_swing_plaf_gtk_GTKEngine_native_1paint_1box;
@@ -397,8 +429,8 @@
         Java_com_sun_java_swing_plaf_gtk_GTKStyle_nativeGetClassValue;
         Java_com_sun_java_swing_plaf_gtk_GTKStyle_nativeGetPangoFontName;
 
-	Java_sun_awt_X11_GtkFileDialogPeer_run;
-	Java_sun_awt_X11_GtkFileDialogPeer_quit;
+        Java_sun_awt_X11_GtkFileDialogPeer_run;
+        Java_sun_awt_X11_GtkFileDialogPeer_quit;
 
 	Java_sun_print_CUPSPrinter_initIDs;
 	Java_sun_print_CUPSPrinter_getCupsServer;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/make/tools/UnicodeData/Scripts.txt	Wed Jul 21 09:57:21 2010 -0700
@@ -0,0 +1,1972 @@
+# Scripts-5.2.0.txt
+# Date: 2009-08-22, 04:58:43 GMT [MD]
+#
+# Unicode Character Database
+# Copyright (c) 1991-2009 Unicode, Inc.
+# For terms of use, see http://www.unicode.org/terms_of_use.html
+# For documentation, see http://www.unicode.org/reports/tr44/
+
+# ================================================
+
+# Property:	Script
+
+#  All code points not explicitly listed for Script
+#  have the value Unknown (Zzzz).
+
+# @missing: 0000..10FFFF; Unknown
+
+# ================================================
+
+0000..001F    ; Common # Cc  [32] <control-0000>..<control-001F>
+0020          ; Common # Zs       SPACE
+0021..0023    ; Common # Po   [3] EXCLAMATION MARK..NUMBER SIGN
+0024          ; Common # Sc       DOLLAR SIGN
+0025..0027    ; Common # Po   [3] PERCENT SIGN..APOSTROPHE
+0028          ; Common # Ps       LEFT PARENTHESIS
+0029          ; Common # Pe       RIGHT PARENTHESIS
+002A          ; Common # Po       ASTERISK
+002B          ; Common # Sm       PLUS SIGN
+002C          ; Common # Po       COMMA
+002D          ; Common # Pd       HYPHEN-MINUS
+002E..002F    ; Common # Po   [2] FULL STOP..SOLIDUS
+0030..0039    ; Common # Nd  [10] DIGIT ZERO..DIGIT NINE
+003A..003B    ; Common # Po   [2] COLON..SEMICOLON
+003C..003E    ; Common # Sm   [3] LESS-THAN SIGN..GREATER-THAN SIGN
+003F..0040    ; Common # Po   [2] QUESTION MARK..COMMERCIAL AT
+005B          ; Common # Ps       LEFT SQUARE BRACKET
+005C          ; Common # Po       REVERSE SOLIDUS
+005D          ; Common # Pe       RIGHT SQUARE BRACKET
+005E          ; Common # Sk       CIRCUMFLEX ACCENT
+005F          ; Common # Pc       LOW LINE
+0060          ; Common # Sk       GRAVE ACCENT
+007B          ; Common # Ps       LEFT CURLY BRACKET
+007C          ; Common # Sm       VERTICAL LINE
+007D          ; Common # Pe       RIGHT CURLY BRACKET
+007E          ; Common # Sm       TILDE
+007F..009F    ; Common # Cc  [33] <control-007F>..<control-009F>
+00A0          ; Common # Zs       NO-BREAK SPACE
+00A1          ; Common # Po       INVERTED EXCLAMATION MARK
+00A2..00A5    ; Common # Sc   [4] CENT SIGN..YEN SIGN
+00A6..00A7    ; Common # So   [2] BROKEN BAR..SECTION SIGN
+00A8          ; Common # Sk       DIAERESIS
+00A9          ; Common # So       COPYRIGHT SIGN
+00AB          ; Common # Pi       LEFT-POINTING DOUBLE ANGLE QUOTATION MARK
+00AC          ; Common # Sm       NOT SIGN
+00AD          ; Common # Cf       SOFT HYPHEN
+00AE          ; Common # So       REGISTERED SIGN
+00AF          ; Common # Sk       MACRON
+00B0          ; Common # So       DEGREE SIGN
+00B1          ; Common # Sm       PLUS-MINUS SIGN
+00B2..00B3    ; Common # No   [2] SUPERSCRIPT TWO..SUPERSCRIPT THREE
+00B4          ; Common # Sk       ACUTE ACCENT
+00B5          ; Common # L&       MICRO SIGN
+00B6          ; Common # So       PILCROW SIGN
+00B7          ; Common # Po       MIDDLE DOT
+00B8          ; Common # Sk       CEDILLA
+00B9          ; Common # No       SUPERSCRIPT ONE
+00BB          ; Common # Pf       RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK
+00BC..00BE    ; Common # No   [3] VULGAR FRACTION ONE QUARTER..VULGAR FRACTION THREE QUARTERS
+00BF          ; Common # Po       INVERTED QUESTION MARK
+00D7          ; Common # Sm       MULTIPLICATION SIGN
+00F7          ; Common # Sm       DIVISION SIGN
+02B9..02C1    ; Common # Lm   [9] MODIFIER LETTER PRIME..MODIFIER LETTER REVERSED GLOTTAL STOP
+02C2..02C5    ; Common # Sk   [4] MODIFIER LETTER LEFT ARROWHEAD..MODIFIER LETTER DOWN ARROWHEAD
+02C6..02D1    ; Common # Lm  [12] MODIFIER LETTER CIRCUMFLEX ACCENT..MODIFIER LETTER HALF TRIANGULAR COLON
+02D2..02DF    ; Common # Sk  [14] MODIFIER LETTER CENTRED RIGHT HALF RING..MODIFIER LETTER CROSS ACCENT
+02E5..02EB    ; Common # Sk   [7] MODIFIER LETTER EXTRA-HIGH TONE BAR..MODIFIER LETTER YANG DEPARTING TONE MARK
+02EC          ; Common # Lm       MODIFIER LETTER VOICING
+02ED          ; Common # Sk       MODIFIER LETTER UNASPIRATED
+02EE          ; Common # Lm       MODIFIER LETTER DOUBLE APOSTROPHE
+02EF..02FF    ; Common # Sk  [17] MODIFIER LETTER LOW DOWN ARROWHEAD..MODIFIER LETTER LOW LEFT ARROW
+0374          ; Common # Lm       GREEK NUMERAL SIGN
+037E          ; Common # Po       GREEK QUESTION MARK
+0385          ; Common # Sk       GREEK DIALYTIKA TONOS
+0387          ; Common # Po       GREEK ANO TELEIA
+0589          ; Common # Po       ARMENIAN FULL STOP
+0600..0603    ; Common # Cf   [4] ARABIC NUMBER SIGN..ARABIC SIGN SAFHA
+060C          ; Common # Po       ARABIC COMMA
+061B          ; Common # Po       ARABIC SEMICOLON
+061F          ; Common # Po       ARABIC QUESTION MARK
+0640          ; Common # Lm       ARABIC TATWEEL
+0660..0669    ; Common # Nd  [10] ARABIC-INDIC DIGIT ZERO..ARABIC-INDIC DIGIT NINE
+06DD          ; Common # Cf       ARABIC END OF AYAH
+0964..0965    ; Common # Po   [2] DEVANAGARI DANDA..DEVANAGARI DOUBLE DANDA
+0970          ; Common # Po       DEVANAGARI ABBREVIATION SIGN
+0CF1..0CF2    ; Common # So   [2] KANNADA SIGN JIHVAMULIYA..KANNADA SIGN UPADHMANIYA
+0E3F          ; Common # Sc       THAI CURRENCY SYMBOL BAHT
+0FD5..0FD8    ; Common # So   [4] RIGHT-FACING SVASTI SIGN..LEFT-FACING SVASTI SIGN WITH DOTS
+10FB          ; Common # Po       GEORGIAN PARAGRAPH SEPARATOR
+16EB..16ED    ; Common # Po   [3] RUNIC SINGLE PUNCTUATION..RUNIC CROSS PUNCTUATION
+1735..1736    ; Common # Po   [2] PHILIPPINE SINGLE PUNCTUATION..PHILIPPINE DOUBLE PUNCTUATION
+1802..1803    ; Common # Po   [2] MONGOLIAN COMMA..MONGOLIAN FULL STOP
+1805          ; Common # Po       MONGOLIAN FOUR DOTS
+1CD3          ; Common # Po       VEDIC SIGN NIHSHVASA
+1CE1          ; Common # Mc       VEDIC TONE ATHARVAVEDIC INDEPENDENT SVARITA
+1CE9..1CEC    ; Common # Lo   [4] VEDIC SIGN ANUSVARA ANTARGOMUKHA..VEDIC SIGN ANUSVARA VAMAGOMUKHA WITH TAIL
+1CEE..1CF1    ; Common # Lo   [4] VEDIC SIGN HEXIFORM LONG ANUSVARA..VEDIC SIGN ANUSVARA UBHAYATO MUKHA
+1CF2          ; Common # Mc       VEDIC SIGN ARDHAVISARGA
+2000..200A    ; Common # Zs  [11] EN QUAD..HAIR SPACE
+200B          ; Common # Cf       ZERO WIDTH SPACE
+200E..200F    ; Common # Cf   [2] LEFT-TO-RIGHT MARK..RIGHT-TO-LEFT MARK
+2010..2015    ; Common # Pd   [6] HYPHEN..HORIZONTAL BAR
+2016..2017    ; Common # Po   [2] DOUBLE VERTICAL LINE..DOUBLE LOW LINE
+2018          ; Common # Pi       LEFT SINGLE QUOTATION MARK
+2019          ; Common # Pf       RIGHT SINGLE QUOTATION MARK
+201A          ; Common # Ps       SINGLE LOW-9 QUOTATION MARK
+201B..201C    ; Common # Pi   [2] SINGLE HIGH-REVERSED-9 QUOTATION MARK..LEFT DOUBLE QUOTATION MARK
+201D          ; Common # Pf       RIGHT DOUBLE QUOTATION MARK
+201E          ; Common # Ps       DOUBLE LOW-9 QUOTATION MARK
+201F          ; Common # Pi       DOUBLE HIGH-REVERSED-9 QUOTATION MARK
+2020..2027    ; Common # Po   [8] DAGGER..HYPHENATION POINT
+2028          ; Common # Zl       LINE SEPARATOR
+2029          ; Common # Zp       PARAGRAPH SEPARATOR
+202A..202E    ; Common # Cf   [5] LEFT-TO-RIGHT EMBEDDING..RIGHT-TO-LEFT OVERRIDE
+202F          ; Common # Zs       NARROW NO-BREAK SPACE
+2030..2038    ; Common # Po   [9] PER MILLE SIGN..CARET
+2039          ; Common # Pi       SINGLE LEFT-POINTING ANGLE QUOTATION MARK
+203A          ; Common # Pf       SINGLE RIGHT-POINTING ANGLE QUOTATION MARK
+203B..203E    ; Common # Po   [4] REFERENCE MARK..OVERLINE
+203F..2040    ; Common # Pc   [2] UNDERTIE..CHARACTER TIE
+2041..2043    ; Common # Po   [3] CARET INSERTION POINT..HYPHEN BULLET
+2044          ; Common # Sm       FRACTION SLASH
+2045          ; Common # Ps       LEFT SQUARE BRACKET WITH QUILL
+2046          ; Common # Pe       RIGHT SQUARE BRACKET WITH QUILL
+2047..2051    ; Common # Po  [11] DOUBLE QUESTION MARK..TWO ASTERISKS ALIGNED VERTICALLY
+2052          ; Common # Sm       COMMERCIAL MINUS SIGN
+2053          ; Common # Po       SWUNG DASH
+2054          ; Common # Pc       INVERTED UNDERTIE
+2055..205E    ; Common # Po  [10] FLOWER PUNCTUATION MARK..VERTICAL FOUR DOTS
+205F          ; Common # Zs       MEDIUM MATHEMATICAL SPACE
+2060..2064    ; Common # Cf   [5] WORD JOINER..INVISIBLE PLUS
+206A..206F    ; Common # Cf   [6] INHIBIT SYMMETRIC SWAPPING..NOMINAL DIGIT SHAPES
+2070          ; Common # No       SUPERSCRIPT ZERO
+2074..2079    ; Common # No   [6] SUPERSCRIPT FOUR..SUPERSCRIPT NINE
+207A..207C    ; Common # Sm   [3] SUPERSCRIPT PLUS SIGN..SUPERSCRIPT EQUALS SIGN
+207D          ; Common # Ps       SUPERSCRIPT LEFT PARENTHESIS
+207E          ; Common # Pe       SUPERSCRIPT RIGHT PARENTHESIS
+2080..2089    ; Common # No  [10] SUBSCRIPT ZERO..SUBSCRIPT NINE
+208A..208C    ; Common # Sm   [3] SUBSCRIPT PLUS SIGN..SUBSCRIPT EQUALS SIGN
+208D          ; Common # Ps       SUBSCRIPT LEFT PARENTHESIS
+208E          ; Common # Pe       SUBSCRIPT RIGHT PARENTHESIS
+20A0..20B8    ; Common # Sc  [25] EURO-CURRENCY SIGN..TENGE SIGN
+2100..2101    ; Common # So   [2] ACCOUNT OF..ADDRESSED TO THE SUBJECT
+2102          ; Common # L&       DOUBLE-STRUCK CAPITAL C
+2103..2106    ; Common # So   [4] DEGREE CELSIUS..CADA UNA
+2107          ; Common # L&       EULER CONSTANT
+2108..2109    ; Common # So   [2] SCRUPLE..DEGREE FAHRENHEIT
+210A..2113    ; Common # L&  [10] SCRIPT SMALL G..SCRIPT SMALL L
+2114          ; Common # So       L B BAR SYMBOL
+2115          ; Common # L&       DOUBLE-STRUCK CAPITAL N
+2116..2118    ; Common # So   [3] NUMERO SIGN..SCRIPT CAPITAL P
+2119..211D    ; Common # L&   [5] DOUBLE-STRUCK CAPITAL P..DOUBLE-STRUCK CAPITAL R
+211E..2123    ; Common # So   [6] PRESCRIPTION TAKE..VERSICLE
+2124          ; Common # L&       DOUBLE-STRUCK CAPITAL Z
+2125          ; Common # So       OUNCE SIGN
+2127          ; Common # So       INVERTED OHM SIGN
+2128          ; Common # L&       BLACK-LETTER CAPITAL Z
+2129          ; Common # So       TURNED GREEK SMALL LETTER IOTA
+212C..212D    ; Common # L&   [2] SCRIPT CAPITAL B..BLACK-LETTER CAPITAL C
+212E          ; Common # So       ESTIMATED SYMBOL
+212F..2131    ; Common # L&   [3] SCRIPT SMALL E..SCRIPT CAPITAL F
+2133..2134    ; Common # L&   [2] SCRIPT CAPITAL M..SCRIPT SMALL O
+2135..2138    ; Common # Lo   [4] ALEF SYMBOL..DALET SYMBOL
+2139          ; Common # L&       INFORMATION SOURCE
+213A..213B    ; Common # So   [2] ROTATED CAPITAL Q..FACSIMILE SIGN
+213C..213F    ; Common # L&   [4] DOUBLE-STRUCK SMALL PI..DOUBLE-STRUCK CAPITAL PI
+2140..2144    ; Common # Sm   [5] DOUBLE-STRUCK N-ARY SUMMATION..TURNED SANS-SERIF CAPITAL Y
+2145..2149    ; Common # L&   [5] DOUBLE-STRUCK ITALIC CAPITAL D..DOUBLE-STRUCK ITALIC SMALL J
+214A          ; Common # So       PROPERTY LINE
+214B          ; Common # Sm       TURNED AMPERSAND
+214C..214D    ; Common # So   [2] PER SIGN..AKTIESELSKAB
+214F          ; Common # So       SYMBOL FOR SAMARITAN SOURCE
+2150..215F    ; Common # No  [16] VULGAR FRACTION ONE SEVENTH..FRACTION NUMERATOR ONE
+2189          ; Common # No       VULGAR FRACTION ZERO THIRDS
+2190..2194    ; Common # Sm   [5] LEFTWARDS ARROW..LEFT RIGHT ARROW
+2195..2199    ; Common # So   [5] UP DOWN ARROW..SOUTH WEST ARROW
+219A..219B    ; Common # Sm   [2] LEFTWARDS ARROW WITH STROKE..RIGHTWARDS ARROW WITH STROKE
+219C..219F    ; Common # So   [4] LEFTWARDS WAVE ARROW..UPWARDS TWO HEADED ARROW
+21A0          ; Common # Sm       RIGHTWARDS TWO HEADED ARROW
+21A1..21A2    ; Common # So   [2] DOWNWARDS TWO HEADED ARROW..LEFTWARDS ARROW WITH TAIL
+21A3          ; Common # Sm       RIGHTWARDS ARROW WITH TAIL
+21A4..21A5    ; Common # So   [2] LEFTWARDS ARROW FROM BAR..UPWARDS ARROW FROM BAR
+21A6          ; Common # Sm       RIGHTWARDS ARROW FROM BAR
+21A7..21AD    ; Common # So   [7] DOWNWARDS ARROW FROM BAR..LEFT RIGHT WAVE ARROW
+21AE          ; Common # Sm       LEFT RIGHT ARROW WITH STROKE
+21AF..21CD    ; Common # So  [31] DOWNWARDS ZIGZAG ARROW..LEFTWARDS DOUBLE ARROW WITH STROKE
+21CE..21CF    ; Common # Sm   [2] LEFT RIGHT DOUBLE ARROW WITH STROKE..RIGHTWARDS DOUBLE ARROW WITH STROKE
+21D0..21D1    ; Common # So   [2] LEFTWARDS DOUBLE ARROW..UPWARDS DOUBLE ARROW
+21D2          ; Common # Sm       RIGHTWARDS DOUBLE ARROW
+21D3          ; Common # So       DOWNWARDS DOUBLE ARROW
+21D4          ; Common # Sm       LEFT RIGHT DOUBLE ARROW
+21D5..21F3    ; Common # So  [31] UP DOWN DOUBLE ARROW..UP DOWN WHITE ARROW
+21F4..22FF    ; Common # Sm [268] RIGHT ARROW WITH SMALL CIRCLE..Z NOTATION BAG MEMBERSHIP
+2300..2307    ; Common # So   [8] DIAMETER SIGN..WAVY LINE
+2308..230B    ; Common # Sm   [4] LEFT CEILING..RIGHT FLOOR
+230C..231F    ; Common # So  [20] BOTTOM RIGHT CROP..BOTTOM RIGHT CORNER
+2320..2321    ; Common # Sm   [2] TOP HALF INTEGRAL..BOTTOM HALF INTEGRAL
+2322..2328    ; Common # So   [7] FROWN..KEYBOARD
+2329          ; Common # Ps       LEFT-POINTING ANGLE BRACKET
+232A          ; Common # Pe       RIGHT-POINTING ANGLE BRACKET
+232B..237B    ; Common # So  [81] ERASE TO THE LEFT..NOT CHECK MARK
+237C          ; Common # Sm       RIGHT ANGLE WITH DOWNWARDS ZIGZAG ARROW
+237D..239A    ; Common # So  [30] SHOULDERED OPEN BOX..CLEAR SCREEN SYMBOL
+239B..23B3    ; Common # Sm  [25] LEFT PARENTHESIS UPPER HOOK..SUMMATION BOTTOM
+23B4..23DB    ; Common # So  [40] TOP SQUARE BRACKET..FUSE
+23DC..23E1    ; Common # Sm   [6] TOP PARENTHESIS..BOTTOM TORTOISE SHELL BRACKET
+23E2..23E8    ; Common # So   [7] WHITE TRAPEZIUM..DECIMAL EXPONENT SYMBOL
+2400..2426    ; Common # So  [39] SYMBOL FOR NULL..SYMBOL FOR SUBSTITUTE FORM TWO
+2440..244A    ; Common # So  [11] OCR HOOK..OCR DOUBLE BACKSLASH
+2460..249B    ; Common # No  [60] CIRCLED DIGIT ONE..NUMBER TWENTY FULL STOP
+249C..24E9    ; Common # So  [78] PARENTHESIZED LATIN SMALL LETTER A..CIRCLED LATIN SMALL LETTER Z
+24EA..24FF    ; Common # No  [22] CIRCLED DIGIT ZERO..NEGATIVE CIRCLED DIGIT ZERO
+2500..25B6    ; Common # So [183] BOX DRAWINGS LIGHT HORIZONTAL..BLACK RIGHT-POINTING TRIANGLE
+25B7          ; Common # Sm       WHITE RIGHT-POINTING TRIANGLE
+25B8..25C0    ; Common # So   [9] BLACK RIGHT-POINTING SMALL TRIANGLE..BLACK LEFT-POINTING TRIANGLE
+25C1          ; Common # Sm       WHITE LEFT-POINTING TRIANGLE
+25C2..25F7    ; Common # So  [54] BLACK LEFT-POINTING SMALL TRIANGLE..WHITE CIRCLE WITH UPPER RIGHT QUADRANT
+25F8..25FF    ; Common # Sm   [8] UPPER LEFT TRIANGLE..LOWER RIGHT TRIANGLE
+2600..266E    ; Common # So [111] BLACK SUN WITH RAYS..MUSIC NATURAL SIGN
+266F          ; Common # Sm       MUSIC SHARP SIGN
+2670..26CD    ; Common # So  [94] WEST SYRIAC CROSS..DISABLED CAR
+26CF..26E1    ; Common # So  [19] PICK..RESTRICTED LEFT ENTRY-2
+26E3          ; Common # So       HEAVY CIRCLE WITH STROKE AND TWO DOTS ABOVE
+26E8..26FF    ; Common # So  [24] BLACK CROSS ON SHIELD..WHITE FLAG WITH HORIZONTAL MIDDLE BLACK STRIPE
+2701..2704    ; Common # So   [4] UPPER BLADE SCISSORS..WHITE SCISSORS
+2706..2709    ; Common # So   [4] TELEPHONE LOCATION SIGN..ENVELOPE
+270C..2727    ; Common # So  [28] VICTORY HAND..WHITE FOUR POINTED STAR
+2729..274B    ; Common # So  [35] STRESS OUTLINED WHITE STAR..HEAVY EIGHT TEARDROP-SPOKED PROPELLER ASTERISK
+274D          ; Common # So       SHADOWED WHITE CIRCLE
+274F..2752    ; Common # So   [4] LOWER RIGHT DROP-SHADOWED WHITE SQUARE..UPPER RIGHT SHADOWED WHITE SQUARE
+2756..275E    ; Common # So   [9] BLACK DIAMOND MINUS WHITE X..HEAVY DOUBLE COMMA QUOTATION MARK ORNAMENT
+2761..2767    ; Common # So   [7] CURVED STEM PARAGRAPH SIGN ORNAMENT..ROTATED FLORAL HEART BULLET
+2768          ; Common # Ps       MEDIUM LEFT PARENTHESIS ORNAMENT
+2769          ; Common # Pe       MEDIUM RIGHT PARENTHESIS ORNAMENT
+276A          ; Common # Ps       MEDIUM FLATTENED LEFT PARENTHESIS ORNAMENT
+276B          ; Common # Pe       MEDIUM FLATTENED RIGHT PARENTHESIS ORNAMENT
+276C          ; Common # Ps       MEDIUM LEFT-POINTING ANGLE BRACKET ORNAMENT
+276D          ; Common # Pe       MEDIUM RIGHT-POINTING ANGLE BRACKET ORNAMENT
+276E          ; Common # Ps       HEAVY LEFT-POINTING ANGLE QUOTATION MARK ORNAMENT
+276F          ; Common # Pe       HEAVY RIGHT-POINTING ANGLE QUOTATION MARK ORNAMENT
+2770          ; Common # Ps       HEAVY LEFT-POINTING ANGLE BRACKET ORNAMENT
+2771          ; Common # Pe       HEAVY RIGHT-POINTING ANGLE BRACKET ORNAMENT
+2772          ; Common # Ps       LIGHT LEFT TORTOISE SHELL BRACKET ORNAMENT
+2773          ; Common # Pe       LIGHT RIGHT TORTOISE SHELL BRACKET ORNAMENT
+2774          ; Common # Ps       MEDIUM LEFT CURLY BRACKET ORNAMENT
+2775          ; Common # Pe       MEDIUM RIGHT CURLY BRACKET ORNAMENT
+2776..2793    ; Common # No  [30] DINGBAT NEGATIVE CIRCLED DIGIT ONE..DINGBAT NEGATIVE CIRCLED SANS-SERIF NUMBER TEN
+2794          ; Common # So       HEAVY WIDE-HEADED RIGHTWARDS ARROW
+2798..27AF    ; Common # So  [24] HEAVY SOUTH EAST ARROW..NOTCHED LOWER RIGHT-SHADOWED WHITE RIGHTWARDS ARROW
+27B1..27BE    ; Common # So  [14] NOTCHED UPPER RIGHT-SHADOWED WHITE RIGHTWARDS ARROW..OPEN-OUTLINED RIGHTWARDS ARROW
+27C0..27C4    ; Common # Sm   [5] THREE DIMENSIONAL ANGLE..OPEN SUPERSET
+27C5          ; Common # Ps       LEFT S-SHAPED BAG DELIMITER
+27C6          ; Common # Pe       RIGHT S-SHAPED BAG DELIMITER
+27C7..27CA    ; Common # Sm   [4] OR WITH DOT INSIDE..VERTICAL BAR WITH HORIZONTAL STROKE
+27CC          ; Common # Sm       LONG DIVISION
+27D0..27E5    ; Common # Sm  [22] WHITE DIAMOND WITH CENTRED DOT..WHITE SQUARE WITH RIGHTWARDS TICK
+27E6          ; Common # Ps       MATHEMATICAL LEFT WHITE SQUARE BRACKET
+27E7          ; Common # Pe       MATHEMATICAL RIGHT WHITE SQUARE BRACKET
+27E8          ; Common # Ps       MATHEMATICAL LEFT ANGLE BRACKET
+27E9          ; Common # Pe       MATHEMATICAL RIGHT ANGLE BRACKET
+27EA          ; Common # Ps       MATHEMATICAL LEFT DOUBLE ANGLE BRACKET
+27EB          ; Common # Pe       MATHEMATICAL RIGHT DOUBLE ANGLE BRACKET
+27EC          ; Common # Ps       MATHEMATICAL LEFT WHITE TORTOISE SHELL BRACKET
+27ED          ; Common # Pe       MATHEMATICAL RIGHT WHITE TORTOISE SHELL BRACKET
+27EE          ; Common # Ps       MATHEMATICAL LEFT FLATTENED PARENTHESIS
+27EF          ; Common # Pe       MATHEMATICAL RIGHT FLATTENED PARENTHESIS
+27F0..27FF    ; Common # Sm  [16] UPWARDS QUADRUPLE ARROW..LONG RIGHTWARDS SQUIGGLE ARROW
+2900..2982    ; Common # Sm [131] RIGHTWARDS TWO-HEADED ARROW WITH VERTICAL STROKE..Z NOTATION TYPE COLON
+2983          ; Common # Ps       LEFT WHITE CURLY BRACKET
+2984          ; Common # Pe       RIGHT WHITE CURLY BRACKET
+2985          ; Common # Ps       LEFT WHITE PARENTHESIS
+2986          ; Common # Pe       RIGHT WHITE PARENTHESIS
+2987          ; Common # Ps       Z NOTATION LEFT IMAGE BRACKET
+2988          ; Common # Pe       Z NOTATION RIGHT IMAGE BRACKET
+2989          ; Common # Ps       Z NOTATION LEFT BINDING BRACKET
+298A          ; Common # Pe       Z NOTATION RIGHT BINDING BRACKET
+298B          ; Common # Ps       LEFT SQUARE BRACKET WITH UNDERBAR
+298C          ; Common # Pe       RIGHT SQUARE BRACKET WITH UNDERBAR
+298D          ; Common # Ps       LEFT SQUARE BRACKET WITH TICK IN TOP CORNER
+298E          ; Common # Pe       RIGHT SQUARE BRACKET WITH TICK IN BOTTOM CORNER
+298F          ; Common # Ps       LEFT SQUARE BRACKET WITH TICK IN BOTTOM CORNER
+2990          ; Common # Pe       RIGHT SQUARE BRACKET WITH TICK IN TOP CORNER
+2991          ; Common # Ps       LEFT ANGLE BRACKET WITH DOT
+2992          ; Common # Pe       RIGHT ANGLE BRACKET WITH DOT
+2993          ; Common # Ps       LEFT ARC LESS-THAN BRACKET
+2994          ; Common # Pe       RIGHT ARC GREATER-THAN BRACKET
+2995          ; Common # Ps       DOUBLE LEFT ARC GREATER-THAN BRACKET
+2996          ; Common # Pe       DOUBLE RIGHT ARC LESS-THAN BRACKET
+2997          ; Common # Ps       LEFT BLACK TORTOISE SHELL BRACKET
+2998          ; Common # Pe       RIGHT BLACK TORTOISE SHELL BRACKET
+2999..29D7    ; Common # Sm  [63] DOTTED FENCE..BLACK HOURGLASS
+29D8          ; Common # Ps       LEFT WIGGLY FENCE
+29D9          ; Common # Pe       RIGHT WIGGLY FENCE
+29DA          ; Common # Ps       LEFT DOUBLE WIGGLY FENCE
+29DB          ; Common # Pe       RIGHT DOUBLE WIGGLY FENCE
+29DC..29FB    ; Common # Sm  [32] INCOMPLETE INFINITY..TRIPLE PLUS
+29FC          ; Common # Ps       LEFT-POINTING CURVED ANGLE BRACKET
+29FD          ; Common # Pe       RIGHT-POINTING CURVED ANGLE BRACKET
+29FE..2AFF    ; Common # Sm [258] TINY..N-ARY WHITE VERTICAL BAR
+2B00..2B2F    ; Common # So  [48] NORTH EAST WHITE ARROW..WHITE VERTICAL ELLIPSE
+2B30..2B44    ; Common # Sm  [21] LEFT ARROW WITH SMALL CIRCLE..RIGHTWARDS ARROW THROUGH SUPERSET
+2B45..2B46    ; Common # So   [2] LEFTWARDS QUADRUPLE ARROW..RIGHTWARDS QUADRUPLE ARROW
+2B47..2B4C    ; Common # Sm   [6] REVERSE TILDE OPERATOR ABOVE RIGHTWARDS ARROW..RIGHTWARDS ARROW ABOVE REVERSE TILDE OPERATOR
+2B50..2B59    ; Common # So  [10] WHITE MEDIUM STAR..HEAVY CIRCLED SALTIRE
+2E00..2E01    ; Common # Po   [2] RIGHT ANGLE SUBSTITUTION MARKER..RIGHT ANGLE DOTTED SUBSTITUTION MARKER
+2E02          ; Common # Pi       LEFT SUBSTITUTION BRACKET
+2E03          ; Common # Pf       RIGHT SUBSTITUTION BRACKET
+2E04          ; Common # Pi       LEFT DOTTED SUBSTITUTION BRACKET
+2E05          ; Common # Pf       RIGHT DOTTED SUBSTITUTION BRACKET
+2E06..2E08    ; Common # Po   [3] RAISED INTERPOLATION MARKER..DOTTED TRANSPOSITION MARKER
+2E09          ; Common # Pi       LEFT TRANSPOSITION BRACKET
+2E0A          ; Common # Pf       RIGHT TRANSPOSITION BRACKET
+2E0B          ; Common # Po       RAISED SQUARE
+2E0C          ; Common # Pi       LEFT RAISED OMISSION BRACKET
+2E0D          ; Common # Pf       RIGHT RAISED OMISSION BRACKET
+2E0E..2E16    ; Common # Po   [9] EDITORIAL CORONIS..DOTTED RIGHT-POINTING ANGLE
+2E17          ; Common # Pd       DOUBLE OBLIQUE HYPHEN
+2E18..2E19    ; Common # Po   [2] INVERTED INTERROBANG..PALM BRANCH
+2E1A          ; Common # Pd       HYPHEN WITH DIAERESIS
+2E1B          ; Common # Po       TILDE WITH RING ABOVE
+2E1C          ; Common # Pi       LEFT LOW PARAPHRASE BRACKET
+2E1D          ; Common # Pf       RIGHT LOW PARAPHRASE BRACKET
+2E1E..2E1F    ; Common # Po   [2] TILDE WITH DOT ABOVE..TILDE WITH DOT BELOW
+2E20          ; Common # Pi       LEFT VERTICAL BAR WITH QUILL
+2E21          ; Common # Pf       RIGHT VERTICAL BAR WITH QUILL
+2E22          ; Common # Ps       TOP LEFT HALF BRACKET
+2E23          ; Common # Pe       TOP RIGHT HALF BRACKET
+2E24          ; Common # Ps       BOTTOM LEFT HALF BRACKET
+2E25          ; Common # Pe       BOTTOM RIGHT HALF BRACKET
+2E26          ; Common # Ps       LEFT SIDEWAYS U BRACKET
+2E27          ; Common # Pe       RIGHT SIDEWAYS U BRACKET
+2E28          ; Common # Ps       LEFT DOUBLE PARENTHESIS
+2E29          ; Common # Pe       RIGHT DOUBLE PARENTHESIS
+2E2A..2E2E    ; Common # Po   [5] TWO DOTS OVER ONE DOT PUNCTUATION..REVERSED QUESTION MARK
+2E2F          ; Common # Lm       VERTICAL TILDE
+2E30..2E31    ; Common # Po   [2] RING POINT..WORD SEPARATOR MIDDLE DOT
+2FF0..2FFB    ; Common # So  [12] IDEOGRAPHIC DESCRIPTION CHARACTER LEFT TO RIGHT..IDEOGRAPHIC DESCRIPTION CHARACTER OVERLAID
+3000          ; Common # Zs       IDEOGRAPHIC SPACE
+3001..3003    ; Common # Po   [3] IDEOGRAPHIC COMMA..DITTO MARK
+3004          ; Common # So       JAPANESE INDUSTRIAL STANDARD SYMBOL
+3006          ; Common # Lo       IDEOGRAPHIC CLOSING MARK
+3008          ; Common # Ps       LEFT ANGLE BRACKET
+3009          ; Common # Pe       RIGHT ANGLE BRACKET
+300A          ; Common # Ps       LEFT DOUBLE ANGLE BRACKET
+300B          ; Common # Pe       RIGHT DOUBLE ANGLE BRACKET
+300C          ; Common # Ps       LEFT CORNER BRACKET
+300D          ; Common # Pe       RIGHT CORNER BRACKET
+300E          ; Common # Ps       LEFT WHITE CORNER BRACKET
+300F          ; Common # Pe       RIGHT WHITE CORNER BRACKET
+3010          ; Common # Ps       LEFT BLACK LENTICULAR BRACKET
+3011          ; Common # Pe       RIGHT BLACK LENTICULAR BRACKET
+3012..3013    ; Common # So   [2] POSTAL MARK..GETA MARK
+3014          ; Common # Ps       LEFT TORTOISE SHELL BRACKET
+3015          ; Common # Pe       RIGHT TORTOISE SHELL BRACKET
+3016          ; Common # Ps       LEFT WHITE LENTICULAR BRACKET
+3017          ; Common # Pe       RIGHT WHITE LENTICULAR BRACKET
+3018          ; Common # Ps       LEFT WHITE TORTOISE SHELL BRACKET
+3019          ; Common # Pe       RIGHT WHITE TORTOISE SHELL BRACKET
+301A          ; Common # Ps       LEFT WHITE SQUARE BRACKET
+301B          ; Common # Pe       RIGHT WHITE SQUARE BRACKET
+301C          ; Common # Pd       WAVE DASH
+301D          ; Common # Ps       REVERSED DOUBLE PRIME QUOTATION MARK
+301E..301F    ; Common # Pe   [2] DOUBLE PRIME QUOTATION MARK..LOW DOUBLE PRIME QUOTATION MARK
+3020          ; Common # So       POSTAL MARK FACE
+3030          ; Common # Pd       WAVY DASH
+3031..3035    ; Common # Lm   [5] VERTICAL KANA REPEAT MARK..VERTICAL KANA REPEAT MARK LOWER HALF
+3036..3037    ; Common # So   [2] CIRCLED POSTAL MARK..IDEOGRAPHIC TELEGRAPH LINE FEED SEPARATOR SYMBOL
+303C          ; Common # Lo       MASU MARK
+303D          ; Common # Po       PART ALTERNATION MARK
+303E..303F    ; Common # So   [2] IDEOGRAPHIC VARIATION INDICATOR..IDEOGRAPHIC HALF FILL SPACE
+309B..309C    ; Common # Sk   [2] KATAKANA-HIRAGANA VOICED SOUND MARK..KATAKANA-HIRAGANA SEMI-VOICED SOUND MARK
+30A0          ; Common # Pd       KATAKANA-HIRAGANA DOUBLE HYPHEN
+30FB          ; Common # Po       KATAKANA MIDDLE DOT
+30FC          ; Common # Lm       KATAKANA-HIRAGANA PROLONGED SOUND MARK
+3190..3191    ; Common # So   [2] IDEOGRAPHIC ANNOTATION LINKING MARK..IDEOGRAPHIC ANNOTATION REVERSE MARK
+3192..3195    ; Common # No   [4] IDEOGRAPHIC ANNOTATION ONE MARK..IDEOGRAPHIC ANNOTATION FOUR MARK
+3196..319F    ; Common # So  [10] IDEOGRAPHIC ANNOTATION TOP MARK..IDEOGRAPHIC ANNOTATION MAN MARK
+31C0..31E3    ; Common # So  [36] CJK STROKE T..CJK STROKE Q
+3220..3229    ; Common # No  [10] PARENTHESIZED IDEOGRAPH ONE..PARENTHESIZED IDEOGRAPH TEN
+322A..3250    ; Common # So  [39] PARENTHESIZED IDEOGRAPH MOON..PARTNERSHIP SIGN
+3251..325F    ; Common # No  [15] CIRCLED NUMBER TWENTY ONE..CIRCLED NUMBER THIRTY FIVE
+327F          ; Common # So       KOREAN STANDARD SYMBOL
+3280..3289    ; Common # No  [10] CIRCLED IDEOGRAPH ONE..CIRCLED IDEOGRAPH TEN
+328A..32B0    ; Common # So  [39] CIRCLED IDEOGRAPH MOON..CIRCLED IDEOGRAPH NIGHT
+32B1..32BF    ; Common # No  [15] CIRCLED NUMBER THIRTY SIX..CIRCLED NUMBER FIFTY
+32C0..32CF    ; Common # So  [16] IDEOGRAPHIC TELEGRAPH SYMBOL FOR JANUARY..LIMITED LIABILITY SIGN
+3358..33FF    ; Common # So [168] IDEOGRAPHIC TELEGRAPH SYMBOL FOR HOUR ZERO..SQUARE GAL
+4DC0..4DFF    ; Common # So  [64] HEXAGRAM FOR THE CREATIVE HEAVEN..HEXAGRAM FOR BEFORE COMPLETION
+A700..A716    ; Common # Sk  [23] MODIFIER LETTER CHINESE TONE YIN PING..MODIFIER LETTER EXTRA-LOW LEFT-STEM TONE BAR
+A717..A71F    ; Common # Lm   [9] MODIFIER LETTER DOT VERTICAL BAR..MODIFIER LETTER LOW INVERTED EXCLAMATION MARK
+A720..A721    ; Common # Sk   [2] MODIFIER LETTER STRESS AND HIGH TONE..MODIFIER LETTER STRESS AND LOW TONE
+A788          ; Common # Lm       MODIFIER LETTER LOW CIRCUMFLEX ACCENT
+A789..A78A    ; Common # Sk   [2] MODIFIER LETTER COLON..MODIFIER LETTER SHORT EQUALS SIGN
+A830..A835    ; Common # No   [6] NORTH INDIC FRACTION ONE QUARTER..NORTH INDIC FRACTION THREE SIXTEENTHS
+A836..A837    ; Common # So   [2] NORTH INDIC QUARTER MARK..NORTH INDIC PLACEHOLDER MARK
+A838          ; Common # Sc       NORTH INDIC RUPEE MARK
+A839          ; Common # So       NORTH INDIC QUANTITY MARK
+FD3E          ; Common # Ps       ORNATE LEFT PARENTHESIS
+FD3F          ; Common # Pe       ORNATE RIGHT PARENTHESIS
+FDFD          ; Common # So       ARABIC LIGATURE BISMILLAH AR-RAHMAN AR-RAHEEM
+FE10..FE16    ; Common # Po   [7] PRESENTATION FORM FOR VERTICAL COMMA..PRESENTATION FORM FOR VERTICAL QUESTION MARK
+FE17          ; Common # Ps       PRESENTATION FORM FOR VERTICAL LEFT WHITE LENTICULAR BRACKET
+FE18          ; Common # Pe       PRESENTATION FORM FOR VERTICAL RIGHT WHITE LENTICULAR BRAKCET
+FE19          ; Common # Po       PRESENTATION FORM FOR VERTICAL HORIZONTAL ELLIPSIS
+FE30          ; Common # Po       PRESENTATION FORM FOR VERTICAL TWO DOT LEADER
+FE31..FE32    ; Common # Pd   [2] PRESENTATION FORM FOR VERTICAL EM DASH..PRESENTATION FORM FOR VERTICAL EN DASH
+FE33..FE34    ; Common # Pc   [2] PRESENTATION FORM FOR VERTICAL LOW LINE..PRESENTATION FORM FOR VERTICAL WAVY LOW LINE
+FE35          ; Common # Ps       PRESENTATION FORM FOR VERTICAL LEFT PARENTHESIS
+FE36          ; Common # Pe       PRESENTATION FORM FOR VERTICAL RIGHT PARENTHESIS
+FE37          ; Common # Ps       PRESENTATION FORM FOR VERTICAL LEFT CURLY BRACKET
+FE38          ; Common # Pe       PRESENTATION FORM FOR VERTICAL RIGHT CURLY BRACKET
+FE39          ; Common # Ps       PRESENTATION FORM FOR VERTICAL LEFT TORTOISE SHELL BRACKET
+FE3A          ; Common # Pe       PRESENTATION FORM FOR VERTICAL RIGHT TORTOISE SHELL BRACKET
+FE3B          ; Common # Ps       PRESENTATION FORM FOR VERTICAL LEFT BLACK LENTICULAR BRACKET
+FE3C          ; Common # Pe       PRESENTATION FORM FOR VERTICAL RIGHT BLACK LENTICULAR BRACKET
+FE3D          ; Common # Ps       PRESENTATION FORM FOR VERTICAL LEFT DOUBLE ANGLE BRACKET
+FE3E          ; Common # Pe       PRESENTATION FORM FOR VERTICAL RIGHT DOUBLE ANGLE BRACKET
+FE3F          ; Common # Ps       PRESENTATION FORM FOR VERTICAL LEFT ANGLE BRACKET
+FE40          ; Common # Pe       PRESENTATION FORM FOR VERTICAL RIGHT ANGLE BRACKET
+FE41          ; Common # Ps       PRESENTATION FORM FOR VERTICAL LEFT CORNER BRACKET
+FE42          ; Common # Pe       PRESENTATION FORM FOR VERTICAL RIGHT CORNER BRACKET
+FE43          ; Common # Ps       PRESENTATION FORM FOR VERTICAL LEFT WHITE CORNER BRACKET
+FE44          ; Common # Pe       PRESENTATION FORM FOR VERTICAL RIGHT WHITE CORNER BRACKET
+FE45..FE46    ; Common # Po   [2] SESAME DOT..WHITE SESAME DOT
+FE47          ; Common # Ps       PRESENTATION FORM FOR VERTICAL LEFT SQUARE BRACKET
+FE48          ; Common # Pe       PRESENTATION FORM FOR VERTICAL RIGHT SQUARE BRACKET
+FE49..FE4C    ; Common # Po   [4] DASHED OVERLINE..DOUBLE WAVY OVERLINE
+FE4D..FE4F    ; Common # Pc   [3] DASHED LOW LINE..WAVY LOW LINE
+FE50..FE52    ; Common # Po   [3] SMALL COMMA..SMALL FULL STOP
+FE54..FE57    ; Common # Po   [4] SMALL SEMICOLON..SMALL EXCLAMATION MARK
+FE58          ; Common # Pd       SMALL EM DASH
+FE59          ; Common # Ps       SMALL LEFT PARENTHESIS
+FE5A          ; Common # Pe       SMALL RIGHT PARENTHESIS
+FE5B          ; Common # Ps       SMALL LEFT CURLY BRACKET
+FE5C          ; Common # Pe       SMALL RIGHT CURLY BRACKET
+FE5D          ; Common # Ps       SMALL LEFT TORTOISE SHELL BRACKET
+FE5E          ; Common # Pe       SMALL RIGHT TORTOISE SHELL BRACKET
+FE5F..FE61    ; Common # Po   [3] SMALL NUMBER SIGN..SMALL ASTERISK
+FE62          ; Common # Sm       SMALL PLUS SIGN
+FE63          ; Common # Pd       SMALL HYPHEN-MINUS
+FE64..FE66    ; Common # Sm   [3] SMALL LESS-THAN SIGN..SMALL EQUALS SIGN
+FE68          ; Common # Po       SMALL REVERSE SOLIDUS
+FE69          ; Common # Sc       SMALL DOLLAR SIGN
+FE6A..FE6B    ; Common # Po   [2] SMALL PERCENT SIGN..SMALL COMMERCIAL AT
+FEFF          ; Common # Cf       ZERO WIDTH NO-BREAK SPACE
+FF01..FF03    ; Common # Po   [3] FULLWIDTH EXCLAMATION MARK..FULLWIDTH NUMBER SIGN
+FF04          ; Common # Sc       FULLWIDTH DOLLAR SIGN
+FF05..FF07    ; Common # Po   [3] FULLWIDTH PERCENT SIGN..FULLWIDTH APOSTROPHE
+FF08          ; Common # Ps       FULLWIDTH LEFT PARENTHESIS
+FF09          ; Common # Pe       FULLWIDTH RIGHT PARENTHESIS
+FF0A          ; Common # Po       FULLWIDTH ASTERISK
+FF0B          ; Common # Sm       FULLWIDTH PLUS SIGN
+FF0C          ; Common # Po       FULLWIDTH COMMA
+FF0D          ; Common # Pd       FULLWIDTH HYPHEN-MINUS
+FF0E..FF0F    ; Common # Po   [2] FULLWIDTH FULL STOP..FULLWIDTH SOLIDUS
+FF10..FF19    ; Common # Nd  [10] FULLWIDTH DIGIT ZERO..FULLWIDTH DIGIT NINE
+FF1A..FF1B    ; Common # Po   [2] FULLWIDTH COLON..FULLWIDTH SEMICOLON
+FF1C..FF1E    ; Common # Sm   [3] FULLWIDTH LESS-THAN SIGN..FULLWIDTH GREATER-THAN SIGN
+FF1F..FF20    ; Common # Po   [2] FULLWIDTH QUESTION MARK..FULLWIDTH COMMERCIAL AT
+FF3B          ; Common # Ps       FULLWIDTH LEFT SQUARE BRACKET
+FF3C          ; Common # Po       FULLWIDTH REVERSE SOLIDUS
+FF3D          ; Common # Pe       FULLWIDTH RIGHT SQUARE BRACKET
+FF3E          ; Common # Sk       FULLWIDTH CIRCUMFLEX ACCENT
+FF3F          ; Common # Pc       FULLWIDTH LOW LINE
+FF40          ; Common # Sk       FULLWIDTH GRAVE ACCENT
+FF5B          ; Common # Ps       FULLWIDTH LEFT CURLY BRACKET
+FF5C          ; Common # Sm       FULLWIDTH VERTICAL LINE
+FF5D          ; Common # Pe       FULLWIDTH RIGHT CURLY BRACKET
+FF5E          ; Common # Sm       FULLWIDTH TILDE
+FF5F          ; Common # Ps       FULLWIDTH LEFT WHITE PARENTHESIS
+FF60          ; Common # Pe       FULLWIDTH RIGHT WHITE PARENTHESIS
+FF61          ; Common # Po       HALFWIDTH IDEOGRAPHIC FULL STOP
+FF62          ; Common # Ps       HALFWIDTH LEFT CORNER BRACKET
+FF63          ; Common # Pe       HALFWIDTH RIGHT CORNER BRACKET
+FF64..FF65    ; Common # Po   [2] HALFWIDTH IDEOGRAPHIC COMMA..HALFWIDTH KATAKANA MIDDLE DOT
+FF70          ; Common # Lm       HALFWIDTH KATAKANA-HIRAGANA PROLONGED SOUND MARK
+FF9E..FF9F    ; Common # Lm   [2] HALFWIDTH KATAKANA VOICED SOUND MARK..HALFWIDTH KATAKANA SEMI-VOICED SOUND MARK
+FFE0..FFE1    ; Common # Sc   [2] FULLWIDTH CENT SIGN..FULLWIDTH POUND SIGN
+FFE2          ; Common # Sm       FULLWIDTH NOT SIGN
+FFE3          ; Common # Sk       FULLWIDTH MACRON
+FFE4          ; Common # So       FULLWIDTH BROKEN BAR
+FFE5..FFE6    ; Common # Sc   [2] FULLWIDTH YEN SIGN..FULLWIDTH WON SIGN
+FFE8          ; Common # So       HALFWIDTH FORMS LIGHT VERTICAL
+FFE9..FFEC    ; Common # Sm   [4] HALFWIDTH LEFTWARDS ARROW..HALFWIDTH DOWNWARDS ARROW
+FFED..FFEE    ; Common # So   [2] HALFWIDTH BLACK SQUARE..HALFWIDTH WHITE CIRCLE
+FFF9..FFFB    ; Common # Cf   [3] INTERLINEAR ANNOTATION ANCHOR..INTERLINEAR ANNOTATION TERMINATOR
+FFFC..FFFD    ; Common # So   [2] OBJECT REPLACEMENT CHARACTER..REPLACEMENT CHARACTER
+10100..10101  ; Common # Po   [2] AEGEAN WORD SEPARATOR LINE..AEGEAN WORD SEPARATOR DOT
+10102         ; Common # So       AEGEAN CHECK MARK
+10107..10133  ; Common # No  [45] AEGEAN NUMBER ONE..AEGEAN NUMBER NINETY THOUSAND
+10137..1013F  ; Common # So   [9] AEGEAN WEIGHT BASE UNIT..AEGEAN MEASURE THIRD SUBUNIT
+10190..1019B  ; Common # So  [12] ROMAN SEXTANS SIGN..ROMAN CENTURIAL SIGN
+101D0..101FC  ; Common # So  [45] PHAISTOS DISC SIGN PEDESTRIAN..PHAISTOS DISC SIGN WAVY BAND
+1D000..1D0F5  ; Common # So [246] BYZANTINE MUSICAL SYMBOL PSILI..BYZANTINE MUSICAL SYMBOL GORGON NEO KATO
+1D100..1D126  ; Common # So  [39] MUSICAL SYMBOL SINGLE BARLINE..MUSICAL SYMBOL DRUM CLEF-2
+1D129..1D164  ; Common # So  [60] MUSICAL SYMBOL MULTIPLE MEASURE REST..MUSICAL SYMBOL ONE HUNDRED TWENTY-EIGHTH NOTE
+1D165..1D166  ; Common # Mc   [2] MUSICAL SYMBOL COMBINING STEM..MUSICAL SYMBOL COMBINING SPRECHGESANG STEM
+1D16A..1D16C  ; Common # So   [3] MUSICAL SYMBOL FINGERED TREMOLO-1..MUSICAL SYMBOL FINGERED TREMOLO-3
+1D16D..1D172  ; Common # Mc   [6] MUSICAL SYMBOL COMBINING AUGMENTATION DOT..MUSICAL SYMBOL COMBINING FLAG-5
+1D173..1D17A  ; Common # Cf   [8] MUSICAL SYMBOL BEGIN BEAM..MUSICAL SYMBOL END PHRASE
+1D183..1D184  ; Common # So   [2] MUSICAL SYMBOL ARPEGGIATO UP..MUSICAL SYMBOL ARPEGGIATO DOWN
+1D18C..1D1A9  ; Common # So  [30] MUSICAL SYMBOL RINFORZANDO..MUSICAL SYMBOL DEGREE SLASH
+1D1AE..1D1DD  ; Common # So  [48] MUSICAL SYMBOL PEDAL MARK..MUSICAL SYMBOL PES SUBPUNCTIS
+1D300..1D356  ; Common # So  [87] MONOGRAM FOR EARTH..TETRAGRAM FOR FOSTERING
+1D360..1D371  ; Common # No  [18] COUNTING ROD UNIT DIGIT ONE..COUNTING ROD TENS DIGIT NINE
+1D400..1D454  ; Common # L&  [85] MATHEMATICAL BOLD CAPITAL A..MATHEMATICAL ITALIC SMALL G
+1D456..1D49C  ; Common # L&  [71] MATHEMATICAL ITALIC SMALL I..MATHEMATICAL SCRIPT CAPITAL A
+1D49E..1D49F  ; Common # L&   [2] MATHEMATICAL SCRIPT CAPITAL C..MATHEMATICAL SCRIPT CAPITAL D
+1D4A2         ; Common # L&       MATHEMATICAL SCRIPT CAPITAL G
+1D4A5..1D4A6  ; Common # L&   [2] MATHEMATICAL SCRIPT CAPITAL J..MATHEMATICAL SCRIPT CAPITAL K
+1D4A9..1D4AC  ; Common # L&   [4] MATHEMATICAL SCRIPT CAPITAL N..MATHEMATICAL SCRIPT CAPITAL Q
+1D4AE..1D4B9  ; Common # L&  [12] MATHEMATICAL SCRIPT CAPITAL S..MATHEMATICAL SCRIPT SMALL D
+1D4BB         ; Common # L&       MATHEMATICAL SCRIPT SMALL F
+1D4BD..1D4C3  ; Common # L&   [7] MATHEMATICAL SCRIPT SMALL H..MATHEMATICAL SCRIPT SMALL N
+1D4C5..1D505  ; Common # L&  [65] MATHEMATICAL SCRIPT SMALL P..MATHEMATICAL FRAKTUR CAPITAL B
+1D507..1D50A  ; Common # L&   [4] MATHEMATICAL FRAKTUR CAPITAL D..MATHEMATICAL FRAKTUR CAPITAL G
+1D50D..1D514  ; Common # L&   [8] MATHEMATICAL FRAKTUR CAPITAL J..MATHEMATICAL FRAKTUR CAPITAL Q
+1D516..1D51C  ; Common # L&   [7] MATHEMATICAL FRAKTUR CAPITAL S..MATHEMATICAL FRAKTUR CAPITAL Y
+1D51E..1D539  ; Common # L&  [28] MATHEMATICAL FRAKTUR SMALL A..MATHEMATICAL DOUBLE-STRUCK CAPITAL B
+1D53B..1D53E  ; Common # L&   [4] MATHEMATICAL DOUBLE-STRUCK CAPITAL D..MATHEMATICAL DOUBLE-STRUCK CAPITAL G
+1D540..1D544  ; Common # L&   [5] MATHEMATICAL DOUBLE-STRUCK CAPITAL I..MATHEMATICAL DOUBLE-STRUCK CAPITAL M
+1D546         ; Common # L&       MATHEMATICAL DOUBLE-STRUCK CAPITAL O
+1D54A..1D550  ; Common # L&   [7] MATHEMATICAL DOUBLE-STRUCK CAPITAL S..MATHEMATICAL DOUBLE-STRUCK CAPITAL Y
+1D552..1D6A5  ; Common # L& [340] MATHEMATICAL DOUBLE-STRUCK SMALL A..MATHEMATICAL ITALIC SMALL DOTLESS J
+1D6A8..1D6C0  ; Common # L&  [25] MATHEMATICAL BOLD CAPITAL ALPHA..MATHEMATICAL BOLD CAPITAL OMEGA
+1D6C1         ; Common # Sm       MATHEMATICAL BOLD NABLA
+1D6C2..1D6DA  ; Common # L&  [25] MATHEMATICAL BOLD SMALL ALPHA..MATHEMATICAL BOLD SMALL OMEGA
+1D6DB         ; Common # Sm       MATHEMATICAL BOLD PARTIAL DIFFERENTIAL
+1D6DC..1D6FA  ; Common # L&  [31] MATHEMATICAL BOLD EPSILON SYMBOL..MATHEMATICAL ITALIC CAPITAL OMEGA
+1D6FB         ; Common # Sm       MATHEMATICAL ITALIC NABLA
+1D6FC..1D714  ; Common # L&  [25] MATHEMATICAL ITALIC SMALL ALPHA..MATHEMATICAL ITALIC SMALL OMEGA
+1D715         ; Common # Sm       MATHEMATICAL ITALIC PARTIAL DIFFERENTIAL
+1D716..1D734  ; Common # L&  [31] MATHEMATICAL ITALIC EPSILON SYMBOL..MATHEMATICAL BOLD ITALIC CAPITAL OMEGA
+1D735         ; Common # Sm       MATHEMATICAL BOLD ITALIC NABLA
+1D736..1D74E  ; Common # L&  [25] MATHEMATICAL BOLD ITALIC SMALL ALPHA..MATHEMATICAL BOLD ITALIC SMALL OMEGA
+1D74F         ; Common # Sm       MATHEMATICAL BOLD ITALIC PARTIAL DIFFERENTIAL
+1D750..1D76E  ; Common # L&  [31] MATHEMATICAL BOLD ITALIC EPSILON SYMBOL..MATHEMATICAL SANS-SERIF BOLD CAPITAL OMEGA
+1D76F         ; Common # Sm       MATHEMATICAL SANS-SERIF BOLD NABLA
+1D770..1D788  ; Common # L&  [25] MATHEMATICAL SANS-SERIF BOLD SMALL ALPHA..MATHEMATICAL SANS-SERIF BOLD SMALL OMEGA
+1D789         ; Common # Sm       MATHEMATICAL SANS-SERIF BOLD PARTIAL DIFFERENTIAL
+1D78A..1D7A8  ; Common # L&  [31] MATHEMATICAL SANS-SERIF BOLD EPSILON SYMBOL..MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL OMEGA
+1D7A9         ; Common # Sm       MATHEMATICAL SANS-SERIF BOLD ITALIC NABLA
+1D7AA..1D7C2  ; Common # L&  [25] MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL ALPHA..MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL OMEGA
+1D7C3         ; Common # Sm       MATHEMATICAL SANS-SERIF BOLD ITALIC PARTIAL DIFFERENTIAL
+1D7C4..1D7CB  ; Common # L&   [8] MATHEMATICAL SANS-SERIF BOLD ITALIC EPSILON SYMBOL..MATHEMATICAL BOLD SMALL DIGAMMA
+1D7CE..1D7FF  ; Common # Nd  [50] MATHEMATICAL BOLD DIGIT ZERO..MATHEMATICAL MONOSPACE DIGIT NINE
+1F000..1F02B  ; Common # So  [44] MAHJONG TILE EAST WIND..MAHJONG TILE BACK
+1F030..1F093  ; Common # So [100] DOMINO TILE HORIZONTAL BACK..DOMINO TILE VERTICAL-06-06
+1F100..1F10A  ; Common # No  [11] DIGIT ZERO FULL STOP..DIGIT NINE COMMA
+1F110..1F12E  ; Common # So  [31] PARENTHESIZED LATIN CAPITAL LETTER A..CIRCLED WZ
+1F131         ; Common # So       SQUARED LATIN CAPITAL LETTER B
+1F13D         ; Common # So       SQUARED LATIN CAPITAL LETTER N
+1F13F         ; Common # So       SQUARED LATIN CAPITAL LETTER P
+1F142         ; Common # So       SQUARED LATIN CAPITAL LETTER S
+1F146         ; Common # So       SQUARED LATIN CAPITAL LETTER W
+1F14A..1F14E  ; Common # So   [5] SQUARED HV..SQUARED PPV
+1F157         ; Common # So       NEGATIVE CIRCLED LATIN CAPITAL LETTER H
+1F15F         ; Common # So       NEGATIVE CIRCLED LATIN CAPITAL LETTER P
+1F179         ; Common # So       NEGATIVE SQUARED LATIN CAPITAL LETTER J
+1F17B..1F17C  ; Common # So   [2] NEGATIVE SQUARED LATIN CAPITAL LETTER L..NEGATIVE SQUARED LATIN CAPITAL LETTER M
+1F17F         ; Common # So       NEGATIVE SQUARED LATIN CAPITAL LETTER P
+1F18A..1F18D  ; Common # So   [4] CROSSED NEGATIVE SQUARED LATIN CAPITAL LETTER P..NEGATIVE SQUARED SA
+1F190         ; Common # So       SQUARE DJ
+1F210..1F231  ; Common # So  [34] SQUARED CJK UNIFIED IDEOGRAPH-624B..SQUARED CJK UNIFIED IDEOGRAPH-6253
+1F240..1F248  ; Common # So   [9] TORTOISE SHELL BRACKETED CJK UNIFIED IDEOGRAPH-672C..TORTOISE SHELL BRACKETED CJK UNIFIED IDEOGRAPH-6557
+E0001         ; Common # Cf       LANGUAGE TAG
+E0020..E007F  ; Common # Cf  [96] TAG SPACE..CANCEL TAG
+
+# Total code points: 5395
+
+# ================================================
+
+0041..005A    ; Latin # L&  [26] LATIN CAPITAL LETTER A..LATIN CAPITAL LETTER Z
+0061..007A    ; Latin # L&  [26] LATIN SMALL LETTER A..LATIN SMALL LETTER Z
+00AA          ; Latin # L&       FEMININE ORDINAL INDICATOR
+00BA          ; Latin # L&       MASCULINE ORDINAL INDICATOR
+00C0..00D6    ; Latin # L&  [23] LATIN CAPITAL LETTER A WITH GRAVE..LATIN CAPITAL LETTER O WITH DIAERESIS
+00D8..00F6    ; Latin # L&  [31] LATIN CAPITAL LETTER O WITH STROKE..LATIN SMALL LETTER O WITH DIAERESIS
+00F8..01BA    ; Latin # L& [195] LATIN SMALL LETTER O WITH STROKE..LATIN SMALL LETTER EZH WITH TAIL
+01BB          ; Latin # Lo       LATIN LETTER TWO WITH STROKE
+01BC..01BF    ; Latin # L&   [4] LATIN CAPITAL LETTER TONE FIVE..LATIN LETTER WYNN
+01C0..01C3    ; Latin # Lo   [4] LATIN LETTER DENTAL CLICK..LATIN LETTER RETROFLEX CLICK
+01C4..0293    ; Latin # L& [208] LATIN CAPITAL LETTER DZ WITH CARON..LATIN SMALL LETTER EZH WITH CURL
+0294          ; Latin # Lo       LATIN LETTER GLOTTAL STOP
+0295..02AF    ; Latin # L&  [27] LATIN LETTER PHARYNGEAL VOICED FRICATIVE..LATIN SMALL LETTER TURNED H WITH FISHHOOK AND TAIL
+02B0..02B8    ; Latin # Lm   [9] MODIFIER LETTER SMALL H..MODIFIER LETTER SMALL Y
+02E0..02E4    ; Latin # Lm   [5] MODIFIER LETTER SMALL GAMMA..MODIFIER LETTER SMALL REVERSED GLOTTAL STOP
+1D00..1D25    ; Latin # L&  [38] LATIN LETTER SMALL CAPITAL A..LATIN LETTER AIN
+1D2C..1D5C    ; Latin # Lm  [49] MODIFIER LETTER CAPITAL A..MODIFIER LETTER SMALL AIN
+1D62..1D65    ; Latin # L&   [4] LATIN SUBSCRIPT SMALL LETTER I..LATIN SUBSCRIPT SMALL LETTER V
+1D6B..1D77    ; Latin # L&  [13] LATIN SMALL LETTER UE..LATIN SMALL LETTER TURNED G
+1D79..1D9A    ; Latin # L&  [34] LATIN SMALL LETTER INSULAR G..LATIN SMALL LETTER EZH WITH RETROFLEX HOOK
+1D9B..1DBE    ; Latin # Lm  [36] MODIFIER LETTER SMALL TURNED ALPHA..MODIFIER LETTER SMALL EZH
+1E00..1EFF    ; Latin # L& [256] LATIN CAPITAL LETTER A WITH RING BELOW..LATIN SMALL LETTER Y WITH LOOP
+2071          ; Latin # Lm       SUPERSCRIPT LATIN SMALL LETTER I
+207F          ; Latin # Lm       SUPERSCRIPT LATIN SMALL LETTER N
+2090..2094    ; Latin # Lm   [5] LATIN SUBSCRIPT SMALL LETTER A..LATIN SUBSCRIPT SMALL LETTER SCHWA
+212A..212B    ; Latin # L&   [2] KELVIN SIGN..ANGSTROM SIGN
+2132          ; Latin # L&       TURNED CAPITAL F
+214E          ; Latin # L&       TURNED SMALL F
+2160..2182    ; Latin # Nl  [35] ROMAN NUMERAL ONE..ROMAN NUMERAL TEN THOUSAND
+2183..2184    ; Latin # L&   [2] ROMAN NUMERAL REVERSED ONE HUNDRED..LATIN SMALL LETTER REVERSED C
+2185..2188    ; Latin # Nl   [4] ROMAN NUMERAL SIX LATE FORM..ROMAN NUMERAL ONE HUNDRED THOUSAND
+2C60..2C7C    ; Latin # L&  [29] LATIN CAPITAL LETTER L WITH DOUBLE BAR..LATIN SUBSCRIPT SMALL LETTER J
+2C7D          ; Latin # Lm       MODIFIER LETTER CAPITAL V
+2C7E..2C7F    ; Latin # L&   [2] LATIN CAPITAL LETTER S WITH SWASH TAIL..LATIN CAPITAL LETTER Z WITH SWASH TAIL
+A722..A76F    ; Latin # L&  [78] LATIN CAPITAL LETTER EGYPTOLOGICAL ALEF..LATIN SMALL LETTER CON
+A770          ; Latin # Lm       MODIFIER LETTER US
+A771..A787    ; Latin # L&  [23] LATIN SMALL LETTER DUM..LATIN SMALL LETTER INSULAR T
+A78B..A78C    ; Latin # L&   [2] LATIN CAPITAL LETTER SALTILLO..LATIN SMALL LETTER SALTILLO
+A7FB..A7FF    ; Latin # Lo   [5] LATIN EPIGRAPHIC LETTER REVERSED F..LATIN EPIGRAPHIC LETTER ARCHAIC M
+FB00..FB06    ; Latin # L&   [7] LATIN SMALL LIGATURE FF..LATIN SMALL LIGATURE ST
+FF21..FF3A    ; Latin # L&  [26] FULLWIDTH LATIN CAPITAL LETTER A..FULLWIDTH LATIN CAPITAL LETTER Z
+FF41..FF5A    ; Latin # L&  [26] FULLWIDTH LATIN SMALL LETTER A..FULLWIDTH LATIN SMALL LETTER Z
+
+# Total code points: 1244
+
+# ================================================
+
+0370..0373    ; Greek # L&   [4] GREEK CAPITAL LETTER HETA..GREEK SMALL LETTER ARCHAIC SAMPI
+0375          ; Greek # Sk       GREEK LOWER NUMERAL SIGN
+0376..0377    ; Greek # L&   [2] GREEK CAPITAL LETTER PAMPHYLIAN DIGAMMA..GREEK SMALL LETTER PAMPHYLIAN DIGAMMA
+037A          ; Greek # Lm       GREEK YPOGEGRAMMENI
+037B..037D    ; Greek # L&   [3] GREEK SMALL REVERSED LUNATE SIGMA SYMBOL..GREEK SMALL REVERSED DOTTED LUNATE SIGMA SYMBOL
+0384          ; Greek # Sk       GREEK TONOS
+0386          ; Greek # L&       GREEK CAPITAL LETTER ALPHA WITH TONOS
+0388..038A    ; Greek # L&   [3] GREEK CAPITAL LETTER EPSILON WITH TONOS..GREEK CAPITAL LETTER IOTA WITH TONOS
+038C          ; Greek # L&       GREEK CAPITAL LETTER OMICRON WITH TONOS
+038E..03A1    ; Greek # L&  [20] GREEK CAPITAL LETTER UPSILON WITH TONOS..GREEK CAPITAL LETTER RHO
+03A3..03E1    ; Greek # L&  [63] GREEK CAPITAL LETTER SIGMA..GREEK SMALL LETTER SAMPI
+03F0..03F5    ; Greek # L&   [6] GREEK KAPPA SYMBOL..GREEK LUNATE EPSILON SYMBOL
+03F6          ; Greek # Sm       GREEK REVERSED LUNATE EPSILON SYMBOL
+03F7..03FF    ; Greek # L&   [9] GREEK CAPITAL LETTER SHO..GREEK CAPITAL REVERSED DOTTED LUNATE SIGMA SYMBOL
+1D26..1D2A    ; Greek # L&   [5] GREEK LETTER SMALL CAPITAL GAMMA..GREEK LETTER SMALL CAPITAL PSI
+1D5D..1D61    ; Greek # Lm   [5] MODIFIER LETTER SMALL BETA..MODIFIER LETTER SMALL CHI
+1D66..1D6A    ; Greek # L&   [5] GREEK SUBSCRIPT SMALL LETTER BETA..GREEK SUBSCRIPT SMALL LETTER CHI
+1DBF          ; Greek # Lm       MODIFIER LETTER SMALL THETA
+1F00..1F15    ; Greek # L&  [22] GREEK SMALL LETTER ALPHA WITH PSILI..GREEK SMALL LETTER EPSILON WITH DASIA AND OXIA
+1F18..1F1D    ; Greek # L&   [6] GREEK CAPITAL LETTER EPSILON WITH PSILI..GREEK CAPITAL LETTER EPSILON WITH DASIA AND OXIA
+1F20..1F45    ; Greek # L&  [38] GREEK SMALL LETTER ETA WITH PSILI..GREEK SMALL LETTER OMICRON WITH DASIA AND OXIA
+1F48..1F4D    ; Greek # L&   [6] GREEK CAPITAL LETTER OMICRON WITH PSILI..GREEK CAPITAL LETTER OMICRON WITH DASIA AND OXIA
+1F50..1F57    ; Greek # L&   [8] GREEK SMALL LETTER UPSILON WITH PSILI..GREEK SMALL LETTER UPSILON WITH DASIA AND PERISPOMENI
+1F59          ; Greek # L&       GREEK CAPITAL LETTER UPSILON WITH DASIA
+1F5B          ; Greek # L&       GREEK CAPITAL LETTER UPSILON WITH DASIA AND VARIA
+1F5D          ; Greek # L&       GREEK CAPITAL LETTER UPSILON WITH DASIA AND OXIA
+1F5F..1F7D    ; Greek # L&  [31] GREEK CAPITAL LETTER UPSILON WITH DASIA AND PERISPOMENI..GREEK SMALL LETTER OMEGA WITH OXIA
+1F80..1FB4    ; Greek # L&  [53] GREEK SMALL LETTER ALPHA WITH PSILI AND YPOGEGRAMMENI..GREEK SMALL LETTER ALPHA WITH OXIA AND YPOGEGRAMMENI
+1FB6..1FBC    ; Greek # L&   [7] GREEK SMALL LETTER ALPHA WITH PERISPOMENI..GREEK CAPITAL LETTER ALPHA WITH PROSGEGRAMMENI
+1FBD          ; Greek # Sk       GREEK KORONIS
+1FBE          ; Greek # L&       GREEK PROSGEGRAMMENI
+1FBF..1FC1    ; Greek # Sk   [3] GREEK PSILI..GREEK DIALYTIKA AND PERISPOMENI
+1FC2..1FC4    ; Greek # L&   [3] GREEK SMALL LETTER ETA WITH VARIA AND YPOGEGRAMMENI..GREEK SMALL LETTER ETA WITH OXIA AND YPOGEGRAMMENI
+1FC6..1FCC    ; Greek # L&   [7] GREEK SMALL LETTER ETA WITH PERISPOMENI..GREEK CAPITAL LETTER ETA WITH PROSGEGRAMMENI
+1FCD..1FCF    ; Greek # Sk   [3] GREEK PSILI AND VARIA..GREEK PSILI AND PERISPOMENI
+1FD0..1FD3    ; Greek # L&   [4] GREEK SMALL LETTER IOTA WITH VRACHY..GREEK SMALL LETTER IOTA WITH DIALYTIKA AND OXIA
+1FD6..1FDB    ; Greek # L&   [6] GREEK SMALL LETTER IOTA WITH PERISPOMENI..GREEK CAPITAL LETTER IOTA WITH OXIA
+1FDD..1FDF    ; Greek # Sk   [3] GREEK DASIA AND VARIA..GREEK DASIA AND PERISPOMENI
+1FE0..1FEC    ; Greek # L&  [13] GREEK SMALL LETTER UPSILON WITH VRACHY..GREEK CAPITAL LETTER RHO WITH DASIA
+1FED..1FEF    ; Greek # Sk   [3] GREEK DIALYTIKA AND VARIA..GREEK VARIA
+1FF2..1FF4    ; Greek # L&   [3] GREEK SMALL LETTER OMEGA WITH VARIA AND YPOGEGRAMMENI..GREEK SMALL LETTER OMEGA WITH OXIA AND YPOGEGRAMMENI
+1FF6..1FFC    ; Greek # L&   [7] GREEK SMALL LETTER OMEGA WITH PERISPOMENI..GREEK CAPITAL LETTER OMEGA WITH PROSGEGRAMMENI
+1FFD..1FFE    ; Greek # Sk   [2] GREEK OXIA..GREEK DASIA
+2126          ; Greek # L&       OHM SIGN
+10140..10174  ; Greek # Nl  [53] GREEK ACROPHONIC ATTIC ONE QUARTER..GREEK ACROPHONIC STRATIAN FIFTY MNAS
+10175..10178  ; Greek # No   [4] GREEK ONE HALF SIGN..GREEK THREE QUARTERS SIGN
+10179..10189  ; Greek # So  [17] GREEK YEAR SIGN..GREEK TRYBLION BASE SIGN
+1018A         ; Greek # No       GREEK ZERO SIGN
+1D200..1D241  ; Greek # So  [66] GREEK VOCAL NOTATION SYMBOL-1..GREEK INSTRUMENTAL NOTATION SYMBOL-54
+1D242..1D244  ; Greek # Mn   [3] COMBINING GREEK MUSICAL TRISEME..COMBINING GREEK MUSICAL PENTASEME
+1D245         ; Greek # So       GREEK MUSICAL LEIMMA
+
+# Total code points: 511
+
+# ================================================
+
+0400..0481    ; Cyrillic # L& [130] CYRILLIC CAPITAL LETTER IE WITH GRAVE..CYRILLIC SMALL LETTER KOPPA
+0482          ; Cyrillic # So       CYRILLIC THOUSANDS SIGN
+0483..0484    ; Cyrillic # Mn   [2] COMBINING CYRILLIC TITLO..COMBINING CYRILLIC PALATALIZATION
+0487          ; Cyrillic # Mn       COMBINING CYRILLIC POKRYTIE
+0488..0489    ; Cyrillic # Me   [2] COMBINING CYRILLIC HUNDRED THOUSANDS SIGN..COMBINING CYRILLIC MILLIONS SIGN
+048A..0525    ; Cyrillic # L& [156] CYRILLIC CAPITAL LETTER SHORT I WITH TAIL..CYRILLIC SMALL LETTER PE WITH DESCENDER
+1D2B          ; Cyrillic # L&       CYRILLIC LETTER SMALL CAPITAL EL
+1D78          ; Cyrillic # Lm       MODIFIER LETTER CYRILLIC EN
+2DE0..2DFF    ; Cyrillic # Mn  [32] COMBINING CYRILLIC LETTER BE..COMBINING CYRILLIC LETTER IOTIFIED BIG YUS
+A640..A65F    ; Cyrillic # L&  [32] CYRILLIC CAPITAL LETTER ZEMLYA..CYRILLIC SMALL LETTER YN
+A662..A66D    ; Cyrillic # L&  [12] CYRILLIC CAPITAL LETTER SOFT DE..CYRILLIC SMALL LETTER DOUBLE MONOCULAR O
+A66E          ; Cyrillic # Lo       CYRILLIC LETTER MULTIOCULAR O
+A66F          ; Cyrillic # Mn       COMBINING CYRILLIC VZMET
+A670..A672    ; Cyrillic # Me   [3] COMBINING CYRILLIC TEN MILLIONS SIGN..COMBINING CYRILLIC THOUSAND MILLIONS SIGN
+A673          ; Cyrillic # Po       SLAVONIC ASTERISK
+A67C..A67D    ; Cyrillic # Mn   [2] COMBINING CYRILLIC KAVYKA..COMBINING CYRILLIC PAYEROK
+A67E          ; Cyrillic # Po       CYRILLIC KAVYKA
+A67F          ; Cyrillic # Lm       CYRILLIC PAYEROK
+A680..A697    ; Cyrillic # L&  [24] CYRILLIC CAPITAL LETTER DWE..CYRILLIC SMALL LETTER SHWE
+
+# Total code points: 404
+
+# ================================================
+
+0531..0556    ; Armenian # L&  [38] ARMENIAN CAPITAL LETTER AYB..ARMENIAN CAPITAL LETTER FEH
+0559          ; Armenian # Lm       ARMENIAN MODIFIER LETTER LEFT HALF RING
+055A..055F    ; Armenian # Po   [6] ARMENIAN APOSTROPHE..ARMENIAN ABBREVIATION MARK
+0561..0587    ; Armenian # L&  [39] ARMENIAN SMALL LETTER AYB..ARMENIAN SMALL LIGATURE ECH YIWN
+058A          ; Armenian # Pd       ARMENIAN HYPHEN
+FB13..FB17    ; Armenian # L&   [5] ARMENIAN SMALL LIGATURE MEN NOW..ARMENIAN SMALL LIGATURE MEN XEH
+
+# Total code points: 90
+
+# ================================================
+
+0591..05BD    ; Hebrew # Mn  [45] HEBREW ACCENT ETNAHTA..HEBREW POINT METEG
+05BE          ; Hebrew # Pd       HEBREW PUNCTUATION MAQAF
+05BF          ; Hebrew # Mn       HEBREW POINT RAFE
+05C0          ; Hebrew # Po       HEBREW PUNCTUATION PASEQ
+05C1..05C2    ; Hebrew # Mn   [2] HEBREW POINT SHIN DOT..HEBREW POINT SIN DOT
+05C3          ; Hebrew # Po       HEBREW PUNCTUATION SOF PASUQ
+05C4..05C5    ; Hebrew # Mn   [2] HEBREW MARK UPPER DOT..HEBREW MARK LOWER DOT
+05C6          ; Hebrew # Po       HEBREW PUNCTUATION NUN HAFUKHA
+05C7          ; Hebrew # Mn       HEBREW POINT QAMATS QATAN
+05D0..05EA    ; Hebrew # Lo  [27] HEBREW LETTER ALEF..HEBREW LETTER TAV
+05F0..05F2    ; Hebrew # Lo   [3] HEBREW LIGATURE YIDDISH DOUBLE VAV..HEBREW LIGATURE YIDDISH DOUBLE YOD
+05F3..05F4    ; Hebrew # Po   [2] HEBREW PUNCTUATION GERESH..HEBREW PUNCTUATION GERSHAYIM
+FB1D          ; Hebrew # Lo       HEBREW LETTER YOD WITH HIRIQ
+FB1E          ; Hebrew # Mn       HEBREW POINT JUDEO-SPANISH VARIKA
+FB1F..FB28    ; Hebrew # Lo  [10] HEBREW LIGATURE YIDDISH YOD YOD PATAH..HEBREW LETTER WIDE TAV
+FB29          ; Hebrew # Sm       HEBREW LETTER ALTERNATIVE PLUS SIGN
+FB2A..FB36    ; Hebrew # Lo  [13] HEBREW LETTER SHIN WITH SHIN DOT..HEBREW LETTER ZAYIN WITH DAGESH
+FB38..FB3C    ; Hebrew # Lo   [5] HEBREW LETTER TET WITH DAGESH..HEBREW LETTER LAMED WITH DAGESH
+FB3E          ; Hebrew # Lo       HEBREW LETTER MEM WITH DAGESH
+FB40..FB41    ; Hebrew # Lo   [2] HEBREW LETTER NUN WITH DAGESH..HEBREW LETTER SAMEKH WITH DAGESH
+FB43..FB44    ; Hebrew # Lo   [2] HEBREW LETTER FINAL PE WITH DAGESH..HEBREW LETTER PE WITH DAGESH
+FB46..FB4F    ; Hebrew # Lo  [10] HEBREW LETTER TSADI WITH DAGESH..HEBREW LIGATURE ALEF LAMED
+
+# Total code points: 133
+
+# ================================================
+
+0606..0608    ; Arabic # Sm   [3] ARABIC-INDIC CUBE ROOT..ARABIC RAY
+0609..060A    ; Arabic # Po   [2] ARABIC-INDIC PER MILLE SIGN..ARABIC-INDIC PER TEN THOUSAND SIGN
+060B          ; Arabic # Sc       AFGHANI SIGN
+060D          ; Arabic # Po       ARABIC DATE SEPARATOR
+060E..060F    ; Arabic # So   [2] ARABIC POETIC VERSE SIGN..ARABIC SIGN MISRA
+0610..061A    ; Arabic # Mn  [11] ARABIC SIGN SALLALLAHOU ALAYHE WASSALLAM..ARABIC SMALL KASRA
+061E          ; Arabic # Po       ARABIC TRIPLE DOT PUNCTUATION MARK
+0621..063F    ; Arabic # Lo  [31] ARABIC LETTER HAMZA..ARABIC LETTER FARSI YEH WITH THREE DOTS ABOVE
+0641..064A    ; Arabic # Lo  [10] ARABIC LETTER FEH..ARABIC LETTER YEH
+0656..065E    ; Arabic # Mn   [9] ARABIC SUBSCRIPT ALEF..ARABIC FATHA WITH TWO DOTS
+066A..066D    ; Arabic # Po   [4] ARABIC PERCENT SIGN..ARABIC FIVE POINTED STAR
+066E..066F    ; Arabic # Lo   [2] ARABIC LETTER DOTLESS BEH..ARABIC LETTER DOTLESS QAF
+0671..06D3    ; Arabic # Lo  [99] ARABIC LETTER ALEF WASLA..ARABIC LETTER YEH BARREE WITH HAMZA ABOVE
+06D4          ; Arabic # Po       ARABIC FULL STOP
+06D5          ; Arabic # Lo       ARABIC LETTER AE
+06D6..06DC    ; Arabic # Mn   [7] ARABIC SMALL HIGH LIGATURE SAD WITH LAM WITH ALEF MAKSURA..ARABIC SMALL HIGH SEEN
+06DE          ; Arabic # Me       ARABIC START OF RUB EL HIZB
+06DF..06E4    ; Arabic # Mn   [6] ARABIC SMALL HIGH ROUNDED ZERO..ARABIC SMALL HIGH MADDA
+06E5..06E6    ; Arabic # Lm   [2] ARABIC SMALL WAW..ARABIC SMALL YEH
+06E7..06E8    ; Arabic # Mn   [2] ARABIC SMALL HIGH YEH..ARABIC SMALL HIGH NOON
+06E9          ; Arabic # So       ARABIC PLACE OF SAJDAH
+06EA..06ED    ; Arabic # Mn   [4] ARABIC EMPTY CENTRE LOW STOP..ARABIC SMALL LOW MEEM
+06EE..06EF    ; Arabic # Lo   [2] ARABIC LETTER DAL WITH INVERTED V..ARABIC LETTER REH WITH INVERTED V
+06F0..06F9    ; Arabic # Nd  [10] EXTENDED ARABIC-INDIC DIGIT ZERO..EXTENDED ARABIC-INDIC DIGIT NINE
+06FA..06FC    ; Arabic # Lo   [3] ARABIC LETTER SHEEN WITH DOT BELOW..ARABIC LETTER GHAIN WITH DOT BELOW
+06FD..06FE    ; Arabic # So   [2] ARABIC SIGN SINDHI AMPERSAND..ARABIC SIGN SINDHI POSTPOSITION MEN
+06FF          ; Arabic # Lo       ARABIC LETTER HEH WITH INVERTED V
+0750..077F    ; Arabic # Lo  [48] ARABIC LETTER BEH WITH THREE DOTS HORIZONTALLY BELOW..ARABIC LETTER KAF WITH TWO DOTS ABOVE
+FB50..FBB1    ; Arabic # Lo  [98] ARABIC LETTER ALEF WASLA ISOLATED FORM..ARABIC LETTER YEH BARREE WITH HAMZA ABOVE FINAL FORM
+FBD3..FD3D    ; Arabic # Lo [363] ARABIC LETTER NG ISOLATED FORM..ARABIC LIGATURE ALEF WITH FATHATAN ISOLATED FORM
+FD50..FD8F    ; Arabic # Lo  [64] ARABIC LIGATURE TEH WITH JEEM WITH MEEM INITIAL FORM..ARABIC LIGATURE MEEM WITH KHAH WITH MEEM INITIAL FORM
+FD92..FDC7    ; Arabic # Lo  [54] ARABIC LIGATURE MEEM WITH JEEM WITH KHAH INITIAL FORM..ARABIC LIGATURE NOON WITH JEEM WITH YEH FINAL FORM
+FDF0..FDFB    ; Arabic # Lo  [12] ARABIC LIGATURE SALLA USED AS KORANIC STOP SIGN ISOLATED FORM..ARABIC LIGATURE JALLAJALALOUHOU
+FDFC          ; Arabic # Sc       RIAL SIGN
+FE70..FE74    ; Arabic # Lo   [5] ARABIC FATHATAN ISOLATED FORM..ARABIC KASRATAN ISOLATED FORM
+FE76..FEFC    ; Arabic # Lo [135] ARABIC FATHA ISOLATED FORM..ARABIC LIGATURE LAM WITH ALEF FINAL FORM
+10E60..10E7E  ; Arabic # No  [31] RUMI DIGIT ONE..RUMI FRACTION TWO THIRDS
+
+# Total code points: 1030
+
+# ================================================
+
+0700..070D    ; Syriac # Po  [14] SYRIAC END OF PARAGRAPH..SYRIAC HARKLEAN ASTERISCUS
+070F          ; Syriac # Cf       SYRIAC ABBREVIATION MARK
+0710          ; Syriac # Lo       SYRIAC LETTER ALAPH
+0711          ; Syriac # Mn       SYRIAC LETTER SUPERSCRIPT ALAPH
+0712..072F    ; Syriac # Lo  [30] SYRIAC LETTER BETH..SYRIAC LETTER PERSIAN DHALATH
+0730..074A    ; Syriac # Mn  [27] SYRIAC PTHAHA ABOVE..SYRIAC BARREKH
+074D..074F    ; Syriac # Lo   [3] SYRIAC LETTER SOGDIAN ZHAIN..SYRIAC LETTER SOGDIAN FE
+
+# Total code points: 77
+
+# ================================================
+
+0780..07A5    ; Thaana # Lo  [38] THAANA LETTER HAA..THAANA LETTER WAAVU
+07A6..07B0    ; Thaana # Mn  [11] THAANA ABAFILI..THAANA SUKUN
+07B1          ; Thaana # Lo       THAANA LETTER NAA
+
+# Total code points: 50
+
+# ================================================
+
+0900..0902    ; Devanagari # Mn   [3] DEVANAGARI SIGN INVERTED CANDRABINDU..DEVANAGARI SIGN ANUSVARA
+0903          ; Devanagari # Mc       DEVANAGARI SIGN VISARGA
+0904..0939    ; Devanagari # Lo  [54] DEVANAGARI LETTER SHORT A..DEVANAGARI LETTER HA
+093C          ; Devanagari # Mn       DEVANAGARI SIGN NUKTA
+093D          ; Devanagari # Lo       DEVANAGARI SIGN AVAGRAHA
+093E..0940    ; Devanagari # Mc   [3] DEVANAGARI VOWEL SIGN AA..DEVANAGARI VOWEL SIGN II
+0941..0948    ; Devanagari # Mn   [8] DEVANAGARI VOWEL SIGN U..DEVANAGARI VOWEL SIGN AI
+0949..094C    ; Devanagari # Mc   [4] DEVANAGARI VOWEL SIGN CANDRA O..DEVANAGARI VOWEL SIGN AU
+094D          ; Devanagari # Mn       DEVANAGARI SIGN VIRAMA
+094E          ; Devanagari # Mc       DEVANAGARI VOWEL SIGN PRISHTHAMATRA E
+0950          ; Devanagari # Lo       DEVANAGARI OM
+0953..0955    ; Devanagari # Mn   [3] DEVANAGARI GRAVE ACCENT..DEVANAGARI VOWEL SIGN CANDRA LONG E
+0958..0961    ; Devanagari # Lo  [10] DEVANAGARI LETTER QA..DEVANAGARI LETTER VOCALIC LL
+0962..0963    ; Devanagari # Mn   [2] DEVANAGARI VOWEL SIGN VOCALIC L..DEVANAGARI VOWEL SIGN VOCALIC LL
+0966..096F    ; Devanagari # Nd  [10] DEVANAGARI DIGIT ZERO..DEVANAGARI DIGIT NINE
+0971          ; Devanagari # Lm       DEVANAGARI SIGN HIGH SPACING DOT
+0972          ; Devanagari # Lo       DEVANAGARI LETTER CANDRA A
+0979..097F    ; Devanagari # Lo   [7] DEVANAGARI LETTER ZHA..DEVANAGARI LETTER BBA
+A8E0..A8F1    ; Devanagari # Mn  [18] COMBINING DEVANAGARI DIGIT ZERO..COMBINING DEVANAGARI SIGN AVAGRAHA
+A8F2..A8F7    ; Devanagari # Lo   [6] DEVANAGARI SIGN SPACING CANDRABINDU..DEVANAGARI SIGN CANDRABINDU AVAGRAHA
+A8F8..A8FA    ; Devanagari # Po   [3] DEVANAGARI SIGN PUSHPIKA..DEVANAGARI CARET
+A8FB          ; Devanagari # Lo       DEVANAGARI HEADSTROKE
+
+# Total code points: 140
+
+# ================================================
+
+0981          ; Bengali # Mn       BENGALI SIGN CANDRABINDU
+0982..0983    ; Bengali # Mc   [2] BENGALI SIGN ANUSVARA..BENGALI SIGN VISARGA
+0985..098C    ; Bengali # Lo   [8] BENGALI LETTER A..BENGALI LETTER VOCALIC L
+098F..0990    ; Bengali # Lo   [2] BENGALI LETTER E..BENGALI LETTER AI
+0993..09A8    ; Bengali # Lo  [22] BENGALI LETTER O..BENGALI LETTER NA
+09AA..09B0    ; Bengali # Lo   [7] BENGALI LETTER PA..BENGALI LETTER RA
+09B2          ; Bengali # Lo       BENGALI LETTER LA
+09B6..09B9    ; Bengali # Lo   [4] BENGALI LETTER SHA..BENGALI LETTER HA
+09BC          ; Bengali # Mn       BENGALI SIGN NUKTA
+09BD          ; Bengali # Lo       BENGALI SIGN AVAGRAHA
+09BE..09C0    ; Bengali # Mc   [3] BENGALI VOWEL SIGN AA..BENGALI VOWEL SIGN II
+09C1..09C4    ; Bengali # Mn   [4] BENGALI VOWEL SIGN U..BENGALI VOWEL SIGN VOCALIC RR
+09C7..09C8    ; Bengali # Mc   [2] BENGALI VOWEL SIGN E..BENGALI VOWEL SIGN AI
+09CB..09CC    ; Bengali # Mc   [2] BENGALI VOWEL SIGN O..BENGALI VOWEL SIGN AU
+09CD          ; Bengali # Mn       BENGALI SIGN VIRAMA
+09CE          ; Bengali # Lo       BENGALI LETTER KHANDA TA
+09D7          ; Bengali # Mc       BENGALI AU LENGTH MARK
+09DC..09DD    ; Bengali # Lo   [2] BENGALI LETTER RRA..BENGALI LETTER RHA
+09DF..09E1    ; Bengali # Lo   [3] BENGALI LETTER YYA..BENGALI LETTER VOCALIC LL
+09E2..09E3    ; Bengali # Mn   [2] BENGALI VOWEL SIGN VOCALIC L..BENGALI VOWEL SIGN VOCALIC LL
+09E6..09EF    ; Bengali # Nd  [10] BENGALI DIGIT ZERO..BENGALI DIGIT NINE
+09F0..09F1    ; Bengali # Lo   [2] BENGALI LETTER RA WITH MIDDLE DIAGONAL..BENGALI LETTER RA WITH LOWER DIAGONAL
+09F2..09F3    ; Bengali # Sc   [2] BENGALI RUPEE MARK..BENGALI RUPEE SIGN
+09F4..09F9    ; Bengali # No   [6] BENGALI CURRENCY NUMERATOR ONE..BENGALI CURRENCY DENOMINATOR SIXTEEN
+09FA          ; Bengali # So       BENGALI ISSHAR
+09FB          ; Bengali # Sc       BENGALI GANDA MARK
+
+# Total code points: 92
+
+# ================================================
+
+0A01..0A02    ; Gurmukhi # Mn   [2] GURMUKHI SIGN ADAK BINDI..GURMUKHI SIGN BINDI
+0A03          ; Gurmukhi # Mc       GURMUKHI SIGN VISARGA
+0A05..0A0A    ; Gurmukhi # Lo   [6] GURMUKHI LETTER A..GURMUKHI LETTER UU
+0A0F..0A10    ; Gurmukhi # Lo   [2] GURMUKHI LETTER EE..GURMUKHI LETTER AI
+0A13..0A28    ; Gurmukhi # Lo  [22] GURMUKHI LETTER OO..GURMUKHI LETTER NA
+0A2A..0A30    ; Gurmukhi # Lo   [7] GURMUKHI LETTER PA..GURMUKHI LETTER RA
+0A32..0A33    ; Gurmukhi # Lo   [2] GURMUKHI LETTER LA..GURMUKHI LETTER LLA
+0A35..0A36    ; Gurmukhi # Lo   [2] GURMUKHI LETTER VA..GURMUKHI LETTER SHA
+0A38..0A39    ; Gurmukhi # Lo   [2] GURMUKHI LETTER SA..GURMUKHI LETTER HA
+0A3C          ; Gurmukhi # Mn       GURMUKHI SIGN NUKTA
+0A3E..0A40    ; Gurmukhi # Mc   [3] GURMUKHI VOWEL SIGN AA..GURMUKHI VOWEL SIGN II
+0A41..0A42    ; Gurmukhi # Mn   [2] GURMUKHI VOWEL SIGN U..GURMUKHI VOWEL SIGN UU
+0A47..0A48    ; Gurmukhi # Mn   [2] GURMUKHI VOWEL SIGN EE..GURMUKHI VOWEL SIGN AI
+0A4B..0A4D    ; Gurmukhi # Mn   [3] GURMUKHI VOWEL SIGN OO..GURMUKHI SIGN VIRAMA
+0A51          ; Gurmukhi # Mn       GURMUKHI SIGN UDAAT
+0A59..0A5C    ; Gurmukhi # Lo   [4] GURMUKHI LETTER KHHA..GURMUKHI LETTER RRA
+0A5E          ; Gurmukhi # Lo       GURMUKHI LETTER FA
+0A66..0A6F    ; Gurmukhi # Nd  [10] GURMUKHI DIGIT ZERO..GURMUKHI DIGIT NINE
+0A70..0A71    ; Gurmukhi # Mn   [2] GURMUKHI TIPPI..GURMUKHI ADDAK
+0A72..0A74    ; Gurmukhi # Lo   [3] GURMUKHI IRI..GURMUKHI EK ONKAR
+0A75          ; Gurmukhi # Mn       GURMUKHI SIGN YAKASH
+
+# Total code points: 79
+
+# ================================================
+
+0A81..0A82    ; Gujarati # Mn   [2] GUJARATI SIGN CANDRABINDU..GUJARATI SIGN ANUSVARA
+0A83          ; Gujarati # Mc       GUJARATI SIGN VISARGA
+0A85..0A8D    ; Gujarati # Lo   [9] GUJARATI LETTER A..GUJARATI VOWEL CANDRA E
+0A8F..0A91    ; Gujarati # Lo   [3] GUJARATI LETTER E..GUJARATI VOWEL CANDRA O
+0A93..0AA8    ; Gujarati # Lo  [22] GUJARATI LETTER O..GUJARATI LETTER NA
+0AAA..0AB0    ; Gujarati # Lo   [7] GUJARATI LETTER PA..GUJARATI LETTER RA
+0AB2..0AB3    ; Gujarati # Lo   [2] GUJARATI LETTER LA..GUJARATI LETTER LLA
+0AB5..0AB9    ; Gujarati # Lo   [5] GUJARATI LETTER VA..GUJARATI LETTER HA
+0ABC          ; Gujarati # Mn       GUJARATI SIGN NUKTA
+0ABD          ; Gujarati # Lo       GUJARATI SIGN AVAGRAHA
+0ABE..0AC0    ; Gujarati # Mc   [3] GUJARATI VOWEL SIGN AA..GUJARATI VOWEL SIGN II
+0AC1..0AC5    ; Gujarati # Mn   [5] GUJARATI VOWEL SIGN U..GUJARATI VOWEL SIGN CANDRA E
+0AC7..0AC8    ; Gujarati # Mn   [2] GUJARATI VOWEL SIGN E..GUJARATI VOWEL SIGN AI
+0AC9          ; Gujarati # Mc       GUJARATI VOWEL SIGN CANDRA O
+0ACB..0ACC    ; Gujarati # Mc   [2] GUJARATI VOWEL SIGN O..GUJARATI VOWEL SIGN AU
+0ACD          ; Gujarati # Mn       GUJARATI SIGN VIRAMA
+0AD0          ; Gujarati # Lo       GUJARATI OM
+0AE0..0AE1    ; Gujarati # Lo   [2] GUJARATI LETTER VOCALIC RR..GUJARATI LETTER VOCALIC LL
+0AE2..0AE3    ; Gujarati # Mn   [2] GUJARATI VOWEL SIGN VOCALIC L..GUJARATI VOWEL SIGN VOCALIC LL
+0AE6..0AEF    ; Gujarati # Nd  [10] GUJARATI DIGIT ZERO..GUJARATI DIGIT NINE
+0AF1          ; Gujarati # Sc       GUJARATI RUPEE SIGN
+
+# Total code points: 83
+
+# ================================================
+
+0B01          ; Oriya # Mn       ORIYA SIGN CANDRABINDU
+0B02..0B03    ; Oriya # Mc   [2] ORIYA SIGN ANUSVARA..ORIYA SIGN VISARGA
+0B05..0B0C    ; Oriya # Lo   [8] ORIYA LETTER A..ORIYA LETTER VOCALIC L
+0B0F..0B10    ; Oriya # Lo   [2] ORIYA LETTER E..ORIYA LETTER AI
+0B13..0B28    ; Oriya # Lo  [22] ORIYA LETTER O..ORIYA LETTER NA
+0B2A..0B30    ; Oriya # Lo   [7] ORIYA LETTER PA..ORIYA LETTER RA
+0B32..0B33    ; Oriya # Lo   [2] ORIYA LETTER LA..ORIYA LETTER LLA
+0B35..0B39    ; Oriya # Lo   [5] ORIYA LETTER VA..ORIYA LETTER HA
+0B3C          ; Oriya # Mn       ORIYA SIGN NUKTA
+0B3D          ; Oriya # Lo       ORIYA SIGN AVAGRAHA
+0B3E          ; Oriya # Mc       ORIYA VOWEL SIGN AA
+0B3F          ; Oriya # Mn       ORIYA VOWEL SIGN I
+0B40          ; Oriya # Mc       ORIYA VOWEL SIGN II
+0B41..0B44    ; Oriya # Mn   [4] ORIYA VOWEL SIGN U..ORIYA VOWEL SIGN VOCALIC RR
+0B47..0B48    ; Oriya # Mc   [2] ORIYA VOWEL SIGN E..ORIYA VOWEL SIGN AI
+0B4B..0B4C    ; Oriya # Mc   [2] ORIYA VOWEL SIGN O..ORIYA VOWEL SIGN AU
+0B4D          ; Oriya # Mn       ORIYA SIGN VIRAMA
+0B56          ; Oriya # Mn       ORIYA AI LENGTH MARK
+0B57          ; Oriya # Mc       ORIYA AU LENGTH MARK
+0B5C..0B5D    ; Oriya # Lo   [2] ORIYA LETTER RRA..ORIYA LETTER RHA
+0B5F..0B61    ; Oriya # Lo   [3] ORIYA LETTER YYA..ORIYA LETTER VOCALIC LL
+0B62..0B63    ; Oriya # Mn   [2] ORIYA VOWEL SIGN VOCALIC L..ORIYA VOWEL SIGN VOCALIC LL
+0B66..0B6F    ; Oriya # Nd  [10] ORIYA DIGIT ZERO..ORIYA DIGIT NINE
+0B70          ; Oriya # So       ORIYA ISSHAR
+0B71          ; Oriya # Lo       ORIYA LETTER WA
+
+# Total code points: 84
+
+# ================================================
+
+0B82          ; Tamil # Mn       TAMIL SIGN ANUSVARA
+0B83          ; Tamil # Lo       TAMIL SIGN VISARGA
+0B85..0B8A    ; Tamil # Lo   [6] TAMIL LETTER A..TAMIL LETTER UU
+0B8E..0B90    ; Tamil # Lo   [3] TAMIL LETTER E..TAMIL LETTER AI
+0B92..0B95    ; Tamil # Lo   [4] TAMIL LETTER O..TAMIL LETTER KA
+0B99..0B9A    ; Tamil # Lo   [2] TAMIL LETTER NGA..TAMIL LETTER CA
+0B9C          ; Tamil # Lo       TAMIL LETTER JA
+0B9E..0B9F    ; Tamil # Lo   [2] TAMIL LETTER NYA..TAMIL LETTER TTA
+0BA3..0BA4    ; Tamil # Lo   [2] TAMIL LETTER NNA..TAMIL LETTER TA
+0BA8..0BAA    ; Tamil # Lo   [3] TAMIL LETTER NA..TAMIL LETTER PA
+0BAE..0BB9    ; Tamil # Lo  [12] TAMIL LETTER MA..TAMIL LETTER HA
+0BBE..0BBF    ; Tamil # Mc   [2] TAMIL VOWEL SIGN AA..TAMIL VOWEL SIGN I
+0BC0          ; Tamil # Mn       TAMIL VOWEL SIGN II
+0BC1..0BC2    ; Tamil # Mc   [2] TAMIL VOWEL SIGN U..TAMIL VOWEL SIGN UU
+0BC6..0BC8    ; Tamil # Mc   [3] TAMIL VOWEL SIGN E..TAMIL VOWEL SIGN AI
+0BCA..0BCC    ; Tamil # Mc   [3] TAMIL VOWEL SIGN O..TAMIL VOWEL SIGN AU
+0BCD          ; Tamil # Mn       TAMIL SIGN VIRAMA
+0BD0          ; Tamil # Lo       TAMIL OM
+0BD7          ; Tamil # Mc       TAMIL AU LENGTH MARK
+0BE6..0BEF    ; Tamil # Nd  [10] TAMIL DIGIT ZERO..TAMIL DIGIT NINE
+0BF0..0BF2    ; Tamil # No   [3] TAMIL NUMBER TEN..TAMIL NUMBER ONE THOUSAND
+0BF3..0BF8    ; Tamil # So   [6] TAMIL DAY SIGN..TAMIL AS ABOVE SIGN
+0BF9          ; Tamil # Sc       TAMIL RUPEE SIGN
+0BFA          ; Tamil # So       TAMIL NUMBER SIGN
+
+# Total code points: 72
+
+# ================================================
+
+0C01..0C03    ; Telugu # Mc   [3] TELUGU SIGN CANDRABINDU..TELUGU SIGN VISARGA
+0C05..0C0C    ; Telugu # Lo   [8] TELUGU LETTER A..TELUGU LETTER VOCALIC L
+0C0E..0C10    ; Telugu # Lo   [3] TELUGU LETTER E..TELUGU LETTER AI
+0C12..0C28    ; Telugu # Lo  [23] TELUGU LETTER O..TELUGU LETTER NA
+0C2A..0C33    ; Telugu # Lo  [10] TELUGU LETTER PA..TELUGU LETTER LLA
+0C35..0C39    ; Telugu # Lo   [5] TELUGU LETTER VA..TELUGU LETTER HA
+0C3D          ; Telugu # Lo       TELUGU SIGN AVAGRAHA
+0C3E..0C40    ; Telugu # Mn   [3] TELUGU VOWEL SIGN AA..TELUGU VOWEL SIGN II
+0C41..0C44    ; Telugu # Mc   [4] TELUGU VOWEL SIGN U..TELUGU VOWEL SIGN VOCALIC RR
+0C46..0C48    ; Telugu # Mn   [3] TELUGU VOWEL SIGN E..TELUGU VOWEL SIGN AI
+0C4A..0C4D    ; Telugu # Mn   [4] TELUGU VOWEL SIGN O..TELUGU SIGN VIRAMA
+0C55..0C56    ; Telugu # Mn   [2] TELUGU LENGTH MARK..TELUGU AI LENGTH MARK
+0C58..0C59    ; Telugu # Lo   [2] TELUGU LETTER TSA..TELUGU LETTER DZA
+0C60..0C61    ; Telugu # Lo   [2] TELUGU LETTER VOCALIC RR..TELUGU LETTER VOCALIC LL
+0C62..0C63    ; Telugu # Mn   [2] TELUGU VOWEL SIGN VOCALIC L..TELUGU VOWEL SIGN VOCALIC LL
+0C66..0C6F    ; Telugu # Nd  [10] TELUGU DIGIT ZERO..TELUGU DIGIT NINE
+0C78..0C7E    ; Telugu # No   [7] TELUGU FRACTION DIGIT ZERO FOR ODD POWERS OF FOUR..TELUGU FRACTION DIGIT THREE FOR EVEN POWERS OF FOUR
+0C7F          ; Telugu # So       TELUGU SIGN TUUMU
+
+# Total code points: 93
+
+# ================================================
+
+0C82..0C83    ; Kannada # Mc   [2] KANNADA SIGN ANUSVARA..KANNADA SIGN VISARGA
+0C85..0C8C    ; Kannada # Lo   [8] KANNADA LETTER A..KANNADA LETTER VOCALIC L
+0C8E..0C90    ; Kannada # Lo   [3] KANNADA LETTER E..KANNADA LETTER AI
+0C92..0CA8    ; Kannada # Lo  [23] KANNADA LETTER O..KANNADA LETTER NA
+0CAA..0CB3    ; Kannada # Lo  [10] KANNADA LETTER PA..KANNADA LETTER LLA
+0CB5..0CB9    ; Kannada # Lo   [5] KANNADA LETTER VA..KANNADA LETTER HA
+0CBC          ; Kannada # Mn       KANNADA SIGN NUKTA
+0CBD          ; Kannada # Lo       KANNADA SIGN AVAGRAHA
+0CBE          ; Kannada # Mc       KANNADA VOWEL SIGN AA
+0CBF          ; Kannada # Mn       KANNADA VOWEL SIGN I
+0CC0..0CC4    ; Kannada # Mc   [5] KANNADA VOWEL SIGN II..KANNADA VOWEL SIGN VOCALIC RR
+0CC6          ; Kannada # Mn       KANNADA VOWEL SIGN E
+0CC7..0CC8    ; Kannada # Mc   [2] KANNADA VOWEL SIGN EE..KANNADA VOWEL SIGN AI
+0CCA..0CCB    ; Kannada # Mc   [2] KANNADA VOWEL SIGN O..KANNADA VOWEL SIGN OO
+0CCC..0CCD    ; Kannada # Mn   [2] KANNADA VOWEL SIGN AU..KANNADA SIGN VIRAMA
+0CD5..0CD6    ; Kannada # Mc   [2] KANNADA LENGTH MARK..KANNADA AI LENGTH MARK
+0CDE          ; Kannada # Lo       KANNADA LETTER FA
+0CE0..0CE1    ; Kannada # Lo   [2] KANNADA LETTER VOCALIC RR..KANNADA LETTER VOCALIC LL
+0CE2..0CE3    ; Kannada # Mn   [2] KANNADA VOWEL SIGN VOCALIC L..KANNADA VOWEL SIGN VOCALIC LL
+0CE6..0CEF    ; Kannada # Nd  [10] KANNADA DIGIT ZERO..KANNADA DIGIT NINE
+
+# Total code points: 84
+
+# ================================================
+
+0D02..0D03    ; Malayalam # Mc   [2] MALAYALAM SIGN ANUSVARA..MALAYALAM SIGN VISARGA
+0D05..0D0C    ; Malayalam # Lo   [8] MALAYALAM LETTER A..MALAYALAM LETTER VOCALIC L
+0D0E..0D10    ; Malayalam # Lo   [3] MALAYALAM LETTER E..MALAYALAM LETTER AI
+0D12..0D28    ; Malayalam # Lo  [23] MALAYALAM LETTER O..MALAYALAM LETTER NA
+0D2A..0D39    ; Malayalam # Lo  [16] MALAYALAM LETTER PA..MALAYALAM LETTER HA
+0D3D          ; Malayalam # Lo       MALAYALAM SIGN AVAGRAHA
+0D3E..0D40    ; Malayalam # Mc   [3] MALAYALAM VOWEL SIGN AA..MALAYALAM VOWEL SIGN II
+0D41..0D44    ; Malayalam # Mn   [4] MALAYALAM VOWEL SIGN U..MALAYALAM VOWEL SIGN VOCALIC RR
+0D46..0D48    ; Malayalam # Mc   [3] MALAYALAM VOWEL SIGN E..MALAYALAM VOWEL SIGN AI
+0D4A..0D4C    ; Malayalam # Mc   [3] MALAYALAM VOWEL SIGN O..MALAYALAM VOWEL SIGN AU
+0D4D          ; Malayalam # Mn       MALAYALAM SIGN VIRAMA
+0D57          ; Malayalam # Mc       MALAYALAM AU LENGTH MARK
+0D60..0D61    ; Malayalam # Lo   [2] MALAYALAM LETTER VOCALIC RR..MALAYALAM LETTER VOCALIC LL
+0D62..0D63    ; Malayalam # Mn   [2] MALAYALAM VOWEL SIGN VOCALIC L..MALAYALAM VOWEL SIGN VOCALIC LL
+0D66..0D6F    ; Malayalam # Nd  [10] MALAYALAM DIGIT ZERO..MALAYALAM DIGIT NINE
+0D70..0D75    ; Malayalam # No   [6] MALAYALAM NUMBER TEN..MALAYALAM FRACTION THREE QUARTERS
+0D79          ; Malayalam # So       MALAYALAM DATE MARK
+0D7A..0D7F    ; Malayalam # Lo   [6] MALAYALAM LETTER CHILLU NN..MALAYALAM LETTER CHILLU K
+
+# Total code points: 95
+
+# ================================================
+
+0D82..0D83    ; Sinhala # Mc   [2] SINHALA SIGN ANUSVARAYA..SINHALA SIGN VISARGAYA
+0D85..0D96    ; Sinhala # Lo  [18] SINHALA LETTER AYANNA..SINHALA LETTER AUYANNA
+0D9A..0DB1    ; Sinhala # Lo  [24] SINHALA LETTER ALPAPRAANA KAYANNA..SINHALA LETTER DANTAJA NAYANNA
+0DB3..0DBB    ; Sinhala # Lo   [9] SINHALA LETTER SANYAKA DAYANNA..SINHALA LETTER RAYANNA
+0DBD          ; Sinhala # Lo       SINHALA LETTER DANTAJA LAYANNA
+0DC0..0DC6    ; Sinhala # Lo   [7] SINHALA LETTER VAYANNA..SINHALA LETTER FAYANNA
+0DCA          ; Sinhala # Mn       SINHALA SIGN AL-LAKUNA
+0DCF..0DD1    ; Sinhala # Mc   [3] SINHALA VOWEL SIGN AELA-PILLA..SINHALA VOWEL SIGN DIGA AEDA-PILLA
+0DD2..0DD4    ; Sinhala # Mn   [3] SINHALA VOWEL SIGN KETTI IS-PILLA..SINHALA VOWEL SIGN KETTI PAA-PILLA
+0DD6          ; Sinhala # Mn       SINHALA VOWEL SIGN DIGA PAA-PILLA
+0DD8..0DDF    ; Sinhala # Mc   [8] SINHALA VOWEL SIGN GAETTA-PILLA..SINHALA VOWEL SIGN GAYANUKITTA
+0DF2..0DF3    ; Sinhala # Mc   [2] SINHALA VOWEL SIGN DIGA GAETTA-PILLA..SINHALA VOWEL SIGN DIGA GAYANUKITTA
+0DF4          ; Sinhala # Po       SINHALA PUNCTUATION KUNDDALIYA
+
+# Total code points: 80
+
+# ================================================
+
+0E01..0E30    ; Thai # Lo  [48] THAI CHARACTER KO KAI..THAI CHARACTER SARA A
+0E31          ; Thai # Mn       THAI CHARACTER MAI HAN-AKAT
+0E32..0E33    ; Thai # Lo   [2] THAI CHARACTER SARA AA..THAI CHARACTER SARA AM
+0E34..0E3A    ; Thai # Mn   [7] THAI CHARACTER SARA I..THAI CHARACTER PHINTHU
+0E40..0E45    ; Thai # Lo   [6] THAI CHARACTER SARA E..THAI CHARACTER LAKKHANGYAO
+0E46          ; Thai # Lm       THAI CHARACTER MAIYAMOK
+0E47..0E4E    ; Thai # Mn   [8] THAI CHARACTER MAITAIKHU..THAI CHARACTER YAMAKKAN
+0E4F          ; Thai # Po       THAI CHARACTER FONGMAN
+0E50..0E59    ; Thai # Nd  [10] THAI DIGIT ZERO..THAI DIGIT NINE
+0E5A..0E5B    ; Thai # Po   [2] THAI CHARACTER ANGKHANKHU..THAI CHARACTER KHOMUT
+
+# Total code points: 86
+
+# ================================================
+
+0E81..0E82    ; Lao # Lo   [2] LAO LETTER KO..LAO LETTER KHO SUNG
+0E84          ; Lao # Lo       LAO LETTER KHO TAM
+0E87..0E88    ; Lao # Lo   [2] LAO LETTER NGO..LAO LETTER CO
+0E8A          ; Lao # Lo       LAO LETTER SO TAM
+0E8D          ; Lao # Lo       LAO LETTER NYO
+0E94..0E97    ; Lao # Lo   [4] LAO LETTER DO..LAO LETTER THO TAM
+0E99..0E9F    ; Lao # Lo   [7] LAO LETTER NO..LAO LETTER FO SUNG
+0EA1..0EA3    ; Lao # Lo   [3] LAO LETTER MO..LAO LETTER LO LING
+0EA5          ; Lao # Lo       LAO LETTER LO LOOT
+0EA7          ; Lao # Lo       LAO LETTER WO
+0EAA..0EAB    ; Lao # Lo   [2] LAO LETTER SO SUNG..LAO LETTER HO SUNG
+0EAD..0EB0    ; Lao # Lo   [4] LAO LETTER O..LAO VOWEL SIGN A
+0EB1          ; Lao # Mn       LAO VOWEL SIGN MAI KAN
+0EB2..0EB3    ; Lao # Lo   [2] LAO VOWEL SIGN AA..LAO VOWEL SIGN AM
+0EB4..0EB9    ; Lao # Mn   [6] LAO VOWEL SIGN I..LAO VOWEL SIGN UU
+0EBB..0EBC    ; Lao # Mn   [2] LAO VOWEL SIGN MAI KON..LAO SEMIVOWEL SIGN LO
+0EBD          ; Lao # Lo       LAO SEMIVOWEL SIGN NYO
+0EC0..0EC4    ; Lao # Lo   [5] LAO VOWEL SIGN E..LAO VOWEL SIGN AI
+0EC6          ; Lao # Lm       LAO KO LA
+0EC8..0ECD    ; Lao # Mn   [6] LAO TONE MAI EK..LAO NIGGAHITA
+0ED0..0ED9    ; Lao # Nd  [10] LAO DIGIT ZERO..LAO DIGIT NINE
+0EDC..0EDD    ; Lao # Lo   [2] LAO HO NO..LAO HO MO
+
+# Total code points: 65
+
+# ================================================
+
+0F00          ; Tibetan # Lo       TIBETAN SYLLABLE OM
+0F01..0F03    ; Tibetan # So   [3] TIBETAN MARK GTER YIG MGO TRUNCATED A..TIBETAN MARK GTER YIG MGO -UM GTER TSHEG MA
+0F04..0F12    ; Tibetan # Po  [15] TIBETAN MARK INITIAL YIG MGO MDUN MA..TIBETAN MARK RGYA GRAM SHAD
+0F13..0F17    ; Tibetan # So   [5] TIBETAN MARK CARET -DZUD RTAGS ME LONG CAN..TIBETAN ASTROLOGICAL SIGN SGRA GCAN -CHAR RTAGS
+0F18..0F19    ; Tibetan # Mn   [2] TIBETAN ASTROLOGICAL SIGN -KHYUD PA..TIBETAN ASTROLOGICAL SIGN SDONG TSHUGS
+0F1A..0F1F    ; Tibetan # So   [6] TIBETAN SIGN RDEL DKAR GCIG..TIBETAN SIGN RDEL DKAR RDEL NAG
+0F20..0F29    ; Tibetan # Nd  [10] TIBETAN DIGIT ZERO..TIBETAN DIGIT NINE
+0F2A..0F33    ; Tibetan # No  [10] TIBETAN DIGIT HALF ONE..TIBETAN DIGIT HALF ZERO
+0F34          ; Tibetan # So       TIBETAN MARK BSDUS RTAGS
+0F35          ; Tibetan # Mn       TIBETAN MARK NGAS BZUNG NYI ZLA
+0F36          ; Tibetan # So       TIBETAN MARK CARET -DZUD RTAGS BZHI MIG CAN
+0F37          ; Tibetan # Mn       TIBETAN MARK NGAS BZUNG SGOR RTAGS
+0F38          ; Tibetan # So       TIBETAN MARK CHE MGO
+0F39          ; Tibetan # Mn       TIBETAN MARK TSA -PHRU
+0F3A          ; Tibetan # Ps       TIBETAN MARK GUG RTAGS GYON
+0F3B          ; Tibetan # Pe       TIBETAN MARK GUG RTAGS GYAS
+0F3C          ; Tibetan # Ps       TIBETAN MARK ANG KHANG GYON
+0F3D          ; Tibetan # Pe       TIBETAN MARK ANG KHANG GYAS
+0F3E..0F3F    ; Tibetan # Mc   [2] TIBETAN SIGN YAR TSHES..TIBETAN SIGN MAR TSHES
+0F40..0F47    ; Tibetan # Lo   [8] TIBETAN LETTER KA..TIBETAN LETTER JA
+0F49..0F6C    ; Tibetan # Lo  [36] TIBETAN LETTER NYA..TIBETAN LETTER RRA
+0F71..0F7E    ; Tibetan # Mn  [14] TIBETAN VOWEL SIGN AA..TIBETAN SIGN RJES SU NGA RO
+0F7F          ; Tibetan # Mc       TIBETAN SIGN RNAM BCAD
+0F80..0F84    ; Tibetan # Mn   [5] TIBETAN VOWEL SIGN REVERSED I..TIBETAN MARK HALANTA
+0F85          ; Tibetan # Po       TIBETAN MARK PALUTA
+0F86..0F87    ; Tibetan # Mn   [2] TIBETAN SIGN LCI RTAGS..TIBETAN SIGN YANG RTAGS
+0F88..0F8B    ; Tibetan # Lo   [4] TIBETAN SIGN LCE TSA CAN..TIBETAN SIGN GRU MED RGYINGS
+0F90..0F97    ; Tibetan # Mn   [8] TIBETAN SUBJOINED LETTER KA..TIBETAN SUBJOINED LETTER JA
+0F99..0FBC    ; Tibetan # Mn  [36] TIBETAN SUBJOINED LETTER NYA..TIBETAN SUBJOINED LETTER FIXED-FORM RA
+0FBE..0FC5    ; Tibetan # So   [8] TIBETAN KU RU KHA..TIBETAN SYMBOL RDO RJE
+0FC6          ; Tibetan # Mn       TIBETAN SYMBOL PADMA GDAN
+0FC7..0FCC    ; Tibetan # So   [6] TIBETAN SYMBOL RDO RJE RGYA GRAM..TIBETAN SYMBOL NOR BU BZHI -KHYIL
+0FCE..0FCF    ; Tibetan # So   [2] TIBETAN SIGN RDEL NAG RDEL DKAR..TIBETAN SIGN RDEL NAG GSUM
+0FD0..0FD4    ; Tibetan # Po   [5] TIBETAN MARK BSKA- SHOG GI MGO RGYAN..TIBETAN MARK CLOSING BRDA RNYING YIG MGO SGAB MA
+
+# Total code points: 201
+
+# ================================================
+
+1000..102A    ; Myanmar # Lo  [43] MYANMAR LETTER KA..MYANMAR LETTER AU
+102B..102C    ; Myanmar # Mc   [2] MYANMAR VOWEL SIGN TALL AA..MYANMAR VOWEL SIGN AA
+102D..1030    ; Myanmar # Mn   [4] MYANMAR VOWEL SIGN I..MYANMAR VOWEL SIGN UU
+1031          ; Myanmar # Mc       MYANMAR VOWEL SIGN E
+1032..1037    ; Myanmar # Mn   [6] MYANMAR VOWEL SIGN AI..MYANMAR SIGN DOT BELOW
+1038          ; Myanmar # Mc       MYANMAR SIGN VISARGA
+1039..103A    ; Myanmar # Mn   [2] MYANMAR SIGN VIRAMA..MYANMAR SIGN ASAT
+103B..103C    ; Myanmar # Mc   [2] MYANMAR CONSONANT SIGN MEDIAL YA..MYANMAR CONSONANT SIGN MEDIAL RA
+103D..103E    ; Myanmar # Mn   [2] MYANMAR CONSONANT SIGN MEDIAL WA..MYANMAR CONSONANT SIGN MEDIAL HA
+103F          ; Myanmar # Lo       MYANMAR LETTER GREAT SA
+1040..1049    ; Myanmar # Nd  [10] MYANMAR DIGIT ZERO..MYANMAR DIGIT NINE
+104A..104F    ; Myanmar # Po   [6] MYANMAR SIGN LITTLE SECTION..MYANMAR SYMBOL GENITIVE
+1050..1055    ; Myanmar # Lo   [6] MYANMAR LETTER SHA..MYANMAR LETTER VOCALIC LL
+1056..1057    ; Myanmar # Mc   [2] MYANMAR VOWEL SIGN VOCALIC R..MYANMAR VOWEL SIGN VOCALIC RR
+1058..1059    ; Myanmar # Mn   [2] MYANMAR VOWEL SIGN VOCALIC L..MYANMAR VOWEL SIGN VOCALIC LL
+105A..105D    ; Myanmar # Lo   [4] MYANMAR LETTER MON NGA..MYANMAR LETTER MON BBE
+105E..1060    ; Myanmar # Mn   [3] MYANMAR CONSONANT SIGN MON MEDIAL NA..MYANMAR CONSONANT SIGN MON MEDIAL LA
+1061          ; Myanmar # Lo       MYANMAR LETTER SGAW KAREN SHA
+1062..1064    ; Myanmar # Mc   [3] MYANMAR VOWEL SIGN SGAW KAREN EU..MYANMAR TONE MARK SGAW KAREN KE PHO
+1065..1066    ; Myanmar # Lo   [2] MYANMAR LETTER WESTERN PWO KAREN THA..MYANMAR LETTER WESTERN PWO KAREN PWA
+1067..106D    ; Myanmar # Mc   [7] MYANMAR VOWEL SIGN WESTERN PWO KAREN EU..MYANMAR SIGN WESTERN PWO KAREN TONE-5
+106E..1070    ; Myanmar # Lo   [3] MYANMAR LETTER EASTERN PWO KAREN NNA..MYANMAR LETTER EASTERN PWO KAREN GHWA
+1071..1074    ; Myanmar # Mn   [4] MYANMAR VOWEL SIGN GEBA KAREN I..MYANMAR VOWEL SIGN KAYAH EE
+1075..1081    ; Myanmar # Lo  [13] MYANMAR LETTER SHAN KA..MYANMAR LETTER SHAN HA
+1082          ; Myanmar # Mn       MYANMAR CONSONANT SIGN SHAN MEDIAL WA
+1083..1084    ; Myanmar # Mc   [2] MYANMAR VOWEL SIGN SHAN AA..MYANMAR VOWEL SIGN SHAN E
+1085..1086    ; Myanmar # Mn   [2] MYANMAR VOWEL SIGN SHAN E ABOVE..MYANMAR VOWEL SIGN SHAN FINAL Y
+1087..108C    ; Myanmar # Mc   [6] MYANMAR SIGN SHAN TONE-2..MYANMAR SIGN SHAN COUNCIL TONE-3
+108D          ; Myanmar # Mn       MYANMAR SIGN SHAN COUNCIL EMPHATIC TONE
+108E          ; Myanmar # Lo       MYANMAR LETTER RUMAI PALAUNG FA
+108F          ; Myanmar # Mc       MYANMAR SIGN RUMAI PALAUNG TONE-5
+1090..1099    ; Myanmar # Nd  [10] MYANMAR SHAN DIGIT ZERO..MYANMAR SHAN DIGIT NINE
+109A..109C    ; Myanmar # Mc   [3] MYANMAR SIGN KHAMTI TONE-1..MYANMAR VOWEL SIGN AITON A
+109D          ; Myanmar # Mn       MYANMAR VOWEL SIGN AITON AI
+109E..109F    ; Myanmar # So   [2] MYANMAR SYMBOL SHAN ONE..MYANMAR SYMBOL SHAN EXCLAMATION
+AA60..AA6F    ; Myanmar # Lo  [16] MYANMAR LETTER KHAMTI GA..MYANMAR LETTER KHAMTI FA
+AA70          ; Myanmar # Lm       MYANMAR MODIFIER LETTER KHAMTI REDUPLICATION
+AA71..AA76    ; Myanmar # Lo   [6] MYANMAR LETTER KHAMTI XA..MYANMAR LOGOGRAM KHAMTI HM
+AA77..AA79    ; Myanmar # So   [3] MYANMAR SYMBOL AITON EXCLAMATION..MYANMAR SYMBOL AITON TWO
+AA7A          ; Myanmar # Lo       MYANMAR LETTER AITON RA
+AA7B          ; Myanmar # Mc       MYANMAR SIGN PAO KAREN TONE
+
+# Total code points: 188
+
+# ================================================
+
+10A0..10C5    ; Georgian # L&  [38] GEORGIAN CAPITAL LETTER AN..GEORGIAN CAPITAL LETTER HOE
+10D0..10FA    ; Georgian # Lo  [43] GEORGIAN LETTER AN..GEORGIAN LETTER AIN
+10FC          ; Georgian # Lm       MODIFIER LETTER GEORGIAN NAR
+2D00..2D25    ; Georgian # L&  [38] GEORGIAN SMALL LETTER AN..GEORGIAN SMALL LETTER HOE
+
+# Total code points: 120
+
+# ================================================
+
+1100..11FF    ; Hangul # Lo [256] HANGUL CHOSEONG KIYEOK..HANGUL JONGSEONG SSANGNIEUN
+3131..318E    ; Hangul # Lo  [94] HANGUL LETTER KIYEOK..HANGUL LETTER ARAEAE
+3200..321E    ; Hangul # So  [31] PARENTHESIZED HANGUL KIYEOK..PARENTHESIZED KOREAN CHARACTER O HU
+3260..327E    ; Hangul # So  [31] CIRCLED HANGUL KIYEOK..CIRCLED HANGUL IEUNG U
+A960..A97C    ; Hangul # Lo  [29] HANGUL CHOSEONG TIKEUT-MIEUM..HANGUL CHOSEONG SSANGYEORINHIEUH
+AC00..D7A3    ; Hangul # Lo [11172] HANGUL SYLLABLE GA..HANGUL SYLLABLE HIH
+D7B0..D7C6    ; Hangul # Lo  [23] HANGUL JUNGSEONG O-YEO..HANGUL JUNGSEONG ARAEA-E
+D7CB..D7FB    ; Hangul # Lo  [49] HANGUL JONGSEONG NIEUN-RIEUL..HANGUL JONGSEONG PHIEUPH-THIEUTH
+FFA0..FFBE    ; Hangul # Lo  [31] HALFWIDTH HANGUL FILLER..HALFWIDTH HANGUL LETTER HIEUH
+FFC2..FFC7    ; Hangul # Lo   [6] HALFWIDTH HANGUL LETTER A..HALFWIDTH HANGUL LETTER E
+FFCA..FFCF    ; Hangul # Lo   [6] HALFWIDTH HANGUL LETTER YEO..HALFWIDTH HANGUL LETTER OE
+FFD2..FFD7    ; Hangul # Lo   [6] HALFWIDTH HANGUL LETTER YO..HALFWIDTH HANGUL LETTER YU
+FFDA..FFDC    ; Hangul # Lo   [3] HALFWIDTH HANGUL LETTER EU..HALFWIDTH HANGUL LETTER I
+
+# Total code points: 11737
+
+# ================================================
+
+1200..1248    ; Ethiopic # Lo  [73] ETHIOPIC SYLLABLE HA..ETHIOPIC SYLLABLE QWA
+124A..124D    ; Ethiopic # Lo   [4] ETHIOPIC SYLLABLE QWI..ETHIOPIC SYLLABLE QWE
+1250..1256    ; Ethiopic # Lo   [7] ETHIOPIC SYLLABLE QHA..ETHIOPIC SYLLABLE QHO
+1258          ; Ethiopic # Lo       ETHIOPIC SYLLABLE QHWA
+125A..125D    ; Ethiopic # Lo   [4] ETHIOPIC SYLLABLE QHWI..ETHIOPIC SYLLABLE QHWE
+1260..1288    ; Ethiopic # Lo  [41] ETHIOPIC SYLLABLE BA..ETHIOPIC SYLLABLE XWA
+128A..128D    ; Ethiopic # Lo   [4] ETHIOPIC SYLLABLE XWI..ETHIOPIC SYLLABLE XWE
+1290..12B0    ; Ethiopic # Lo  [33] ETHIOPIC SYLLABLE NA..ETHIOPIC SYLLABLE KWA
+12B2..12B5    ; Ethiopic # Lo   [4] ETHIOPIC SYLLABLE KWI..ETHIOPIC SYLLABLE KWE
+12B8..12BE    ; Ethiopic # Lo   [7] ETHIOPIC SYLLABLE KXA..ETHIOPIC SYLLABLE KXO
+12C0          ; Ethiopic # Lo       ETHIOPIC SYLLABLE KXWA
+12C2..12C5    ; Ethiopic # Lo   [4] ETHIOPIC SYLLABLE KXWI..ETHIOPIC SYLLABLE KXWE
+12C8..12D6    ; Ethiopic # Lo  [15] ETHIOPIC SYLLABLE WA..ETHIOPIC SYLLABLE PHARYNGEAL O
+12D8..1310    ; Ethiopic # Lo  [57] ETHIOPIC SYLLABLE ZA..ETHIOPIC SYLLABLE GWA
+1312..1315    ; Ethiopic # Lo   [4] ETHIOPIC SYLLABLE GWI..ETHIOPIC SYLLABLE GWE
+1318..135A    ; Ethiopic # Lo  [67] ETHIOPIC SYLLABLE GGA..ETHIOPIC SYLLABLE FYA
+135F          ; Ethiopic # Mn       ETHIOPIC COMBINING GEMINATION MARK
+1360          ; Ethiopic # So       ETHIOPIC SECTION MARK
+1361..1368    ; Ethiopic # Po   [8] ETHIOPIC WORDSPACE..ETHIOPIC PARAGRAPH SEPARATOR
+1369..137C    ; Ethiopic # No  [20] ETHIOPIC DIGIT ONE..ETHIOPIC NUMBER TEN THOUSAND
+1380..138F    ; Ethiopic # Lo  [16] ETHIOPIC SYLLABLE SEBATBEIT MWA..ETHIOPIC SYLLABLE PWE
+1390..1399    ; Ethiopic # So  [10] ETHIOPIC TONAL MARK YIZET..ETHIOPIC TONAL MARK KURT
+2D80..2D96    ; Ethiopic # Lo  [23] ETHIOPIC SYLLABLE LOA..ETHIOPIC SYLLABLE GGWE
+2DA0..2DA6    ; Ethiopic # Lo   [7] ETHIOPIC SYLLABLE SSA..ETHIOPIC SYLLABLE SSO
+2DA8..2DAE    ; Ethiopic # Lo   [7] ETHIOPIC SYLLABLE CCA..ETHIOPIC SYLLABLE CCO
+2DB0..2DB6    ; Ethiopic # Lo   [7] ETHIOPIC SYLLABLE ZZA..ETHIOPIC SYLLABLE ZZO
+2DB8..2DBE    ; Ethiopic # Lo   [7] ETHIOPIC SYLLABLE CCHA..ETHIOPIC SYLLABLE CCHO
+2DC0..2DC6    ; Ethiopic # Lo   [7] ETHIOPIC SYLLABLE QYA..ETHIOPIC SYLLABLE QYO
+2DC8..2DCE    ; Ethiopic # Lo   [7] ETHIOPIC SYLLABLE KYA..ETHIOPIC SYLLABLE KYO
+2DD0..2DD6    ; Ethiopic # Lo   [7] ETHIOPIC SYLLABLE XYA..ETHIOPIC SYLLABLE XYO
+2DD8..2DDE    ; Ethiopic # Lo   [7] ETHIOPIC SYLLABLE GYA..ETHIOPIC SYLLABLE GYO
+
+# Total code points: 461
+
+# ================================================
+
+13A0..13F4    ; Cherokee # Lo  [85] CHEROKEE LETTER A..CHEROKEE LETTER YV
+
+# Total code points: 85
+
+# ================================================
+
+1400          ; Canadian_Aboriginal # Pd       CANADIAN SYLLABICS HYPHEN
+1401..166C    ; Canadian_Aboriginal # Lo [620] CANADIAN SYLLABICS E..CANADIAN SYLLABICS CARRIER TTSA
+166D..166E    ; Canadian_Aboriginal # Po   [2] CANADIAN SYLLABICS CHI SIGN..CANADIAN SYLLABICS FULL STOP
+166F..167F    ; Canadian_Aboriginal # Lo  [17] CANADIAN SYLLABICS QAI..CANADIAN SYLLABICS BLACKFOOT W
+18B0..18F5    ; Canadian_Aboriginal # Lo  [70] CANADIAN SYLLABICS OY..CANADIAN SYLLABICS CARRIER DENTAL S
+
+# Total code points: 710
+
+# ================================================
+
+1680          ; Ogham # Zs       OGHAM SPACE MARK
+1681..169A    ; Ogham # Lo  [26] OGHAM LETTER BEITH..OGHAM LETTER PEITH
+169B          ; Ogham # Ps       OGHAM FEATHER MARK
+169C          ; Ogham # Pe       OGHAM REVERSED FEATHER MARK
+
+# Total code points: 29
+
+# ================================================
+
+16A0..16EA    ; Runic # Lo  [75] RUNIC LETTER FEHU FEOH FE F..RUNIC LETTER X
+16EE..16F0    ; Runic # Nl   [3] RUNIC ARLAUG SYMBOL..RUNIC BELGTHOR SYMBOL
+
+# Total code points: 78
+
+# ================================================
+
+1780..17B3    ; Khmer # Lo  [52] KHMER LETTER KA..KHMER INDEPENDENT VOWEL QAU
+17B4..17B5    ; Khmer # Cf   [2] KHMER VOWEL INHERENT AQ..KHMER VOWEL INHERENT AA
+17B6          ; Khmer # Mc       KHMER VOWEL SIGN AA
+17B7..17BD    ; Khmer # Mn   [7] KHMER VOWEL SIGN I..KHMER VOWEL SIGN UA
+17BE..17C5    ; Khmer # Mc   [8] KHMER VOWEL SIGN OE..KHMER VOWEL SIGN AU
+17C6          ; Khmer # Mn       KHMER SIGN NIKAHIT
+17C7..17C8    ; Khmer # Mc   [2] KHMER SIGN REAHMUK..KHMER SIGN YUUKALEAPINTU
+17C9..17D3    ; Khmer # Mn  [11] KHMER SIGN MUUSIKATOAN..KHMER SIGN BATHAMASAT
+17D4..17D6    ; Khmer # Po   [3] KHMER SIGN KHAN..KHMER SIGN CAMNUC PII KUUH
+17D7          ; Khmer # Lm       KHMER SIGN LEK TOO
+17D8..17DA    ; Khmer # Po   [3] KHMER SIGN BEYYAL..KHMER SIGN KOOMUUT
+17DB          ; Khmer # Sc       KHMER CURRENCY SYMBOL RIEL
+17DC          ; Khmer # Lo       KHMER SIGN AVAKRAHASANYA
+17DD          ; Khmer # Mn       KHMER SIGN ATTHACAN
+17E0..17E9    ; Khmer # Nd  [10] KHMER DIGIT ZERO..KHMER DIGIT NINE
+17F0..17F9    ; Khmer # No  [10] KHMER SYMBOL LEK ATTAK SON..KHMER SYMBOL LEK ATTAK PRAM-BUON
+19E0..19FF    ; Khmer # So  [32] KHMER SYMBOL PATHAMASAT..KHMER SYMBOL DAP-PRAM ROC
+
+# Total code points: 146
+
+# ================================================
+
+1800..1801    ; Mongolian # Po   [2] MONGOLIAN BIRGA..MONGOLIAN ELLIPSIS
+1804          ; Mongolian # Po       MONGOLIAN COLON
+1806          ; Mongolian # Pd       MONGOLIAN TODO SOFT HYPHEN
+1807..180A    ; Mongolian # Po   [4] MONGOLIAN SIBE SYLLABLE BOUNDARY MARKER..MONGOLIAN NIRUGU
+180B..180D    ; Mongolian # Mn   [3] MONGOLIAN FREE VARIATION SELECTOR ONE..MONGOLIAN FREE VARIATION SELECTOR THREE
+180E          ; Mongolian # Zs       MONGOLIAN VOWEL SEPARATOR
+1810..1819    ; Mongolian # Nd  [10] MONGOLIAN DIGIT ZERO..MONGOLIAN DIGIT NINE
+1820..1842    ; Mongolian # Lo  [35] MONGOLIAN LETTER A..MONGOLIAN LETTER CHI
+1843          ; Mongolian # Lm       MONGOLIAN LETTER TODO LONG VOWEL SIGN
+1844..1877    ; Mongolian # Lo  [52] MONGOLIAN LETTER TODO E..MONGOLIAN LETTER MANCHU ZHA
+1880..18A8    ; Mongolian # Lo  [41] MONGOLIAN LETTER ALI GALI ANUSVARA ONE..MONGOLIAN LETTER MANCHU ALI GALI BHA
+18A9          ; Mongolian # Mn       MONGOLIAN LETTER ALI GALI DAGALGA
+18AA          ; Mongolian # Lo       MONGOLIAN LETTER MANCHU ALI GALI LHA
+
+# Total code points: 153
+
+# ================================================
+
+3041..3096    ; Hiragana # Lo  [86] HIRAGANA LETTER SMALL A..HIRAGANA LETTER SMALL KE
+309D..309E    ; Hiragana # Lm   [2] HIRAGANA ITERATION MARK..HIRAGANA VOICED ITERATION MARK
+309F          ; Hiragana # Lo       HIRAGANA DIGRAPH YORI
+1F200         ; Hiragana # So       SQUARE HIRAGANA HOKA
+
+# Total code points: 90
+
+# ================================================
+
+30A1..30FA    ; Katakana # Lo  [90] KATAKANA LETTER SMALL A..KATAKANA LETTER VO
+30FD..30FE    ; Katakana # Lm   [2] KATAKANA ITERATION MARK..KATAKANA VOICED ITERATION MARK
+30FF          ; Katakana # Lo       KATAKANA DIGRAPH KOTO
+31F0..31FF    ; Katakana # Lo  [16] KATAKANA LETTER SMALL KU..KATAKANA LETTER SMALL RO
+32D0..32FE    ; Katakana # So  [47] CIRCLED KATAKANA A..CIRCLED KATAKANA WO
+3300..3357    ; Katakana # So  [88] SQUARE APAATO..SQUARE WATTO
+FF66..FF6F    ; Katakana # Lo  [10] HALFWIDTH KATAKANA LETTER WO..HALFWIDTH KATAKANA LETTER SMALL TU
+FF71..FF9D    ; Katakana # Lo  [45] HALFWIDTH KATAKANA LETTER A..HALFWIDTH KATAKANA LETTER N
+
+# Total code points: 299
+
+# ================================================
+
+3105..312D    ; Bopomofo # Lo  [41] BOPOMOFO LETTER B..BOPOMOFO LETTER IH
+31A0..31B7    ; Bopomofo # Lo  [24] BOPOMOFO LETTER BU..BOPOMOFO FINAL LETTER H
+
+# Total code points: 65
+
+# ================================================
+
+2E80..2E99    ; Han # So  [26] CJK RADICAL REPEAT..CJK RADICAL RAP
+2E9B..2EF3    ; Han # So  [89] CJK RADICAL CHOKE..CJK RADICAL C-SIMPLIFIED TURTLE
+2F00..2FD5    ; Han # So [214] KANGXI RADICAL ONE..KANGXI RADICAL FLUTE
+3005          ; Han # Lm       IDEOGRAPHIC ITERATION MARK
+3007          ; Han # Nl       IDEOGRAPHIC NUMBER ZERO
+3021..3029    ; Han # Nl   [9] HANGZHOU NUMERAL ONE..HANGZHOU NUMERAL NINE
+3038..303A    ; Han # Nl   [3] HANGZHOU NUMERAL TEN..HANGZHOU NUMERAL THIRTY
+303B          ; Han # Lm       VERTICAL IDEOGRAPHIC ITERATION MARK
+3400..4DB5    ; Han # Lo [6582] CJK UNIFIED IDEOGRAPH-3400..CJK UNIFIED IDEOGRAPH-4DB5
+4E00..9FCB    ; Han # Lo [20940] CJK UNIFIED IDEOGRAPH-4E00..CJK UNIFIED IDEOGRAPH-9FCB
+F900..FA2D    ; Han # Lo [302] CJK COMPATIBILITY IDEOGRAPH-F900..CJK COMPATIBILITY IDEOGRAPH-FA2D
+FA30..FA6D    ; Han # Lo  [62] CJK COMPATIBILITY IDEOGRAPH-FA30..CJK COMPATIBILITY IDEOGRAPH-FA6D
+FA70..FAD9    ; Han # Lo [106] CJK COMPATIBILITY IDEOGRAPH-FA70..CJK COMPATIBILITY IDEOGRAPH-FAD9
+20000..2A6D6  ; Han # Lo [42711] CJK UNIFIED IDEOGRAPH-20000..CJK UNIFIED IDEOGRAPH-2A6D6
+2A700..2B734  ; Han # Lo [4149] CJK UNIFIED IDEOGRAPH-2A700..CJK UNIFIED IDEOGRAPH-2B734
+2F800..2FA1D  ; Han # Lo [542] CJK COMPATIBILITY IDEOGRAPH-2F800..CJK COMPATIBILITY IDEOGRAPH-2FA1D
+
+# Total code points: 75738
+
+# ================================================
+
+A000..A014    ; Yi # Lo  [21] YI SYLLABLE IT..YI SYLLABLE E
+A015          ; Yi # Lm       YI SYLLABLE WU
+A016..A48C    ; Yi # Lo [1143] YI SYLLABLE BIT..YI SYLLABLE YYR
+A490..A4C6    ; Yi # So  [55] YI RADICAL QOT..YI RADICAL KE
+
+# Total code points: 1220
+
+# ================================================
+
+10300..1031E  ; Old_Italic # Lo  [31] OLD ITALIC LETTER A..OLD ITALIC LETTER UU
+10320..10323  ; Old_Italic # No   [4] OLD ITALIC NUMERAL ONE..OLD ITALIC NUMERAL FIFTY
+
+# Total code points: 35
+
+# ================================================
+
+10330..10340  ; Gothic # Lo  [17] GOTHIC LETTER AHSA..GOTHIC LETTER PAIRTHRA
+10341         ; Gothic # Nl       GOTHIC LETTER NINETY
+10342..10349  ; Gothic # Lo   [8] GOTHIC LETTER RAIDA..GOTHIC LETTER OTHAL
+1034A         ; Gothic # Nl       GOTHIC LETTER NINE HUNDRED
+
+# Total code points: 27
+
+# ================================================
+
+10400..1044F  ; Deseret # L&  [80] DESERET CAPITAL LETTER LONG I..DESERET SMALL LETTER EW
+
+# Total code points: 80
+
+# ================================================
+
+0300..036F    ; Inherited # Mn [112] COMBINING GRAVE ACCENT..COMBINING LATIN SMALL LETTER X
+0485..0486    ; Inherited # Mn   [2] COMBINING CYRILLIC DASIA PNEUMATA..COMBINING CYRILLIC PSILI PNEUMATA
+064B..0655    ; Inherited # Mn  [11] ARABIC FATHATAN..ARABIC HAMZA BELOW
+0670          ; Inherited # Mn       ARABIC LETTER SUPERSCRIPT ALEF
+0951..0952    ; Inherited # Mn   [2] DEVANAGARI STRESS SIGN UDATTA..DEVANAGARI STRESS SIGN ANUDATTA
+1CD0..1CD2    ; Inherited # Mn   [3] VEDIC TONE KARSHANA..VEDIC TONE PRENKHA
+1CD4..1CE0    ; Inherited # Mn  [13] VEDIC SIGN YAJURVEDIC MIDLINE SVARITA..VEDIC TONE RIGVEDIC KASHMIRI INDEPENDENT SVARITA
+1CE2..1CE8    ; Inherited # Mn   [7] VEDIC SIGN VISARGA SVARITA..VEDIC SIGN VISARGA ANUDATTA WITH TAIL
+1CED          ; Inherited # Mn       VEDIC SIGN TIRYAK
+1DC0..1DE6    ; Inherited # Mn  [39] COMBINING DOTTED GRAVE ACCENT..COMBINING LATIN SMALL LETTER Z
+1DFD..1DFF    ; Inherited # Mn   [3] COMBINING ALMOST EQUAL TO BELOW..COMBINING RIGHT ARROWHEAD AND DOWN ARROWHEAD BELOW
+200C..200D    ; Inherited # Cf   [2] ZERO WIDTH NON-JOINER..ZERO WIDTH JOINER
+20D0..20DC    ; Inherited # Mn  [13] COMBINING LEFT HARPOON ABOVE..COMBINING FOUR DOTS ABOVE
+20DD..20E0    ; Inherited # Me   [4] COMBINING ENCLOSING CIRCLE..COMBINING ENCLOSING CIRCLE BACKSLASH
+20E1          ; Inherited # Mn       COMBINING LEFT RIGHT ARROW ABOVE
+20E2..20E4    ; Inherited # Me   [3] COMBINING ENCLOSING SCREEN..COMBINING ENCLOSING UPWARD POINTING TRIANGLE
+20E5..20F0    ; Inherited # Mn  [12] COMBINING REVERSE SOLIDUS OVERLAY..COMBINING ASTERISK ABOVE
+302A..302F    ; Inherited # Mn   [6] IDEOGRAPHIC LEVEL TONE MARK..HANGUL DOUBLE DOT TONE MARK
+3099..309A    ; Inherited # Mn   [2] COMBINING KATAKANA-HIRAGANA VOICED SOUND MARK..COMBINING KATAKANA-HIRAGANA SEMI-VOICED SOUND MARK
+FE00..FE0F    ; Inherited # Mn  [16] VARIATION SELECTOR-1..VARIATION SELECTOR-16
+FE20..FE26    ; Inherited # Mn   [7] COMBINING LIGATURE LEFT HALF..COMBINING CONJOINING MACRON
+101FD         ; Inherited # Mn       PHAISTOS DISC SIGN COMBINING OBLIQUE STROKE
+1D167..1D169  ; Inherited # Mn   [3] MUSICAL SYMBOL COMBINING TREMOLO-1..MUSICAL SYMBOL COMBINING TREMOLO-3
+1D17B..1D182  ; Inherited # Mn   [8] MUSICAL SYMBOL COMBINING ACCENT..MUSICAL SYMBOL COMBINING LOURE
+1D185..1D18B  ; Inherited # Mn   [7] MUSICAL SYMBOL COMBINING DOIT..MUSICAL SYMBOL COMBINING TRIPLE TONGUE
+1D1AA..1D1AD  ; Inherited # Mn   [4] MUSICAL SYMBOL COMBINING DOWN BOW..MUSICAL SYMBOL COMBINING SNAP PIZZICATO
+E0100..E01EF  ; Inherited # Mn [240] VARIATION SELECTOR-17..VARIATION SELECTOR-256
+
+# Total code points: 523
+
+# ================================================
+
+1700..170C    ; Tagalog # Lo  [13] TAGALOG LETTER A..TAGALOG LETTER YA
+170E..1711    ; Tagalog # Lo   [4] TAGALOG LETTER LA..TAGALOG LETTER HA
+1712..1714    ; Tagalog # Mn   [3] TAGALOG VOWEL SIGN I..TAGALOG SIGN VIRAMA
+
+# Total code points: 20
+
+# ================================================
+
+1720..1731    ; Hanunoo # Lo  [18] HANUNOO LETTER A..HANUNOO LETTER HA
+1732..1734    ; Hanunoo # Mn   [3] HANUNOO VOWEL SIGN I..HANUNOO SIGN PAMUDPOD
+
+# Total code points: 21
+
+# ================================================
+
+1740..1751    ; Buhid # Lo  [18] BUHID LETTER A..BUHID LETTER HA
+1752..1753    ; Buhid # Mn   [2] BUHID VOWEL SIGN I..BUHID VOWEL SIGN U
+
+# Total code points: 20
+
+# ================================================
+
+1760..176C    ; Tagbanwa # Lo  [13] TAGBANWA LETTER A..TAGBANWA LETTER YA
+176E..1770    ; Tagbanwa # Lo   [3] TAGBANWA LETTER LA..TAGBANWA LETTER SA
+1772..1773    ; Tagbanwa # Mn   [2] TAGBANWA VOWEL SIGN I..TAGBANWA VOWEL SIGN U
+
+# Total code points: 18
+
+# ================================================
+
+1900..191C    ; Limbu # Lo  [29] LIMBU VOWEL-CARRIER LETTER..LIMBU LETTER HA
+1920..1922    ; Limbu # Mn   [3] LIMBU VOWEL SIGN A..LIMBU VOWEL SIGN U
+1923..1926    ; Limbu # Mc   [4] LIMBU VOWEL SIGN EE..LIMBU VOWEL SIGN AU
+1927..1928    ; Limbu # Mn   [2] LIMBU VOWEL SIGN E..LIMBU VOWEL SIGN O
+1929..192B    ; Limbu # Mc   [3] LIMBU SUBJOINED LETTER YA..LIMBU SUBJOINED LETTER WA
+1930..1931    ; Limbu # Mc   [2] LIMBU SMALL LETTER KA..LIMBU SMALL LETTER NGA
+1932          ; Limbu # Mn       LIMBU SMALL LETTER ANUSVARA
+1933..1938    ; Limbu # Mc   [6] LIMBU SMALL LETTER TA..LIMBU SMALL LETTER LA
+1939..193B    ; Limbu # Mn   [3] LIMBU SIGN MUKPHRENG..LIMBU SIGN SA-I
+1940          ; Limbu # So       LIMBU SIGN LOO
+1944..1945    ; Limbu # Po   [2] LIMBU EXCLAMATION MARK..LIMBU QUESTION MARK
+1946..194F    ; Limbu # Nd  [10] LIMBU DIGIT ZERO..LIMBU DIGIT NINE
+
+# Total code points: 66
+
+# ================================================
+
+1950..196D    ; Tai_Le # Lo  [30] TAI LE LETTER KA..TAI LE LETTER AI
+1970..1974    ; Tai_Le # Lo   [5] TAI LE LETTER TONE-2..TAI LE LETTER TONE-6
+
+# Total code points: 35
+
+# ================================================
+
+10000..1000B  ; Linear_B # Lo  [12] LINEAR B SYLLABLE B008 A..LINEAR B SYLLABLE B046 JE
+1000D..10026  ; Linear_B # Lo  [26] LINEAR B SYLLABLE B036 JO..LINEAR B SYLLABLE B032 QO
+10028..1003A  ; Linear_B # Lo  [19] LINEAR B SYLLABLE B060 RA..LINEAR B SYLLABLE B042 WO
+1003C..1003D  ; Linear_B # Lo   [2] LINEAR B SYLLABLE B017 ZA..LINEAR B SYLLABLE B074 ZE
+1003F..1004D  ; Linear_B # Lo  [15] LINEAR B SYLLABLE B020 ZO..LINEAR B SYLLABLE B091 TWO
+10050..1005D  ; Linear_B # Lo  [14] LINEAR B SYMBOL B018..LINEAR B SYMBOL B089
+10080..100FA  ; Linear_B # Lo [123] LINEAR B IDEOGRAM B100 MAN..LINEAR B IDEOGRAM VESSEL B305
+
+# Total code points: 211
+
+# ================================================
+
+10380..1039D  ; Ugaritic # Lo  [30] UGARITIC LETTER ALPA..UGARITIC LETTER SSU
+1039F         ; Ugaritic # Po       UGARITIC WORD DIVIDER
+
+# Total code points: 31
+
+# ================================================
+
+10450..1047F  ; Shavian # Lo  [48] SHAVIAN LETTER PEEP..SHAVIAN LETTER YEW
+
+# Total code points: 48
+
+# ================================================
+
+10480..1049D  ; Osmanya # Lo  [30] OSMANYA LETTER ALEF..OSMANYA LETTER OO
+104A0..104A9  ; Osmanya # Nd  [10] OSMANYA DIGIT ZERO..OSMANYA DIGIT NINE
+
+# Total code points: 40
+
+# ================================================
+
+10800..10805  ; Cypriot # Lo   [6] CYPRIOT SYLLABLE A..CYPRIOT SYLLABLE JA
+10808         ; Cypriot # Lo       CYPRIOT SYLLABLE JO
+1080A..10835  ; Cypriot # Lo  [44] CYPRIOT SYLLABLE KA..CYPRIOT SYLLABLE WO
+10837..10838  ; Cypriot # Lo   [2] CYPRIOT SYLLABLE XA..CYPRIOT SYLLABLE XE
+1083C         ; Cypriot # Lo       CYPRIOT SYLLABLE ZA
+1083F         ; Cypriot # Lo       CYPRIOT SYLLABLE ZO
+
+# Total code points: 55
+
+# ================================================
+
+2800..28FF    ; Braille # So [256] BRAILLE PATTERN BLANK..BRAILLE PATTERN DOTS-12345678
+
+# Total code points: 256
+
+# ================================================
+
+1A00..1A16    ; Buginese # Lo  [23] BUGINESE LETTER KA..BUGINESE LETTER HA
+1A17..1A18    ; Buginese # Mn   [2] BUGINESE VOWEL SIGN I..BUGINESE VOWEL SIGN U
+1A19..1A1B    ; Buginese # Mc   [3] BUGINESE VOWEL SIGN E..BUGINESE VOWEL SIGN AE
+1A1E..1A1F    ; Buginese # Po   [2] BUGINESE PALLAWA..BUGINESE END OF SECTION
+
+# Total code points: 30
+
+# ================================================
+
+03E2..03EF    ; Coptic # L&  [14] COPTIC CAPITAL LETTER SHEI..COPTIC SMALL LETTER DEI
+2C80..2CE4    ; Coptic # L& [101] COPTIC CAPITAL LETTER ALFA..COPTIC SYMBOL KAI
+2CE5..2CEA    ; Coptic # So   [6] COPTIC SYMBOL MI RO..COPTIC SYMBOL SHIMA SIMA
+2CEB..2CEE    ; Coptic # L&   [4] COPTIC CAPITAL LETTER CRYPTOGRAMMIC SHEI..COPTIC SMALL LETTER CRYPTOGRAMMIC GANGIA
+2CEF..2CF1    ; Coptic # Mn   [3] COPTIC COMBINING NI ABOVE..COPTIC COMBINING SPIRITUS LENIS
+2CF9..2CFC    ; Coptic # Po   [4] COPTIC OLD NUBIAN FULL STOP..COPTIC OLD NUBIAN VERSE DIVIDER
+2CFD          ; Coptic # No       COPTIC FRACTION ONE HALF
+2CFE..2CFF    ; Coptic # Po   [2] COPTIC FULL STOP..COPTIC MORPHOLOGICAL DIVIDER
+
+# Total code points: 135
+
+# ================================================
+
+1980..19AB    ; New_Tai_Lue # Lo  [44] NEW TAI LUE LETTER HIGH QA..NEW TAI LUE LETTER LOW SUA
+19B0..19C0    ; New_Tai_Lue # Mc  [17] NEW TAI LUE VOWEL SIGN VOWEL SHORTENER..NEW TAI LUE VOWEL SIGN IY
+19C1..19C7    ; New_Tai_Lue # Lo   [7] NEW TAI LUE LETTER FINAL V..NEW TAI LUE LETTER FINAL B
+19C8..19C9    ; New_Tai_Lue # Mc   [2] NEW TAI LUE TONE MARK-1..NEW TAI LUE TONE MARK-2
+19D0..19DA    ; New_Tai_Lue # Nd  [11] NEW TAI LUE DIGIT ZERO..NEW TAI LUE THAM DIGIT ONE
+19DE..19DF    ; New_Tai_Lue # Po   [2] NEW TAI LUE SIGN LAE..NEW TAI LUE SIGN LAEV
+
+# Total code points: 83
+
+# ================================================
+
+2C00..2C2E    ; Glagolitic # L&  [47] GLAGOLITIC CAPITAL LETTER AZU..GLAGOLITIC CAPITAL LETTER LATINATE MYSLITE
+2C30..2C5E    ; Glagolitic # L&  [47] GLAGOLITIC SMALL LETTER AZU..GLAGOLITIC SMALL LETTER LATINATE MYSLITE
+
+# Total code points: 94
+
+# ================================================
+
+2D30..2D65    ; Tifinagh # Lo  [54] TIFINAGH LETTER YA..TIFINAGH LETTER YAZZ
+2D6F          ; Tifinagh # Lm       TIFINAGH MODIFIER LETTER LABIALIZATION MARK
+
+# Total code points: 55
+
+# ================================================
+
+A800..A801    ; Syloti_Nagri # Lo   [2] SYLOTI NAGRI LETTER A..SYLOTI NAGRI LETTER I
+A802          ; Syloti_Nagri # Mn       SYLOTI NAGRI SIGN DVISVARA
+A803..A805    ; Syloti_Nagri # Lo   [3] SYLOTI NAGRI LETTER U..SYLOTI NAGRI LETTER O
+A806          ; Syloti_Nagri # Mn       SYLOTI NAGRI SIGN HASANTA
+A807..A80A    ; Syloti_Nagri # Lo   [4] SYLOTI NAGRI LETTER KO..SYLOTI NAGRI LETTER GHO
+A80B          ; Syloti_Nagri # Mn       SYLOTI NAGRI SIGN ANUSVARA
+A80C..A822    ; Syloti_Nagri # Lo  [23] SYLOTI NAGRI LETTER CO..SYLOTI NAGRI LETTER HO
+A823..A824    ; Syloti_Nagri # Mc   [2] SYLOTI NAGRI VOWEL SIGN A..SYLOTI NAGRI VOWEL SIGN I
+A825..A826    ; Syloti_Nagri # Mn   [2] SYLOTI NAGRI VOWEL SIGN U..SYLOTI NAGRI VOWEL SIGN E
+A827          ; Syloti_Nagri # Mc       SYLOTI NAGRI VOWEL SIGN OO
+A828..A82B    ; Syloti_Nagri # So   [4] SYLOTI NAGRI POETRY MARK-1..SYLOTI NAGRI POETRY MARK-4
+
+# Total code points: 44
+
+# ================================================
+
+103A0..103C3  ; Old_Persian # Lo  [36] OLD PERSIAN SIGN A..OLD PERSIAN SIGN HA
+103C8..103CF  ; Old_Persian # Lo   [8] OLD PERSIAN SIGN AURAMAZDAA..OLD PERSIAN SIGN BUUMISH
+103D0         ; Old_Persian # Po       OLD PERSIAN WORD DIVIDER
+103D1..103D5  ; Old_Persian # Nl   [5] OLD PERSIAN NUMBER ONE..OLD PERSIAN NUMBER HUNDRED
+
+# Total code points: 50
+
+# ================================================
+
+10A00         ; Kharoshthi # Lo       KHAROSHTHI LETTER A
+10A01..10A03  ; Kharoshthi # Mn   [3] KHAROSHTHI VOWEL SIGN I..KHAROSHTHI VOWEL SIGN VOCALIC R
+10A05..10A06  ; Kharoshthi # Mn   [2] KHAROSHTHI VOWEL SIGN E..KHAROSHTHI VOWEL SIGN O
+10A0C..10A0F  ; Kharoshthi # Mn   [4] KHAROSHTHI VOWEL LENGTH MARK..KHAROSHTHI SIGN VISARGA
+10A10..10A13  ; Kharoshthi # Lo   [4] KHAROSHTHI LETTER KA..KHAROSHTHI LETTER GHA
+10A15..10A17  ; Kharoshthi # Lo   [3] KHAROSHTHI LETTER CA..KHAROSHTHI LETTER JA
+10A19..10A33  ; Kharoshthi # Lo  [27] KHAROSHTHI LETTER NYA..KHAROSHTHI LETTER TTTHA
+10A38..10A3A  ; Kharoshthi # Mn   [3] KHAROSHTHI SIGN BAR ABOVE..KHAROSHTHI SIGN DOT BELOW
+10A3F         ; Kharoshthi # Mn       KHAROSHTHI VIRAMA
+10A40..10A47  ; Kharoshthi # No   [8] KHAROSHTHI DIGIT ONE..KHAROSHTHI NUMBER ONE THOUSAND
+10A50..10A58  ; Kharoshthi # Po   [9] KHAROSHTHI PUNCTUATION DOT..KHAROSHTHI PUNCTUATION LINES
+
+# Total code points: 65
+
+# ================================================
+
+1B00..1B03    ; Balinese # Mn   [4] BALINESE SIGN ULU RICEM..BALINESE SIGN SURANG
+1B04          ; Balinese # Mc       BALINESE SIGN BISAH
+1B05..1B33    ; Balinese # Lo  [47] BALINESE LETTER AKARA..BALINESE LETTER HA
+1B34          ; Balinese # Mn       BALINESE SIGN REREKAN
+1B35          ; Balinese # Mc       BALINESE VOWEL SIGN TEDUNG
+1B36..1B3A    ; Balinese # Mn   [5] BALINESE VOWEL SIGN ULU..BALINESE VOWEL SIGN RA REPA
+1B3B          ; Balinese # Mc       BALINESE VOWEL SIGN RA REPA TEDUNG
+1B3C          ; Balinese # Mn       BALINESE VOWEL SIGN LA LENGA
+1B3D..1B41    ; Balinese # Mc   [5] BALINESE VOWEL SIGN LA LENGA TEDUNG..BALINESE VOWEL SIGN TALING REPA TEDUNG
+1B42          ; Balinese # Mn       BALINESE VOWEL SIGN PEPET
+1B43..1B44    ; Balinese # Mc   [2] BALINESE VOWEL SIGN PEPET TEDUNG..BALINESE ADEG ADEG
+1B45..1B4B    ; Balinese # Lo   [7] BALINESE LETTER KAF SASAK..BALINESE LETTER ASYURA SASAK
+1B50..1B59    ; Balinese # Nd  [10] BALINESE DIGIT ZERO..BALINESE DIGIT NINE
+1B5A..1B60    ; Balinese # Po   [7] BALINESE PANTI..BALINESE PAMENENG
+1B61..1B6A    ; Balinese # So  [10] BALINESE MUSICAL SYMBOL DONG..BALINESE MUSICAL SYMBOL DANG GEDE
+1B6B..1B73    ; Balinese # Mn   [9] BALINESE MUSICAL SYMBOL COMBINING TEGEH..BALINESE MUSICAL SYMBOL COMBINING GONG
+1B74..1B7C    ; Balinese # So   [9] BALINESE MUSICAL SYMBOL RIGHT-HAND OPEN DUG..BALINESE MUSICAL SYMBOL LEFT-HAND OPEN PING
+
+# Total code points: 121
+
+# ================================================
+
+12000..1236E  ; Cuneiform # Lo [879] CUNEIFORM SIGN A..CUNEIFORM SIGN ZUM
+12400..12462  ; Cuneiform # Nl  [99] CUNEIFORM NUMERIC SIGN TWO ASH..CUNEIFORM NUMERIC SIGN OLD ASSYRIAN ONE QUARTER
+12470..12473  ; Cuneiform # Po   [4] CUNEIFORM PUNCTUATION SIGN OLD ASSYRIAN WORD DIVIDER..CUNEIFORM PUNCTUATION SIGN DIAGONAL TRICOLON
+
+# Total code points: 982
+
+# ================================================
+
+10900..10915  ; Phoenician # Lo  [22] PHOENICIAN LETTER ALF..PHOENICIAN LETTER TAU
+10916..1091B  ; Phoenician # No   [6] PHOENICIAN NUMBER ONE..PHOENICIAN NUMBER THREE
+1091F         ; Phoenician # Po       PHOENICIAN WORD SEPARATOR
+
+# Total code points: 29
+
+# ================================================
+
+A840..A873    ; Phags_Pa # Lo  [52] PHAGS-PA LETTER KA..PHAGS-PA LETTER CANDRABINDU
+A874..A877    ; Phags_Pa # Po   [4] PHAGS-PA SINGLE HEAD MARK..PHAGS-PA MARK DOUBLE SHAD
+
+# Total code points: 56
+
+# ================================================
+
+07C0..07C9    ; Nko # Nd  [10] NKO DIGIT ZERO..NKO DIGIT NINE
+07CA..07EA    ; Nko # Lo  [33] NKO LETTER A..NKO LETTER JONA RA
+07EB..07F3    ; Nko # Mn   [9] NKO COMBINING SHORT HIGH TONE..NKO COMBINING DOUBLE DOT ABOVE
+07F4..07F5    ; Nko # Lm   [2] NKO HIGH TONE APOSTROPHE..NKO LOW TONE APOSTROPHE
+07F6          ; Nko # So       NKO SYMBOL OO DENNEN
+07F7..07F9    ; Nko # Po   [3] NKO SYMBOL GBAKURUNEN..NKO EXCLAMATION MARK
+07FA          ; Nko # Lm       NKO LAJANYALAN
+
+# Total code points: 59
+
+# ================================================
+
+1B80..1B81    ; Sundanese # Mn   [2] SUNDANESE SIGN PANYECEK..SUNDANESE SIGN PANGLAYAR
+1B82          ; Sundanese # Mc       SUNDANESE SIGN PANGWISAD
+1B83..1BA0    ; Sundanese # Lo  [30] SUNDANESE LETTER A..SUNDANESE LETTER HA
+1BA1          ; Sundanese # Mc       SUNDANESE CONSONANT SIGN PAMINGKAL
+1BA2..1BA5    ; Sundanese # Mn   [4] SUNDANESE CONSONANT SIGN PANYAKRA..SUNDANESE VOWEL SIGN PANYUKU
+1BA6..1BA7    ; Sundanese # Mc   [2] SUNDANESE VOWEL SIGN PANAELAENG..SUNDANESE VOWEL SIGN PANOLONG
+1BA8..1BA9    ; Sundanese # Mn   [2] SUNDANESE VOWEL SIGN PAMEPET..SUNDANESE VOWEL SIGN PANEULEUNG
+1BAA          ; Sundanese # Mc       SUNDANESE SIGN PAMAAEH
+1BAE..1BAF    ; Sundanese # Lo   [2] SUNDANESE LETTER KHA..SUNDANESE LETTER SYA
+1BB0..1BB9    ; Sundanese # Nd  [10] SUNDANESE DIGIT ZERO..SUNDANESE DIGIT NINE
+
+# Total code points: 55
+
+# ================================================
+
+1C00..1C23    ; Lepcha # Lo  [36] LEPCHA LETTER KA..LEPCHA LETTER A
+1C24..1C2B    ; Lepcha # Mc   [8] LEPCHA SUBJOINED LETTER YA..LEPCHA VOWEL SIGN UU
+1C2C..1C33    ; Lepcha # Mn   [8] LEPCHA VOWEL SIGN E..LEPCHA CONSONANT SIGN T
+1C34..1C35    ; Lepcha # Mc   [2] LEPCHA CONSONANT SIGN NYIN-DO..LEPCHA CONSONANT SIGN KANG
+1C36..1C37    ; Lepcha # Mn   [2] LEPCHA SIGN RAN..LEPCHA SIGN NUKTA
+1C3B..1C3F    ; Lepcha # Po   [5] LEPCHA PUNCTUATION TA-ROL..LEPCHA PUNCTUATION TSHOOK
+1C40..1C49    ; Lepcha # Nd  [10] LEPCHA DIGIT ZERO..LEPCHA DIGIT NINE
+1C4D..1C4F    ; Lepcha # Lo   [3] LEPCHA LETTER TTA..LEPCHA LETTER DDA
+
+# Total code points: 74
+
+# ================================================
+
+1C50..1C59    ; Ol_Chiki # Nd  [10] OL CHIKI DIGIT ZERO..OL CHIKI DIGIT NINE
+1C5A..1C77    ; Ol_Chiki # Lo  [30] OL CHIKI LETTER LA..OL CHIKI LETTER OH
+1C78..1C7D    ; Ol_Chiki # Lm   [6] OL CHIKI MU TTUDDAG..OL CHIKI AHAD
+1C7E..1C7F    ; Ol_Chiki # Po   [2] OL CHIKI PUNCTUATION MUCAAD..OL CHIKI PUNCTUATION DOUBLE MUCAAD
+
+# Total code points: 48
+
+# ================================================
+
+A500..A60B    ; Vai # Lo [268] VAI SYLLABLE EE..VAI SYLLABLE NG
+A60C          ; Vai # Lm       VAI SYLLABLE LENGTHENER
+A60D..A60F    ; Vai # Po   [3] VAI COMMA..VAI QUESTION MARK
+A610..A61F    ; Vai # Lo  [16] VAI SYLLABLE NDOLE FA..VAI SYMBOL JONG
+A620..A629    ; Vai # Nd  [10] VAI DIGIT ZERO..VAI DIGIT NINE
+A62A..A62B    ; Vai # Lo   [2] VAI SYLLABLE NDOLE MA..VAI SYLLABLE NDOLE DO
+
+# Total code points: 300
+
+# ================================================
+
+A880..A881    ; Saurashtra # Mc   [2] SAURASHTRA SIGN ANUSVARA..SAURASHTRA SIGN VISARGA
+A882..A8B3    ; Saurashtra # Lo  [50] SAURASHTRA LETTER A..SAURASHTRA LETTER LLA
+A8B4..A8C3    ; Saurashtra # Mc  [16] SAURASHTRA CONSONANT SIGN HAARU..SAURASHTRA VOWEL SIGN AU
+A8C4          ; Saurashtra # Mn       SAURASHTRA SIGN VIRAMA
+A8CE..A8CF    ; Saurashtra # Po   [2] SAURASHTRA DANDA..SAURASHTRA DOUBLE DANDA
+A8D0..A8D9    ; Saurashtra # Nd  [10] SAURASHTRA DIGIT ZERO..SAURASHTRA DIGIT NINE
+
+# Total code points: 81
+
+# ================================================
+
+A900..A909    ; Kayah_Li # Nd  [10] KAYAH LI DIGIT ZERO..KAYAH LI DIGIT NINE
+A90A..A925    ; Kayah_Li # Lo  [28] KAYAH LI LETTER KA..KAYAH LI LETTER OO
+A926..A92D    ; Kayah_Li # Mn   [8] KAYAH LI VOWEL UE..KAYAH LI TONE CALYA PLOPHU
+A92E..A92F    ; Kayah_Li # Po   [2] KAYAH LI SIGN CWI..KAYAH LI SIGN SHYA
+
+# Total code points: 48
+
+# ================================================
+
+A930..A946    ; Rejang # Lo  [23] REJANG LETTER KA..REJANG LETTER A
+A947..A951    ; Rejang # Mn  [11] REJANG VOWEL SIGN I..REJANG CONSONANT SIGN R
+A952..A953    ; Rejang # Mc   [2] REJANG CONSONANT SIGN H..REJANG VIRAMA
+A95F          ; Rejang # Po       REJANG SECTION MARK
+
+# Total code points: 37
+
+# ================================================
+
+10280..1029C  ; Lycian # Lo  [29] LYCIAN LETTER A..LYCIAN LETTER X
+
+# Total code points: 29
+
+# ================================================
+
+102A0..102D0  ; Carian # Lo  [49] CARIAN LETTER A..CARIAN LETTER UUU3
+
+# Total code points: 49
+
+# ================================================
+
+10920..10939  ; Lydian # Lo  [26] LYDIAN LETTER A..LYDIAN LETTER C
+1093F         ; Lydian # Po       LYDIAN TRIANGULAR MARK
+
+# Total code points: 27
+
+# ================================================
+
+AA00..AA28    ; Cham # Lo  [41] CHAM LETTER A..CHAM LETTER HA
+AA29..AA2E    ; Cham # Mn   [6] CHAM VOWEL SIGN AA..CHAM VOWEL SIGN OE
+AA2F..AA30    ; Cham # Mc   [2] CHAM VOWEL SIGN O..CHAM VOWEL SIGN AI
+AA31..AA32    ; Cham # Mn   [2] CHAM VOWEL SIGN AU..CHAM VOWEL SIGN UE
+AA33..AA34    ; Cham # Mc   [2] CHAM CONSONANT SIGN YA..CHAM CONSONANT SIGN RA
+AA35..AA36    ; Cham # Mn   [2] CHAM CONSONANT SIGN LA..CHAM CONSONANT SIGN WA
+AA40..AA42    ; Cham # Lo   [3] CHAM LETTER FINAL K..CHAM LETTER FINAL NG
+AA43          ; Cham # Mn       CHAM CONSONANT SIGN FINAL NG
+AA44..AA4B    ; Cham # Lo   [8] CHAM LETTER FINAL CH..CHAM LETTER FINAL SS
+AA4C          ; Cham # Mn       CHAM CONSONANT SIGN FINAL M
+AA4D          ; Cham # Mc       CHAM CONSONANT SIGN FINAL H
+AA50..AA59    ; Cham # Nd  [10] CHAM DIGIT ZERO..CHAM DIGIT NINE
+AA5C..AA5F    ; Cham # Po   [4] CHAM PUNCTUATION SPIRAL..CHAM PUNCTUATION TRIPLE DANDA
+
+# Total code points: 83
+
+# ================================================
+
+1A20..1A54    ; Tai_Tham # Lo  [53] TAI THAM LETTER HIGH KA..TAI THAM LETTER GREAT SA
+1A55          ; Tai_Tham # Mc       TAI THAM CONSONANT SIGN MEDIAL RA
+1A56          ; Tai_Tham # Mn       TAI THAM CONSONANT SIGN MEDIAL LA
+1A57          ; Tai_Tham # Mc       TAI THAM CONSONANT SIGN LA TANG LAI
+1A58..1A5E    ; Tai_Tham # Mn   [7] TAI THAM SIGN MAI KANG LAI..TAI THAM CONSONANT SIGN SA
+1A60          ; Tai_Tham # Mn       TAI THAM SIGN SAKOT
+1A61          ; Tai_Tham # Mc       TAI THAM VOWEL SIGN A
+1A62          ; Tai_Tham # Mn       TAI THAM VOWEL SIGN MAI SAT
+1A63..1A64    ; Tai_Tham # Mc   [2] TAI THAM VOWEL SIGN AA..TAI THAM VOWEL SIGN TALL AA
+1A65..1A6C    ; Tai_Tham # Mn   [8] TAI THAM VOWEL SIGN I..TAI THAM VOWEL SIGN OA BELOW
+1A6D..1A72    ; Tai_Tham # Mc   [6] TAI THAM VOWEL SIGN OY..TAI THAM VOWEL SIGN THAM AI
+1A73..1A7C    ; Tai_Tham # Mn  [10] TAI THAM VOWEL SIGN OA ABOVE..TAI THAM SIGN KHUEN-LUE KARAN
+1A7F          ; Tai_Tham # Mn       TAI THAM COMBINING CRYPTOGRAMMIC DOT
+1A80..1A89    ; Tai_Tham # Nd  [10] TAI THAM HORA DIGIT ZERO..TAI THAM HORA DIGIT NINE
+1A90..1A99    ; Tai_Tham # Nd  [10] TAI THAM THAM DIGIT ZERO..TAI THAM THAM DIGIT NINE
+1AA0..1AA6    ; Tai_Tham # Po   [7] TAI THAM SIGN WIANG..TAI THAM SIGN REVERSED ROTATED RANA
+1AA7          ; Tai_Tham # Lm       TAI THAM SIGN MAI YAMOK
+1AA8..1AAD    ; Tai_Tham # Po   [6] TAI THAM SIGN KAAN..TAI THAM SIGN CAANG
+
+# Total code points: 127
+
+# ================================================
+
+AA80..AAAF    ; Tai_Viet # Lo  [48] TAI VIET LETTER LOW KO..TAI VIET LETTER HIGH O
+AAB0          ; Tai_Viet # Mn       TAI VIET MAI KANG
+AAB1          ; Tai_Viet # Lo       TAI VIET VOWEL AA
+AAB2..AAB4    ; Tai_Viet # Mn   [3] TAI VIET VOWEL I..TAI VIET VOWEL U
+AAB5..AAB6    ; Tai_Viet # Lo   [2] TAI VIET VOWEL E..TAI VIET VOWEL O
+AAB7..AAB8    ; Tai_Viet # Mn   [2] TAI VIET MAI KHIT..TAI VIET VOWEL IA
+AAB9..AABD    ; Tai_Viet # Lo   [5] TAI VIET VOWEL UEA..TAI VIET VOWEL AN
+AABE..AABF    ; Tai_Viet # Mn   [2] TAI VIET VOWEL AM..TAI VIET TONE MAI EK
+AAC0          ; Tai_Viet # Lo       TAI VIET TONE MAI NUENG
+AAC1          ; Tai_Viet # Mn       TAI VIET TONE MAI THO
+AAC2          ; Tai_Viet # Lo       TAI VIET TONE MAI SONG
+AADB..AADC    ; Tai_Viet # Lo   [2] TAI VIET SYMBOL KON..TAI VIET SYMBOL NUENG
+AADD          ; Tai_Viet # Lm       TAI VIET SYMBOL SAM
+AADE..AADF    ; Tai_Viet # Po   [2] TAI VIET SYMBOL HO HOI..TAI VIET SYMBOL KOI KOI
+
+# Total code points: 72
+
+# ================================================
+
+10B00..10B35  ; Avestan # Lo  [54] AVESTAN LETTER A..AVESTAN LETTER HE
+10B39..10B3F  ; Avestan # Po   [7] AVESTAN ABBREVIATION MARK..LARGE ONE RING OVER TWO RINGS PUNCTUATION
+
+# Total code points: 61
+
+# ================================================
+
+13000..1342E  ; Egyptian_Hieroglyphs # Lo [1071] EGYPTIAN HIEROGLYPH A001..EGYPTIAN HIEROGLYPH AA032
+
+# Total code points: 1071
+
+# ================================================
+
+0800..0815    ; Samaritan # Lo  [22] SAMARITAN LETTER ALAF..SAMARITAN LETTER TAAF
+0816..0819    ; Samaritan # Mn   [4] SAMARITAN MARK IN..SAMARITAN MARK DAGESH
+081A          ; Samaritan # Lm       SAMARITAN MODIFIER LETTER EPENTHETIC YUT
+081B..0823    ; Samaritan # Mn   [9] SAMARITAN MARK EPENTHETIC YUT..SAMARITAN VOWEL SIGN A
+0824          ; Samaritan # Lm       SAMARITAN MODIFIER LETTER SHORT A
+0825..0827    ; Samaritan # Mn   [3] SAMARITAN VOWEL SIGN SHORT A..SAMARITAN VOWEL SIGN U
+0828          ; Samaritan # Lm       SAMARITAN MODIFIER LETTER I
+0829..082D    ; Samaritan # Mn   [5] SAMARITAN VOWEL SIGN LONG I..SAMARITAN MARK NEQUDAA
+0830..083E    ; Samaritan # Po  [15] SAMARITAN PUNCTUATION NEQUDAA..SAMARITAN PUNCTUATION ANNAAU
+
+# Total code points: 61
+
+# ================================================
+
+A4D0..A4F7    ; Lisu # Lo  [40] LISU LETTER BA..LISU LETTER OE
+A4F8..A4FD    ; Lisu # Lm   [6] LISU LETTER TONE MYA TI..LISU LETTER TONE MYA JEU
+A4FE..A4FF    ; Lisu # Po   [2] LISU PUNCTUATION COMMA..LISU PUNCTUATION FULL STOP
+
+# Total code points: 48
+
+# ================================================
+
+A6A0..A6E5    ; Bamum # Lo  [70] BAMUM LETTER A..BAMUM LETTER KI
+A6E6..A6EF    ; Bamum # Nl  [10] BAMUM LETTER MO..BAMUM LETTER KOGHOM
+A6F0..A6F1    ; Bamum # Mn   [2] BAMUM COMBINING MARK KOQNDON..BAMUM COMBINING MARK TUKWENTIS
+A6F2..A6F7    ; Bamum # Po   [6] BAMUM NJAEMLI..BAMUM QUESTION MARK
+
+# Total code points: 88
+
+# ================================================
+
+A980..A982    ; Javanese # Mn   [3] JAVANESE SIGN PANYANGGA..JAVANESE SIGN LAYAR
+A983          ; Javanese # Mc       JAVANESE SIGN WIGNYAN
+A984..A9B2    ; Javanese # Lo  [47] JAVANESE LETTER A..JAVANESE LETTER HA
+A9B3          ; Javanese # Mn       JAVANESE SIGN CECAK TELU
+A9B4..A9B5    ; Javanese # Mc   [2] JAVANESE VOWEL SIGN TARUNG..JAVANESE VOWEL SIGN TOLONG
+A9B6..A9B9    ; Javanese # Mn   [4] JAVANESE VOWEL SIGN WULU..JAVANESE VOWEL SIGN SUKU MENDUT
+A9BA..A9BB    ; Javanese # Mc   [2] JAVANESE VOWEL SIGN TALING..JAVANESE VOWEL SIGN DIRGA MURE
+A9BC          ; Javanese # Mn       JAVANESE VOWEL SIGN PEPET
+A9BD..A9C0    ; Javanese # Mc   [4] JAVANESE CONSONANT SIGN KERET..JAVANESE PANGKON
+A9C1..A9CD    ; Javanese # Po  [13] JAVANESE LEFT RERENGGAN..JAVANESE TURNED PADA PISELEH
+A9CF          ; Javanese # Lm       JAVANESE PANGRANGKEP
+A9D0..A9D9    ; Javanese # Nd  [10] JAVANESE DIGIT ZERO..JAVANESE DIGIT NINE
+A9DE..A9DF    ; Javanese # Po   [2] JAVANESE PADA TIRTA TUMETES..JAVANESE PADA ISEN-ISEN
+
+# Total code points: 91
+
+# ================================================
+
+ABC0..ABE2    ; Meetei_Mayek # Lo  [35] MEETEI MAYEK LETTER KOK..MEETEI MAYEK LETTER I LONSUM
+ABE3..ABE4    ; Meetei_Mayek # Mc   [2] MEETEI MAYEK VOWEL SIGN ONAP..MEETEI MAYEK VOWEL SIGN INAP
+ABE5          ; Meetei_Mayek # Mn       MEETEI MAYEK VOWEL SIGN ANAP
+ABE6..ABE7    ; Meetei_Mayek # Mc   [2] MEETEI MAYEK VOWEL SIGN YENAP..MEETEI MAYEK VOWEL SIGN SOUNAP
+ABE8          ; Meetei_Mayek # Mn       MEETEI MAYEK VOWEL SIGN UNAP
+ABE9..ABEA    ; Meetei_Mayek # Mc   [2] MEETEI MAYEK VOWEL SIGN CHEINAP..MEETEI MAYEK VOWEL SIGN NUNG
+ABEB          ; Meetei_Mayek # Po       MEETEI MAYEK CHEIKHEI
+ABEC          ; Meetei_Mayek # Mc       MEETEI MAYEK LUM IYEK
+ABED          ; Meetei_Mayek # Mn       MEETEI MAYEK APUN IYEK
+ABF0..ABF9    ; Meetei_Mayek # Nd  [10] MEETEI MAYEK DIGIT ZERO..MEETEI MAYEK DIGIT NINE
+
+# Total code points: 56
+
+# ================================================
+
+10840..10855  ; Imperial_Aramaic # Lo  [22] IMPERIAL ARAMAIC LETTER ALEPH..IMPERIAL ARAMAIC LETTER TAW
+10857         ; Imperial_Aramaic # Po       IMPERIAL ARAMAIC SECTION SIGN
+10858..1085F  ; Imperial_Aramaic # No   [8] IMPERIAL ARAMAIC NUMBER ONE..IMPERIAL ARAMAIC NUMBER TEN THOUSAND
+
+# Total code points: 31
+
+# ================================================
+
+10A60..10A7C  ; Old_South_Arabian # Lo  [29] OLD SOUTH ARABIAN LETTER HE..OLD SOUTH ARABIAN LETTER THETH
+10A7D..10A7E  ; Old_South_Arabian # No   [2] OLD SOUTH ARABIAN NUMBER ONE..OLD SOUTH ARABIAN NUMBER FIFTY
+10A7F         ; Old_South_Arabian # Po       OLD SOUTH ARABIAN NUMERIC INDICATOR
+
+# Total code points: 32
+
+# ================================================
+
+10B40..10B55  ; Inscriptional_Parthian # Lo  [22] INSCRIPTIONAL PARTHIAN LETTER ALEPH..INSCRIPTIONAL PARTHIAN LETTER TAW
+10B58..10B5F  ; Inscriptional_Parthian # No   [8] INSCRIPTIONAL PARTHIAN NUMBER ONE..INSCRIPTIONAL PARTHIAN NUMBER ONE THOUSAND
+
+# Total code points: 30
+
+# ================================================
+
+10B60..10B72  ; Inscriptional_Pahlavi # Lo  [19] INSCRIPTIONAL PAHLAVI LETTER ALEPH..INSCRIPTIONAL PAHLAVI LETTER TAW
+10B78..10B7F  ; Inscriptional_Pahlavi # No   [8] INSCRIPTIONAL PAHLAVI NUMBER ONE..INSCRIPTIONAL PAHLAVI NUMBER ONE THOUSAND
+
+# Total code points: 27
+
+# ================================================
+
+10C00..10C48  ; Old_Turkic # Lo  [73] OLD TURKIC LETTER ORKHON A..OLD TURKIC LETTER ORKHON BASH
+
+# Total code points: 73
+
+# ================================================
+
+11080..11081  ; Kaithi # Mn   [2] KAITHI SIGN CANDRABINDU..KAITHI SIGN ANUSVARA
+11082         ; Kaithi # Mc       KAITHI SIGN VISARGA
+11083..110AF  ; Kaithi # Lo  [45] KAITHI LETTER A..KAITHI LETTER HA
+110B0..110B2  ; Kaithi # Mc   [3] KAITHI VOWEL SIGN AA..KAITHI VOWEL SIGN II
+110B3..110B6  ; Kaithi # Mn   [4] KAITHI VOWEL SIGN U..KAITHI VOWEL SIGN AI
+110B7..110B8  ; Kaithi # Mc   [2] KAITHI VOWEL SIGN O..KAITHI VOWEL SIGN AU
+110B9..110BA  ; Kaithi # Mn   [2] KAITHI SIGN VIRAMA..KAITHI SIGN NUKTA
+110BB..110BC  ; Kaithi # Po   [2] KAITHI ABBREVIATION SIGN..KAITHI ENUMERATION SIGN
+110BD         ; Kaithi # Cf       KAITHI NUMBER SIGN
+110BE..110C1  ; Kaithi # Po   [4] KAITHI SECTION MARK..KAITHI DOUBLE DANDA
+
+# Total code points: 66
+
+# EOF
--- a/jdk/make/tools/freetypecheck/freetypecheck.c	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/make/tools/freetypecheck/freetypecheck.c	Wed Jul 21 09:57:21 2010 -0700
@@ -33,7 +33,7 @@
 #include FT_FREETYPE_H
 
 #ifdef _MSC_VER
-#if _MSC_VER > 1400
+#if _MSC_VER > 1400 && _MSC_VER < 1600
 
 /*
  * When building for Microsoft Windows, your program has a dependency
@@ -68,7 +68,7 @@
         "publicKeyToken='" _VC_ASSEMBLY_PUBLICKEYTOKEN "'\"")
 
 #endif  /* _M_AMD64 */
-#endif  /* _MSC_VER > 1400 */
+#endif  /* _MSC_VER > 1400 && _MSC_VER < 1600 */
 #endif  /* _MSC_VER */
 
 #define QUOTEMACRO(x) QUOTEME(x)
--- a/jdk/make/tools/sharing/classlist.linux	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/make/tools/sharing/classlist.linux	Wed Jul 21 09:57:21 2010 -0700
@@ -2259,7 +2259,6 @@
 com/sun/java/swing/plaf/gtk/GTKLookAndFeel$2
 com/sun/java/swing/plaf/gtk/GTKLookAndFeel$3
 javax/swing/plaf/synth/SynthPanelUI
-sun/swing/plaf/synth/SynthUI
 javax/swing/plaf/synth/SynthConstants
 javax/swing/plaf/synth/SynthContext
 javax/swing/plaf/synth/SynthBorder
@@ -2271,6 +2270,7 @@
 javax/swing/plaf/synth/SynthMenuBarUI
 javax/swing/plaf/synth/DefaultMenuLayout
 javax/swing/plaf/synth/SynthMenuUI
+javax/swing/plaf/synth/SynthUI
 com/sun/java/swing/plaf/gtk/GTKIconFactory
 com/sun/java/swing/plaf/gtk/GTKIconFactory$MenuArrowIcon
 com/sun/java/swing/plaf/gtk/GTKIconFactory$DelegatingIcon
--- a/jdk/make/tools/sharing/classlist.solaris	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/make/tools/sharing/classlist.solaris	Wed Jul 21 09:57:21 2010 -0700
@@ -2360,7 +2360,6 @@
 com/sun/java/swing/plaf/gtk/GTKLookAndFeel$2
 com/sun/java/swing/plaf/gtk/GTKLookAndFeel$3
 javax/swing/plaf/synth/SynthPanelUI
-sun/swing/plaf/synth/SynthUI
 javax/swing/plaf/synth/SynthConstants
 javax/swing/plaf/synth/SynthContext
 javax/swing/plaf/synth/SynthBorder
@@ -2373,6 +2372,7 @@
 javax/swing/plaf/synth/SynthMenuBarUI
 javax/swing/plaf/synth/DefaultMenuLayout
 javax/swing/plaf/synth/SynthMenuUI
+javax/swing/plaf/synth/SynthUI
 com/sun/java/swing/plaf/gtk/GTKIconFactory
 com/sun/java/swing/plaf/gtk/GTKIconFactory$MenuArrowIcon
 com/sun/java/swing/plaf/gtk/GTKIconFactory$DelegatingIcon
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/make/tools/src/build/tools/generatecharacter/CharacterName.java	Wed Jul 21 09:57:21 2010 -0700
@@ -0,0 +1,100 @@
+package build.tools.generatecharacter;
+
+import java.io.*;
+import java.nio.*;
+import java.util.*;
+import java.util.zip.*;
+
+public class CharacterName {
+
+    public static void main(String[] args) {
+        FileReader reader = null;
+        try {
+            if (args.length != 2) {
+                System.err.println("Usage: java CharacterName UniocdeData.txt uniName.dat");
+                System.exit(1);
+            }
+
+            reader = new FileReader(args[0]);
+            BufferedReader bfr = new BufferedReader(reader);
+            String line = null;
+
+            StringBuilder namePool = new StringBuilder();
+            byte[] cpPoolBytes = new byte[0x100000];
+            ByteBuffer cpBB = ByteBuffer.wrap(cpPoolBytes);
+            int lastCp = 0;
+            int cpNum = 0;
+
+            while ((line = bfr.readLine()) != null) {
+                if (line.startsWith("#"))
+                    continue;
+                UnicodeSpec spec = UnicodeSpec.parse(line);
+                if (spec != null) {
+                    int cp = spec.getCodePoint();
+                    String name = spec.getName();
+                    cpNum++;
+                    if (name.equals("<control>") && spec.getOldName() != null) {
+                        if (spec.getOldName().length() != 0)
+                            name = spec.getOldName();
+                        else
+                            continue;
+                    } else if (name.startsWith("<")) {
+                        /*
+                          3400    <CJK Ideograph Extension A, First>
+                          4db5    <CJK Ideograph Extension A, Last>
+                          4e00    <CJK Ideograph, First>
+                          9fc3    <CJK Ideograph, Last>
+                          ac00    <Hangul Syllable, First>
+                          d7a3    <Hangul Syllable, Last>
+                          d800    <Non Private Use High Surrogate, First>
+                          db7f    <Non Private Use High Surrogate, Last>
+                          db80    <Private Use High Surrogate, First>
+                          dbff    <Private Use High Surrogate, Last>
+                          dc00    <Low Surrogate, First>
+                          dfff    <Low Surrogate, Last>
+                          e000    <Private Use, First>
+                          f8ff    <Private Use, Last>
+                         20000    <CJK Ideograph Extension B, First>
+                         2a6d6    <CJK Ideograph Extension B, Last>
+                         f0000    <Plane 15 Private Use, First>
+                         ffffd    <Plane 15 Private Use, Last>
+                        */
+                        continue;
+                    }
+
+                    if (cp == lastCp + 1) {
+                        cpBB.put((byte)name.length());
+                    } else {
+                        cpBB.put((byte)0);  // segment start flag
+                        cpBB.putInt((name.length() << 24) | (cp & 0xffffff));
+                    }
+                    namePool.append(name);
+                    lastCp = cp;
+                }
+            }
+
+            byte[] namePoolBytes = namePool.toString().getBytes("ASCII");
+            int cpLen = cpBB.position();
+            int total = cpLen + namePoolBytes.length;
+
+            DataOutputStream dos = new DataOutputStream(
+                                       new DeflaterOutputStream(
+                                           new FileOutputStream(args[1])));
+            dos.writeInt(total);  // total
+            dos.writeInt(cpLen);  // nameOff
+            dos.write(cpPoolBytes, 0, cpLen);
+            dos.write(namePoolBytes);
+            dos.close();
+
+        } catch (Throwable e) {
+            System.out.println("Unexpected exception:");
+            e.printStackTrace();
+        } finally {
+            if (reader != null) {
+                try {
+                    reader.close();
+                } catch (Throwable ee) { ee.printStackTrace(); }
+            }
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/make/tools/src/build/tools/generatecharacter/CharacterScript.java	Wed Jul 21 09:57:21 2010 -0700
@@ -0,0 +1,214 @@
+import java.util.regex.*;
+import java.util.*;
+import java.io.*;
+
+public class CharacterScript {
+
+    // generate the code needed for j.l.C.UnicodeScript
+    static void fortest(String fmt, Object... o) {
+        //System.out.printf(fmt, o);
+    }
+
+    static void print(String fmt, Object... o) {
+        System.out.printf(fmt, o);
+    }
+
+    static void debug(String fmt, Object... o) {
+        //System.out.printf(fmt, o);
+    }
+
+    public static void main(String args[]){
+        try {
+            if (args.length != 1) {
+                System.out.println("java CharacterScript script.txt out");
+                System.exit(1);
+            }
+
+            int i, j;
+            BufferedReader sbfr = new BufferedReader(new FileReader(args[0]));
+            HashMap<String,Integer> scriptMap = new HashMap<String,Integer>();
+            String line = null;
+
+            Matcher m = Pattern.compile("(\\p{XDigit}+)(?:\\.{2}(\\p{XDigit}+))?\\s+;\\s+(\\w+)\\s+#.*").matcher("");
+
+            int prevS = -1;
+            int prevE = -1;
+            String prevN = null;
+            int[][] scripts = new int[1024][3];
+            int scriptSize = 0;
+
+            while ((line = sbfr.readLine()) != null) {
+                if (line.length() <= 1 || line.charAt(0) == '#') {
+                    continue;
+                }
+                m.reset(line);
+                if (m.matches()) {
+                    int start = Integer.parseInt(m.group(1), 16);
+                    int end = (m.group(2)==null)?start
+                              :Integer.parseInt(m.group(2), 16);
+                    String name = m.group(3);
+                    if (name.equals(prevN) && start == prevE + 1) {
+                        prevE = end;
+                    } else {
+                        if (prevS != -1) {
+                            if (scriptMap.get(prevN) == null) {
+                                scriptMap.put(prevN, scriptMap.size());
+                            }
+                            scripts[scriptSize][0] = prevS;
+                            scripts[scriptSize][1] = prevE;
+                            scripts[scriptSize][2] = scriptMap.get(prevN);
+                            scriptSize++;
+                        }
+                        debug("%x-%x\t%s%n", prevS, prevE, prevN);
+                        prevS = start; prevE = end; prevN = name;
+                    }
+                } else {
+                    debug("Warning: Unrecognized line <%s>%n", line);
+                }
+            }
+
+            //last one.
+            if (scriptMap.get(prevN) == null) {
+                scriptMap.put(prevN, scriptMap.size());
+            }
+            scripts[scriptSize][0] = prevS;
+            scripts[scriptSize][1] = prevE;
+            scripts[scriptSize][2] = scriptMap.get(prevN);
+            scriptSize++;
+
+            debug("%x-%x\t%s%n", prevS, prevE, prevN);
+            debug("-----------------%n");
+            debug("Total scripts=%s%n", scriptMap.size());
+            debug("-----------------%n%n");
+
+            String[] names = new String[scriptMap.size()];
+            for (String name: scriptMap.keySet()) {
+                names[scriptMap.get(name).intValue()] = name;
+            }
+
+            for (j = 0; j < scriptSize; j++) {
+                for (int cp = scripts[j][0]; cp <= scripts[j][1]; cp++) {
+                    String name = names[scripts[j][2]].toUpperCase(Locale.ENGLISH);;
+                    if (cp > 0xffff)
+                        System.out.printf("%05X    %s%n", cp, name);
+                    else
+                        System.out.printf("%05X    %s%n", cp, name);
+                }
+            }
+
+            Arrays.sort(scripts, 0, scriptSize,
+                        new Comparator<int[]>() {
+                            public int compare(int[] a1, int[] a2) {
+                                return a1[0] - a2[0];
+                            }
+                            public boolean compare(Object obj) {
+                                return obj == this;
+                            }
+                         });
+
+
+
+            // Consolidation: there are lots of "reserved" code points
+            // embedded in those otherwise "sequential" blocks.
+            // To make the lookup table smaller, we combine those
+            // separated segments with the assumption that the lookup
+            // implementation checks
+            //    Character.getType() !=  Character.UNASSIGNED
+            // first (return UNKNOWN for unassigned)
+
+            ArrayList<int[]> list = new ArrayList();
+            list.add(scripts[0]);
+
+            int[] last = scripts[0];
+            for (i = 1; i < scriptSize; i++) {
+                if (scripts[i][0] != (last[1] + 1)) {
+
+                    boolean isNotUnassigned = false;
+                    for (int cp = last[1] + 1; cp < scripts[i][0]; cp++) {
+                        if (Character.getType(cp) != Character.UNASSIGNED) {
+                            isNotUnassigned = true;
+                            debug("Warning: [%x] is ASSIGNED but in NON script%n", cp);
+                            break;
+                        }
+                    }
+                    if (isNotUnassigned) {
+                        // surrogates only?
+                        int[] a = new int[3];
+                        a[0] = last[1] + 1;
+                        a[1] = scripts[i][0] - 1;
+                        a[2] = -1;  // unknown
+                        list.add(a);
+                    } else {
+                        if (last[2] == scripts[i][2]) {
+                            //combine
+                            last[1] = scripts[i][1];
+                            continue;
+                        } else {
+                            // expand last
+                            last[1] = scripts[i][0] - 1;
+                        }
+                    }
+                }
+                list.add(scripts[i]);
+                last = scripts[i];
+            }
+
+            for (i = 0; i < list.size(); i++) {
+                int[] a = (int[])list.get(i);
+                String name = "UNKNOWN";
+                if (a[2] != -1)
+                    name = names[a[2]].toUpperCase(Locale.US);
+                debug("0x%05x, 0x%05x  %s%n", a[0], a[1], name);
+            }
+            debug("--->total=%d%n", list.size());
+
+
+            //////////////////OUTPUT//////////////////////////////////
+            print("public class Scripts {%n%n");
+            print("    public static enum UnicodeScript {%n");
+            for (i = 0; i < names.length; i++) {
+                print("        /**%n         * Unicode script \"%s\".%n         */%n", names[i]);
+                print("        %s,%n%n",  names[i].toUpperCase(Locale.US));
+            }
+            print("        /**%n         * Unicode script \"Unknown\".%n         */%n        UNKNOWN;%n%n");
+
+
+            // lookup table
+            print("        private static final int[] scriptStarts = {%n");
+            for (int[] a : list) {
+                String name = "UNKNOWN";
+                if (a[2] != -1)
+                    name = names[a[2]].toUpperCase(Locale.US);
+                if (a[0] < 0x10000)
+                    print("            0x%04X,   // %04X..%04X; %s%n",
+                          a[0], a[0], a[1], name);
+                else
+                    print("            0x%05X,  // %05X..%05X; %s%n",
+                          a[0], a[0], a[1], name);
+            }
+            last = list.get(list.size() -1);
+            if (last[1] != Character.MAX_CODE_POINT)
+                print("            0x%05X   // %05X..%06X; %s%n",
+                      last[1] + 1, last[1] + 1, Character.MAX_CODE_POINT,
+                      "UNKNOWN");
+            print("%n        };%n%n");
+
+            print("        private static final UnicodeScript[] scripts = {%n");
+            for (int[] a : list) {
+                String name = "UNKNOWN";
+                if (a[2] != -1)
+                    name = names[a[2]].toUpperCase(Locale.US);
+                print("            %s,%n", name);
+            }
+
+            if (last[1] != Character.MAX_CODE_POINT)
+                print("            UNKNOWN%n");
+            print("        };%n");
+            print("    }%n");
+            print("}%n");
+
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+    }
+}
--- a/jdk/make/tools/src/build/tools/generatecharacter/GenerateCharacter.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/make/tools/src/build/tools/generatecharacter/GenerateCharacter.java	Wed Jul 21 09:57:21 2010 -0700
@@ -35,6 +35,8 @@
 import java.io.FileWriter;
 import java.io.File;
 
+import build.tools.generatecharacter.CharacterName;
+
 /**
  * This program generates the source code for the class java.lang.Character.
  * It also generates native C code that can perform the same operations.
--- a/jdk/make/tools/src/build/tools/jarreorder/JarReorder.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/make/tools/src/build/tools/jarreorder/JarReorder.java	Wed Jul 21 09:57:21 2010 -0700
@@ -28,7 +28,6 @@
  * combine with an argument list of files and directories, and
  * write a list of items to be included in a jar file.
  */
-
 package build.tools.jarreorder;
 
 import java.io.BufferedReader;
@@ -36,74 +35,68 @@
 import java.io.FileNotFoundException;
 import java.io.FileReader;
 import java.io.IOException;
-import java.util.Arrays;
-import java.util.HashMap;
+import java.util.Collections;
 import java.util.HashSet;
-import java.util.Vector;
 import java.io.PrintStream;
 import java.io.FileOutputStream;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Set;
 
 public class JarReorder {
 
     // To deal with output
-    private static PrintStream out;
+    private PrintStream out;
 
-    private final static boolean useTopDir = false;
-
-    private static void usage() {
+    private void usage() {
         String help;
         help =
-            "Usage:  jar JarReorder [-o <outputfile>] <order_list> <exclude_list> <file> ...\n"
-          + "   order_list    is a file containing names of files to load\n"
-          + "                 in order at the end of a jar file.\n"
-          + "   exclude_list  is a file containing names of files/directories\n"
-          + "                 NOT to be included in a jar file.\n";
-        if (useTopDir)
-            help +=
-                "   top_dir       is the top of the directory structure to be searched;\n"
-              + "                 the contents of the lists and remaining arguments are\n"
-              + "                 relative to this.\n";
-        help +=
-            "\n"
-          + "The order_list or exclude_list may be replaced by a \"_\" if no\n"
-          + "data is to be provided.\n"
-          + "\n"
-          + "   The remaining arguments are files or directories to be included\n"
-          + "   in a jar file, from which will be excluded thse entries which\n"
-          + "   appear in the exclude list.\n";
+                "Usage:  jar JarReorder [-o <outputfile>] <order_list> <exclude_list> <file> ...\n"
+                + "   order_list    is a file containing names of files to load\n"
+                + "                 in order at the end of a jar file unless\n"
+                + "                 excluded in the exclude list.\n"
+                + "   exclude_list  is a file containing names of files/directories\n"
+                + "                 NOT to be included in a jar file.\n"
+                + "\n"
+                + "The order_list or exclude_list may be replaced by a \"-\" if no\n"
+                + "data is to be provided.\n"
+                + "\n"
+                + "   The remaining arguments are files or directories to be included\n"
+                + "   in a jar file, from which will be excluded those entries which\n"
+                + "   appear in the exclude list.\n";
         System.err.println(help);
-        System.exit(1);
     }
 
 
     /*
-     * Create a list of files to be included in a jar file, such that the
-     * some the files will appear in a specific order, and allowing certain
+     * Create the file list to be included in a jar file, such that the
+     * list will appear in a specific order, and allowing certain
      * files and directories to be excluded.
      *
-     * Command line arguments are
+     * Command path arguments are
      *    - optional -o outputfile
-     *    - name of a file containing a list of files to be included in a jar file.
-     *    - name of a file containing a list of files (or directories) to be
+     *    - name of a file containing a set of files to be included in a jar file.
+     *    - name of a file containing a set of files (or directories) to be
      *      excluded from the jar file.
      *    - names of files or directories to be searched for files to include
      *      in the jar file.
      */
     public static void main(String[] args) {
+        JarReorder jr = new JarReorder();
+        jr.run(args);
+    }
 
-        HashMap filesExcluded = new HashMap();
-        Vector filesIncluded = new Vector();
-        int fileArgs;
-        String topDirName = "";
+    private void run(String args[]) {
+
         int arglen = args.length;
         int argpos = 0;
 
         // Look for "-o outputfilename" option
-        if ( arglen > 0 ) {
-            if ( arglen >= 2 && args[0].equals("-o") ) {
+        if (arglen > 0) {
+            if (arglen >= 2 && args[0].equals("-o")) {
                 try {
                     out = new PrintStream(new FileOutputStream(args[1]));
-                } catch ( FileNotFoundException e ) {
+                } catch (FileNotFoundException e) {
                     System.err.println("Error: " + e.getMessage());
                     e.printStackTrace(System.err);
                     System.exit(1);
@@ -118,128 +111,111 @@
             out = System.out;
         }
 
-        fileArgs = useTopDir ? 3 : 2;
-
-        if (arglen <= fileArgs) {
+        // Should be 2 or more args left
+        if (arglen <= 2) {
             usage();
+            System.exit(1);
         }
 
-        // Read the ordered list of files to be included in rt.jar.
-        // Read the list of files/directories to be excluded from rt.jar.
-
-        Vector orderList = readListFromFile(args[argpos], true);
-        Vector excludeList = readListFromFile(args[argpos+1], false);
-        if (useTopDir) {
-            topDirName = args[argpos+2];
-            if (!topDirName.endsWith(File.separator))
-                topDirName = topDirName + File.separator;
-        }
+        // Read the ordered set of files to be included in rt.jar.
+        // Read the set of files/directories to be excluded from rt.jar.
+        String classListFile = args[argpos];
+        String excludeListFile = args[argpos + 1];
+        argpos += 2;
+        arglen -= 2;
 
-        // Copy these lists into filesExcluded so that these files will be excluded
-        // from the file list. (The orderList files will be appended later.)
+        // Create 2 lists and a set of processed files
+        List<String> orderList = readListFromFile(classListFile, true);
+        List<String> excludeList = readListFromFile(excludeListFile, false);
+        Set<String> processed = new HashSet<String>();
 
-        for (int i = 0; i < orderList.size(); ++i) {
-            String s = (String) orderList.elementAt(i);
-            filesExcluded.put(s, s);
-        }
-        for (int i = 0; i < excludeList.size(); ++i) {
-            String s = (String) excludeList.elementAt(i);
-            filesExcluded.put(s, s);
-        }
+        // Create set of all files and directories excluded, then expand
+        //   that list completely
+        Set<String> excludeSet = new HashSet<String>(excludeList);
+        Set<String> allFilesExcluded = expand(null, excludeSet, processed);
+
+        // Indicate all these have been processed, orderList too, kept to end.
+        processed.addAll(orderList);
 
         // The remaining arguments are names of files/directories to be included
         // in the jar file.
-
-        String[] files = new String[arglen - fileArgs];
-        for (int i = fileArgs; i < arglen; ++i) {
-            files[i-fileArgs] = args[argpos+i];
-            filesExcluded.put(args[argpos+i], args[argpos+i]);
+        Set<String> inputSet = new HashSet<String>();
+        for (int i = 0; i < arglen; ++i) {
+            String name = args[argpos + i];
+            name = cleanPath(new File(name));
+            if ( name != null && name.length() > 0 && !inputSet.contains(name) ) {
+                inputSet.add(name);
+            }
         }
 
-        // Expand file/directory list to file list excluding those
-        // read from the class list.
+        // Expand file/directory input so we get a complete set (except ordered)
+        //   Should be everything not excluded and not in order list.
+        Set<String> allFilesIncluded = expand(null, inputSet, processed);
 
-        if (useTopDir)
-            expand(new File(topDirName), files, filesIncluded, filesExcluded, topDirName);
-        else
-            expand(null, files, filesIncluded, filesExcluded, null);
+        // Create simple sorted list so we can add ordered items at end.
+        List<String> allFiles = new ArrayList<String>(allFilesIncluded);
+        Collections.sort(allFiles);
 
-        // Now add the ordered list to the end of the expanded list.
+        // Now add the ordered set to the end of the list.
         // Add in REVERSE ORDER, so that the first element is closest to
         // the end (and the index).
-
-        HashSet excludeSet = new HashSet(excludeList);
         for (int i = orderList.size() - 1; i >= 0; --i) {
-            String s = (String) orderList.elementAt(i);
-            if (excludeSet.contains(s)) {
-                System.err.println("Included file " + s + " is also excluded, skipping.");
-                continue;
+            String s = orderList.get(i);
+            if (allFilesExcluded.contains(s)) {
+                System.err.println("Included order file " + s
+                    + " is also excluded, skipping.");
+            } else if (new File(s).exists()) {
+                allFiles.add(s);
+            } else {
+                System.err.println("Included order file " + s
+                    + " missing, skipping.");
             }
-            if (new File(topDirName + s).exists())
-                filesIncluded.addElement(s);
-            else
-                System.err.println("Included file "+s+" missing, skipping.");
         }
 
-        // Print results.
-
-        for (int i = 0; i < filesIncluded.size(); ++i) {
-            if (useTopDir) {
-                out.print("-C ");
-                out.print(topDirName);
-                out.print(" ");
-            }
-            out.println((String)filesIncluded.elementAt(i));
+        // Print final results.
+        for (String str : allFiles) {
+            out.println(str);
         }
-
         out.flush();
         out.close();
     }
 
-
     /*
-     * Read a file containing a list of files into a Vector.
+     * Read a file containing a list of files and directories into a List.
      */
-    private static Vector readListFromFile(String fileName,
-                                           boolean addClassSuffix) {
+    private List<String> readListFromFile(String fileName,
+            boolean addClassSuffix) {
 
         BufferedReader br = null;
-        Vector v = new Vector(2000);
-
-        if ("-".equals(fileName))
-            return v;
-
+        List<String> list = new ArrayList<String>();
+        // If you see "-" for the name, just assume nothing was provided.
+        if ("-".equals(fileName)) {
+            return list;
+        }
         try {
             br = new BufferedReader(new FileReader(fileName));
-
-        // Read the input file a line at a time. # in column 1 is a comment.
-
+            // Read the input file a path at a time. # in column 1 is a comment.
             while (true) {
-                String line = null;
-                line = br.readLine();
-
-                if (line == null)
+                String path = br.readLine();
+                if (path == null) {
                     break;
-
-                if (line.length() == 0    ||
-                    line.charAt(0) == '#')
+                }
+                // Look for comments
+                path = path.trim();
+                if (path.length() == 0
+                        || path.charAt(0) == '#') {
                     continue;
-
-                // Convert forward or back slashes to the type expected for
-                // the current platform.
-
-                if (File.separatorChar == '/')
-                    line = line.replace('\\', '/');
-                else
-                    line = line.replace('/', '\\');
-
-                line = line.trim();
-                if (addClassSuffix) {
-                    if (!line.endsWith(".class")) {
-                        line = line + ".class";
-                    }
+                }
+                // Add trailing .class if necessary
+                if (addClassSuffix && !path.endsWith(".class")) {
+                    path = path + ".class";
                 }
-                v.addElement(line);
+                // Normalize the path
+                path = cleanPath(new File(path));
+                // Add to list
+                if (path != null && path.length() > 0 && !list.contains(path)) {
+                    list.add(path);
+                }
             }
             br.close();
         } catch (FileNotFoundException e) {
@@ -249,68 +225,89 @@
             e.printStackTrace();
             System.exit(2);
         }
-        return v;
+        return list;
     }
 
-
     /*
-     * Expands list of files to process into full list of all files that
+     * Expands inputSet (files or dirs) into full set of all files that
      * can be found by recursively descending directories.
+     * @param dir root directory
+     * @param inputSet set of files or dirs to look into
+     * @param processed files or dirs already processed
+     * @return set of files
      */
-    private static void expand(File dir, String[] files,
-                               Vector includedFiles, HashMap excludedFiles,
-                               String topDirName) {
-        if (files == null) {
-            return;
+    private Set<String> expand(File dir,
+            Set<String> inputSet,
+            Set<String> processed) {
+        Set<String> includedFiles = new HashSet<String>();
+        if (inputSet.isEmpty()) {
+            return includedFiles;
         }
-        for (int i = 0; i < files.length; i++) {
-            File f = (dir == null) ? new File(files[i])
-                                   : new File(dir, files[i]);
-            if (f.isFile()) {
-                String filePath = f.getPath();
-
-                if (useTopDir) {
-                    if (filePath.startsWith(topDirName))
-                        filePath = filePath.substring(topDirName.length());
+        for (String name : inputSet) {
+            // Depending on start location
+            File f = (dir == null) ? new File(name)
+                    : new File(dir, name);
+            // Normalized path to use
+            String path = cleanPath(f);
+            if (path != null && path.length() > 0
+                    && !processed.contains(path)) {
+                if (f.isFile()) {
+                    // Not in the excludeList, add it to both lists
+                    includedFiles.add(path);
+                    processed.add(path);
+                } else if (f.isDirectory()) {
+                    // Add the directory entries
+                    String[] dirList = f.list();
+                    Set<String> dirInputSet = new HashSet<String>();
+                    for (String x : dirList) {
+                        dirInputSet.add(x);
+                    }
+                    // Process all entries in this directory
+                    Set<String> subList = expand(f, dirInputSet, processed);
+                    includedFiles.addAll(subList);
+                    processed.add(path);
                 }
-
-                if (filePath.length() >= 2 &&
-                    filePath.charAt(0) == '.' &&
-                    filePath.charAt(1) == File.separatorChar)
-                    filePath = filePath.substring(2);
-
-                if (!excludedFiles.containsKey(filePath)) {
-                    excludedFiles.put(filePath, filePath);
-                    includedFiles.addElement(filePath);
-                }
-            } else if (f.isDirectory()) {
-                String dirPath = f.getPath();
-                dirPath = (dirPath.endsWith(File.separator)) ? dirPath :
-                    (dirPath + File.separator);
-
-                if (useTopDir) {
-                    if (dirPath.startsWith(topDirName))
-                        dirPath = dirPath.substring(topDirName.length());
-                }
-
-                if (dirPath.length() >= 2 &&
-                    dirPath.charAt(0) == '.' &&
-                    dirPath.charAt(1) == File.separatorChar)
-                    dirPath = dirPath.substring(2);
-
-                if (!excludedFiles.containsKey(dirPath)) {
-
-                    // Sort the directory list so that entries in the jar file
-                    // are in a repeatable order.  The order itself is not particularly
-                    // important.  [File.list() is unpredictable.]
-
-                    String[] dirList = f.list();
-                    Arrays.sort(dirList);
-                    expand(f, dirList, includedFiles, excludedFiles, topDirName);
-                }
-            } else {
-                System.err.println("Error accessing: " + f.getPath());
             }
         }
+        return includedFiles;
     }
+
+    private String cleanPath(File f) {
+        String path = f.getPath();
+        if (f.isFile()) {
+            path = cleanFilePath(path);
+        } else if (f.isDirectory()) {
+            path = cleanDirPath(path);
+        } else {
+            System.err.println("WARNING: Path does not exist as file or directory: " + path);
+            path = null;
+        }
+        return path;
+    }
+
+    private String cleanFilePath(String path) {
+        // Remove leading and trailing whitespace
+        path = path.trim();
+        // Make all / and \ chars one
+        if (File.separatorChar == '/') {
+            path = path.replace('\\', '/');
+        } else {
+            path = path.replace('/', '\\');
+        }
+        // Remove leading ./
+        if (path.startsWith("." + File.separator)) {
+            path = path.substring(2);
+        }
+        return path;
+    }
+
+    private String cleanDirPath(String path) {
+        path = cleanFilePath(path);
+        // Make sure it ends with a file separator
+        if (!path.endsWith(File.separator)) {
+            path = path + File.separator;
+        }
+        return path;
+    }
+
 }
--- a/jdk/src/linux/doc/man/appletviewer.1	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/linux/doc/man/appletviewer.1	Wed Jul 21 09:57:21 2010 -0700
@@ -1,4 +1,4 @@
-." Copyright 2002-2006 Sun Microsystems, Inc.  All Rights Reserved.
+." Copyright (c) 1995, 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
@@ -19,12 +19,11 @@
 ." or visit www.oracle.com if you need additional information or have any
 ." questions.
 ."
-.TH appletviewer 1 "04 May 2009"
-." Generated from HTML by html2man (author: Eric Armstrong)
+.TH appletviewer 1 "02 Jun 2010"
 
 .LP
 .SH "Name"
-appletviewer \- The Java Applet Viewer
+appletviewer \- The Java Applet Viewer.
 .LP
 .RS 3
 
@@ -74,6 +73,4 @@
 .LP
 
 .LP
-
-.LP
  
--- a/jdk/src/linux/doc/man/apt.1	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/linux/doc/man/apt.1	Wed Jul 21 09:57:21 2010 -0700
@@ -1,4 +1,4 @@
-." Copyright 2004-2006 Sun Microsystems, Inc.  All Rights Reserved.
+." 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
@@ -19,8 +19,7 @@
 ." or visit www.oracle.com if you need additional information or have any
 ." questions.
 ."
-.TH apt 1 "04 May 2009"
-." Generated from HTML by html2man (author: Eric Armstrong)
+.TH apt 1 "02 Jun 2010"
 
 .LP
 .SH "NAME"
@@ -124,6 +123,4 @@
 .RE
 
 .LP
-
-.LP
  
--- a/jdk/src/linux/doc/man/extcheck.1	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/linux/doc/man/extcheck.1	Wed Jul 21 09:57:21 2010 -0700
@@ -1,4 +1,4 @@
-." Copyright 2002-2006 Sun Microsystems, Inc.  All Rights Reserved.
+." Copyright (c) 1998, 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
@@ -19,8 +19,7 @@
 ." or visit www.oracle.com if you need additional information or have any
 ." questions.
 ."
-.TH extcheck 1 "04 May 2009"
-." Generated from HTML by html2man (author: Eric Armstrong)
+.TH extcheck 1 "02 Jun 2010"
 
 .LP
 .SH "Name"
@@ -83,6 +82,4 @@
 .LP
 jar(1)
 .LP
-
-.LP
  
--- a/jdk/src/linux/doc/man/idlj.1	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/linux/doc/man/idlj.1	Wed Jul 21 09:57:21 2010 -0700
@@ -1,4 +1,4 @@
-." Copyright 2001-2006 Sun Microsystems, Inc.  All Rights Reserved.
+." Copyright (c) 2001, 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
@@ -19,8 +19,7 @@
 ." or visit www.oracle.com if you need additional information or have any
 ." questions.
 ."
-.TH idlj 1 "04 May 2009"
-." Generated from HTML by html2man (author: Eric Armstrong)
+.TH idlj 1 "02 Jun 2010"
 
 .LP
 .SH "Name"
@@ -508,6 +507,4 @@
 .RE
 
 .LP
-
-.LP
  
--- a/jdk/src/linux/doc/man/ja/appletviewer.1	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/linux/doc/man/ja/appletviewer.1	Wed Jul 21 09:57:21 2010 -0700
@@ -1,4 +1,4 @@
-." Copyright 2002-2006 Sun Microsystems, Inc.  All Rights Reserved.
+." Copyright (c) 1995, 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
@@ -19,8 +19,7 @@
 ." or visit www.oracle.com if you need additional information or have any
 ." questions.
 ."
-.TH appletviewer 1 "04 May 2009"
-." Generated from HTML by html2man (author: Eric Armstrong)
+.TH appletviewer 1 "02 Jun 2010"
 
 .LP
 .SH "åå‰"
@@ -74,6 +73,4 @@
 .LP
 
 .LP
-
-.LP
  
--- a/jdk/src/linux/doc/man/ja/apt.1	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/linux/doc/man/ja/apt.1	Wed Jul 21 09:57:21 2010 -0700
@@ -1,4 +1,4 @@
-." Copyright  Sun Microsystems, Inc.  All Rights Reserved.
+." 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
@@ -19,8 +19,7 @@
 ." or visit www.oracle.com if you need additional information or have any
 ." questions.
 ."
-.TH apt 1 "04 May 2009"
-." Generated from HTML by html2man (author: Eric Armstrong)
+.TH apt 1 "02 Jun 2010"
 
 .LP
 .SH "NAME"
--- a/jdk/src/linux/doc/man/ja/extcheck.1	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/linux/doc/man/ja/extcheck.1	Wed Jul 21 09:57:21 2010 -0700
@@ -1,4 +1,4 @@
-." Copyright 2002-2006 Sun Microsystems, Inc.  All Rights Reserved.
+." Copyright (c) 1998, 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
@@ -19,8 +19,7 @@
 ." or visit www.oracle.com if you need additional information or have any
 ." questions.
 ."
-.TH extcheck 1 "04 May 2009"
-." Generated from HTML by html2man (author: Eric Armstrong)
+.TH extcheck 1 "02 Jun 2010"
 
 .LP
 .SH "åå‰"
@@ -83,6 +82,4 @@
 .LP
 jar(1)
 .LP
-
-.LP
  
--- a/jdk/src/linux/doc/man/ja/idlj.1	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/linux/doc/man/ja/idlj.1	Wed Jul 21 09:57:21 2010 -0700
@@ -1,4 +1,4 @@
-." Copyright 2001-2006 Sun Microsystems, Inc.  All Rights Reserved.
+." Copyright (c) 2001, 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
@@ -19,8 +19,7 @@
 ." or visit www.oracle.com if you need additional information or have any
 ." questions.
 ."
-.TH idlj 1 "04 May 2009"
-." Generated from HTML by html2man (author: Eric Armstrong)
+.TH idlj 1 "02 Jun 2010"
 
 .LP
 .SH "åå‰"
@@ -507,6 +506,4 @@
 .RE
 
 .LP
-
-.LP
  
--- a/jdk/src/linux/doc/man/ja/jar.1	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/linux/doc/man/ja/jar.1	Wed Jul 21 09:57:21 2010 -0700
@@ -1,4 +1,4 @@
-." Copyright 2004-2006 Sun Microsystems, Inc.  All Rights Reserved.
+." Copyright (c) 1997, 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
@@ -19,8 +19,7 @@
 ." or visit www.oracle.com if you need additional information or have any
 ." questions.
 ."
-.TH jar 1 "04 May 2009"
-." Generated from HTML by html2man (author: Eric Armstrong)
+.TH jar 1 "02 Jun 2010"
 
 .LP
 .SH "åå‰"
@@ -205,7 +204,7 @@
 
 .LP
 .LP
-Java 2 SDK ã®ãƒãƒ¼ã‚¸ãƒ§ãƒ³ 1.3 以é™ã‹ã‚‰ã€\f2jar\fP ユーティリティー㧠
+JDK ã®ãƒãƒ¼ã‚¸ãƒ§ãƒ³ 1.3 以é™ã‹ã‚‰ã€\f2jar\fP ユーティリティー㧠
 .na
 \f2JarIndex\fP @
 .fi
@@ -717,6 +716,4 @@
 .br
 
 .LP
-pack200(1) 
-.LP
- 
+pack200(1)  
--- a/jdk/src/linux/doc/man/ja/jarsigner.1	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/linux/doc/man/ja/jarsigner.1	Wed Jul 21 09:57:21 2010 -0700
@@ -1,4 +1,4 @@
-." Copyright 2004-2006 Sun Microsystems, Inc.  All Rights Reserved.
+." Copyright (c) 1998, 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
@@ -19,8 +19,7 @@
 ." or visit www.oracle.com if you need additional information or have any
 ." questions.
 ."
-.TH jarsigner 1 "04 May 2009"
-." Generated from HTML by html2man (author: Eric Armstrong)
+.TH jarsigner 1 "02 Jun 2010"
 
 .LP
 .SH "åå‰"
@@ -504,7 +503,7 @@
 .nr 44 \n(83+(3*\n(38)
 .nr 84 +\n(44
 .nr TW \n(84
-.if t .if \n(TW>\n(.li .tm Table at line 186 file Input is too wide - \n(TW units
+.if t .if \n(TW>\n(.li .tm Table at line 185 file Input is too wide - \n(TW units
 .fc  
 .nr #T 0-1
 .nr #a 0-1
@@ -1616,6 +1615,4 @@
 .RE
 
 .LP
-
-.LP
  
--- a/jdk/src/linux/doc/man/ja/java.1	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/linux/doc/man/ja/java.1	Wed Jul 21 09:57:21 2010 -0700
@@ -1,4 +1,4 @@
-." Copyright 2002-2006 Sun Microsystems, Inc.  All Rights Reserved.
+." Copyright (c) 1994, 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
@@ -19,8 +19,7 @@
 ." or visit www.oracle.com if you need additional information or have any
 ." questions.
 ."
-.TH java 1 "04 May 2009"
-." Generated from HTML by html2man (author: Eric Armstrong)
+.TH java 1 "02 Jun 2010"
 
 .LP
 .SH "åå‰"
@@ -315,19 +314,19 @@
 ãƒãƒƒã‚¯ã‚°ãƒ©ã‚¦ãƒ³ãƒ‰ã‚³ãƒ³ãƒ‘イルを無効ã«ã—ã¾ã™ã€‚通常ã€VM ã§ã¯ã€ãƒãƒƒã‚¯ã‚°ãƒ©ã‚¦ãƒ³ãƒ‰ã‚³ãƒ³ãƒ‘イルãŒçµ‚了ã™ã‚‹ã¾ã§ã€ãƒ¡ã‚½ãƒƒãƒ‰ã‚’ãƒãƒƒã‚¯ã‚°ãƒ©ã‚¦ãƒ³ãƒ‰ã‚¿ã‚¹ã‚¯ã¨ã—ã¦ã‚³ãƒ³ãƒ‘イルã—ã€ã‚¤ãƒ³ã‚¿ãƒ—リタモードã§ãƒ¡ã‚½ãƒƒãƒ‰ã‚’実行ã—ã¾ã™ã€‚\f2\-Xbatch\fP フラグを指定ã™ã‚‹ã¨ã€ãƒãƒƒã‚¯ã‚°ãƒ©ã‚¦ãƒ³ãƒ‰ã‚³ãƒ³ãƒ‘イルãŒç„¡åŠ¹ã«ãªã‚Šã€ã™ã¹ã¦ã®ãƒ¡ã‚½ãƒƒãƒ‰ã®ã‚³ãƒ³ãƒ‘イルãŒå®Œäº†ã™ã‚‹ã¾ã§ãƒ•ã‚©ã‚¢ã‚°ãƒ©ã‚¦ãƒ³ãƒ‰ã‚¿ã‚¹ã‚¯ã¨ã—ã¦å‡¦ç†ã•ã‚Œã¾ã™ã€‚ 
 .TP 3
 \-Xbootclasspath:bootclasspath 
-ブートクラスファイルを探ã™ãƒ‡ã‚£ãƒ¬ã‚¯ãƒˆãƒªã€JAR アーカイブã€ãŠã‚ˆã³ ZIP アーカイブをコロンã§åŒºåˆ‡ã£ãŸãƒªã‚¹ãƒˆã§æŒ‡å®šã—ã¾ã™ã€‚指定ã—ãŸãƒ‘スã«å­˜åœ¨ã™ã‚‹ãƒ–ートクラスファイルãŒã€Java 2 SDK ã«å«ã¾ã‚Œã‚‹ãƒ–ートクラスファイルã®ä»£ã‚ã‚Šã«ä½¿ç”¨ã•ã‚Œã¾ã™ã€‚\f2注: rt.jar 内ã®ã‚¯ãƒ©ã‚¹ã‚’オーãƒãƒ¼ãƒ©ã‚¤ãƒ‰ã™ã‚‹ç›®çš„ã§ã“ã®ã‚ªãƒ—ションを使用ã™ã‚‹ã‚¢ãƒ—リケーションã¯ã€ã‚·ã‚¹ãƒ†ãƒ ã«é…ç½®ã—ãªã„ã§ãã ã•ã„。Java 2 Runtime Environment ãƒã‚¤ãƒŠãƒªã‚³ãƒ¼ãƒ‰ãƒ©ã‚¤ã‚»ãƒ³ã‚¹é•åã«ãªã‚Šã¾ã™ã€‚\fP 
+ブートクラスファイルを探ã™ãƒ‡ã‚£ãƒ¬ã‚¯ãƒˆãƒªã€JAR アーカイブã€ãŠã‚ˆã³ ZIP アーカイブをコロンã§åŒºåˆ‡ã£ãŸãƒªã‚¹ãƒˆã§æŒ‡å®šã—ã¾ã™ã€‚指定ã—ãŸãƒ‘スã«å­˜åœ¨ã™ã‚‹ãƒ–ートクラスファイルãŒã€JDK ã«å«ã¾ã‚Œã‚‹ãƒ–ートクラスファイルã®ä»£ã‚ã‚Šã«ä½¿ç”¨ã•ã‚Œã¾ã™ã€‚\f2注: rt.jar 内ã®ã‚¯ãƒ©ã‚¹ã‚’オーãƒãƒ¼ãƒ©ã‚¤ãƒ‰ã™ã‚‹ç›®çš„ã§ã“ã®ã‚ªãƒ—ションを使用ã™ã‚‹ã‚¢ãƒ—リケーションã¯ã€ã‚·ã‚¹ãƒ†ãƒ ã«é…ç½®ã—ãªã„ã§ãã ã•ã„。Java Runtime Environment ãƒã‚¤ãƒŠãƒªã‚³ãƒ¼ãƒ‰ãƒ©ã‚¤ã‚»ãƒ³ã‚¹é•åã«ãªã‚Šã¾ã™ã€‚\fP 
 .TP 3
 \-Xbootclasspath/a:path 
 ディレクトリã€JAR アーカイブã€ãŠã‚ˆã³ ZIP アーカイブã®ãƒ‘スをコロンã§åŒºåˆ‡ã£ã¦æŒ‡å®šã—ã¾ã™ã€‚ パスã¯ãƒ‡ãƒ•ã‚©ãƒ«ãƒˆã®ãƒ–ートストラップクラスパスã®ã‚ã¨ã«è¿½åŠ ã•ã‚Œã¾ã™ã€‚ 
 .TP 3
 \-Xbootclasspath/p:path 
-ディレクトリã€JAR アーカイブã€ãŠã‚ˆã³ ZIP アーカイブã®ãƒ‘スをコロンã§åŒºåˆ‡ã£ã¦æŒ‡å®šã—ã¾ã™ã€‚ パスã¯ãƒ‡ãƒ•ã‚©ãƒ«ãƒˆã®ãƒ–ートストラップクラスパスã®å‰ã«è¿½åŠ ã•ã‚Œã¾ã™ã€‚\f2注 rt.jar 内ã®ã‚¯ãƒ©ã‚¹ã‚’オーãƒãƒ¼ãƒ©ã‚¤ãƒ‰ã™ã‚‹ç›®çš„ã§ã“ã®ã‚ªãƒ—ションを使用ã™ã‚‹ã‚¢ãƒ—リケーションã¯ã€ã‚·ã‚¹ãƒ†ãƒ ã«é…ç½®ã—ãªã„ã§ãã ã•ã„。Java 2 Runtime Environment ãƒã‚¤ãƒŠãƒªã‚³ãƒ¼ãƒ‰ãƒ©ã‚¤ã‚»ãƒ³ã‚¹é•åã«ãªã‚Šã¾ã™ã€‚\fP 
+ディレクトリã€JAR アーカイブã€ãŠã‚ˆã³ ZIP アーカイブã®ãƒ‘スをコロンã§åŒºåˆ‡ã£ã¦æŒ‡å®šã—ã¾ã™ã€‚ パスã¯ãƒ‡ãƒ•ã‚©ãƒ«ãƒˆã®ãƒ–ートストラップクラスパスã®å‰ã«è¿½åŠ ã•ã‚Œã¾ã™ã€‚\f2注 rt.jar 内ã®ã‚¯ãƒ©ã‚¹ã‚’オーãƒãƒ¼ãƒ©ã‚¤ãƒ‰ã™ã‚‹ç›®çš„ã§ã“ã®ã‚ªãƒ—ションを使用ã™ã‚‹ã‚¢ãƒ—リケーションã¯ã€ã‚·ã‚¹ãƒ†ãƒ ã«é…ç½®ã—ãªã„ã§ãã ã•ã„。Java Runtime Environment ãƒã‚¤ãƒŠãƒªã‚³ãƒ¼ãƒ‰ãƒ©ã‚¤ã‚»ãƒ³ã‚¹é•åã«ãªã‚Šã¾ã™ã€‚\fP 
 .TP 3
 \-Xcheck:jni 
 Java Native Interface (JNI) 機能ã«å¯¾ã—ã¦è¿½åŠ ãƒã‚§ãƒƒã‚¯ã‚’è¡Œã„ã¾ã™ã€‚具体的ã«ã¯ã€Java 仮想マシン㯠JNI è¦æ±‚を処ç†ã™ã‚‹å‰ã«ã€JNI 関数ã«æ¸¡ã•ã‚Œã‚‹ãƒ‘ラメータã¨ã€å®Ÿè¡Œç’°å¢ƒã®ãƒ‡ãƒ¼ã‚¿ã‚’検証ã—ã¾ã™ã€‚無効ãªãƒ‡ãƒ¼ã‚¿ãŒè¦‹ã¤ã‹ã£ãŸå ´åˆã¯ã€ãƒã‚¤ãƒ†ã‚£ãƒ–コードã«å•é¡ŒãŒã‚ã‚‹ã“ã¨ã‚’示ã—ã¦ã„ã‚‹ãŸã‚ã€Java 仮想マシンã¯è‡´å‘½çš„エラーを発生ã—ã¦çµ‚了ã—ã¾ã™ã€‚ã“ã®ã‚ªãƒ—ションを使用ã™ã‚‹ã¨ã€ãƒ‘フォーマンス低下ãŒäºˆæƒ³ã•ã‚Œã¾ã™ã€‚ 
 .TP 3
 \-Xfuture 
-クラスã¨ãƒ•ã‚¡ã‚¤ãƒ«ã®å½¢å¼ã‚’厳密ã«ãƒã‚§ãƒƒã‚¯ã—ã¾ã™ã€‚下ä½äº’æ›æ€§ã‚’ä¿ã¤ãŸã‚ã€Java 2 SDK ã®ä»®æƒ³ãƒžã‚·ãƒ³ãŒå®Ÿè¡Œã™ã‚‹ãƒ‡ãƒ•ã‚©ãƒ«ãƒˆã®å½¢å¼ãƒã‚§ãƒƒã‚¯ã¯ã€JDK ソフトウェアã®ãƒãƒ¼ã‚¸ãƒ§ãƒ³ 1.1.x ãŒå®Ÿè¡Œã™ã‚‹ãƒã‚§ãƒƒã‚¯ã¨åŒç¨‹åº¦ã®åŽ³å¯†ã•ã«ãªã£ã¦ã„ã¾ã™ã€‚\f3\-Xfuture\fP フラグを指定ã™ã‚‹ã¨ã€ã‚¯ãƒ©ã‚¹ãƒ•ã‚¡ã‚¤ãƒ«å½¢å¼ã®ä»•æ§˜ã¸ã®æº–拠を強化ã™ã‚‹ãŸã‚ã®ã‚ˆã‚ŠåŽ³å¯†ãªãƒã‚§ãƒƒã‚¯ãŒæœ‰åŠ¹ã«ãªã‚Šã¾ã™ã€‚Java アプリケーション起動ツールã®å°†æ¥ã®ãƒªãƒªãƒ¼ã‚¹ã§ã¯ã€ã‚ˆã‚ŠåŽ³å¯†ãªãƒã‚§ãƒƒã‚¯ãŒãƒ‡ãƒ•ã‚©ãƒ«ãƒˆã«ãªã‚‹ãŸã‚ã€æ–°ã—ã„コードを開発ã™ã‚‹ã¨ãã«ã¯ã“ã®ãƒ•ãƒ©ã‚°ã‚’使用ã™ã‚‹ã“ã¨ã‚’ãŠå‹§ã‚ã—ã¾ã™ã€‚ 
+クラスã¨ãƒ•ã‚¡ã‚¤ãƒ«ã®å½¢å¼ã‚’厳密ã«ãƒã‚§ãƒƒã‚¯ã—ã¾ã™ã€‚下ä½äº’æ›æ€§ã‚’ä¿ã¤ãŸã‚ã€JDK ã®ä»®æƒ³ãƒžã‚·ãƒ³ãŒå®Ÿè¡Œã™ã‚‹ãƒ‡ãƒ•ã‚©ãƒ«ãƒˆã®å½¢å¼ãƒã‚§ãƒƒã‚¯ã¯ã€JDK ソフトウェアã®ãƒãƒ¼ã‚¸ãƒ§ãƒ³ 1.1.x ãŒå®Ÿè¡Œã™ã‚‹ãƒã‚§ãƒƒã‚¯ã¨åŒç¨‹åº¦ã®åŽ³å¯†ã•ã«ãªã£ã¦ã„ã¾ã™ã€‚\f3\-Xfuture\fP フラグを指定ã™ã‚‹ã¨ã€ã‚¯ãƒ©ã‚¹ãƒ•ã‚¡ã‚¤ãƒ«å½¢å¼ã®ä»•æ§˜ã¸ã®æº–拠を強化ã™ã‚‹ãŸã‚ã®ã‚ˆã‚ŠåŽ³å¯†ãªãƒã‚§ãƒƒã‚¯ãŒæœ‰åŠ¹ã«ãªã‚Šã¾ã™ã€‚Java アプリケーション起動ツールã®å°†æ¥ã®ãƒªãƒªãƒ¼ã‚¹ã§ã¯ã€ã‚ˆã‚ŠåŽ³å¯†ãªãƒã‚§ãƒƒã‚¯ãŒãƒ‡ãƒ•ã‚©ãƒ«ãƒˆã«ãªã‚‹ãŸã‚ã€æ–°ã—ã„コードを開発ã™ã‚‹ã¨ãã«ã¯ã“ã®ãƒ•ãƒ©ã‚°ã‚’使用ã™ã‚‹ã“ã¨ã‚’ãŠå‹§ã‚ã—ã¾ã™ã€‚ 
 .TP 3
 \-Xnoclassgc 
 クラスã®ã‚¬ãƒ™ãƒ¼ã‚¸ã‚³ãƒ¬ã‚¯ã‚·ãƒ§ãƒ³ã‚’無効ã«ã—ã¾ã™ã€‚ã“ã®ã‚ªãƒ—ションを使用ã™ã‚‹ã¨ã€ãƒ­ãƒ¼ãƒ‰æ¸ˆã¿ã‚¯ãƒ©ã‚¹ã‹ã‚‰ãƒ¡ãƒ¢ãƒªãƒ¼ãŒå›žå¾©ã•ã‚Œã‚‹ã“ã¨ãŒãªããªã‚‹ãŸã‚ã€å…¨ä½“çš„ãªãƒ¡ãƒ¢ãƒªãƒ¼ä½¿ç”¨é‡ãŒå¢—大ã—ã¾ã™ã€‚ã“ã®å ´åˆã€ã‚¢ãƒ—リケーションã«ã‚ˆã£ã¦ã¯ OutOfMemoryError ãŒã‚¹ãƒ­ãƒ¼ã•ã‚Œã‚‹å¯èƒ½æ€§ãŒã‚ã‚Šã¾ã™ã€‚ 
@@ -503,6 +502,4 @@
 .RE
 
 .LP
-
-.LP
  
--- a/jdk/src/linux/doc/man/ja/javac.1	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/linux/doc/man/ja/javac.1	Wed Jul 21 09:57:21 2010 -0700
@@ -1,4 +1,4 @@
-." Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+." Copyright (c) 1994, 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
@@ -19,8 +19,7 @@
 ." or visit www.oracle.com if you need additional information or have any
 ." questions.
 ."
-.TH javac 1 "04 May 2009"
-." Generated from HTML by html2man (author: Eric Armstrong)
+.TH javac 1 "02 Jun 2010"
 
 .LP
 .SH "åå‰"
@@ -960,6 +959,4 @@
 .RE
 
 .LP
-
-.LP
  
--- a/jdk/src/linux/doc/man/ja/javadoc.1	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/linux/doc/man/ja/javadoc.1	Wed Jul 21 09:57:21 2010 -0700
@@ -1,4 +1,4 @@
-." Copyright 2002-2006 Sun Microsystems, Inc.  All Rights Reserved.
+." Copyright (c) 1994, 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
@@ -19,8 +19,7 @@
 ." or visit www.oracle.com if you need additional information or have any
 ." questions.
 ."
-.TH javadoc 1 "04 May 2009"
-." Generated from HTML by html2man (author: Eric Armstrong)
+.TH javadoc 1 "02 Jun 2010"
 .SH "åå‰"
 javadoc \- Java API ドキュメントジェãƒãƒ¬ãƒ¼ã‚¿
 .RS 3
@@ -395,7 +394,7 @@
 .nr 40 \n(79+(0*\n(38)
 .nr 80 +\n(40
 .nr TW \n(80
-.if t .if \n(TW>\n(.li .tm Table at line 353 file Input is too wide - \n(TW units
+.if t .if \n(TW>\n(.li .tm Table at line 352 file Input is too wide - \n(TW units
 .fc  
 .nr #T 0-1
 .nr #a 0-1
@@ -529,7 +528,7 @@
 .nr 40 \n(79+(0*\n(38)
 .nr 80 +\n(40
 .nr TW \n(80
-.if t .if \n(TW>\n(.li .tm Table at line 406 file Input is too wide - \n(TW units
+.if t .if \n(TW>\n(.li .tm Table at line 405 file Input is too wide - \n(TW units
 .fc  
 .nr #T 0-1
 .nr #a 0-1
@@ -1374,7 +1373,7 @@
 .nr 41 \n(80+(3*\n(38)
 .nr 81 +\n(41
 .nr TW \n(81
-.if t .if \n(TW>\n(.li .tm Table at line 1125 file Input is too wide - \n(TW units
+.if t .if \n(TW>\n(.li .tm Table at line 1124 file Input is too wide - \n(TW units
 .fc  
 .nr #T 0-1
 .nr #a 0-1
@@ -2309,7 +2308,7 @@
 .nr 40 \n(79+(0*\n(38)
 .nr 80 +\n(40
 .nr TW \n(80
-.if t .if \n(TW>\n(.li .tm Table at line 1861 file Input is too wide - \n(TW units
+.if t .if \n(TW>\n(.li .tm Table at line 1860 file Input is too wide - \n(TW units
 .fc  
 .nr #T 0-1
 .nr #a 0-1
@@ -2677,7 +2676,7 @@
 .nr 42 \n(81+(3*\n(38)
 .nr 82 +\n(42
 .nr TW \n(82
-.if t .if \n(TW>\n(.li .tm Table at line 1959 file Input is too wide - \n(TW units
+.if t .if \n(TW>\n(.li .tm Table at line 1958 file Input is too wide - \n(TW units
 .fc  
 .nr #T 0-1
 .nr #a 0-1
@@ -3180,7 +3179,7 @@
 .nr 40 \n(79+(0*\n(38)
 .nr 80 +\n(40
 .nr TW \n(80
-.if t .if \n(TW>\n(.li .tm Table at line 2280 file Input is too wide - \n(TW units
+.if t .if \n(TW>\n(.li .tm Table at line 2279 file Input is too wide - \n(TW units
 .fc  
 .nr #T 0-1
 .nr #a 0-1
@@ -3301,7 +3300,7 @@
 .nr 40 \n(79+(0*\n(38)
 .nr 80 +\n(40
 .nr TW \n(80
-.if t .if \n(TW>\n(.li .tm Table at line 2316 file Input is too wide - \n(TW units
+.if t .if \n(TW>\n(.li .tm Table at line 2315 file Input is too wide - \n(TW units
 .fc  
 .nr #T 0-1
 .nr #a 0-1
@@ -3440,7 +3439,7 @@
 .nr 40 \n(79+(0*\n(38)
 .nr 80 +\n(40
 .nr TW \n(80
-.if t .if \n(TW>\n(.li .tm Table at line 2356 file Input is too wide - \n(TW units
+.if t .if \n(TW>\n(.li .tm Table at line 2355 file Input is too wide - \n(TW units
 .fc  
 .nr #T 0-1
 .nr #a 0-1
@@ -3619,7 +3618,7 @@
 .nr 40 \n(79+(0*\n(38)
 .nr 80 +\n(40
 .nr TW \n(80
-.if t .if \n(TW>\n(.li .tm Table at line 2437 file Input is too wide - \n(TW units
+.if t .if \n(TW>\n(.li .tm Table at line 2436 file Input is too wide - \n(TW units
 .fc  
 .nr #T 0-1
 .nr #a 0-1
@@ -3785,7 +3784,7 @@
 .nr 40 \n(79+(0*\n(38)
 .nr 80 +\n(40
 .nr TW \n(80
-.if t .if \n(TW>\n(.li .tm Table at line 2504 file Input is too wide - \n(TW units
+.if t .if \n(TW>\n(.li .tm Table at line 2503 file Input is too wide - \n(TW units
 .fc  
 .nr #T 0-1
 .nr #a 0-1
@@ -4102,7 +4101,7 @@
 .nr 42 \n(81+(3*\n(38)
 .nr 82 +\n(42
 .nr TW \n(82
-.if t .if \n(TW>\n(.li .tm Table at line 2681 file Input is too wide - \n(TW units
+.if t .if \n(TW>\n(.li .tm Table at line 2680 file Input is too wide - \n(TW units
 .fc  
 .nr #T 0-1
 .nr #a 0-1
@@ -4365,7 +4364,7 @@
 .nr 41 \n(80+(3*\n(38)
 .nr 81 +\n(41
 .nr TW \n(81
-.if t .if \n(TW>\n(.li .tm Table at line 2791 file Input is too wide - \n(TW units
+.if t .if \n(TW>\n(.li .tm Table at line 2790 file Input is too wide - \n(TW units
 .fc  
 .nr #T 0-1
 .nr #a 0-1
@@ -5831,5 +5830,4 @@
 .RE
 
 .LP
-.LP
-javadoc ã¯ã€Sun Microsystems, Inc ã®å•†æ¨™ã§ã™ (\f2javadoc\fP コマンド自体ã«ã¯å•†æ¨™ã‚·ãƒ³ãƒœãƒ«ã¯ä¸è¦)。 
+ 
--- a/jdk/src/linux/doc/man/ja/javah.1	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/linux/doc/man/ja/javah.1	Wed Jul 21 09:57:21 2010 -0700
@@ -1,4 +1,4 @@
-." Copyright 2002-2006 Sun Microsystems, Inc.  All Rights Reserved.
+." Copyright (c) 1994, 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
@@ -19,8 +19,7 @@
 ." or visit www.oracle.com if you need additional information or have any
 ." questions.
 ."
-.TH javah 1 "04 May 2009"
-." Generated from HTML by html2man (author: Eric Armstrong)
+.TH javah 1 "02 Jun 2010"
 
 .LP
 .SH "åå‰"
@@ -156,6 +155,4 @@
 .LP
 javac(1)ã€java(1)ã€jdb(1)ã€javap(1)ã€javadoc(1)
 .LP
-
-.LP
  
--- a/jdk/src/linux/doc/man/ja/javap.1	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/linux/doc/man/ja/javap.1	Wed Jul 21 09:57:21 2010 -0700
@@ -1,4 +1,4 @@
-." Copyright 2002-2006 Sun Microsystems, Inc.  All Rights Reserved.
+." Copyright (c) 1994, 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
@@ -19,8 +19,7 @@
 ." or visit www.oracle.com if you need additional information or have any
 ." questions.
 ."
-.TH javap 1 "04 May 2009"
-." Generated from HTML by html2man (author: Eric Armstrong)
+.TH javap 1 "02 Jun 2010"
 
 .LP
 .SH "åå‰"
@@ -359,6 +358,4 @@
 .LP
 javac(1)〠java(1)ã€jdb(1)ã€javah(1)ã€javadoc(1)
 .LP
-
-.LP
  
--- a/jdk/src/linux/doc/man/ja/javaws.1	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/linux/doc/man/ja/javaws.1	Wed Jul 21 09:57:21 2010 -0700
@@ -1,4 +1,4 @@
-." Copyright  Sun Microsystems, Inc.  All Rights Reserved.
+." Copyright (c) 2003, 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
@@ -19,17 +19,12 @@
 ." or visit www.oracle.com if you need additional information or have any
 ." questions.
 ."
-.TH javaws 1 "04 May 2009"
-." Generated from HTML by html2man (author: Eric Armstrong)
-
-.LP
+.TH javaws 1 "02 Jun 2010"
 
 .LP
 .SH "åå‰"
 \f2javaws\fP コマンド行
 .LP
-
-.LP
 .LP
 \ 
 .LP
--- a/jdk/src/linux/doc/man/ja/jconsole.1	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/linux/doc/man/ja/jconsole.1	Wed Jul 21 09:57:21 2010 -0700
@@ -1,4 +1,4 @@
-." Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+." 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
@@ -19,8 +19,7 @@
 ." or visit www.oracle.com if you need additional information or have any
 ." questions.
 ."
-.TH jconsole 1 "04 May 2009"
-." Generated from HTML by html2man (author: Eric Armstrong)
+.TH jconsole 1 "02 Jun 2010"
 
 .LP
 .SH "åå‰"
@@ -160,6 +159,4 @@
 .RE
 
 .LP
-
-.LP
  
--- a/jdk/src/linux/doc/man/ja/jdb.1	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/linux/doc/man/ja/jdb.1	Wed Jul 21 09:57:21 2010 -0700
@@ -1,4 +1,4 @@
-." Copyright 2002-2006 Sun Microsystems, Inc.  All Rights Reserved.
+." Copyright (c) 1995, 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
@@ -19,8 +19,7 @@
 ." or visit www.oracle.com if you need additional information or have any
 ." questions.
 ."
-.TH jdb 1 "04 May 2009"
-." Generated from HTML by html2man (author: Eric Armstrong)
+.TH jdb 1 "02 Jun 2010"
 
 .LP
 .SH "åå‰"
@@ -364,6 +363,4 @@
 .LP
 javac(1)ã€java(1)ã€javah(1)ã€javap(1)ã€javadoc(1)
 .LP
-
-.LP
  
--- a/jdk/src/linux/doc/man/ja/jhat.1	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/linux/doc/man/ja/jhat.1	Wed Jul 21 09:57:21 2010 -0700
@@ -1,4 +1,4 @@
-." Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+." Copyright (c) 2006, 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
@@ -19,8 +19,7 @@
 ." or visit www.oracle.com if you need additional information or have any
 ." questions.
 ."
-.TH jhat 1 "04 May 2009"
-." Generated from HTML by html2man (author: Eric Armstrong)
+.TH jhat 1 "02 Jun 2010"
 
 .LP
 .SH "åå‰"
--- a/jdk/src/linux/doc/man/ja/jinfo.1	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/linux/doc/man/ja/jinfo.1	Wed Jul 21 09:57:21 2010 -0700
@@ -1,4 +1,4 @@
-." Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+." 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
@@ -19,8 +19,7 @@
 ." or visit www.oracle.com if you need additional information or have any
 ." questions.
 ."
-.TH jinfo 1 "04 May 2009"
-." Generated from HTML by html2man (author: Eric Armstrong)
+.TH jinfo 1 "02 Jun 2010"
 
 .LP
 .SH "åå‰"
@@ -164,6 +163,4 @@
 .RE
 
 .LP
-
-.LP
  
--- a/jdk/src/linux/doc/man/ja/jmap.1	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/linux/doc/man/ja/jmap.1	Wed Jul 21 09:57:21 2010 -0700
@@ -1,4 +1,4 @@
-." Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+." 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
@@ -19,8 +19,7 @@
 ." or visit www.oracle.com if you need additional information or have any
 ." questions.
 ."
-.TH jmap 1 "04 May 2009"
-." Generated from HTML by html2man (author: Eric Armstrong)
+.TH jmap 1 "02 Jun 2010"
 
 .LP
 .SH "åå‰"
@@ -196,6 +195,4 @@
 .RE
 
 .LP
-
-.LP
  
--- a/jdk/src/linux/doc/man/ja/jps.1	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/linux/doc/man/ja/jps.1	Wed Jul 21 09:57:21 2010 -0700
@@ -1,4 +1,4 @@
-." Copyright 2003 Sun Microsystems, Inc.  All Rights Reserved.
+." 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
@@ -19,8 +19,7 @@
 ." or visit www.oracle.com if you need additional information or have any
 ." questions.
 ."
-.TH jps 1 "04 May 2009"
-." Generated from HTML by html2man (author: Eric Armstrong)
+.TH jps 1 "02 Jun 2010"
 
 .LP
 .SH "åå‰"
@@ -292,6 +291,4 @@
 .RE
 
 .LP
-
-.LP
  
--- a/jdk/src/linux/doc/man/ja/jrunscript.1	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/linux/doc/man/ja/jrunscript.1	Wed Jul 21 09:57:21 2010 -0700
@@ -1,4 +1,4 @@
-." Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+." Copyright (c) 2006, 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
@@ -19,8 +19,7 @@
 ." or visit www.oracle.com if you need additional information or have any
 ." questions.
 ."
-.TH jrunscript 1 "04 May 2009"
-." Generated from HTML by html2man (author: Eric Armstrong)
+.TH jrunscript 1 "02 Jun 2010"
 
 .LP
 .SH "åå‰"
@@ -220,6 +219,4 @@
 .LP
 JavaScript ãŒä½¿ç”¨ã•ã‚Œã‚‹å ´åˆã€jrunscript ã¯ã€æœ€åˆã®ãƒ¦ãƒ¼ã‚¶ãƒ¼å®šç¾©ã‚¹ã‚¯ãƒªãƒ—トを評価ã™ã‚‹å‰ã«ã€ã„ãã¤ã‹ã®çµ„ã¿è¾¼ã¿é–¢æ•°ã‚„組ã¿è¾¼ã¿ã‚ªãƒ–ジェクトをåˆæœŸåŒ–ã—ã¾ã™ã€‚ã“れら㮠JavaScript 組ã¿è¾¼ã¿æ©Ÿèƒ½ã«ã¤ã„ã¦ã¯ã€jsdocs ã‚’å‚ç…§ã—ã¦ãã ã•ã„。
 .LP
-
-.LP
  
--- a/jdk/src/linux/doc/man/ja/jsadebugd.1	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/linux/doc/man/ja/jsadebugd.1	Wed Jul 21 09:57:21 2010 -0700
@@ -1,4 +1,4 @@
-." Copyright 2004 Sun Microsystems, Inc.  All Rights Reserved.
+." 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
@@ -19,8 +19,7 @@
 ." or visit www.oracle.com if you need additional information or have any
 ." questions.
 ."
-.TH jsadebugd 1 "04 May 2009"
-." Generated from HTML by html2man (author: Eric Armstrong)
+.TH jsadebugd 1 "02 Jun 2010"
 
 .LP
 .SH "åå‰"
@@ -147,6 +146,4 @@
 .RE
 
 .LP
-
-.LP
  
--- a/jdk/src/linux/doc/man/ja/jstack.1	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/linux/doc/man/ja/jstack.1	Wed Jul 21 09:57:21 2010 -0700
@@ -1,4 +1,4 @@
-." Copyright 2004 Sun Microsystems, Inc.  All Rights Reserved.
+." 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
@@ -19,8 +19,7 @@
 ." or visit www.oracle.com if you need additional information or have any
 ." questions.
 ."
-.TH jstack 1 "04 May 2009"
-." Generated from HTML by html2man (author: Eric Armstrong)
+.TH jstack 1 "02 Jun 2010"
 
 .LP
 .SH "åå‰"
@@ -189,6 +188,4 @@
 .LP
 æ··åˆãƒ¢ãƒ¼ãƒ‰ã®ã‚¹ã‚¿ãƒƒã‚¯ãƒˆãƒ¬ãƒ¼ã‚¹ (\-m オプション使用) ã¯ã€ãƒªãƒ¢ãƒ¼ãƒˆãƒ‡ãƒãƒƒã‚°ã‚µãƒ¼ãƒãƒ¼ã§ã¯æ©Ÿèƒ½ã—ã¾ã›ã‚“。
 .LP
-
-.LP
  
--- a/jdk/src/linux/doc/man/ja/jstat.1	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/linux/doc/man/ja/jstat.1	Wed Jul 21 09:57:21 2010 -0700
@@ -1,4 +1,4 @@
-." Copyright 2003 Sun Microsystems, Inc.  All Rights Reserved.
+." 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
@@ -19,8 +19,7 @@
 ." or visit www.oracle.com if you need additional information or have any
 ." questions.
 ."
-.TH jstat 1 "04 May 2009"
-." Generated from HTML by html2man (author: Eric Armstrong)
+.TH jstat 1 "02 Jun 2010"
 
 .LP
 .SH "åå‰"
@@ -487,7 +486,7 @@
 .nr 41 \n(80+(3*\n(38)
 .nr 81 +\n(41
 .nr TW \n(81
-.if t .if \n(TW>\n(.li .tm Table at line 260 file Input is too wide - \n(TW units
+.if t .if \n(TW>\n(.li .tm Table at line 259 file Input is too wide - \n(TW units
 .fc  
 .nr #T 0-1
 .nr #a 0-1
@@ -887,7 +886,7 @@
 .nr 41 \n(80+(3*\n(38)
 .nr 81 +\n(41
 .nr TW \n(81
-.if t .if \n(TW>\n(.li .tm Table at line 314 file Input is too wide - \n(TW units
+.if t .if \n(TW>\n(.li .tm Table at line 313 file Input is too wide - \n(TW units
 .fc  
 .nr #T 0-1
 .nr #a 0-1
@@ -1170,7 +1169,7 @@
 .nr 41 \n(80+(3*\n(38)
 .nr 81 +\n(41
 .nr TW \n(81
-.if t .if \n(TW>\n(.li .tm Table at line 350 file Input is too wide - \n(TW units
+.if t .if \n(TW>\n(.li .tm Table at line 349 file Input is too wide - \n(TW units
 .fc  
 .nr #T 0-1
 .nr #a 0-1
@@ -1634,7 +1633,7 @@
 .nr 41 \n(80+(3*\n(38)
 .nr 81 +\n(41
 .nr TW \n(81
-.if t .if \n(TW>\n(.li .tm Table at line 420 file Input is too wide - \n(TW units
+.if t .if \n(TW>\n(.li .tm Table at line 419 file Input is too wide - \n(TW units
 .fc  
 .nr #T 0-1
 .nr #a 0-1
@@ -2258,7 +2257,7 @@
 .nr 41 \n(80+(3*\n(38)
 .nr 81 +\n(41
 .nr TW \n(81
-.if t .if \n(TW>\n(.li .tm Table at line 494 file Input is too wide - \n(TW units
+.if t .if \n(TW>\n(.li .tm Table at line 493 file Input is too wide - \n(TW units
 .fc  
 .nr #T 0-1
 .nr #a 0-1
@@ -2638,7 +2637,7 @@
 .nr 41 \n(80+(3*\n(38)
 .nr 81 +\n(41
 .nr TW \n(81
-.if t .if \n(TW>\n(.li .tm Table at line 517 file Input is too wide - \n(TW units
+.if t .if \n(TW>\n(.li .tm Table at line 516 file Input is too wide - \n(TW units
 .fc  
 .nr #T 0-1
 .nr #a 0-1
@@ -2954,7 +2953,7 @@
 .nr 41 \n(80+(3*\n(38)
 .nr 81 +\n(41
 .nr TW \n(81
-.if t .if \n(TW>\n(.li .tm Table at line 571 file Input is too wide - \n(TW units
+.if t .if \n(TW>\n(.li .tm Table at line 570 file Input is too wide - \n(TW units
 .fc  
 .nr #T 0-1
 .nr #a 0-1
@@ -3409,7 +3408,7 @@
 .nr 41 \n(80+(3*\n(38)
 .nr 81 +\n(41
 .nr TW \n(81
-.if t .if \n(TW>\n(.li .tm Table at line 627 file Input is too wide - \n(TW units
+.if t .if \n(TW>\n(.li .tm Table at line 626 file Input is too wide - \n(TW units
 .fc  
 .nr #T 0-1
 .nr #a 0-1
@@ -3805,7 +3804,7 @@
 .nr 41 \n(80+(3*\n(38)
 .nr 81 +\n(41
 .nr TW \n(81
-.if t .if \n(TW>\n(.li .tm Table at line 669 file Input is too wide - \n(TW units
+.if t .if \n(TW>\n(.li .tm Table at line 668 file Input is too wide - \n(TW units
 .fc  
 .nr #T 0-1
 .nr #a 0-1
@@ -4150,7 +4149,7 @@
 .nr 41 \n(80+(3*\n(38)
 .nr 81 +\n(41
 .nr TW \n(81
-.if t .if \n(TW>\n(.li .tm Table at line 711 file Input is too wide - \n(TW units
+.if t .if \n(TW>\n(.li .tm Table at line 710 file Input is too wide - \n(TW units
 .fc  
 .nr #T 0-1
 .nr #a 0-1
@@ -4495,7 +4494,7 @@
 .nr 41 \n(80+(3*\n(38)
 .nr 81 +\n(41
 .nr TW \n(81
-.if t .if \n(TW>\n(.li .tm Table at line 753 file Input is too wide - \n(TW units
+.if t .if \n(TW>\n(.li .tm Table at line 752 file Input is too wide - \n(TW units
 .fc  
 .nr #T 0-1
 .nr #a 0-1
@@ -4880,7 +4879,7 @@
 .nr 41 \n(80+(3*\n(38)
 .nr 81 +\n(41
 .nr TW \n(81
-.if t .if \n(TW>\n(.li .tm Table at line 803 file Input is too wide - \n(TW units
+.if t .if \n(TW>\n(.li .tm Table at line 802 file Input is too wide - \n(TW units
 .fc  
 .nr #T 0-1
 .nr #a 0-1
@@ -5179,7 +5178,7 @@
 .nr 41 \n(80+(3*\n(38)
 .nr 81 +\n(41
 .nr TW \n(81
-.if t .if \n(TW>\n(.li .tm Table at line 829 file Input is too wide - \n(TW units
+.if t .if \n(TW>\n(.li .tm Table at line 828 file Input is too wide - \n(TW units
 .fc  
 .nr #T 0-1
 .nr #a 0-1
@@ -5462,6 +5461,4 @@
 .RE
 
 .LP
-
-.LP
  
--- a/jdk/src/linux/doc/man/ja/jstatd.1	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/linux/doc/man/ja/jstatd.1	Wed Jul 21 09:57:21 2010 -0700
@@ -1,4 +1,4 @@
-." Copyright 2003 Sun Microsystems, Inc.  All Rights Reserved.
+." 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
@@ -19,8 +19,7 @@
 ." or visit www.oracle.com if you need additional information or have any
 ." questions.
 ."
-.TH jstatd 1 "04 May 2009"
-." Generated from HTML by html2man (author: Eric Armstrong)
+.TH jstatd 1 "02 Jun 2010"
 
 .LP
 .SH "åå‰"
@@ -298,6 +297,4 @@
 .RE
 
 .LP
-
-.LP
  
--- a/jdk/src/linux/doc/man/ja/keytool.1	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/linux/doc/man/ja/keytool.1	Wed Jul 21 09:57:21 2010 -0700
@@ -1,4 +1,4 @@
-." Copyright 2002-2006 Sun Microsystems, Inc.  All Rights Reserved.
+." Copyright (c) 1998, 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
@@ -19,8 +19,7 @@
 ." or visit www.oracle.com if you need additional information or have any
 ." questions.
 ."
-.TH keytool 1 "04 May 2009"
-." Generated from HTML by html2man (author: Eric Armstrong)
+.TH keytool 1 "02 Jun 2010"
 
 .LP
 .SH "åå‰"
@@ -1643,6 +1642,4 @@
 .RE
 
 .LP
-
-.LP
  
--- a/jdk/src/linux/doc/man/ja/kinit.1	Tue Jul 20 16:09:44 2010 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,159 +0,0 @@
-'\" t
-.\"
-.\" Copyright 2002-2004 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.
-.\"
-.\" This code is distributed in the hope that it will be useful, but WITHOUT
-.\" ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-.\" FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
-.\" version 2 for more details (a copy is included in the LICENSE file that
-.\" accompanied this code).
-.\"
-.\" You should have received a copy of the GNU General Public License version
-.\" 2 along with this work; if not, write to the Free Software Foundation,
-.\" Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-.\"
-.\" Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
-.\" or visit www.oracle.com if you need additional information or have any
-.\" questions.
-.\"
-.\"
-.\" 
-.TH kinit 1 "2004 ǯ 6 ·î 22 Æü"
-.SH "̾Á°"
-kinit \- kinit ¤Ï Kerberos ¥Á¥±¥Ã¥Èµö²Ä¥Á¥±¥Ã¥È¤ò¼èÆÀ¤ª¤è¤Ó¥­¥ã¥Ã¥·¥å
-¤¹¤ë¤È¤­¤Ë»ÈÍѤ·¤Þ¤¹¡£¤³¤Î¥Ä¡¼¥ë¤Ï¤Û¤«¤Î°ìÈÌŪ¤Ê Kerberos ¼ÂÁõ 
-(SEAM ¤ä MIT ¤Î¥ê¥Õ¥¡¥ì¥ó¥¹¼ÂÁõ¤Ê¤É) ¤Î kinit ¥Ä¡¼¥ë¤Èµ¡Ç½Åª¤Ë»÷¤Æ¤¤¤Þ¤¹¡£
-.LP
-kinit ¤ò»ÈÍѤ¹¤ë¤¿¤á¤Ë¤Ï¡¢kinit ¤ò¼Â¹Ô¤¹¤ëÁ°¤Ë Key Distribution Center 
-(KDC) ¤ò»ÈÍѤ·¤Æ¥×¥ê¥ó¥·¥Ñ¥ë¤È¤·¤ÆÅÐÏ¿¤¹¤ëɬÍפ¬¤¢¤ê¤Þ¤¹¡£
-.SH "·Á¼°"
-.B kinit
-[
-.IR commands " ]" 
-<principal name>
-.SH "µ¡Ç½ÀâÌÀ"
-¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï¡¢UNIX ¥×¥é¥Ã¥È¥Õ¥©¡¼¥à¤Î¾ì¹ç¡¢/tmp/krb5cc_<uid> ¤È¤¤¤¦
-̾Á°¤Î¥­¥ã¥Ã¥·¥å¥Õ¥¡¥¤¥ë¤¬À¸À®¤µ¤ì¤Þ¤¹¡£<uid> ¤Ï¡¢¥·¥¹¥Æ¥à¤Ë¥í¥°¥¤¥ó
-¤·¤¿¥æ¡¼¥¶¤Î¥æ¡¼¥¶¼±ÊÌÈÖ¹æ¤Ç¤¹¡£¤½¤Î¾¤Î¥×¥é¥Ã¥È¥Õ¥©¡¼¥à¤Î¾ì¹ç¡¢
-<USER_HOME>/krb5cc_<USER_NAME> ¤È¤¤¤¦Ì¾Á°¤Î¥­¥ã¥Ã¥·¥å¥Õ¥¡¥¤¥ë
-¤¬À¸À®¤µ¤ì¤Þ¤¹¡£
-.LP
-<USER_HOME> ¤Ï 
-.BR java.lang.System 
-¥×¥í¥Ñ¥Æ¥£¤Î 
-.BR user.home
-¤«¤é¼èÆÀ¤µ¤ì¤Þ¤¹¡£<USER_NAME> ¤Ï 
-.BR java.lang.System 
-¥×¥í¥Ñ¥Æ¥£¤Î 
-.BR user.name
-¤«¤é¼èÆÀ¤µ¤ì¤Þ¤¹¡£<USER_HOME> ¤¬ null ¤Ç¤¢¤ë¾ì¹ç¡¢
-¥­¥ã¥Ã¥·¥å¥Õ¥¡¥¤¥ë¤Ï¥×¥í¥°¥é¥à¤ò¼Â¹Ô¤·¤¿¸½ºß¤Î¥Ç¥£¥ì¥¯¥È¥ê¤Ë³ÊǼ¤µ¤ì
-¤Þ¤¹¡£<USER_NAME> ¤Ï¥ª¥Ú¥ì¡¼¥Æ¥£¥ó¥°¥·¥¹¥Æ¥à¤Î¥í¥°¥¤¥ó¥æ¡¼¥¶Ì¾
-¤Ç¤¹¡£¤³¤Î¥æ¡¼¥¶Ì¾¤Ï¥æ¡¼¥¶¤Î¥×¥ê¥ó¥·¥Ñ¥ë̾¤È¤Ï°Û¤Ê¤ë¾ì¹ç¤¬¤¢¤ê¤Þ¤¹¡£
-¤¿¤È¤¨¤Ð Solaris ¤Ç¤Ï¡¢<USER_NAME> ¤¬ duke ¤Ç¤¢¤ê¡¢<USER_HOME> 
-¤¬ /home/duke ¤Ç¤¢¤ë¾ì¹ç¡¢¥æ¡¼¥¶¤Î¥×¥ê¥ó¥·¥Ñ¥ë̾¤Ï /home/duke/krb5cc_duke 
-¤Ë¤Ê¤ê¤Þ¤¹¡£
-.LP
-¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï¡¢¥­¡¼¥¿¥Ö̾¤Ï Kerberos ¹½À®¥Õ¥¡¥¤¥ë¤«¤é¼èÆÀ¤µ¤ì¤Þ¤¹¡£
-¥­¡¼¥¿¥Ö̾¤¬ Kerberos ¹½À®¥Õ¥¡¥¤¥ë¤Ë»ØÄꤵ¤ì¤Æ¤¤¤Ê¤¤¾ì¹ç¡¢¥­¡¼¥¿¥Ö̾¤Ï <USER_HOME>/krb5.keytab ¤Ë¤Ê¤ê¤Þ¤¹¡£
-.LP
-¥³¥Þ¥ó¥É¹Ô¤Î password ¥ª¥×¥·¥ç¥ó¤Ç¥Ñ¥¹¥ï¡¼¥É¤ò»ØÄꤷ¤Ê¤¤¾ì¹ç¡¢
-kinit ¤Ï¥Ñ¥¹¥ï¡¼¥É¤ÎÆþÎϤòµá¤á¤Þ¤¹¡£
-.LP
-.B Ãí:
-¥³¥Þ¥ó¥É¹Ô¤Î password ¥ª¥×¥·¥ç¥ó¤Ï¥Æ¥¹¥È¤ÎÌÜŪ¤À¤±¤ËÄ󶡤µ¤ì¤Þ¤¹¡£
-¥Ñ¥¹¥ï¡¼¥É¤ò¥¹¥¯¥ê¥×¥ÈÆâ¤Ë»ØÄꤷ¤¿¤ê¡¢¥³¥Þ¥ó¥É¹Ô¤Ë»ØÄꤷ¤¿¤ê¤·¤Ê¤¤¤Ç
-¤¯¤À¤µ¤¤¡£¤½¤¦¤¹¤ë¤³¤È¤Ë¤è¤Ã¤Æ¡¢¥Ñ¥¹¥ï¡¼¥É¤¬Ï³¤ì¤ë²ÄǽÀ­¤¬¤¢¤ê¤Þ¤¹¡£
-.LP
-¾ÜºÙ¤Ë¤Ä¤¤¤Æ¤Ï¡¢kinit ´ØÏ¢¤Î¥Þ¥Ë¥å¥¢¥ë¥Ú¡¼¥¸¤ò»²¾È¤·¤Æ¤¯¤À¤µ¤¤¡£
-.SH "¥³¥Þ¥ó¥É"
-.B kinit \-fp
-[
-\-c <cache_name> ]
-[
-\-k ]
-[
-\-t <keytab_filename> ]
-[
-<principal> ]
-[
-<password> ]
-[
-\-help ]
-.TP
-.BI \-f
-žÁ÷²Äǽ¤Ê¥Á¥±¥Ã¥È¤òȯ¹Ô¤·¤Þ¤¹¡£
-.TP
-.BI \-p
-¥×¥í¥­¥·²Äǽ¤Ê¥Á¥±¥Ã¥È¤òȯ¹Ô¤·¤Þ¤¹¡£
-.TP
-.BI \-c 
-<cache_name>
-¥­¥ã¥Ã¥·¥å̾ (¤¿¤È¤¨¤Ð¡¢FILE:/temp/mykrb5cc)¡£
-.TP
-.BI \-k
-¥­¡¼¥¿¥Ö¤ò»ÈÍѤ·¤Þ¤¹¡£
-.TP
-.BI \-t 
-<keytab_filename>
-¥­¡¼¥¿¥Ö̾ (¤¿¤È¤¨¤Ð¡¢/home/duke/krb5.keytab)¡£
-.TP
-.BI <principal>
-¥×¥ê¥ó¥·¥Ñ¥ë̾ (¤¿¤È¤¨¤Ð¡¢duke@java.sun.com)¡£
-.TP
-.BI <password>
-¥×¥ê¥ó¥·¥Ñ¥ë¤Î Kerberos ¥Ñ¥¹¥ï¡¼¥É (¥³¥Þ¥ó¥É¹Ô¤ä¥¹¥¯¥ê¥×¥È¤Ë¥Ñ¥¹¥ï¡¼¥É
-¤ò»ØÄꤷ¤Ê¤¤¤Ç¤¯¤À¤µ¤¤)¡£
-.TP
-.BI \-help
-¥Ø¥ë¥×¤òɽ¼¨¤·¤Þ¤¹¡£
-.SH "»ÈÍÑÎã"
-ǧ¾Ú¤ËÍ­¸ú¤Ê»ñ³Ê¤ò¸½ºß¤Î¥¯¥é¥¤¥¢¥ó¥È¥Û¥¹¥È¤«¤éÍ׵ᤷ¤Æ¡¢
-¥Ç¥Õ¥©¥ë¥È¥µ¡¼¥Ó¥¹¤Î¤¿¤á¤Ë»ñ³Ê¤Î¥­¥ã¥Ã¥·¥å¤ò¥Ç¥Õ¥©¥ë¥È¤Î¾ì½ê 
-(/home/duke/krb5cc_duke) ¤Ë³ÊǼ¤·¤Þ¤¹¡£
-.LP
-.ft 3
-.nf
-kinit duke@JAVA.SUN.COM
-.fi
-.ft 1
-.LP
-°Û¤Ê¤ë¥×¥ê¥ó¥·¥Ñ¥ë¤Î¤¿¤á¤Ë¥×¥í¥­¥·²Äǽ¤Ê»ñ³Ê¤òÍ׵ᤷ¤Æ¡¢¤³¤ì¤é¤Î»ñ³Ê¤ò
-»ØÄꤷ¤¿¥Õ¥¡¥¤¥ë¥­¥ã¥Ã¥·¥å¤Ë³ÊǼ¤·¤Þ¤¹¡£
-.LP
-.ft 3
-.nf
-kinit \-p \-c FILE:/home/duke/credentials/krb5cc_cafebeef cafebeef@JAVA.SUN.COM
-.fi
-.ft 1
-.LP
-°Û¤Ê¤ë¥×¥ê¥ó¥·¥Ñ¥ë¤Î¤¿¤á¤Ë¥×¥í¥­¥·²Äǽ¤ÇžÁ÷²Äǽ¤Ê»ñ³Ê¤òÍ׵ᤷ¤Æ¡¢
-¤³¤ì¤é¤Î»ñ³Ê¤ò»ØÄꤷ¤¿¥Õ¥¡¥¤¥ë¥­¥ã¥Ã¥·¥å¤Ë³ÊǼ¤·¤Þ¤¹¡£
-.LP
-.ft 3
-.nf
-kinit \-f \-p \-c
-FILE:/home/duke/credentials/krb5cc_cafebeef cafebeef@JAVA.SUN.COM
-.fi
-.ft 1
-.LP
-kinit ¤Î¥Ø¥ë¥×¥á¥Ë¥å¡¼¤òɽ¼¨¤·¤Þ¤¹¡£
-.LP
-.ft 3
-.nf
-kinit \-help
-.fi
-.ft 1
-.LP
-.SH "¥»¥­¥å¥ê¥Æ¥£¤Ë´Ø¤¹¤ë·Ù¹ð"
-¥³¥Þ¥ó¥É¹Ô¤Î 
-.BR password
-¥ª¥×¥·¥ç¥ó¤Ï¥Æ¥¹¥È¤ÎÌÜŪ¤À¤±¤ËÄ󶡤µ¤ì¤Þ¤¹¡£¥Ñ¥¹¥ï¡¼¥É¤ò¥³¥Þ¥ó¥É¹Ô¤Ë»ØÄꤷ¤Ê¤¤¤Ç¤¯¤À¤µ¤¤¡£
-¤³¤ì¤Ï¥»¥­¥å¥ê¥Æ¥£¥Û¡¼¥ë¤Ë¤Ê¤ê¤Þ¤¹¡£¤¿¤È¤¨¤Ð¡¢UNIX ¤Î 
-.BR ps
-¥³¥Þ¥ó¥É¤Î¼Â¹ÔÃæ¤Ë¡¢¹¶·â¼Ô¤Ï¥Ñ¥¹¥ï¡¼¥É¤ò¸¡½Ð¤¹¤ë¤³¤È¤¬¤Ç¤­¤Æ¤·¤Þ¤¤¤Þ¤¹¡£
--- a/jdk/src/linux/doc/man/ja/klist.1	Tue Jul 20 16:09:44 2010 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,110 +0,0 @@
-'\" t
-.\"
-.\" Copyright 2002-2004 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.
-.\"
-.\" This code is distributed in the hope that it will be useful, but WITHOUT
-.\" ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-.\" FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
-.\" version 2 for more details (a copy is included in the LICENSE file that
-.\" accompanied this code).
-.\"
-.\" You should have received a copy of the GNU General Public License version
-.\" 2 along with this work; if not, write to the Free Software Foundation,
-.\" Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-.\"
-.\" Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
-.\" or visit www.oracle.com if you need additional information or have any
-.\" questions.
-.\"
-.\" 
-.TH klist 1 "2004 ǯ 6 ·î 22 Æü"
-.SH "̾Á°"
-klist \- Kerberos ¥¯¥ì¥Ç¥ó¥·¥ã¥ë¥­¥ã¥Ã¥·¥å¤È¥­¡¼¥¿¥ÖÆâ¤Î¥¨¥ó¥È¥ê¤òɽ¼¨¤·¤Þ¤¹¡£
-.LP
-.BR klist 
-¤ò»ÈÍѤ¹¤ë¤È¡¢¥æ¡¼¥¶¤Ï¥í¡¼¥«¥ë¤Ë¤¢¤ë¥¯¥ì¥Ç¥ó¥·¥ã¥ë¥­¥ã¥Ã¥·¥å¤È
-¥­¡¼¥Æ¡¼¥Ö¥ëÆâ¤Î¥¨¥ó¥È¥ê¤òɽ¼¨¤Ç¤­¤Þ¤¹¡£
-.SH "·Á¼°"
-.B klist
-[
-.IR commands " ]" 
-.SH "µ¡Ç½ÀâÌÀ"
-.BR klist
-¤Ï¥í¡¼¥«¥ë¤Ë¤¢¤ë¥¯¥ì¥Ç¥ó¥·¥ã¥ë¥­¥ã¥Ã¥·¥å¤È¥­¡¼¥Æ¡¼¥Ö¥ëÆâ¤Î¥¨¥ó¥È¥ê¤òɽ¼¨¤·¤Þ¤¹¡£
-¥æ¡¼¥¶¤¬
-.BR kinit 
-¤ò»ÈÍѤ·¤Æ¥¯¥ì¥Ç¥ó¥·¥ã¥ë¥­¥ã¥Ã¥·¥å¤òÊѹ¹¤·¤¿¤ê¡¢
-.BR ktab
-¤ò»ÈÍѤ·¤Æ¥­¡¼¥¿¥Ö¤òÊѹ¹¤·¤¿¸å¡¢Êѹ¹¤ò³Îǧ¤¹¤ëÍ£°ì¤ÎÊýË¡¤Ï¡¢
-.BR klist
-¤ò»ÈÍѤ·¤Æ¥¯¥ì¥Ç¥ó¥·¥ã¥ë¥­¥ã¥Ã¥·¥å¤Þ¤¿¤Ï¥­¡¼¥¿¥Ö¤ÎÆâÍƤòɽ¼¨¤¹¤ë¤³¤È¤Ç¤¹¡£
-.BR klist
-¤Ï Kerberos ¥Ç¡¼¥¿¥Ù¡¼¥¹¤òÊѹ¹¤·¤Þ¤»¤ó¡£
-
-.SH "¥³¥Þ¥ó¥É"
-.B klist 
-[
-\-c [\-fe]]
-[
-\-k [\-tK]]
-[
-<name>]
-[
-\-help ]
-.TP
-.BI \-c
-ɽ¼¨¤·¤¿¤¤¥¯¥ì¥Ç¥ó¥·¥ã¥ë¥­¥ã¥Ã¥·¥å¤Î¥¨¥ó¥È¥ê¤ò»ØÄꤷ¤Þ¤¹¡£
-.TP
-.BI \-k
-ɽ¼¨¤·¤¿¤¤¥­¡¼¥¿¥Ö¤Î¥¨¥ó¥È¥ê¤ò»ØÄꤷ¤Þ¤¹¡£
-.TP
-.BI <cache_name>
-¥¯¥ì¥Ç¥ó¥·¥ã¥ë¥­¥ã¥Ã¥·¥å̾¤Þ¤¿¤Ï¥­¡¼¥¿¥Ö̾¤ò»ØÄꤷ¤Þ¤¹¡£Ì¾Á°¤ò»ØÄꤷ¤Ê¤¤¾ì¹ç¡¢
-¥¯¥ì¥Ç¥ó¥·¥ã¥ë¥­¥ã¥Ã¥·¥å̾¤Þ¤¿¤Ï¥­¡¼¥¿¥Ö¤Î¥Ç¥Õ¥©¥ë¥ÈÃͤ¬»ÈÍѤµ¤ì¤Þ¤¹¡£
-¥­¥ã¥Ã¥·¥å¤È¥­¡¼¥¿¥Ö¤Î¥Ç¥Õ¥©¥ë¥ÈÃͤˤĤ¤¤Æ¤Ï¡¢
-.BR kinit
-¤Î¥Þ¥Ë¥å¥¢¥ë¥Ú¡¼¥¸¤ò»²¾È¤·¤Æ¤¯¤À¤µ¤¤¡£
-.LP
-\-c ¥ª¥×¥·¥ç¥ó¤ò»ØÄꤷ¤¿¾ì¹ç¡¢¥¯¥ì¥Ç¥ó¥·¥ã¥ë¥­¥ã¥Ã¥·¥åÍѤΥª¥×¥·¥ç¥ó¤Ï¼¡¤Î¤È¤ª¤ê¤Ç¤¹¡£
-.TP
-.BI \-f
-¥¯¥ì¥Ç¥ó¥·¥ã¥ë¥Õ¥é¥°¤òɽ¼¨¤·¤Þ¤¹¡£
-.TP
-.BI \-e
-°Å¹æ²½¥¿¥¤¥×¤òɽ¼¨¤·¤Þ¤¹¡£
-.LP
-\-k ¥ª¥×¥·¥ç¥ó¤ò»ØÄꤷ¤¿¾ì¹ç¡¢¥­¡¼¥¿¥ÖÍѤΥª¥×¥·¥ç¥ó¤Ï¼¡¤Î¤È¤ª¤ê¤Ç¤¹¡£
-.TP
-.BI \-t
-¥­¡¼¥¿¥Ö¥¨¥ó¥È¥ê¤Î¥¿¥¤¥à¥¹¥¿¥ó¥×¤òɽ¼¨¤·¤Þ¤¹¡£
-.TP
-.BI \-K
-¥­¡¼¥¿¥Ö¥¨¥ó¥È¥ê¤Î DES ¥­¡¼¤òɽ¼¨¤·¤Þ¤¹¡£
-.LP
-.TP
-.BI \-help
-¥Ø¥ë¥×¤òɽ¼¨¤·¤Þ¤¹¡£
-.SH "»ÈÍÑÎã"
-»ØÄꤷ¤¿¥­¡¼¥Æ¡¼¥Ö¥ë¤Î¥¨¥ó¥È¥ê¤È¡¢¤½¤Î¥¿¥¤¥à¥¹¥¿¥ó¥×¤È DES ¥­¡¼
-¤òɽ¼¨¤·¤Þ¤¹¡£
-.LP
-.ft 3
-.nf
-klist \-k \-t \-K FILE:/temp/mykrb5cc
-.fi
-.ft 1
-.LP
-»ØÄꤷ¤¿¥¯¥ì¥Ç¥ó¥·¥ã¥ë¥­¥ã¥Ã¥·¥å¤Î¥¨¥ó¥È¥ê¤È¡¢¤½¤Î¥¯¥ì¥Ç¥ó¥·¥ã¥ë¥Õ¥é¥°¤È¥¢¥É¥ì¥¹¥ê¥¹¥È¤ò
-ɽ¼¨¤·¤Þ¤¹¡£
-.LP
-.ft 3
-.nf
-klist \-c \-f FILE:/temp/mykrb5cc
-.fi
-.ft 1
-.LP
--- a/jdk/src/linux/doc/man/ja/ktab.1	Tue Jul 20 16:09:44 2010 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,125 +0,0 @@
-'\" t
-.\"
-.\" Copyright 2002-2004 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.
-.\"
-.\" This code is distributed in the hope that it will be useful, but WITHOUT
-.\" ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-.\" FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
-.\" version 2 for more details (a copy is included in the LICENSE file that
-.\" accompanied this code).
-.\"
-.\" You should have received a copy of the GNU General Public License version
-.\" 2 along with this work; if not, write to the Free Software Foundation,
-.\" Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-.\"
-.\" Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
-.\" or visit www.oracle.com if you need additional information or have any
-.\" questions.
-.\"
-.\" 
-.TH ktab 1 "2004 ǯ 6 ·î 22 Æü"
-.SH "̾Á°"
-ktab \- Kerberos ¥­¡¼¥Æ¡¼¥Ö¥ë¥Þ¥Í¡¼¥¸¥ã
-.LP
-.BR ktab
-¤ò»ÈÍѤ¹¤ë¤È¡¢¥æ¡¼¥¶¤Ï¥í¡¼¥«¥ë¤Ë¤¢¤ë¥­¡¼¥Æ¡¼¥Ö¥ë¤Ë³ÊǼ¤µ¤ì¤¿
-¥×¥ê¥ó¥·¥Ñ¥ë̾¤È¥µ¡¼¥Ó¥¹¥­¡¼¤ò´ÉÍý¤Ç¤­¤Þ¤¹¡£¥­¡¼¥¿¥ÖÆâ¤Î¥×¥ê¥ó¥·¥Ñ¥ë
-¤È¥­¡¼¥Ú¥¢¤Ï¡¢¥Û¥¹¥È¾å¤ÇÆ°ºî¤·¤Æ¤¤¤ë¥µ¡¼¥Ó¥¹¤Ë¡¢¤½¤ì¤é¼«¿È¤ò 
-Key Distribution Center (KDC) ¤Ëǧ¾Ú¤µ¤»¤Þ¤¹¡£¥µ¡¼¥Ð¤¬ Kerberos ¤ò
-»ÈÍѤǤ­¤ë¤è¤¦¤ËÀßÄꤹ¤ë¤Ë¤Ï¡¢¤½¤ÎÁ°¤Ë¥æ¡¼¥¶¤Ï¥µ¡¼¥Ð¤¬Æ°ºî¤·¤Æ¤¤¤ë
-¥Û¥¹¥È¾å¤Ç¥­¡¼¥¿¥Ö¤òÀßÄꤹ¤ëɬÍפ¬¤¢¤ê¤Þ¤¹¡£ktab ¤ò»ÈÍѤ·¤Æ¥­¡¼¥¿¥Ö
-¤òÊѹ¹¤·¤Æ¤â¡¢Kerberos ¥Ç¡¼¥¿¥Ù¡¼¥¹¤Ë¤Ï±Æ¶Á¤·¤Ê¤¤¤³¤È¤ËÃí°Õ¤·¤Æ¤¯¤À¤µ
-¤¤¡£¥­¡¼¥¿¥ÖÆâ¤Î¥­¡¼¤òÊѹ¹¤·¤¿¾ì¹ç¡¢Kerberos ¥Ç¡¼¥¿¥Ù¡¼¥¹Æâ¤ÎÂбþ¤¹¤ë
-²Õ½ê¤âÊѹ¹¤¹¤ëɬÍפ¬¤¢¤ê¤Þ¤¹¡£
-.SH "·Á¼°"
-.B ktab
-[
-.IR commands " ]" 
-.SH "µ¡Ç½ÀâÌÀ"
-.BR ktab
-¤Ï¡¢¥­¡¼¥Æ¡¼¥Ö¥ëÆâ¤Î¥×¥ê¥ó¥·¥Ñ¥ë̾¤È¥­¡¼¥Ú¥¢¤ò´ÉÍý¤·¤Þ¤¹¡£
-.BR ktab
-¤ò»ÈÍѤ¹¤ë¤È¡¢¥æ¡¼¥¶¤Ï¥­¡¼¥Æ¡¼¥Ö¥ëÆâ¤Î¥×¥ê¥ó¥·¥Ñ¥ë̾¤È¥­¡¼¥Ú¥¢¤ò
-°ìÍ÷ɽ¼¨¡¢Äɲᢹ¹¿·¡¢¤Þ¤¿¤Ïºï½ü¤Ç¤­¤Þ¤¹¡£¤³¤ì¤é¤ÎÁàºî¤Ï¤¹¤Ù¤Æ¡¢
-Kerberos ¥Ç¡¼¥¿¥Ù¡¼¥¹¤Ë¤Ï±Æ¶Á¤·¤Þ¤»¤ó¡£
-.LP
-.ft 3
-.B ¥­¡¼¥¿¥Ö
-.LP
-¥­¡¼¥¿¥Ö¤È¤Ï¡¢¥Û¥¹¥È¤¬»ý¤Ä¼«Ê¬¼«¿È¤Î¥­¡¼¥ê¥¹¥È¤Î¥³¥Ô¡¼¤Ç¤¢¤ê¡¢¥æ¡¼¥¶
-¤Î¥Ñ¥¹¥ï¡¼¥É¤È»÷¤Æ¤¤¤Þ¤¹¡£¼«Ê¬¼«¿È¤ò Key Distribution Center (KDC) 
-¤Ëǧ¾Ú¤µ¤»¤ëɬÍפ¬¤¢¤ë¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¥µ¡¼¥Ð¤Ï¡¢¤½¤ì¼«¿È¤Î¥×¥ê¥ó¥·¥Ñ¥ë
-¤È¥­¡¼¤ò´Þ¤à¥­¡¼¥¿¥Ö¤ò»ý¤Ã¤Æ¤¤¤ëɬÍפ¬¤¢¤ê¤Þ¤¹¡£¥æ¡¼¥¶¤¬¼«Ê¬¤Î
-¥Ñ¥¹¥ï¡¼¥É¤òÊݸ¤ë¤³¤È¤¬ÂçÀڤǤ¢¤ë¤Î¤ÈƱÍͤˡ¢¥Û¥¹¥È¤Ï¼«Ê¬¤Î¥­¡¼¥¿¥Ö
-¤òÊݸ¤ë¤³¤È¤¬ÂçÀڤǤ¹¡£¥­¡¼¥¿¥Ö¥Õ¥¡¥¤¥ë¤Ï¾ï¤Ë¥í¡¼¥«¥ë¥Ç¥£¥¹¥¯¤Ë
-³ÊǼ¤·¤Æ¡¢root °Ê³°¤Î¥æ¡¼¥¶¤¬Æɤá¤Ê¤¤¤è¤¦¤ËÀßÄꤷ¤Æ¤ª¤¯É¬Íפ¬¤¢¤ê¤Þ¤¹¡£
-¥­¡¼¥¿¥Ö¥Õ¥¡¥¤¥ë¤Ï°Å¹æ²½¤»¤º¤Ë¥Í¥Ã¥È¥ï¡¼¥¯¤ØÁ÷¿®¤·¤Ê¤¤¤Ç¤¯¤À¤µ¤¤¡£
-.SH "¥³¥Þ¥ó¥É"
-»ÈÍÑË¡: ¥³¥Þ¥ó¥É¹Ô¥ª¥×¥·¥ç¥ó¤Ç¤ÏÂçʸ»ú¤È¾®Ê¸»ú¤Ï¶èÊ̤·¤Þ¤»¤ó¡£
-.LP
-.B ktab
-\-help
-.LP
-.B ktab
-\-l [\-k <keytab_name>]
-.LP
-.B ktab
-[\-a <principal_name> <password>] [\-k <keytab_name>]
-.LP
-.B ktab
-[\-d <principal_name>] [\-k <keytab_name>]
-.LP
-.TP
-.BI \-l
-¥­¡¼¥¿¥Ö̾¤È¥¨¥ó¥È¥ê¤ò°ìÍ÷ɽ¼¨¤·¤Þ¤¹¡£
-.TP
-.BI \-a
-<principal_name> <password>
-¥¨¥ó¥È¥ê¤ò¥­¡¼¥¿¥Ö¤ËÄɲä·¤Þ¤¹¡£Kerberos ¥Ç¡¼¥¿¥Ù¡¼¥¹¤ÏÊѹ¹¤·¤Þ¤»¤ó 
-(¥³¥Þ¥ó¥É¹Ô¤ä¥¹¥¯¥ê¥×¥È¤Ë¥Ñ¥¹¥ï¡¼¥É¤ò»ØÄꤷ¤Ê¤¤¤Ç¤¯¤À¤µ¤¤)¡£
-.TP
-.BI \-d 
-<principal_name>
-¥­¡¼¥¿¥Ö¤«¤é¥¨¥ó¥È¥ê¤òºï½ü¤·¤Þ¤¹¡£Kerberos ¥Ç¡¼¥¿¥Ù¡¼¥¹¤ÏÊѹ¹¤·¤Þ¤»¤ó¡£
-.TP
-.BI \-k
-<keytab_name>
-¥­¡¼¥¿¥Ö̾¤È¡¢ÀÜƬ¼­ FILE: ¤Ç»Ï¤Þ¤ë¥Ñ¥¹¤ò»ØÄꤷ¤Þ¤¹¡£
-.TP
-.BI \-help
-¥Ø¥ë¥×¤òɽ¼¨¤·¤Þ¤¹¡£
-.SH "»ÈÍÑÎã"
-¥Ç¥Õ¥©¥ë¥È¤Î¥­¡¼¥Æ¡¼¥Ö¥ëÆâ¤Î¥¨¥ó¥È¥ê¤ò¤¹¤Ù¤Æɽ¼¨¤·¤Þ¤¹¡£
-.LP
-.ft 3
-.nf
-ktab \-l
-.fi
-.ft 1
-.LP
-¿·¤·¤¤¥×¥ê¥ó¥·¥Ñ¥ë¤ò¥­¡¼¥Æ¡¼¥Ö¥ë¤ËÄɲä·¤Þ¤¹¡£¥Ñ¥¹¥ï¡¼¥É¤ÎÆþÎϤ¬µá¤á¤é¤ì¤Þ¤¹¡£
-.LP
-.ft 3
-.nf
-ktab \-a duke@java.sun.com
-.fi
-.ft 1
-.LP
-¥­¡¼¥Æ¡¼¥Ö¥ë¤«¤é¥×¥ê¥ó¥·¥Ñ¥ë¤òºï½ü¤·¤Þ¤¹¡£
-.LP
-.ft 3
-.nf
-ktab \-d duke@java.sun.com
-.fi
-.ft 1
-.LP
-.SH "¥»¥­¥å¥ê¥Æ¥£¤Ë´Ø¤¹¤ë·Ù¹ð"
-¥Ñ¥¹¥ï¡¼¥É¤ò¥³¥Þ¥ó¥É¹Ô¤Ë»ØÄꤷ¤Ê¤¤¤Ç¤¯¤À¤µ¤¤¡£¤³¤ì¤Ï¥»¥­¥å¥ê¥Æ¥£¥Û¡¼¥ë
-¤Ë¤Ê¤ê¤Þ¤¹¡£¤¿¤È¤¨¤Ð¡¢UNIX ¤Î
-.BI ps
-¥³¥Þ¥ó¥É¤Î¼Â¹ÔÃæ¤Ë¡¢¹¶·â¼Ô¤Ï¥Ñ¥¹¥ï¡¼¥É¤ò¸¡½Ð¤¹¤ë¤³¤È¤¬¤Ç¤­¤Æ¤·¤Þ¤¤¤Þ¤¹¡£
--- a/jdk/src/linux/doc/man/ja/native2ascii.1	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/linux/doc/man/ja/native2ascii.1	Wed Jul 21 09:57:21 2010 -0700
@@ -1,4 +1,4 @@
-." Copyright 2002-2006 Sun Microsystems, Inc.  All Rights Reserved.
+." Copyright (c) 2000, 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
@@ -19,8 +19,7 @@
 ." or visit www.oracle.com if you need additional information or have any
 ." questions.
 ."
-.TH native2ascii 1 "04 May 2009"
-." Generated from HTML by html2man (author: Eric Armstrong)
+.TH native2ascii 1 "02 Jun 2010"
 
 .LP
 .SH "åå‰"
@@ -78,6 +77,4 @@
 .RE
 
 .LP
-
-.LP
  
--- a/jdk/src/linux/doc/man/ja/orbd.1	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/linux/doc/man/ja/orbd.1	Wed Jul 21 09:57:21 2010 -0700
@@ -1,4 +1,4 @@
-." Copyright 2001-2006 Sun Microsystems, Inc.  All Rights Reserved.
+." Copyright (c) 2001, 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
@@ -19,8 +19,7 @@
 ." or visit www.oracle.com if you need additional information or have any
 ." questions.
 ."
-.TH orbd 1 "04 May 2009"
-." Generated from HTML by html2man (author: Eric Armstrong)
+.TH orbd 1 "02 Jun 2010"
 
 .LP
 .SH "åå‰"
@@ -374,6 +373,4 @@
 .br
 
 .LP
-
-.LP
  
--- a/jdk/src/linux/doc/man/ja/pack200.1	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/linux/doc/man/ja/pack200.1	Wed Jul 21 09:57:21 2010 -0700
@@ -1,4 +1,4 @@
-." Copyright  Sun Microsystems, Inc.  All Rights Reserved.
+." 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
@@ -19,8 +19,7 @@
 ." or visit www.oracle.com if you need additional information or have any
 ." questions.
 ."
-.TH pack200 1 "04 May 2009"
-." Generated from HTML by html2man (author: Eric Armstrong)
+.TH pack200 1 "02 Jun 2010"
 
 .LP
 .SH "åå‰"
--- a/jdk/src/linux/doc/man/ja/policytool.1	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/linux/doc/man/ja/policytool.1	Wed Jul 21 09:57:21 2010 -0700
@@ -1,4 +1,4 @@
-." Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+." Copyright (c) 2001, 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
@@ -19,8 +19,7 @@
 ." or visit www.oracle.com if you need additional information or have any
 ." questions.
 ."
-.TH policytool 1 "04 May 2009"
-." Generated from HTML by html2man (author: Eric Armstrong)
+.TH policytool 1 "02 Jun 2010"
 
 .LP
 .SH "åå‰"
@@ -105,6 +104,4 @@
 .RE
 
 .LP
-
-.LP
  
--- a/jdk/src/linux/doc/man/ja/rmic.1	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/linux/doc/man/ja/rmic.1	Wed Jul 21 09:57:21 2010 -0700
@@ -1,4 +1,4 @@
-." Copyright 2004-2006 Sun Microsystems, Inc.  All Rights Reserved.
+." Copyright (c) 1997, 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
@@ -19,8 +19,7 @@
 ." or visit www.oracle.com if you need additional information or have any
 ." questions.
 ."
-.TH rmic 1 "04 May 2009"
-." Generated from HTML by html2man (author: Eric Armstrong)
+.TH rmic 1 "02 Jun 2010"
 
 .LP
 .SH "åå‰"
@@ -265,6 +264,4 @@
 .fi
 http://java.sun.com/javase/6/docs/technotes/tools/index.html#classpath
 .LP
-
-.LP
  
--- a/jdk/src/linux/doc/man/ja/rmid.1	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/linux/doc/man/ja/rmid.1	Wed Jul 21 09:57:21 2010 -0700
@@ -1,4 +1,4 @@
-." Copyright 2004-2006 Sun Microsystems, Inc.  All Rights Reserved.
+." Copyright (c) 1998, 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
@@ -19,8 +19,7 @@
 ." or visit www.oracle.com if you need additional information or have any
 ." questions.
 ."
-.TH rmid 1 "04 May 2009"
-." Generated from HTML by html2man (author: Eric Armstrong)
+.TH rmid 1 "02 Jun 2010"
 
 .LP
 .SH "åå‰"
@@ -354,6 +353,4 @@
 .fi
 http://java.sun.com/javase/6/docs/technotes/tools/index.html#classpathã€java(1)
 .LP
-
-.LP
  
--- a/jdk/src/linux/doc/man/ja/rmiregistry.1	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/linux/doc/man/ja/rmiregistry.1	Wed Jul 21 09:57:21 2010 -0700
@@ -1,4 +1,4 @@
-." Copyright 2003-2006 Sun Microsystems, Inc.  All Rights Reserved.
+." Copyright (c) 1997, 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
@@ -19,8 +19,7 @@
 ." or visit www.oracle.com if you need additional information or have any
 ." questions.
 ."
-.TH rmiregistry 1 "04 May 2009"
-." Generated from HTML by html2man (author: Eric Armstrong)
+.TH rmiregistry 1 "02 Jun 2010"
 
 .LP
 .SH "åå‰"
@@ -94,6 +93,4 @@
 .fi
 http://java.sun.com/javase/6/docs/api/java/rmi/Naming.html
 .LP
-
-.LP
  
--- a/jdk/src/linux/doc/man/ja/schemagen.1	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/linux/doc/man/ja/schemagen.1	Wed Jul 21 09:57:21 2010 -0700
@@ -1,4 +1,4 @@
-." Copyright  Sun Microsystems, Inc.  All Rights Reserved.
+." Copyright (c) 2005, 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
@@ -19,8 +19,7 @@
 ." or visit www.oracle.com if you need additional information or have any
 ." questions.
 ."
-.TH schemagen 1 "04 May 2009"
-." Generated from HTML by html2man (author: Eric Armstrong)
+.TH schemagen 1 "02 Jun 2010"
 
 .LP
 .SH "åå‰"
--- a/jdk/src/linux/doc/man/ja/serialver.1	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/linux/doc/man/ja/serialver.1	Wed Jul 21 09:57:21 2010 -0700
@@ -1,4 +1,4 @@
-." Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+." Copyright (c) 1997, 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
@@ -19,8 +19,7 @@
 ." or visit www.oracle.com if you need additional information or have any
 ." questions.
 ."
-.TH serialver 1 "04 May 2009"
-." Generated from HTML by html2man (author: Eric Armstrong)
+.TH serialver 1 "02 Jun 2010"
 
 .LP
 .SH "åå‰"
@@ -121,6 +120,4 @@
 .fi
 http://java.sun.com/javase/6/docs/api/java/io/ObjectStreamClass.html
 .LP
-
-.LP
  
--- a/jdk/src/linux/doc/man/ja/servertool.1	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/linux/doc/man/ja/servertool.1	Wed Jul 21 09:57:21 2010 -0700
@@ -1,4 +1,4 @@
-." Copyright 2001-2006 Sun Microsystems, Inc.  All Rights Reserved.
+." Copyright (c) 2001, 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
@@ -19,8 +19,7 @@
 ." or visit www.oracle.com if you need additional information or have any
 ." questions.
 ."
-.TH servertool 1 "04 May 2009"
-." Generated from HTML by html2man (author: Eric Armstrong)
+.TH servertool 1 "02 Jun 2010"
 
 .LP
 .SH "åå‰"
@@ -125,6 +124,4 @@
 .LP
 
 .LP
-orbd(1) 
-.LP
- 
+orbd(1)  
--- a/jdk/src/linux/doc/man/ja/tnameserv.1	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/linux/doc/man/ja/tnameserv.1	Wed Jul 21 09:57:21 2010 -0700
@@ -1,4 +1,4 @@
-." Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+." Copyright (c) 1999, 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
@@ -19,15 +19,12 @@
 ." or visit www.oracle.com if you need additional information or have any
 ." questions.
 ."
-.TH tnameserv 1 "04 May 2009"
-." Generated from HTML by html2man (author: Eric Armstrong)
+.TH tnameserv 1 "02 Jun 2010"
 
 .LP
 .SH "åå‰"
 Java IDL:一時ãƒãƒ¼ãƒ ã‚µãƒ¼ãƒ“ス \- \f2tnameserv\fP
 .LP
-
-.LP
 .LP
 ã“ã®ãƒ‰ã‚­ãƒ¥ãƒ¡ãƒ³ãƒˆã§ã¯ã€Java IDL 一時ãƒãƒ¼ãƒ ã‚µãƒ¼ãƒ“ス \f2tnameserv\fP ã®ä½¿ç”¨æ–¹æ³•ã«ã¤ã„ã¦èª¬æ˜Žã—ã¾ã™ã€‚Java IDL ã«ã¯ã€Object Request Broker Daemon (ORBD) ã‚‚å«ã¾ã‚Œã¦ã„ã¾ã™ã€‚ORBD ã¯ã€ãƒ–ートストラップサービスã€ä¸€æ™‚ãƒãƒ¼ãƒ ã‚µãƒ¼ãƒ“スã€\f3æŒç¶š\fPãƒãƒ¼ãƒ ã‚µãƒ¼ãƒ“スã€ãŠã‚ˆã³ã‚µãƒ¼ãƒãƒ¼ãƒžãƒãƒ¼ã‚¸ãƒ£ãƒ¼ã‚’å«ã‚€ãƒ‡ãƒ¼ãƒ¢ãƒ³ãƒ—ロセスã§ã™ã€‚Java IDL ã®ã™ã¹ã¦ã®ãƒãƒ¥ãƒ¼ãƒˆãƒªã‚¢ãƒ«ã§ã¯ ORBD を使用ã—ã¦ã„ã¾ã™ãŒã€ä¸€æ™‚ãƒãƒ¼ãƒ ã‚µãƒ¼ãƒ“スを使用ã™ã‚‹ä¾‹ã§ã¯ã€\f2orbd\fP ã®ä»£ã‚ã‚Šã« \f2tnameserv\fP を使用ã§ãã¾ã™ã€‚\f2orbd\fP ツールã®è©³ç´°ã«ã¤ã„ã¦ã¯ã€\f2orbd\fP ã® orbd(1)ã¾ãŸã¯
 .na
@@ -499,6 +496,4 @@
 .fi
 
 .LP
-
-.LP
  
--- a/jdk/src/linux/doc/man/ja/unpack200.1	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/linux/doc/man/ja/unpack200.1	Wed Jul 21 09:57:21 2010 -0700
@@ -1,4 +1,4 @@
-." Copyright  Sun Microsystems, Inc.  All Rights Reserved.
+." 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
@@ -19,8 +19,7 @@
 ." or visit www.oracle.com if you need additional information or have any
 ." questions.
 ."
-.TH unpack200 1 "04 May 2009"
-." Generated from HTML by html2man (author: Eric Armstrong)
+.TH unpack200 1 "02 Jun 2010"
 
 .LP
 .SH "åå‰"
--- a/jdk/src/linux/doc/man/ja/wsgen.1	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/linux/doc/man/ja/wsgen.1	Wed Jul 21 09:57:21 2010 -0700
@@ -1,4 +1,4 @@
-." Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+." Copyright (c) 2005, 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
@@ -19,8 +19,7 @@
 ." or visit www.oracle.com if you need additional information or have any
 ." questions.
 ."
-.TH wsgen 1 "04 May 2009"
-." Generated from HTML by html2man (author: Eric Armstrong)
+.TH wsgen 1 "02 Jun 2010"
 .SH "åå‰"
 wsgen \- XML Web Services (JAX\-WS) 2.0 ã®ãŸã‚ã® Java(TM) API
 .RS 3
@@ -387,7 +386,7 @@
 .nr 41 \n(80+(3*\n(38)
 .nr 81 +\n(41
 .nr TW \n(81
-.if t .if \n(TW>\n(.li .tm Table at line 144 file Input is too wide - \n(TW units
+.if t .if \n(TW>\n(.li .tm Table at line 143 file Input is too wide - \n(TW units
 .fc  
 .nr #T 0-1
 .nr #a 0-1
--- a/jdk/src/linux/doc/man/ja/wsimport.1	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/linux/doc/man/ja/wsimport.1	Wed Jul 21 09:57:21 2010 -0700
@@ -1,4 +1,4 @@
-." Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+." Copyright (c) 2005, 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
@@ -19,8 +19,7 @@
 ." or visit www.oracle.com if you need additional information or have any
 ." questions.
 ."
-.TH wsimport 1 "04 May 2009"
-." Generated from HTML by html2man (author: Eric Armstrong)
+.TH wsimport 1 "02 Jun 2010"
 .SH "åå‰"
 wsimport \- XML Web Services (JAX\-WS) 2.0 ã®ãŸã‚ã® Java(TM) API
 .LP
@@ -467,7 +466,7 @@
 .nr 41 \n(80+(3*\n(38)
 .nr 81 +\n(41
 .nr TW \n(81
-.if t .if \n(TW>\n(.li .tm Table at line 164 file Input is too wide - \n(TW units
+.if t .if \n(TW>\n(.li .tm Table at line 163 file Input is too wide - \n(TW units
 .fc  
 .nr #T 0-1
 .nr #a 0-1
--- a/jdk/src/linux/doc/man/ja/xjc.1	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/linux/doc/man/ja/xjc.1	Wed Jul 21 09:57:21 2010 -0700
@@ -1,4 +1,4 @@
-." Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+." Copyright (c) 2005, 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
@@ -19,8 +19,7 @@
 ." or visit www.oracle.com if you need additional information or have any
 ." questions.
 ."
-.TH xjc 1 "04 May 2009"
-." Generated from HTML by html2man (author: Eric Armstrong)
+.TH xjc 1 "02 Jun 2010"
 
 .LP
 .ad c
--- a/jdk/src/linux/doc/man/jar.1	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/linux/doc/man/jar.1	Wed Jul 21 09:57:21 2010 -0700
@@ -1,4 +1,4 @@
-." Copyright 2004-2006 Sun Microsystems, Inc.  All Rights Reserved.
+." Copyright (c) 1997, 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
@@ -19,8 +19,7 @@
 ." or visit www.oracle.com if you need additional information or have any
 ." questions.
 ."
-.TH jar 1 "04 May 2009"
-." Generated from HTML by html2man (author: Eric Armstrong)
+.TH jar 1 "02 Jun 2010"
 
 .LP
 .SH "Name"
@@ -183,7 +182,7 @@
 
 .LP
 .LP
-Beginning with version 1.3 of the Java 2 SDK, the \f2jar\fP utility supports 
+Beginning with version 1.3 of the JDK, the \f2jar\fP utility supports 
 .na
 \f2JarIndex\fP @
 .fi
@@ -695,6 +694,4 @@
 .br
 
 .LP
-pack200(1) 
-.LP
- 
+pack200(1)  
--- a/jdk/src/linux/doc/man/jarsigner.1	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/linux/doc/man/jarsigner.1	Wed Jul 21 09:57:21 2010 -0700
@@ -1,4 +1,4 @@
-." Copyright 2004-2006 Sun Microsystems, Inc.  All Rights Reserved.
+." Copyright (c) 1998, 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
@@ -19,8 +19,7 @@
 ." or visit www.oracle.com if you need additional information or have any
 ." questions.
 ."
-.TH jarsigner 1 "04 May 2009"
-." Generated from HTML by html2man (author: Eric Armstrong)
+.TH jarsigner 1 "02 Jun 2010"
 
 .LP
 .SH "Name"
@@ -246,12 +245,12 @@
 DSA (Digital Signature Algorithm) with the SHA\-1 digest algorithm, or 
 .TP 2
 o
-the RSA algorithm with the SHA\-1 digest algorithm. 
+the RSA algorithm with the SHA\-256 digest algorithm. 
 .RE
 
 .LP
 .LP
-That is, if the signer's public and private keys are DSA keys, \f3jarsigner\fP will sign the JAR file using the "SHA1withDSA" algorithm. If the signer's keys are RSA keys, \f3jarsigner\fP will attempt to sign the JAR file using the "SHA1withRSA" algorithm.
+That is, if the signer's public and private keys are DSA keys, \f3jarsigner\fP will sign the JAR file using the "SHA1withDSA" algorithm. If the signer's keys are RSA keys, \f3jarsigner\fP will attempt to sign the JAR file using the "SHA256withRSA" algorithm.
 .LP
 .LP
 These default signature algorithms can be overridden using the \f2\-sigalg\fP option.
@@ -541,7 +540,7 @@
 .na
 \f2Appendix A\fP @
 .fi
-http://java.sun.com/javase/6/docs/technotes/guides/security/crypto/CryptoSpec.html#AppA of the Java Cryptography Architecture for a list of standard signature algorithm names. This algorithm must be compatible with the private key used to sign the JAR file. If this option is not specified, SHA1withDSA or SHA1withRSA will be used depending on the type of private key. There must either be a statically installed provider supplying an implementation of the specified algorithm or the user must specify one with the \f2\-providerClass\fP option, otherwise the command will not succeed.
+http://java.sun.com/javase/6/docs/technotes/guides/security/crypto/CryptoSpec.html#AppA of the Java Cryptography Architecture for a list of standard signature algorithm names. This algorithm must be compatible with the private key used to sign the JAR file. If this option is not specified, SHA1withDSA or SHA256withRSA will be used depending on the type of private key. There must either be a statically installed provider supplying an implementation of the specified algorithm or the user must specify one with the \f2\-providerClass\fP option, otherwise the command will not succeed.
 .LP
 .RE
 .TP 3
@@ -553,7 +552,7 @@
 .na
 \f2Appendix A\fP @
 .fi
-http://java.sun.com/javase/6/docs/technotes/guides/security/crypto/CryptoSpec.html#AppA of the Java Cryptography Architecture for a list of standard message digest algorithm names. If this option is not specified, SHA\-1 will be used. There must either be a statically installed provider supplying an implementation of the specified algorithm or the user must specify one with the \f2\-providerClass\fP option, otherwise the command will not succeed.
+http://java.sun.com/javase/6/docs/technotes/guides/security/crypto/CryptoSpec.html#AppA of the Java Cryptography Architecture for a list of standard message digest algorithm names. If this option is not specified, SHA\-256 will be used. There must either be a statically installed provider supplying an implementation of the specified algorithm or the user must specify one with the \f2\-providerClass\fP option, otherwise the command will not succeed.
 .LP
 .RE
 .TP 3
@@ -1391,7 +1390,7 @@
 .nr 44 \n(83+(3*\n(38)
 .nr 84 +\n(44
 .nr TW \n(84
-.if t .if \n(TW>\n(.li .tm Table at line 1129 file Input is too wide - \n(TW units
+.if t .if \n(TW>\n(.li .tm Table at line 1128 file Input is too wide - \n(TW units
 .fc  
 .nr #T 0-1
 .nr #a 0-1
@@ -1615,7 +1614,5 @@
 .RE
 
 .LP
-
-.LP
 .RE
  
--- a/jdk/src/linux/doc/man/java.1	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/linux/doc/man/java.1	Wed Jul 21 09:57:21 2010 -0700
@@ -1,4 +1,4 @@
-." Copyright 2002-2006 Sun Microsystems, Inc.  All Rights Reserved.
+." Copyright (c) 1994, 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
@@ -19,8 +19,7 @@
 ." or visit www.oracle.com if you need additional information or have any
 ." questions.
 ."
-.TH java 1 "04 May 2009"
-." Generated from HTML by html2man (author: Eric Armstrong)
+.TH java 1 "02 Jun 2010"
 
 .LP
 .SH "Name"
@@ -299,19 +298,19 @@
 Disable background compilation. Normally the VM will compile the method as a background task, running the method in interpreter mode until the background compilation is finished. The \f2\-Xbatch\fP flag disables background compilation so that compilation of all methods proceeds as a foreground task until completed. 
 .TP 3
 \-Xbootclasspath:bootclasspath 
-Specify a colon\-separated list of directories, JAR archives, and ZIP archives to search for boot class files. These are used in place of the boot class files included in the Java 2 SDK. \f2Note: Applications that use this option for the purpose of overriding a class in rt.jar should not be deployed as doing so would contravene the Java 2 Runtime Environment binary code license.\fP 
+Specify a colon\-separated list of directories, JAR archives, and ZIP archives to search for boot class files. These are used in place of the boot class files included in the Java platform JDK. \f2Note: Applications that use this option for the purpose of overriding a class in rt.jar should not be deployed as doing so would contravene the Java Runtime Environment binary code license.\fP 
 .TP 3
 \-Xbootclasspath/a:path 
 Specify a colon\-separated path of directires, JAR archives, and ZIP archives to append to the default bootstrap class path. 
 .TP 3
 \-Xbootclasspath/p:path 
-Specify a colon\-separated path of directires, JAR archives, and ZIP archives to prepend in front of the default bootstrap class path. \f2Note: Applications that use this option for the purpose of overriding a class in rt.jar should not be deployed as doing so would contravene the Java 2 Runtime Environment binary code license.\fP 
+Specify a colon\-separated path of directires, JAR archives, and ZIP archives to prepend in front of the default bootstrap class path. \f2Note: Applications that use this option for the purpose of overriding a class in rt.jar should not be deployed as doing so would contravene the Java Runtime Environment binary code license.\fP 
 .TP 3
 \-Xcheck:jni 
 Perform additional checks for Java Native Interface (JNI) functions. Specifically, the Java Virtual Machine validates the parameters passed to the JNI function as well as the runtime environment data before processing the JNI request. Any invalid data encountered indicates a problem in the native code, and the Java Virtual Machine will terminate with a fatal error in such cases. Expect a performance degradation when this option is used. 
 .TP 3
 \-Xfuture 
-Perform strict class\-file format checks. For purposes of backwards compatibility, the default format checks performed by the Java 2 SDK's virtual machine are no stricter than the checks performed by 1.1.x versions of the JDK software. The \f3\-Xfuture\fP flag turns on stricter class\-file format checks that enforce closer conformance to the class\-file format specification. Developers are encouraged to use this flag when developing new code because the stricter checks will become the default in future releases of the Java application launcher. 
+Perform strict class\-file format checks. For purposes of backwards compatibility, the default format checks performed by the JDK's virtual machine are no stricter than the checks performed by 1.1.x versions of the JDK software. The \f3\-Xfuture\fP flag turns on stricter class\-file format checks that enforce closer conformance to the class\-file format specification. Developers are encouraged to use this flag when developing new code because the stricter checks will become the default in future releases of the Java application launcher. 
 .TP 3
 \-Xnoclassgc 
 Disable class garbage collection. Use of this option will prevent memory recovery from loaded classes thus increasing overall memory usage. This could cause OutOfMemoryError to be thrown in some applications. 
@@ -487,6 +486,4 @@
 .RE
 
 .LP
-
-.LP
  
--- a/jdk/src/linux/doc/man/javac.1	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/linux/doc/man/javac.1	Wed Jul 21 09:57:21 2010 -0700
@@ -1,4 +1,4 @@
-." Copyright 2000-2006 Sun Microsystems, Inc.  All Rights Reserved.
+." Copyright (c) 1994, 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
@@ -19,8 +19,7 @@
 ." or visit www.oracle.com if you need additional information or have any
 ." questions.
 ."
-.TH javac 1 "04 May 2009"
-." Generated from HTML by html2man (author: Eric Armstrong)
+.TH javac 1 "02 Jun 2010"
 
 .LP
 .SH "Name"
@@ -938,6 +937,4 @@
 .RE
 
 .LP
-
-.LP
  
--- a/jdk/src/linux/doc/man/javadoc.1	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/linux/doc/man/javadoc.1	Wed Jul 21 09:57:21 2010 -0700
@@ -1,4 +1,4 @@
-." Copyright 2002-2006 Sun Microsystems, Inc.  All Rights Reserved.
+." Copyright (c) 1994, 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
@@ -19,8 +19,7 @@
 ." or visit www.oracle.com if you need additional information or have any
 ." questions.
 ."
-.TH javadoc 1 "04 May 2009"
-." Generated from HTML by html2man (author: Eric Armstrong)
+.TH javadoc 1 "02 Jun 2010"
 .SH "Name"
 javadoc \- The Java API Documentation Generator
 .RS 3
@@ -395,7 +394,7 @@
 .nr 40 \n(79+(0*\n(38)
 .nr 80 +\n(40
 .nr TW \n(80
-.if t .if \n(TW>\n(.li .tm Table at line 353 file Input is too wide - \n(TW units
+.if t .if \n(TW>\n(.li .tm Table at line 352 file Input is too wide - \n(TW units
 .fc  
 .nr #T 0-1
 .nr #a 0-1
@@ -529,7 +528,7 @@
 .nr 40 \n(79+(0*\n(38)
 .nr 80 +\n(40
 .nr TW \n(80
-.if t .if \n(TW>\n(.li .tm Table at line 406 file Input is too wide - \n(TW units
+.if t .if \n(TW>\n(.li .tm Table at line 405 file Input is too wide - \n(TW units
 .fc  
 .nr #T 0-1
 .nr #a 0-1
@@ -1351,7 +1350,7 @@
 .nr 41 \n(80+(3*\n(38)
 .nr 81 +\n(41
 .nr TW \n(81
-.if t .if \n(TW>\n(.li .tm Table at line 1123 file Input is too wide - \n(TW units
+.if t .if \n(TW>\n(.li .tm Table at line 1122 file Input is too wide - \n(TW units
 .fc  
 .nr #T 0-1
 .nr #a 0-1
@@ -2080,7 +2079,7 @@
 .nr 40 \n(79+(0*\n(38)
 .nr 80 +\n(40
 .nr TW \n(80
-.if t .if \n(TW>\n(.li .tm Table at line 1666 file Input is too wide - \n(TW units
+.if t .if \n(TW>\n(.li .tm Table at line 1665 file Input is too wide - \n(TW units
 .fc  
 .nr #T 0-1
 .nr #a 0-1
@@ -2426,7 +2425,7 @@
 .nr 42 \n(81+(3*\n(38)
 .nr 82 +\n(42
 .nr TW \n(82
-.if t .if \n(TW>\n(.li .tm Table at line 1742 file Input is too wide - \n(TW units
+.if t .if \n(TW>\n(.li .tm Table at line 1741 file Input is too wide - \n(TW units
 .fc  
 .nr #T 0-1
 .nr #a 0-1
@@ -2829,7 +2828,7 @@
 .nr 40 \n(79+(0*\n(38)
 .nr 80 +\n(40
 .nr TW \n(80
-.if t .if \n(TW>\n(.li .tm Table at line 1963 file Input is too wide - \n(TW units
+.if t .if \n(TW>\n(.li .tm Table at line 1962 file Input is too wide - \n(TW units
 .fc  
 .nr #T 0-1
 .nr #a 0-1
@@ -2946,7 +2945,7 @@
 .nr 40 \n(79+(0*\n(38)
 .nr 80 +\n(40
 .nr TW \n(80
-.if t .if \n(TW>\n(.li .tm Table at line 1995 file Input is too wide - \n(TW units
+.if t .if \n(TW>\n(.li .tm Table at line 1994 file Input is too wide - \n(TW units
 .fc  
 .nr #T 0-1
 .nr #a 0-1
@@ -3065,7 +3064,7 @@
 .nr 40 \n(79+(0*\n(38)
 .nr 80 +\n(40
 .nr TW \n(80
-.if t .if \n(TW>\n(.li .tm Table at line 2029 file Input is too wide - \n(TW units
+.if t .if \n(TW>\n(.li .tm Table at line 2028 file Input is too wide - \n(TW units
 .fc  
 .nr #T 0-1
 .nr #a 0-1
@@ -3225,7 +3224,7 @@
 .nr 40 \n(79+(0*\n(38)
 .nr 80 +\n(40
 .nr TW \n(80
-.if t .if \n(TW>\n(.li .tm Table at line 2104 file Input is too wide - \n(TW units
+.if t .if \n(TW>\n(.li .tm Table at line 2103 file Input is too wide - \n(TW units
 .fc  
 .nr #T 0-1
 .nr #a 0-1
@@ -3369,7 +3368,7 @@
 .nr 40 \n(79+(0*\n(38)
 .nr 80 +\n(40
 .nr TW \n(80
-.if t .if \n(TW>\n(.li .tm Table at line 2163 file Input is too wide - \n(TW units
+.if t .if \n(TW>\n(.li .tm Table at line 2162 file Input is too wide - \n(TW units
 .fc  
 .nr #T 0-1
 .nr #a 0-1
@@ -3674,7 +3673,7 @@
 .nr 42 \n(81+(3*\n(38)
 .nr 82 +\n(42
 .nr TW \n(82
-.if t .if \n(TW>\n(.li .tm Table at line 2341 file Input is too wide - \n(TW units
+.if t .if \n(TW>\n(.li .tm Table at line 2340 file Input is too wide - \n(TW units
 .fc  
 .nr #T 0-1
 .nr #a 0-1
@@ -3937,7 +3936,7 @@
 .nr 41 \n(80+(3*\n(38)
 .nr 81 +\n(41
 .nr TW \n(81
-.if t .if \n(TW>\n(.li .tm Table at line 2451 file Input is too wide - \n(TW units
+.if t .if \n(TW>\n(.li .tm Table at line 2450 file Input is too wide - \n(TW units
 .fc  
 .nr #T 0-1
 .nr #a 0-1
@@ -5422,9 +5421,53 @@
 .RE
 
 .LP
+.LP
+.TS
+.if \n+(b.=1 .nr d. \n(.c-\n(c.-1
+.de 35
+.ps \n(.s
+.vs \n(.vu
+.in \n(.iu
+.if \n(.u .fi
+.if \n(.j .ad
+.if \n(.j=0 .na
+..
+.nf
+.nr #~ 0
+.if n .nr #~ 0.6n
+.ds #d .d
+.if \(ts\n(.z\(ts\(ts .ds #d nl
+.fc
+.nr 33 \n(.s
+.rm 80
+.nr 80 0
+.80
+.rm 80
+.nr 38 1n
+.nr 79 0
+.nr 40 \n(79+(0*\n(38)
+.nr 80 +\n(40
+.nr TW \n(80
+.if t .if \n(TW>\n(.li .tm Table at line 3869 file Input is too wide - \n(TW units
+.fc  
+.nr #T 0-1
+.nr #a 0-1
+.eo
+.de T#
+.ds #d .d
+.if \(ts\n(.z\(ts\(ts .ds #d nl
+.mk ##
+.nr ## -1v
+.ls 1
+.ls
+..
+.ec
+.fc
+.nr T. 1
+.T# 1
+.35
+.TE
+.if \n-(b.=0 .nr c. \n(.c-\n(d.-3
 
 .LP
-.LP
-Javadoc is a trademark of Sun Microsystems, Inc. (The \f2javadoc\fP command itself does not require the trademark symbol.)
-.LP
  
--- a/jdk/src/linux/doc/man/javah.1	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/linux/doc/man/javah.1	Wed Jul 21 09:57:21 2010 -0700
@@ -1,4 +1,4 @@
-." Copyright 2002-2006 Sun Microsystems, Inc.  All Rights Reserved.
+." Copyright (c) 1994, 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
@@ -19,8 +19,7 @@
 ." or visit www.oracle.com if you need additional information or have any
 ." questions.
 ."
-.TH javah 1 "04 May 2009"
-." Generated from HTML by html2man (author: Eric Armstrong)
+.TH javah 1 "02 Jun 2010"
 
 .LP
 .SH "Name"
@@ -156,6 +155,4 @@
 .LP
 javac(1), java(1), jdb(1), javap(1), javadoc(1)
 .LP
-
-.LP
  
--- a/jdk/src/linux/doc/man/javap.1	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/linux/doc/man/javap.1	Wed Jul 21 09:57:21 2010 -0700
@@ -1,4 +1,4 @@
-." Copyright 2002-2006 Sun Microsystems, Inc.  All Rights Reserved.
+." Copyright (c) 1994, 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
@@ -19,8 +19,7 @@
 ." or visit www.oracle.com if you need additional information or have any
 ." questions.
 ."
-.TH javap 1 "04 May 2009"
-." Generated from HTML by html2man (author: Eric Armstrong)
+.TH javap 1 "02 Jun 2010"
 
 .LP
 .SH "Name"
@@ -356,6 +355,4 @@
 .LP
 javac(1), java(1), jdb(1), javah(1), javadoc(1)
 .LP
-
-.LP
  
--- a/jdk/src/linux/doc/man/javaws.1	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/linux/doc/man/javaws.1	Wed Jul 21 09:57:21 2010 -0700
@@ -1,4 +1,4 @@
-." Copyright 2003-2006 Sun Microsystems, Inc.  All Rights Reserved.
+." Copyright (c) 2003, 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
@@ -19,17 +19,12 @@
 ." or visit www.oracle.com if you need additional information or have any
 ." questions.
 ."
-.TH javaws 1 "04 May 2009"
-." Generated from HTML by html2man (author: Eric Armstrong)
-
-.LP
+.TH javaws 1 "02 Jun 2010"
 
 .LP
 .SH "Name"
 \f2javaws\fP Command Line
 .LP
-
-.LP
 .LP
 \ 
 .LP
@@ -360,6 +355,4 @@
 .LP
 .RE
 .RE
-
-.LP
  
--- a/jdk/src/linux/doc/man/jconsole.1	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/linux/doc/man/jconsole.1	Wed Jul 21 09:57:21 2010 -0700
@@ -1,4 +1,4 @@
-." Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+." 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
@@ -19,8 +19,7 @@
 ." or visit www.oracle.com if you need additional information or have any
 ." questions.
 ."
-.TH jconsole 1 "04 May 2009"
-." Generated from HTML by html2man (author: Eric Armstrong)
+.TH jconsole 1 "02 Jun 2010"
 
 .LP
 .SH "Name"
@@ -141,6 +140,4 @@
 .RE
 
 .LP
-
-.LP
  
--- a/jdk/src/linux/doc/man/jdb.1	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/linux/doc/man/jdb.1	Wed Jul 21 09:57:21 2010 -0700
@@ -1,4 +1,4 @@
-." Copyright 2002-2006 Sun Microsystems, Inc.  All Rights Reserved.
+." Copyright (c) 1995, 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
@@ -19,8 +19,7 @@
 ." or visit www.oracle.com if you need additional information or have any
 ." questions.
 ."
-.TH jdb 1 "04 May 2009"
-." Generated from HTML by html2man (author: Eric Armstrong)
+.TH jdb 1 "02 Jun 2010"
 
 .LP
 .SH "Name"
@@ -364,6 +363,4 @@
 .LP
 javac(1), java(1), javah(1), javap(1), javadoc(1).
 .LP
-
-.LP
  
--- a/jdk/src/linux/doc/man/jhat.1	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/linux/doc/man/jhat.1	Wed Jul 21 09:57:21 2010 -0700
@@ -1,4 +1,4 @@
-." Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+." Copyright (c) 2006, 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
@@ -19,8 +19,7 @@
 ." or visit www.oracle.com if you need additional information or have any
 ." questions.
 ."
-.TH jhat 1 "04 May 2009"
-." Generated from HTML by html2man (author: Eric Armstrong)
+.TH jhat 1 "02 Jun 2010"
 
 .LP
 .SH "Name"
--- a/jdk/src/linux/doc/man/jinfo.1	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/linux/doc/man/jinfo.1	Wed Jul 21 09:57:21 2010 -0700
@@ -1,4 +1,4 @@
-." Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+." 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
@@ -19,8 +19,7 @@
 ." or visit www.oracle.com if you need additional information or have any
 ." questions.
 ."
-.TH jinfo 1 "04 May 2009"
-." Generated from HTML by html2man (author: Eric Armstrong)
+.TH jinfo 1 "02 Jun 2010"
 
 .LP
 .SH "Name"
@@ -148,6 +147,4 @@
 .RE
 
 .LP
-
-.LP
  
--- a/jdk/src/linux/doc/man/jmap.1	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/linux/doc/man/jmap.1	Wed Jul 21 09:57:21 2010 -0700
@@ -1,4 +1,4 @@
-." Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+." 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
@@ -19,8 +19,7 @@
 ." or visit www.oracle.com if you need additional information or have any
 ." questions.
 ."
-.TH jmap 1 "04 May 2009"
-." Generated from HTML by html2man (author: Eric Armstrong)
+.TH jmap 1 "02 Jun 2010"
 
 .LP
 .SH "Name"
@@ -168,6 +167,4 @@
 .RE
 
 .LP
-
-.LP
  
--- a/jdk/src/linux/doc/man/jps.1	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/linux/doc/man/jps.1	Wed Jul 21 09:57:21 2010 -0700
@@ -1,4 +1,4 @@
-." Copyright 2003 Sun Microsystems, Inc.  All Rights Reserved.
+." 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
@@ -19,8 +19,7 @@
 ." or visit www.oracle.com if you need additional information or have any
 ." questions.
 ."
-.TH jps 1 "04 May 2009"
-." Generated from HTML by html2man (author: Eric Armstrong)
+.TH jps 1 "02 Jun 2010"
 
 .LP
 .SH "Name"
@@ -264,6 +263,4 @@
 .RE
 
 .LP
-
-.LP
  
--- a/jdk/src/linux/doc/man/jrunscript.1	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/linux/doc/man/jrunscript.1	Wed Jul 21 09:57:21 2010 -0700
@@ -1,4 +1,4 @@
-." Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+." Copyright (c) 2006, 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
@@ -19,8 +19,7 @@
 ." or visit www.oracle.com if you need additional information or have any
 ." questions.
 ."
-.TH jrunscript 1 "04 May 2009"
-." Generated from HTML by html2man (author: Eric Armstrong)
+.TH jrunscript 1 "02 Jun 2010"
 
 .LP
 .SH "Name"
@@ -195,6 +194,4 @@
 .LP
 If JavaScript is used, then before evaluating any user defined script, jrunscript initializes certain built\-in functions and objects. These JavaScript built\-ins are documented in jsdocs.
 .LP
-
-.LP
  
--- a/jdk/src/linux/doc/man/jsadebugd.1	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/linux/doc/man/jsadebugd.1	Wed Jul 21 09:57:21 2010 -0700
@@ -1,4 +1,4 @@
-." Copyright 2004 Sun Microsystems, Inc.  All Rights Reserved.
+." 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
@@ -19,8 +19,7 @@
 ." or visit www.oracle.com if you need additional information or have any
 ." questions.
 ."
-.TH jsadebugd 1 "04 May 2009"
-." Generated from HTML by html2man (author: Eric Armstrong)
+.TH jsadebugd 1 "02 Jun 2010"
 
 .LP
 .SH "Name"
@@ -134,6 +133,4 @@
 .RE
 
 .LP
-
-.LP
  
--- a/jdk/src/linux/doc/man/jstack.1	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/linux/doc/man/jstack.1	Wed Jul 21 09:57:21 2010 -0700
@@ -1,4 +1,4 @@
-." Copyright 2004 Sun Microsystems, Inc.  All Rights Reserved.
+." 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
@@ -19,8 +19,7 @@
 ." or visit www.oracle.com if you need additional information or have any
 ." questions.
 ."
-.TH jstack 1 "04 May 2009"
-." Generated from HTML by html2man (author: Eric Armstrong)
+.TH jstack 1 "02 Jun 2010"
 
 .LP
 .SH "Name"
@@ -160,6 +159,4 @@
 .LP
 Mixed mode stack trace, the \-m option, does not work with the remote debug server.
 .LP
-
-.LP
  
--- a/jdk/src/linux/doc/man/jstat.1	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/linux/doc/man/jstat.1	Wed Jul 21 09:57:21 2010 -0700
@@ -1,4 +1,4 @@
-." Copyright 2003 Sun Microsystems, Inc.  All Rights Reserved.
+." 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
@@ -19,8 +19,7 @@
 ." or visit www.oracle.com if you need additional information or have any
 ." questions.
 ."
-.TH jstat 1 "04 May 2009"
-." Generated from HTML by html2man (author: Eric Armstrong)
+.TH jstat 1 "02 Jun 2010"
 
 .LP
 .SH "Name"
@@ -458,7 +457,7 @@
 .nr 41 \n(80+(3*\n(38)
 .nr 81 +\n(41
 .nr TW \n(81
-.if t .if \n(TW>\n(.li .tm Table at line 231 file Input is too wide - \n(TW units
+.if t .if \n(TW>\n(.li .tm Table at line 230 file Input is too wide - \n(TW units
 .fc  
 .nr #T 0-1
 .nr #a 0-1
@@ -826,7 +825,7 @@
 .nr 41 \n(80+(3*\n(38)
 .nr 81 +\n(41
 .nr TW \n(81
-.if t .if \n(TW>\n(.li .tm Table at line 281 file Input is too wide - \n(TW units
+.if t .if \n(TW>\n(.li .tm Table at line 280 file Input is too wide - \n(TW units
 .fc  
 .nr #T 0-1
 .nr #a 0-1
@@ -1083,7 +1082,7 @@
 .nr 41 \n(80+(3*\n(38)
 .nr 81 +\n(41
 .nr TW \n(81
-.if t .if \n(TW>\n(.li .tm Table at line 317 file Input is too wide - \n(TW units
+.if t .if \n(TW>\n(.li .tm Table at line 316 file Input is too wide - \n(TW units
 .fc  
 .nr #T 0-1
 .nr #a 0-1
@@ -1547,7 +1546,7 @@
 .nr 41 \n(80+(3*\n(38)
 .nr 81 +\n(41
 .nr TW \n(81
-.if t .if \n(TW>\n(.li .tm Table at line 387 file Input is too wide - \n(TW units
+.if t .if \n(TW>\n(.li .tm Table at line 386 file Input is too wide - \n(TW units
 .fc  
 .nr #T 0-1
 .nr #a 0-1
@@ -2171,7 +2170,7 @@
 .nr 41 \n(80+(3*\n(38)
 .nr 81 +\n(41
 .nr TW \n(81
-.if t .if \n(TW>\n(.li .tm Table at line 461 file Input is too wide - \n(TW units
+.if t .if \n(TW>\n(.li .tm Table at line 460 file Input is too wide - \n(TW units
 .fc  
 .nr #T 0-1
 .nr #a 0-1
@@ -2551,7 +2550,7 @@
 .nr 41 \n(80+(3*\n(38)
 .nr 81 +\n(41
 .nr TW \n(81
-.if t .if \n(TW>\n(.li .tm Table at line 484 file Input is too wide - \n(TW units
+.if t .if \n(TW>\n(.li .tm Table at line 483 file Input is too wide - \n(TW units
 .fc  
 .nr #T 0-1
 .nr #a 0-1
@@ -2867,7 +2866,7 @@
 .nr 41 \n(80+(3*\n(38)
 .nr 81 +\n(41
 .nr TW \n(81
-.if t .if \n(TW>\n(.li .tm Table at line 538 file Input is too wide - \n(TW units
+.if t .if \n(TW>\n(.li .tm Table at line 537 file Input is too wide - \n(TW units
 .fc  
 .nr #T 0-1
 .nr #a 0-1
@@ -3322,7 +3321,7 @@
 .nr 41 \n(80+(3*\n(38)
 .nr 81 +\n(41
 .nr TW \n(81
-.if t .if \n(TW>\n(.li .tm Table at line 594 file Input is too wide - \n(TW units
+.if t .if \n(TW>\n(.li .tm Table at line 593 file Input is too wide - \n(TW units
 .fc  
 .nr #T 0-1
 .nr #a 0-1
@@ -3718,7 +3717,7 @@
 .nr 41 \n(80+(3*\n(38)
 .nr 81 +\n(41
 .nr TW \n(81
-.if t .if \n(TW>\n(.li .tm Table at line 636 file Input is too wide - \n(TW units
+.if t .if \n(TW>\n(.li .tm Table at line 635 file Input is too wide - \n(TW units
 .fc  
 .nr #T 0-1
 .nr #a 0-1
@@ -4063,7 +4062,7 @@
 .nr 41 \n(80+(3*\n(38)
 .nr 81 +\n(41
 .nr TW \n(81
-.if t .if \n(TW>\n(.li .tm Table at line 678 file Input is too wide - \n(TW units
+.if t .if \n(TW>\n(.li .tm Table at line 677 file Input is too wide - \n(TW units
 .fc  
 .nr #T 0-1
 .nr #a 0-1
@@ -4408,7 +4407,7 @@
 .nr 41 \n(80+(3*\n(38)
 .nr 81 +\n(41
 .nr TW \n(81
-.if t .if \n(TW>\n(.li .tm Table at line 720 file Input is too wide - \n(TW units
+.if t .if \n(TW>\n(.li .tm Table at line 719 file Input is too wide - \n(TW units
 .fc  
 .nr #T 0-1
 .nr #a 0-1
@@ -4793,7 +4792,7 @@
 .nr 41 \n(80+(3*\n(38)
 .nr 81 +\n(41
 .nr TW \n(81
-.if t .if \n(TW>\n(.li .tm Table at line 770 file Input is too wide - \n(TW units
+.if t .if \n(TW>\n(.li .tm Table at line 769 file Input is too wide - \n(TW units
 .fc  
 .nr #T 0-1
 .nr #a 0-1
@@ -5092,7 +5091,7 @@
 .nr 41 \n(80+(3*\n(38)
 .nr 81 +\n(41
 .nr TW \n(81
-.if t .if \n(TW>\n(.li .tm Table at line 796 file Input is too wide - \n(TW units
+.if t .if \n(TW>\n(.li .tm Table at line 795 file Input is too wide - \n(TW units
 .fc  
 .nr #T 0-1
 .nr #a 0-1
@@ -5375,6 +5374,4 @@
 .RE
 
 .LP
-
-.LP
  
--- a/jdk/src/linux/doc/man/jstatd.1	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/linux/doc/man/jstatd.1	Wed Jul 21 09:57:21 2010 -0700
@@ -1,4 +1,4 @@
-." Copyright 2003 Sun Microsystems, Inc.  All Rights Reserved.
+." 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
@@ -19,8 +19,7 @@
 ." or visit www.oracle.com if you need additional information or have any
 ." questions.
 ."
-.TH jstatd 1 "04 May 2009"
-." Generated from HTML by html2man (author: Eric Armstrong)
+.TH jstatd 1 "02 Jun 2010"
 
 .LP
 .SH "Name"
@@ -269,6 +268,4 @@
 .RE
 
 .LP
-
-.LP
  
--- a/jdk/src/linux/doc/man/keytool.1	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/linux/doc/man/keytool.1	Wed Jul 21 09:57:21 2010 -0700
@@ -1,4 +1,4 @@
-." Copyright 2002-2006 Sun Microsystems, Inc.  All Rights Reserved.
+." Copyright (c) 1998, 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
@@ -19,8 +19,7 @@
 ." or visit www.oracle.com if you need additional information or have any
 ." questions.
 ."
-.TH keytool 1 "04 May 2009"
-." Generated from HTML by html2man (author: Eric Armstrong)
+.TH keytool 1 "02 Jun 2010"
 
 .LP
 .SH "Name"
@@ -150,7 +149,9 @@
 .fl
 \-keysize
 .fl
-    1024 (when using \fP\f3\-genkeypair\fP\f3)
+    2048 (when using \fP\f3\-genkeypair\fP\f3 and \-keyalg is "RSA")
+.fl
+    1024 (when using \fP\f3\-genkeypair\fP\f3 and \-keyalg is "DSA")
 .fl
     56 (when using \fP\f3\-genseckey\fP\f3 and \-keyalg is "DES")
 .fl
@@ -186,7 +187,7 @@
 .fi
 
 .LP
-In generating a public/private key pair, the signature algorithm (\f2\-sigalg\fP option) is derived from the algorithm of the underlying private key: If the underlying private key is of type "DSA", the \f2\-sigalg\fP option defaults to "SHA1withDSA", and if the underlying private key is of type "RSA", \f2\-sigalg\fP defaults to "SHA1withRSA". Please consult the 
+In generating a public/private key pair, the signature algorithm (\f2\-sigalg\fP option) is derived from the algorithm of the underlying private key: If the underlying private key is of type "DSA", the \f2\-sigalg\fP option defaults to "SHA1withDSA", and if the underlying private key is of type "RSA", \f2\-sigalg\fP defaults to "SHA256withRSA". Please consult the 
 .na
 \f2Java Cryptography Architecture API Specification & Reference\fP @
 .fi
@@ -477,7 +478,7 @@
 .nr 41 \n(80+(3*\n(38)
 .nr 81 +\n(41
 .nr TW \n(81
-.if t .if \n(TW>\n(.li .tm Table at line 288 file Input is too wide - \n(TW units
+.if t .if \n(TW>\n(.li .tm Table at line 289 file Input is too wide - \n(TW units
 .fc  
 .nr #T 0-1
 .nr #a 0-1
@@ -664,6 +665,9 @@
 .LP
 The subjectKeyIdentifier extension is always created. For non self\-signed certificates, the authorityKeyIdentifier is always created.
 .LP
+.LP
+\f3Note:\fP Users should be aware that some combinations of extensions (and other certificate fields) may not conform to the Internet standard. See Warning Regarding Certificate Conformance for details.
+.LP
 .RE
 .RE
 .RE
@@ -679,12 +683,14 @@
 .LP
 .RS 3
 .TP 3
-\-gencert {\-infile infile} {\-outfile outfile} {\-ext ext}* {\-rfc} {\-alias alias} {\-sigalg sigalg} {\-validity valDays} {\-storetype storetype} {\-keystore keystore} [\-storepass storepass] [\-keypass keypass] {\-providerClass provider_class_name {\-providerArg provider_arg}} {\-v} {\-protected} {\-Jjavaoption} 
+\-gencert {\-infile infile} {\-outfile outfile} {\-dname dname} {\-ext ext}* {\-rfc} {\-alias alias} {\-sigalg sigalg} {\-validity valDays} {\-storetype storetype} {\-keystore keystore} [\-storepass storepass] [\-keypass keypass] {\-providerClass provider_class_name {\-providerArg provider_arg}} {\-v} {\-protected} {\-Jjavaoption} 
 .LP
 Generates a certificate as a response to a certificate request file (which can be created by the \f2keytool \-certreq\fP command). The command reads the request from infile (if omitted, from the standard input), signs it using alias's private key, and output the X.509 certificate into outfile (if omitted, to the standard output). If \f2\-rfc\fP is specified, output format is BASE64\-encoded PEM; otherwise, a binary DER is created. 
 .LP
 \f2sigalg\fP specifies the algorithm that should be used to sign the certificate. valDays tells the number of days for which the certificate should be considered valid. 
 .LP
+If \f2dname\fP is provided, it's used as the subject of the generated certificate. Otherwise, the one from the certificate request is used. 
+.LP
 \f2ext\fP shows what X.509 extensions will be embedded in the certificate. Read Common Options for the grammar of \f2\-ext\fP.  
 .TP 3
 \-genkeypair {\-alias alias} {\-keyalg keyalg} {\-keysize keysize} {\-sigalg sigalg} [\-dname dname] [\-keypass keypass] {\-startdate value} {\-validity valDays} {\-storetype storetype} {\-keystore keystore} [\-storepass storepass] {\-providerClass provider_class_name {\-providerArg provider_arg}} {\-v} {\-protected} {\-Jjavaoption} 
@@ -845,13 +851,13 @@
 .LP
 .RS 3
 .TP 3
-\-certreq {\-alias alias} {\-sigalg sigalg} {\-file certreq_file} [\-keypass keypass] {\-storetype storetype} {\-keystore keystore} [\-storepass storepass] {\-providerName provider_name} {\-providerClass provider_class_name {\-providerArg provider_arg}} {\-v} {\-protected} {\-Jjavaoption} 
+\-certreq {\-alias alias} {\-dname dname} {\-sigalg sigalg} {\-file certreq_file} [\-keypass keypass] {\-storetype storetype} {\-keystore keystore} [\-storepass storepass] {\-providerName provider_name} {\-providerClass provider_class_name {\-providerArg provider_arg}} {\-v} {\-protected} {\-Jjavaoption} 
 .LP
 Generates a Certificate Signing Request (CSR), using the PKCS#10 format. 
 .LP
 A CSR is intended to be sent to a certificate authority (CA). The CA will authenticate the certificate requestor (usually off\-line) and will return a certificate or certificate chain, used to replace the existing certificate chain (which initially consists of a self\-signed certificate) in the keystore. 
 .LP
-The private key and X.500 Distinguished Name associated with \f2alias\fP are used to create the PKCS#10 certificate request. In order to access the private key, the appropriate password must be provided, since private keys are protected in the keystore with a password. If \f2keypass\fP is not provided at the command line, and is different from the password used to protect the integrity of the keystore, the user is prompted for it. 
+The private key associated with \f2alias\fP is used to create the PKCS#10 certificate request. In order to access the private key, the appropriate password must be provided, since private keys are protected in the keystore with a password. If \f2keypass\fP is not provided at the command line, and is different from the password used to protect the integrity of the keystore, the user is prompted for it. If dname is provided, it's used as the subject in the CSR. Otherwise, the X.500 Distinguished Name associated with alias is used. 
 .LP
 \f2sigalg\fP specifies the algorithm that should be used to sign the CSR. 
 .LP
@@ -2069,6 +2075,10 @@
 .fl
          SHA1: 20:B6:17:FA:EF:E5:55:8A:D0:71:1F:E8:D6:9D:C0:37:13:0E:5E:FE
 .fl
+         SHA256: 90:7B:70:0A:EA:DC:16:79:92:99:41:FF:8A:FE:EB:90:
+.fl
+                 17:75:E0:90:B2:24:4D:3A:2A:16:A6:E4:11:0F:67:A4
+.fl
 \fP
 .fi
 
@@ -2094,6 +2104,20 @@
 If you don't specify a required password option on a command line, you will be prompted for it.
 .LP
 .RE
+.SS 
+Warning Regarding Certificate Conformance
+.LP
+.RS 3
+
+.LP
+.LP
+The Internet standard 
+.na
+\f2RFC 5280\fP @
+.fi
+http://tools.ietf.org/rfc/rfc5280.txt has defined a profile on conforming X.509 certificates, which includes what values and value combinations are valid for certificate fields and extensions. \f3keytool\fP has not enforced all these rules so it can generate certificates which do not conform to the standard, and these certificates might be rejected by JRE or other applications. Users should make sure that they provide the correct options for \f2\-dname\fP, \f2\-ext\fP, etc.
+.LP
+.RE
 .SH "SEE ALSO"
 .LP
 
@@ -2176,6 +2200,4 @@
 .RE
 
 .LP
-
-.LP
  
--- a/jdk/src/linux/doc/man/native2ascii.1	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/linux/doc/man/native2ascii.1	Wed Jul 21 09:57:21 2010 -0700
@@ -1,4 +1,4 @@
-." Copyright 2002-2006 Sun Microsystems, Inc.  All Rights Reserved.
+." Copyright (c) 1997, 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
@@ -19,8 +19,7 @@
 ." or visit www.oracle.com if you need additional information or have any
 ." questions.
 ."
-.TH native2ascii 1 "04 May 2009"
-." Generated from HTML by html2man (author: Eric Armstrong)
+.TH native2ascii 1 "02 Jun 2010"
 
 .LP
 .SH "Name"
@@ -78,6 +77,4 @@
 .RE
 
 .LP
-
-.LP
  
--- a/jdk/src/linux/doc/man/orbd.1	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/linux/doc/man/orbd.1	Wed Jul 21 09:57:21 2010 -0700
@@ -1,4 +1,4 @@
-." Copyright 2001-2006 Sun Microsystems, Inc.  All Rights Reserved.
+." Copyright (c) 2001, 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
@@ -19,8 +19,7 @@
 ." or visit www.oracle.com if you need additional information or have any
 ." questions.
 ."
-.TH orbd 1 "04 May 2009"
-." Generated from HTML by html2man (author: Eric Armstrong)
+.TH orbd 1 "02 Jun 2010"
 
 .LP
 .SH "Name"
@@ -374,6 +373,4 @@
 .br
 
 .LP
-
-.LP
  
--- a/jdk/src/linux/doc/man/pack200.1	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/linux/doc/man/pack200.1	Wed Jul 21 09:57:21 2010 -0700
@@ -1,4 +1,4 @@
-." Copyright 2004-2006 Sun Microsystems, Inc.  All Rights Reserved.
+." 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
@@ -19,8 +19,7 @@
 ." or visit www.oracle.com if you need additional information or have any
 ." questions.
 ."
-.TH pack200 1 "04 May 2009"
-." Generated from HTML by html2man (author: Eric Armstrong)
+.TH pack200 1 "02 Jun 2010"
 
 .LP
 .SH "Name"
@@ -422,6 +421,4 @@
 .LP
 The Java SE API Specification provided with the JDK is the superseding authority, in case of discrepancies.
 .LP
-
-.LP
  
--- a/jdk/src/linux/doc/man/policytool.1	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/linux/doc/man/policytool.1	Wed Jul 21 09:57:21 2010 -0700
@@ -1,4 +1,4 @@
-." Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+." Copyright (c) 2001, 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
@@ -19,8 +19,7 @@
 ." or visit www.oracle.com if you need additional information or have any
 ." questions.
 ."
-.TH policytool 1 "04 May 2009"
-." Generated from HTML by html2man (author: Eric Armstrong)
+.TH policytool 1 "02 Jun 2010"
 
 .LP
 .SH "Name"
@@ -89,6 +88,4 @@
 .RE
 
 .LP
-
-.LP
  
--- a/jdk/src/linux/doc/man/rmic.1	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/linux/doc/man/rmic.1	Wed Jul 21 09:57:21 2010 -0700
@@ -1,4 +1,4 @@
-." Copyright 2004-2006 Sun Microsystems, Inc.  All Rights Reserved.
+." Copyright (c) 1997, 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
@@ -19,8 +19,7 @@
 ." or visit www.oracle.com if you need additional information or have any
 ." questions.
 ."
-.TH rmic 1 "04 May 2009"
-." Generated from HTML by html2man (author: Eric Armstrong)
+.TH rmic 1 "02 Jun 2010"
 
 .LP
 .SH "Name"
@@ -266,6 +265,4 @@
 .fi
 http://java.sun.com/javase/6/docs/technotes/tools/index.html#classpath
 .LP
-
-.LP
  
--- a/jdk/src/linux/doc/man/rmid.1	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/linux/doc/man/rmid.1	Wed Jul 21 09:57:21 2010 -0700
@@ -1,4 +1,4 @@
-." Copyright 2004-2006 Sun Microsystems, Inc.  All Rights Reserved.
+." Copyright (c) 1998, 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
@@ -19,8 +19,7 @@
 ." or visit www.oracle.com if you need additional information or have any
 ." questions.
 ."
-.TH rmid 1 "04 May 2009"
-." Generated from HTML by html2man (author: Eric Armstrong)
+.TH rmid 1 "02 Jun 2010"
 
 .LP
 .SH "Name"
@@ -348,6 +347,4 @@
 .fi
 http://java.sun.com/javase/6/docs/technotes/tools/index.html#classpath, java(1)
 .LP
-
-.LP
  
--- a/jdk/src/linux/doc/man/rmiregistry.1	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/linux/doc/man/rmiregistry.1	Wed Jul 21 09:57:21 2010 -0700
@@ -1,4 +1,4 @@
-." Copyright 2003-2006 Sun Microsystems, Inc.  All Rights Reserved.
+." Copyright (c) 1997, 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
@@ -19,8 +19,7 @@
 ." or visit www.oracle.com if you need additional information or have any
 ." questions.
 ."
-.TH rmiregistry 1 "04 May 2009"
-." Generated from HTML by html2man (author: Eric Armstrong)
+.TH rmiregistry 1 "02 Jun 2010"
 
 .LP
 .SH "Name"
@@ -94,6 +93,4 @@
 .fi
 http://java.sun.com/javase/6/docs/api/java/rmi/Naming.html
 .LP
-
-.LP
  
--- a/jdk/src/linux/doc/man/schemagen.1	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/linux/doc/man/schemagen.1	Wed Jul 21 09:57:21 2010 -0700
@@ -1,4 +1,4 @@
-." Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+." Copyright (c) 2005, 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
@@ -19,8 +19,7 @@
 ." or visit www.oracle.com if you need additional information or have any
 ." questions.
 ."
-.TH schemagen 1 "04 May 2009"
-." Generated from HTML by html2man (author: Eric Armstrong)
+.TH schemagen 1 "02 Jun 2010"
 
 .LP
 .SH "Name"
@@ -129,6 +128,4 @@
 .RE
 
 .LP
-
-.LP
  
--- a/jdk/src/linux/doc/man/serialver.1	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/linux/doc/man/serialver.1	Wed Jul 21 09:57:21 2010 -0700
@@ -1,4 +1,4 @@
-." Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+." Copyright (c) 1997, 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
@@ -19,8 +19,7 @@
 ." or visit www.oracle.com if you need additional information or have any
 ." questions.
 ."
-.TH serialver 1 "04 May 2009"
-." Generated from HTML by html2man (author: Eric Armstrong)
+.TH serialver 1 "02 Jun 2010"
 
 .LP
 .SH "Name"
@@ -121,6 +120,4 @@
 .fi
 http://java.sun.com/javase/6/docs/api/java/io/ObjectStreamClass.html
 .LP
-
-.LP
  
--- a/jdk/src/linux/doc/man/servertool.1	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/linux/doc/man/servertool.1	Wed Jul 21 09:57:21 2010 -0700
@@ -1,4 +1,4 @@
-." Copyright 2001-2006 Sun Microsystems, Inc.  All Rights Reserved.
+." Copyright (c) 2001, 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
@@ -19,8 +19,7 @@
 ." or visit www.oracle.com if you need additional information or have any
 ." questions.
 ."
-.TH servertool 1 "04 May 2009"
-." Generated from HTML by html2man (author: Eric Armstrong)
+.TH servertool 1 "02 Jun 2010"
 
 .LP
 .SH "Name"
@@ -125,6 +124,4 @@
 .LP
 
 .LP
-orbd(1) 
-.LP
- 
+orbd(1)  
--- a/jdk/src/linux/doc/man/tnameserv.1	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/linux/doc/man/tnameserv.1	Wed Jul 21 09:57:21 2010 -0700
@@ -1,4 +1,4 @@
-." Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+." Copyright (c) 1999, 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
@@ -19,15 +19,12 @@
 ." or visit www.oracle.com if you need additional information or have any
 ." questions.
 ."
-.TH tnameserv 1 "04 May 2009"
-." Generated from HTML by html2man (author: Eric Armstrong)
+.TH tnameserv 1 "02 Jun 2010"
 
 .LP
 .SH "Name"
 Java IDL: Transient Naming Service \- \f2tnameserv\fP
 .LP
-
-.LP
 .LP
 This document discusses using the Java IDL Transient Naming Service, \f2tnameserv\fP. Java IDL also includes the Object Request Broker Daemon (ORBD). ORBD is a daemon process containing a Bootstrap Service, a Transient Naming Service, a \f3Persistent\fP Naming Service, and a Server Manager. The Java IDL tutorials all use ORBD, however, you can substitute \f2tnameserv\fP for \f2orbd\fP in any of the examples that use a Transient Naming Service. For documentation on the \f2orbd\fP tool, link to its orbd(1) or the 
 .na
@@ -499,6 +496,4 @@
 .fi
 
 .LP
-
-.LP
  
--- a/jdk/src/linux/doc/man/unpack200.1	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/linux/doc/man/unpack200.1	Wed Jul 21 09:57:21 2010 -0700
@@ -1,4 +1,4 @@
-." Copyright 2004-2006 Sun Microsystems, Inc.  All Rights Reserved.
+." 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
@@ -19,8 +19,7 @@
 ." or visit www.oracle.com if you need additional information or have any
 ." questions.
 ."
-.TH unpack200 1 "04 May 2009"
-." Generated from HTML by html2man (author: Eric Armstrong)
+.TH unpack200 1 "02 Jun 2010"
 
 .LP
 .SH "Name"
@@ -190,6 +189,4 @@
 .LP
 The Java SE API Specification provided with the JDK is the superseding authority, in case of discrepancies.
 .LP
-
-.LP
  
--- a/jdk/src/linux/doc/man/wsgen.1	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/linux/doc/man/wsgen.1	Wed Jul 21 09:57:21 2010 -0700
@@ -1,4 +1,4 @@
-." Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+." Copyright (c) 2005, 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
@@ -19,8 +19,7 @@
 ." or visit www.oracle.com if you need additional information or have any
 ." questions.
 ."
-.TH wsgen 1 "04 May 2009"
-." Generated from HTML by html2man (author: Eric Armstrong)
+.TH wsgen 1 "02 Jun 2010"
 .SH "Name"
 wsgen \- Java(TM) API for XML Web Services (JAX\-WS) 2.0
 .RS 3
@@ -355,7 +354,7 @@
 .nr 41 \n(80+(3*\n(38)
 .nr 81 +\n(41
 .nr TW \n(81
-.if t .if \n(TW>\n(.li .tm Table at line 140 file Input is too wide - \n(TW units
+.if t .if \n(TW>\n(.li .tm Table at line 139 file Input is too wide - \n(TW units
 .fc  
 .nr #T 0-1
 .nr #a 0-1
--- a/jdk/src/linux/doc/man/wsimport.1	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/linux/doc/man/wsimport.1	Wed Jul 21 09:57:21 2010 -0700
@@ -1,4 +1,4 @@
-." Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+." Copyright (c) 2005, 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
@@ -19,8 +19,7 @@
 ." or visit www.oracle.com if you need additional information or have any
 ." questions.
 ."
-.TH wsimport 1 "04 May 2009"
-." Generated from HTML by html2man (author: Eric Armstrong)
+.TH wsimport 1 "02 Jun 2010"
 .SH "Name"
 wsimport \- Java(TM) API for XML Web Services (JAX\-WS) 2.0
 .LP
@@ -419,7 +418,7 @@
 .nr 41 \n(80+(3*\n(38)
 .nr 81 +\n(41
 .nr TW \n(81
-.if t .if \n(TW>\n(.li .tm Table at line 158 file Input is too wide - \n(TW units
+.if t .if \n(TW>\n(.li .tm Table at line 157 file Input is too wide - \n(TW units
 .fc  
 .nr #T 0-1
 .nr #a 0-1
--- a/jdk/src/linux/doc/man/xjc.1	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/linux/doc/man/xjc.1	Wed Jul 21 09:57:21 2010 -0700
@@ -1,4 +1,4 @@
-." Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+." Copyright (c) 2005, 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
@@ -19,8 +19,7 @@
 ." or visit www.oracle.com if you need additional information or have any
 ." questions.
 ."
-.TH xjc 1 "04 May 2009"
-." Generated from HTML by html2man (author: Eric Armstrong)
+.TH xjc 1 "02 Jun 2010"
 
 .LP
 .ad c
@@ -285,6 +284,4 @@
 .RE
 
 .LP
-
-.LP
  
--- a/jdk/src/share/bin/emessages.h	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/share/bin/emessages.h	Wed Jul 21 09:57:21 2010 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 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
@@ -44,7 +44,7 @@
 
 #define JVM_ERROR1      "Error: Could not create the Java Virtual Machine.\n" GEN_ERROR
 #define JVM_ERROR2      "Error: Could not detach main thread.\n" JNI_ERROR
-#define JVM_ERROR3      "Error: SPARC V8 processor detected; Server compiler requires V9 or better.\nUse Client compiler on V8 processors.\nCould not create the Java virtual machine."
+#define JVM_ERROR3      "Error: SPARC V8 processor detected;  Required V9 processors or better.\nUse JDK5 client compiler for V8 processors.\n" JVM_ERROR1
 
 #define JAR_ERROR1      "Error: Failed to load Main-Class manifest attribute from\n%s\n%s"
 #define JAR_ERROR2      "Error: Unable to access jarfile %s"
@@ -69,7 +69,8 @@
 #define CFG_ERROR5      "Error: Could not determine application home."
 #define CFG_ERROR6      "Error: could not open `%s'"
 #define CFG_ERROR7      "Error: no known VMs. (check for corrupt jvm.cfg file)"
-#define CFG_ERROR8      "Error: no `%s' JVM at `%s'."
+#define CFG_ERROR8      "Error: missing `%s' JVM at `%s'.\nPlease install or use the JRE or JDK that contains these missing components."
+#define CFG_ERROR9      "Error: could not determine JVM type."
 
 
 #define SPC_ERROR1      "Error: Syntax error in version specification \"%s\""
--- a/jdk/src/share/bin/java.c	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/share/bin/java.c	Wed Jul 21 09:57:21 2010 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1995, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1995, 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
@@ -192,8 +192,8 @@
     int ret;
     InvocationFunctions ifn;
     jlong start, end;
-    char jrepath[MAXPATHLEN], jvmpath[MAXPATHLEN];
-    char ** original_argv = argv;
+    char jvmpath[MAXPATHLEN];
+    char jrepath[MAXPATHLEN];
 
     _fVersion = fullversion;
     _dVersion = dotversion;
@@ -225,14 +225,17 @@
      */
     SelectVersion(argc, argv, &main_class);
 
-    /* copy original argv */
-    JLI_TraceLauncher("Command line Args:\n");
-    original_argv = (JLI_CopyArgs(argc, (const char**)argv));
+    if (JLI_IsTraceLauncher()) {
+        int i;
+        printf("Command line args:\n");
+        for (i = 0; i < argc ; i++) {
+            printf("argv[%d] = %s\n", i, argv[i]);
+        }
+    }
 
     CreateExecutionEnvironment(&argc, &argv,
                                jrepath, sizeof(jrepath),
-                               jvmpath, sizeof(jvmpath),
-                               original_argv);
+                               jvmpath, sizeof(jvmpath));
 
     ifn.CreateJavaVM = 0;
     ifn.GetDefaultJavaVMInitArgs = 0;
@@ -301,22 +304,43 @@
     return ContinueInNewThread(&ifn, argc, argv, jarfile, classname, ret);
 
 }
+/*
+ * Always detach the main thread so that it appears to have ended when
+ * the application's main method exits.  This will invoke the
+ * uncaught exception handler machinery if main threw an
+ * exception.  An uncaught exception handler cannot change the
+ * launcher's return code except by calling System.exit.
+ *
+ * Wait for all non-daemon threads to end, then destroy the VM.
+ * This will actually create a trivial new Java waiter thread
+ * named "DestroyJavaVM", but this will be seen as a different
+ * thread from the one that executed main, even though they are
+ * the same C thread.  This allows mainThread.join() and
+ * mainThread.isAlive() to work as expected.
+ */
+#define LEAVE() \
+    if ((*vm)->DetachCurrentThread(vm) != 0) { \
+        JLI_ReportErrorMessage(JVM_ERROR2); \
+        ret = 1; \
+    } \
+    (*vm)->DestroyJavaVM(vm); \
+    return ret \
 
 #define CHECK_EXCEPTION_NULL_LEAVE(e) \
     if ((*env)->ExceptionOccurred(env)) { \
         JLI_ReportExceptionDescription(env); \
-        goto leave; \
+        LEAVE(); \
     } \
     if ((e) == NULL) { \
         JLI_ReportErrorMessage(JNI_ERROR); \
-        goto leave; \
+        LEAVE(); \
     }
 
 #define CHECK_EXCEPTION_LEAVE(rv) \
     if ((*env)->ExceptionOccurred(env)) { \
         JLI_ReportExceptionDescription(env); \
         ret = (rv); \
-        goto leave; \
+        LEAVE(); \
     }
 
 int JNICALL
@@ -349,8 +373,7 @@
         PrintJavaVersion(env, showVersion);
         CHECK_EXCEPTION_LEAVE(0);
         if (printVersion) {
-            ret = 0;
-            goto leave;
+            LEAVE();
         }
     }
 
@@ -358,7 +381,7 @@
     if (printXUsage || printUsage || (jarfile == 0 && classname == 0)) {
         PrintUsage(env, printXUsage);
         CHECK_EXCEPTION_LEAVE(1);
-        goto leave;
+        LEAVE();
     }
 
     FreeKnownVMs();  /* after last possible PrintUsage() */
@@ -430,30 +453,7 @@
      * System.exit) will be non-zero if main threw an exception.
      */
     ret = (*env)->ExceptionOccurred(env) == NULL ? 0 : 1;
-
-leave:
-    /*
-     * Always detach the main thread so that it appears to have ended when
-     * the application's main method exits.  This will invoke the
-     * uncaught exception handler machinery if main threw an
-     * exception.  An uncaught exception handler cannot change the
-     * launcher's return code except by calling System.exit.
-     */
-    if ((*vm)->DetachCurrentThread(vm) != 0) {
-        JLI_ReportErrorMessage(JVM_ERROR2);
-        ret = 1;
-    }
-    /*
-     * Wait for all non-daemon threads to end, then destroy the VM.
-     * This will actually create a trivial new Java waiter thread
-     * named "DestroyJavaVM", but this will be seen as a different
-     * thread from the one that executed main, even though they are
-     * the same C thread.  This allows mainThread.join() and
-     * mainThread.isAlive() to work as expected.
-     */
-    (*vm)->DestroyJavaVM(vm);
-
-    return ret;
+    LEAVE();
 }
 
 /*
@@ -1076,15 +1076,17 @@
     if (--argc >= 0) {
         if (jarflag) {
             *pjarfile = *argv++;
-            *pclassname = 0;
+            *pclassname = NULL;
         } else {
-            *pjarfile = 0;
+            *pjarfile = NULL;
             *pclassname = *argv++;
         }
         *pargc = argc;
         *pargv = argv;
     }
-
+    if (*pjarfile == NULL && *pclassname == NULL) {
+        *pret = 1;
+    }
     return JNI_TRUE;
 }
 
--- a/jdk/src/share/bin/java.h	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/share/bin/java.h	Wed Jul 21 09:57:21 2010 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 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
@@ -114,13 +114,19 @@
 
 #define GetArch() GetArchPath(CURRENT_DATA_MODEL)
 
-void CreateExecutionEnvironment(int *_argc,
-                                       char ***_argv,
-                                       char jrepath[],
-                                       jint so_jrepath,
-                                       char jvmpath[],
-                                       jint so_jvmpath,
-                                       char **original_argv);
+/*
+ * Different platforms will implement this, here
+ * pargc is a pointer to the original argc,
+ * pargv is a pointer to the original argv,
+ * jrepath is an accessible path to the jre as determined by the call
+ * so_jrepath is the length of the buffer jrepath
+ * jvmpath is an accessible path to the jvm as determined by the call
+ * so_jvmpath is the length of the buffer jvmpath
+ */
+void CreateExecutionEnvironment(int *argc, char ***argv,
+                                char *jrepath, jint so_jrepath,
+                                char *jvmpath, jint so_jvmpath);
+
 /* Reports an error message to stderr or a window as appropriate. */
 void JLI_ReportErrorMessage(const char * message, ...);
 
--- a/jdk/src/share/bin/jli_util.c	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/share/bin/jli_util.c	Wed Jul 21 09:57:21 2010 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 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
@@ -85,23 +85,6 @@
 }
 
 /*
- * Makes a copy of arguments
- */
-char**
-JLI_CopyArgs(int argc, const char **iargv)
-{
-    int i;
-    char** oargv = (char**)JLI_MemAlloc(sizeof(char*)*(argc+1));
-    for (i = 0 ; i < argc+1 ; i++) {
-        oargv[i] = (iargv[i] == NULL) ? NULL : JLI_StringDup(iargv[i]);
-        if (iargv[i] != NULL && JLI_IsTraceLauncher() == JNI_TRUE) {
-            printf("\targv[%d] = '%s'\n",i,iargv[i]);
-        }
-    }
-    return oargv;
-}
-
-/*
  * debug helpers we use
  */
 static jboolean _launcher_debug = JNI_FALSE;
--- a/jdk/src/share/bin/jli_util.h	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/share/bin/jli_util.h	Wed Jul 21 09:57:21 2010 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 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
@@ -33,7 +33,6 @@
 void *JLI_MemRealloc(void *ptr, size_t size);
 char *JLI_StringDup(const char *s1);
 void  JLI_MemFree(void *ptr);
-char **JLI_CopyArgs(int argc, const char **iargv);
 int   JLI_StrCCmp(const char *s1, const char* s2);
 
 
@@ -56,10 +55,12 @@
 #include <io.h>
 #define JLI_StrCaseCmp(p1, p2)          stricmp((p1), (p2))
 #define JLI_StrNCaseCmp(p1, p2, p3)     strnicmp((p1), (p2), (p3))
+#define JLI_Snprintf                    _snprintf
 #else
 #include <unistd.h>
 #define JLI_StrCaseCmp(p1, p2)          strcasecmp((p1), (p2))
 #define JLI_StrNCaseCmp(p1, p2, p3)     strncasecmp((p1), (p2), (p3))
+#define JLI_Snprintf                    snprintf
 #endif /* _WIN32 */
 
 /*
--- a/jdk/src/share/classes/com/sun/beans/finder/InstanceFinder.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/share/classes/com/sun/beans/finder/InstanceFinder.java	Wed Jul 21 09:57:21 2010 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2009, 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
@@ -39,7 +39,7 @@
     private final Class<? extends T> type;
     private final boolean allow;
     private final String suffix;
-    private String[] packages;
+    private volatile String[] packages;
 
     InstanceFinder(Class<? extends T> type, boolean allow, String suffix, String... packages) {
         this.type = type;
@@ -49,9 +49,7 @@
     }
 
     public String[] getPackages() {
-        return (this.packages.length > 0)
-                ? this.packages.clone()
-                : this.packages;
+        return this.packages.clone();
     }
 
     public void setPackages(String... packages) {
--- a/jdk/src/share/classes/com/sun/beans/finder/MethodFinder.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/share/classes/com/sun/beans/finder/MethodFinder.java	Wed Jul 21 09:57:21 2010 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2008, Oracle and/or its affiliates. All rights reserved.
+ * 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
@@ -118,7 +118,7 @@
      * @throws NoSuchMethodException if method is not accessible or is not found
      *                               in specified superclass or interface
      */
-    private static Method findAccessibleMethod(Method method) throws NoSuchMethodException {
+    public static Method findAccessibleMethod(Method method) throws NoSuchMethodException {
         Class<?> type = method.getDeclaringClass();
         if (Modifier.isPublic(type.getModifiers())) {
             return method;
--- a/jdk/src/share/classes/com/sun/beans/finder/PersistenceDelegateFinder.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/share/classes/com/sun/beans/finder/PersistenceDelegateFinder.java	Wed Jul 21 09:57:21 2010 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2009, 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
@@ -47,17 +47,22 @@
     }
 
     public void register(Class<?> type, PersistenceDelegate delegate) {
-        if (delegate != null) {
-            this.registry.put(type, delegate);
-        }
-        else {
-            this.registry.remove(type);
+        synchronized (this.registry) {
+            if (delegate != null) {
+                this.registry.put(type, delegate);
+            }
+            else {
+                this.registry.remove(type);
+            }
         }
     }
 
     @Override
     public PersistenceDelegate find(Class<?> type) {
-        PersistenceDelegate delegate = this.registry.get(type);
+        PersistenceDelegate delegate;
+        synchronized (this.registry) {
+            delegate = this.registry.get(type);
+        }
         return (delegate != null) ? delegate : super.find(type);
     }
 }
--- a/jdk/src/share/classes/com/sun/beans/finder/PropertyEditorFinder.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/share/classes/com/sun/beans/finder/PropertyEditorFinder.java	Wed Jul 21 09:57:21 2010 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2009, 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
@@ -64,12 +64,18 @@
     }
 
     public void register(Class<?> type, Class<?> editor) {
-        this.registry.put(type, editor);
+        synchronized (this.registry) {
+            this.registry.put(type, editor);
+        }
     }
 
     @Override
     public PropertyEditor find(Class<?> type) {
-        PropertyEditor editor = instantiate(this.registry.get(type), null);
+        Class<?> predefined;
+        synchronized (this.registry) {
+            predefined = this.registry.get(type);
+        }
+        PropertyEditor editor = instantiate(predefined, null);
         if (editor == null) {
             editor = super.find(type);
             if ((editor == null) && (null != type.getEnumConstants())) {
--- a/jdk/src/share/classes/com/sun/inputmethods/internal/indicim/DevanagariInputMethodDescriptor.java	Tue Jul 20 16:09:44 2010 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,102 +0,0 @@
-/*
- * Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * (C) Copyright IBM Corp. 2000 - All Rights Reserved
- *
- * The original version of this source code and documentation is
- * copyrighted and owned by IBM. These materials are provided
- * under terms of a License Agreement between IBM and Sun.
- * This technology is protected by multiple US and International
- * patents. This notice and attribution to IBM may not be removed.
- *
- */
-
-package com.sun.inputmethods.internal.indicim;
-
-import java.awt.Image;
-import java.awt.im.spi.InputMethod;
-import java.awt.im.spi.InputMethodDescriptor;
-import java.util.Locale;
-import java.util.MissingResourceException;
-import java.util.ResourceBundle;
-
-public class DevanagariInputMethodDescriptor implements InputMethodDescriptor {
-
-    static final Locale HINDI = new Locale("hi", "IN");
-
-    public DevanagariInputMethodDescriptor() {
-    }
-
-    /**
-     * @see java.awt.im.spi.InputMethodDescriptor#getAvailableLocales
-     */
-    public Locale[] getAvailableLocales() {
-        return new Locale[] { HINDI };
-    }
-
-    /**
-     * @see java.awt.im.spi.InputMethodDescriptor#hasDynamicLocaleList
-     */
-    public boolean hasDynamicLocaleList() {
-        return false;
-    }
-
-    /**
-     * @see java.awt.im.spi.InputMethodDescriptor#getInputMethodDisplayName
-     */
-    public synchronized String getInputMethodDisplayName(Locale inputLocale, Locale displayLanguage) {
-        try {
-            ResourceBundle resources = ResourceBundle.getBundle("com.sun.inputmethods.internal.indicim.resources.DisplayNames", displayLanguage);
-            return resources.getString("DisplayName.Devanagari");
-        } catch (MissingResourceException mre) {
-            return "Devanagari Input Method";
-        }
-    }
-
-    /**
-     * @see java.awt.im.spi.InputMethodDescriptor#getInputMethodIcon
-     */
-    public Image getInputMethodIcon(Locale inputLocale) {
-        return null;
-    }
-
-    /**
-     * @see java.awt.im.spi.InputMethodDescriptor#createInputMethod
-     */
-    public InputMethod createInputMethod() throws Exception {
-        IndicInputMethodImpl impl = new IndicInputMethodImpl(
-            DevanagariTables.keyboardMap,
-            DevanagariTables.joinWithNukta,
-            DevanagariTables.nuktaForm,
-            DevanagariTables.substitutionTable);
-
-        return new IndicInputMethod(HINDI, impl);
-    }
-
-    public String toString() {
-        return getClass().getName();
-    }
-}
--- a/jdk/src/share/classes/com/sun/inputmethods/internal/indicim/DevanagariTables.java	Tue Jul 20 16:09:44 2010 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,255 +0,0 @@
-/*
- * Copyright (c) 2002, 2003, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * (C) Copyright IBM Corp. 2000 - All Rights Reserved
- *
- * The original version of this source code and documentation is
- * copyrighted and owned by IBM. These materials are provided
- * under terms of a License Agreement between IBM and Sun.
- * This technology is protected by multiple US and International
- * patents. This notice and attribution to IBM may not be removed.
- *
- */
-
-package com.sun.inputmethods.internal.indicim;
-
-class DevanagariTables {
-
-    static final char[] keyboardMap = {
-    /* 00 */ '\u0000',
-    /* 01 */ '\u0001',
-    /* 02 */ '\u0002',
-    /* 03 */ '\u0003',
-    /* 04 */ '\u0004',
-    /* 05 */ '\u0005',
-    /* 06 */ '\u0006',
-    /* 07 */ '\u0007',
-    /* 08 */ '\u0008',
-    /* 09 */ '\u0009',
-    /* 0A */ '\012',
-    /* 0B */ '\u000B',
-    /* 0C */ '\u000C',
-    /* 0D */ '\015',
-    /* 0E */ '\u000E',
-    /* 0F */ '\u000F',
-    /* 10 */ '\u0010',
-    /* 11 */ '\u0011',
-    /* 12 */ '\u0012',
-    /* 13 */ '\u0013',
-    /* 14 */ '\u0014',
-    /* 15 */ '\u0015',
-    /* 16 */ '\u0016',
-    /* 17 */ '\u0017',
-    /* 18 */ '\u0018',
-    /* 19 */ '\u0019',
-    /* 1A */ '\u001A',
-    /* 1B */ '\u001B',
-    /* 1C */ '\u001C',
-    /* 1D */ '\u001D',
-    /* 1E */ '\u001E',
-    /* 1F */ '\u001F',
-    /* 20 */ '\u0020',
-    /* 21 */ '\u090D',   // '!'
-    /* 22 */ '\u0920',   // '"'
-    /* 23 */ '\uFF00',   // '#'
-    /* 24 */ '\uFF01',   // '$'
-    /* 25 */ '\uFF02',   // '%'
-    /* 26 */ '\uFF04',   // '&'
-    /* 27 */ '\u091F',   // '''
-    /* 28 */ '\u0028',   // '('
-    /* 29 */ '\u0029',   // ')'
-    /* 2A */ '\uFF05',   // '*'
-    /* 2B */ '\u090B',   // '+'
-    /* 2C */ '\u002C',   // ','
-    /* 2D */ '\u002D',   // '-'
-    /* 2E */ '\u002E',   // '.'
-    /* 2F */ '\u092F',   // '/'
-    /* 30 */ '\u0966',   // '0'
-    /* 31 */ '\u0967',   // '1'
-    /* 32 */ '\u0968',   // '2'
-    /* 33 */ '\u0969',   // '3'
-    /* 34 */ '\u096A',   // '4'
-    /* 35 */ '\u096B',   // '5'
-    /* 36 */ '\u096C',   // '6'
-    /* 37 */ '\u096D',   // '7'
-    /* 38 */ '\u096E',   // '8'
-    /* 39 */ '\u096F',   // '9'
-    /* 3A */ '\u091B',   // ':'
-    /* 3B */ '\u091A',   // ';'
-    /* 3C */ '\u0937',   // '<'
-    /* 3D */ '\u0943',   // '='
-    /* 3E */ '\u0964',   // '>'
-    /* 3F */ '\u095F',   // '?'
-    /* 40 */ '\u0945',   // '@'
-    /* 41 */ '\u0913',   // 'A'
-    /* 42 */ '\u0934',   // 'B'
-    /* 43 */ '\u0923',   // 'C'
-    /* 44 */ '\u0905',   // 'D'
-    /* 45 */ '\u0906',   // 'E'
-    /* 46 */ '\u0907',   // 'F'
-    /* 47 */ '\u0909',   // 'G'
-    /* 48 */ '\u092B',   // 'H'
-    /* 49 */ '\u0918',   // 'I'
-    /* 4A */ '\u0931',   // 'J'
-    /* 4B */ '\u0916',   // 'K'
-    /* 4C */ '\u0925',   // 'L'
-    /* 4D */ '\u0936',   // 'M'
-    /* 4E */ '\u0933',   // 'N'
-    /* 4F */ '\u0927',   // 'O'
-    /* 50 */ '\u091D',   // 'P'
-    /* 51 */ '\u0914',   // 'Q'
-    /* 52 */ '\u0908',   // 'R'
-    /* 53 */ '\u090F',   // 'S'
-    /* 54 */ '\u090A',   // 'T'
-    /* 55 */ '\u0919',   // 'U'
-    /* 56 */ '\u0929',   // 'V'
-    /* 57 */ '\u0910',   // 'W'
-    /* 58 */ '\u0901',   // 'X'
-    /* 59 */ '\u092D',   // 'Y'
-    /* 5A */ '\u090E',   // 'Z'
-    /* 5B */ '\u0921',   // '['
-    /* 5C */ '\u0949',   // '\'
-    /* 5D */ '\u093C',   // ']'
-    /* 5E */ '\uFF03',   // '^'
-    /* 5F */ '\u0903',   // '_'
-    /* 60 */ '\u094A',   // '`'
-    /* 61 */ '\u094B',   // 'a'
-    /* 62 */ '\u0935',   // 'b'
-    /* 63 */ '\u092E',   // 'c'
-    /* 64 */ '\u094D',   // 'd'
-    /* 65 */ '\u093E',   // 'e'
-    /* 66 */ '\u093F',   // 'f'
-    /* 67 */ '\u0941',   // 'g'
-    /* 68 */ '\u092A',   // 'h'
-    /* 69 */ '\u0917',   // 'i'
-    /* 6A */ '\u0930',   // 'j'
-    /* 6B */ '\u0915',   // 'k'
-    /* 6C */ '\u0924',   // 'l'
-    /* 6D */ '\u0938',   // 'm'
-    /* 6E */ '\u0932',   // 'n'
-    /* 6F */ '\u0926',   // 'o'
-    /* 70 */ '\u091C',   // 'p'
-    /* 71 */ '\u094C',   // 'q'
-    /* 72 */ '\u0940',   // 'r'
-    /* 73 */ '\u0947',   // 's'
-    /* 74 */ '\u0942',   // 't'
-    /* 75 */ '\u0939',   // 'u'
-    /* 76 */ '\u0928',   // 'v'
-    /* 77 */ '\u0948',   // 'w'
-    /* 78 */ '\u0902',   // 'x'
-    /* 79 */ '\u092C',   // 'y'
-    /* 7A */ '\u0946',   // 'z'
-    /* 7B */ '\u0922',   // '{'
-    /* 7C */ '\u0911',   // '|'
-    /* 7D */ '\u091E',   // '}'
-    /* 7E */ '\u0912',   // '~'
-    /* 7F */ '\u007F'    //
-};
-
-    // the character substitutions for the meta characters.
-    static final char[] RA_SUB = {'\u094D', '\u0930'};
-    static final char[] RA_SUP = {'\u0930', '\u094D'};
-    static final char[] CONJ_JA_NYA = {'\u091C', '\u094D', '\u091E'};
-    static final char[] CONJ_TA_RA = {'\u0924', '\u094D', '\u0930'};
-    static final char[] CONJ_KA_SSA = {'\u0915', '\u094D', '\u0937'};
-    static final char[] CONJ_SHA_RA = {'\u0936', '\u094D', '\u0930'};
-
-    static final char[][] substitutionTable = {
-        RA_SUB, RA_SUP, CONJ_JA_NYA, CONJ_TA_RA, CONJ_KA_SSA, CONJ_SHA_RA
-    };
-
-    // The following characters followed by Nukta should be replaced
-    // by the corresponding character as defined in ISCII91
-    static final char SIGN_CANDRABINDU      = '\u0901';
-    static final char LETTER_I              = '\u0907';
-    static final char LETTER_II             = '\u0908';
-    static final char LETTER_VOCALIC_R      = '\u090B';
-    static final char LETTER_KA             = '\u0915';
-    static final char LETTER_KHA            = '\u0916';
-    static final char LETTER_GA             = '\u0917';
-    static final char LETTER_JA             = '\u091C';
-    static final char LETTER_DDA            = '\u0921';
-    static final char LETTER_DDHA           = '\u0922';
-    static final char LETTER_PHA            = '\u092B';
-    static final char VOWEL_SIGN_I          = '\u093F';
-    static final char VOWEL_SIGN_II         = '\u0940';
-    static final char VOWEL_SIGN_VOCALIC_R  = '\u0943';
-    static final char DANDA                 = '\u0964';
-
-   // The follwing characters replace the above characters followed by Nukta. These
-   // are defined in one to one correspondence order.
-    static final char SIGN_OM               = '\u0950';
-    static final char LETTER_VOCALIC_L      = '\u090C';
-    static final char LETTER_VOCALIC_LL     = '\u0961';
-    static final char LETTER_VOCALIC_RR     = '\u0960';
-    static final char LETTER_QA             = '\u0958';
-    static final char LETTER_KHHA           = '\u0959';
-    static final char LETTER_GHHA           = '\u095A';
-    static final char LETTER_ZA             = '\u095B';
-    static final char LETTER_DDDHA          = '\u095C';
-    static final char LETTER_RHA            = '\u095D';
-    static final char LETTER_FA             = '\u095E';
-    static final char VOWEL_SIGN_VOCALIC_L  = '\u0962';
-    static final char VOWEL_SIGN_VOCALIC_LL = '\u0963';
-    static final char VOWEL_SIGN_VOCALIC_RR = '\u0944';
-    static final char SIGN_AVAGRAHA         = '\u093D';
-
-    static final char[] joinWithNukta = {
-        SIGN_CANDRABINDU,
-        LETTER_I,
-        LETTER_II,
-        LETTER_VOCALIC_R ,
-        LETTER_KA,
-        LETTER_KHA,
-        LETTER_GA,
-        LETTER_JA,
-        LETTER_DDA,
-        LETTER_DDHA,
-        LETTER_PHA,
-        VOWEL_SIGN_I,
-        VOWEL_SIGN_II,
-        VOWEL_SIGN_VOCALIC_R,
-        DANDA
-    };
-
-    static final char[] nuktaForm = {
-        SIGN_OM,
-        LETTER_VOCALIC_L,
-        LETTER_VOCALIC_LL,
-        LETTER_VOCALIC_RR,
-        LETTER_QA,
-        LETTER_KHHA,
-        LETTER_GHHA,
-        LETTER_ZA,
-        LETTER_DDDHA,
-        LETTER_RHA,
-        LETTER_FA,
-        VOWEL_SIGN_VOCALIC_L,
-        VOWEL_SIGN_VOCALIC_LL,
-        VOWEL_SIGN_VOCALIC_RR,
-        SIGN_AVAGRAHA
-    };
-}
--- a/jdk/src/share/classes/com/sun/inputmethods/internal/indicim/IndicInputMethod.java	Tue Jul 20 16:09:44 2010 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,436 +0,0 @@
-/*
- * Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * (C) Copyright IBM Corp. 2000 - All Rights Reserved
- *
- * The original version of this source code and documentation is
- * copyrighted and owned by IBM. These materials are provided
- * under terms of a License Agreement between IBM and Sun.
- * This technology is protected by multiple US and International
- * patents. This notice and attribution to IBM may not be removed.
- *
- */
-
-package com.sun.inputmethods.internal.indicim;
-
-import java.awt.im.spi.InputMethod;
-import java.awt.im.spi.InputMethodContext;
-
-import java.awt.AWTEvent;
-import java.awt.Rectangle;
-
-import java.awt.event.KeyEvent;
-import java.awt.event.MouseEvent;
-
-import java.lang.Character.Subset;
-
-import java.util.Locale;
-
-class IndicInputMethod implements InputMethod {
-
-    private IndicInputMethodImpl impl;
-    private Locale locale;
-
-    IndicInputMethod(Locale theLocale, IndicInputMethodImpl theImplementation) {
-        locale = theLocale;
-        impl = theImplementation;
-    }
-
-    /**
-     * Sets the input method context, which is used to dispatch input method
-     * events to the client component and to request information from
-     * the client component.
-     * <p>
-     * This method is called once immediately after instantiating this input
-     * method.
-     *
-     * @param context the input method context for this input method
-     * @exception NullPointerException if <code>context</code> is null
-     */
-    public void setInputMethodContext(InputMethodContext context) {
-
-        impl.setInputMethodContext(context);
-    }
-
-    /**
-     * Attempts to set the input locale. If the input method supports the
-     * desired locale, it changes its behavior to support input for the locale
-     * and returns true.
-     * Otherwise, it returns false and does not change its behavior.
-     * <p>
-     * This method is called
-     * <ul>
-     * <li>by {@link java.awt.im.InputContext#selectInputMethod InputContext.selectInputMethod},
-     * <li>when switching to this input method through the user interface if the user
-     *     specified a locale or if the previously selected input method's
-     *     {@link java.awt.im.spi.InputMethod#getLocale getLocale} method
-     *     returns a non-null value.
-     * </ul>
-     *
-     * @param locale locale to input
-     * @return whether the specified locale is supported
-     * @exception NullPointerException if <code>locale</code> is null
-     */
-    public boolean setLocale(Locale locale) {
-
-        if (locale.getLanguage().equals(this.locale.getLanguage())) {
-            //System.out.println("returning true for locale " + locale);
-            return true;
-        }
-        else {
-            //System.out.println("returning false for locale " + locale);
-            return false;
-        }
-    }
-
-    /**
-     * Returns the current input locale. Might return null in exceptional cases.
-     * <p>
-     * This method is called
-     * <ul>
-     * <li>by {@link java.awt.im.InputContext#getLocale InputContext.getLocale} and
-     * <li>when switching from this input method to a different one through the
-     *     user interface.
-     * </ul>
-     *
-     * @return the current input locale, or null
-     */
-    public Locale getLocale() {
-
-        return locale;
-    }
-
-    /**
-     * Sets the subsets of the Unicode character set that this input method
-     * is allowed to input. Null may be passed in to indicate that all
-     * characters are allowed.
-     * <p>
-     * This method is called
-     * <ul>
-     * <li>immediately after instantiating this input method,
-     * <li>when switching to this input method from a different one, and
-     * <li>by {@link java.awt.im.InputContext#setCharacterSubsets InputContext.setCharacterSubsets}.
-     * </ul>
-     *
-     * @param subsets the subsets of the Unicode character set from which
-     * characters may be input
-     */
-    public void setCharacterSubsets(Subset[] subsets) {
-    }
-
-    /**
-     * Enables or disables this input method for composition,
-     * depending on the value of the parameter <code>enable</code>.
-     * <p>
-     * An input method that is enabled for composition interprets incoming
-     * events for both composition and control purposes, while a
-     * disabled input method does not interpret events for composition.
-     * Note however that events are passed on to the input method regardless
-     * whether it is enabled or not, and that an input method that is disabled
-     * for composition may still interpret events for control purposes,
-     * including to enable or disable itself for composition.
-     * <p>
-     * This method is called
-     * <ul>
-     * <li>by {@link java.awt.im.InputContext#setCompositionEnabled InputContext.setCompositionEnabled},
-     * <li>when switching to this input method from a different one using the
-     *     user interface or
-     *     {@link java.awt.im.InputContext#selectInputMethod InputContext.selectInputMethod},
-     *     if the previously selected input method's
-     *     {@link java.awt.im.spi.InputMethod#isCompositionEnabled isCompositionEnabled}
-     *     method returns without throwing an exception.
-     * </ul>
-     *
-     * @param enable whether to enable the input method for composition
-     * @throws UnsupportedOperationException if this input method does not
-     * support the enabling/disabling operation
-     * @see #isCompositionEnabled
-     */
-    public void setCompositionEnabled(boolean enable) {
-
-        throw new UnsupportedOperationException();
-    }
-
-    /**
-     * Determines whether this input method is enabled.
-     * An input method that is enabled for composition interprets incoming
-     * events for both composition and control purposes, while a
-     * disabled input method does not interpret events for composition.
-     * <p>
-     * This method is called
-     * <ul>
-     * <li>by {@link java.awt.im.InputContext#isCompositionEnabled InputContext.isCompositionEnabled} and
-     * <li>when switching from this input method to a different one using the
-     *     user interface or
-     *     {@link java.awt.im.InputContext#selectInputMethod InputContext.selectInputMethod}.
-     * </ul>
-     *
-     * @return <code>true</code> if this input method is enabled for
-     * composition; <code>false</code> otherwise.
-     * @throws UnsupportedOperationException if this input method does not
-     * support checking whether it is enabled for composition
-     * @see #setCompositionEnabled
-     */
-    public boolean isCompositionEnabled() {
-
-        return true;
-    }
-
-    /**
-     * Starts the reconversion operation. The input method obtains the
-     * text to be reconverted from the current client component using the
-     * {@link java.awt.im.InputMethodRequests#getSelectedText InputMethodRequests.getSelectedText}
-     * method. It can use other <code>InputMethodRequests</code>
-     * methods to request additional information required for the
-     * reconversion operation. The composed and committed text
-     * produced by the operation is sent to the client component as a
-     * sequence of <code>InputMethodEvent</code>s. If the given text
-     * cannot be reconverted, the same text should be sent to the
-     * client component as committed text.
-     * <p>
-     * This method is called by
-     * {@link java.awt.im.InputContext#reconvert() InputContext.reconvert}.
-     *
-     * @throws UnsupportedOperationException if the input method does not
-     * support the reconversion operation.
-     */
-    public void reconvert() {
-
-        throw new UnsupportedOperationException("This input method does not reconvert.");
-    }
-
-    /**
-     * Dispatches the event to the input method. If input method support is
-     * enabled for the focussed component, incoming events of certain types
-     * are dispatched to the current input method for this component before
-     * they are dispatched to the component's methods or event listeners.
-     * The input method decides whether it needs to handle the event. If it
-     * does, it also calls the event's <code>consume</code> method; this
-     * causes the event to not get dispatched to the component's event
-     * processing methods or event listeners.
-     * <p>
-     * Events are dispatched if they are instances of InputEvent or its
-     * subclasses.
-     * This includes instances of the AWT classes KeyEvent and MouseEvent.
-     * <p>
-     * This method is called by {@link java.awt.im.InputContext#dispatchEvent InputContext.dispatchEvent}.
-     *
-     * @param event the event being dispatched to the input method
-     * @exception NullPointerException if <code>event</code> is null
-     */
-    public void dispatchEvent(AWTEvent event) {
-
-        if (event instanceof KeyEvent) {
-
-            KeyEvent keyEvent = (KeyEvent) event;
-            if (event.getID() == KeyEvent.KEY_TYPED) {
-                impl.handleKeyTyped(keyEvent);
-            }
-            //System.out.println("handled event " + event);
-        }
-        else {
-            //System.out.println("did not handle event " + event);
-        }
-    }
-
-    /**
-     * Notifies this input method of changes in the client window
-     * location or state. This method is called while this input
-     * method is the current input method of its input context and
-     * notifications for it are enabled (see {@link
-     * InputMethodContext#enableClientWindowNotification
-     * InputMethodContext.enableClientWindowNotification}). Calls
-     * to this method are temporarily suspended if the input context's
-     * {@link java.awt.im.InputContext#removeNotify removeNotify}
-     * method is called, and resume when the input method is activated
-     * for a new client component. It is called in the following
-     * situations:
-     * <ul>
-     * <li>
-     * when the window containing the current client component changes
-     * in location, size, visibility, iconification state, or when the
-     * window is closed.</li>
-     * <li>
-     * from <code> enableClientWindowNotification(inputMethod,
-     * true)</code> if the current client component exists,</li>
-     * <li>
-     * when activating the input method for the first time after it
-     * called
-     * <code>enableClientWindowNotification(inputMethod,
-     * true)</code> if during the call no current client component was
-     * available,</li>
-     * <li>
-     * when activating the input method for a new client component
-     * after the input context's removeNotify method has been
-     * called.</li>
-     * </ul>
-     * @param bounds client window's {@link
-     * java.awt.Component#getBounds bounds} on the screen; or null if
-     * the client window is iconified or invisible
-     */
-    public void notifyClientWindowChange(Rectangle bounds) {
-    }
-
-    /**
-     * Activates the input method for immediate input processing.
-     * <p>
-     * If an input method provides its own windows, it should make sure
-     * at this point that all necessary windows are open and visible.
-     * <p>
-     * This method is called
-     * <ul>
-     * <li>by {@link java.awt.im.InputContext#dispatchEvent InputContext.dispatchEvent}
-     *     when a client component receives a FOCUS_GAINED event,
-     * <li>when switching to this input method from a different one using the
-     *     user interface or
-     *     {@link java.awt.im.InputContext#selectInputMethod InputContext.selectInputMethod}.
-     * </ul>
-     * The method is only called when the input method is inactive.
-     * A newly instantiated input method is assumed to be inactive.
-     */
-    public void activate() {
-        //System.out.println("activated");
-    }
-
-    /**
-     * Deactivates the input method.
-     * The isTemporary argument has the same meaning as in
-     * {@link java.awt.event.FocusEvent#isTemporary FocusEvent.isTemporary}.
-     * <p>
-     * If an input method provides its own windows, only windows that relate
-     * to the current composition (such as a lookup choice window) should be
-     * closed at this point.
-     * It is possible that the input method will be immediately activated again
-     * for a different client component, and closing and reopening more
-     * persistent windows (such as a control panel) would create unnecessary
-     * screen flicker.
-     * Before an instance of a different input method class is activated,
-     * {@link #hideWindows} is called on the current input method.
-     * <p>
-     * This method is called
-     * <ul>
-     * <li>by {@link java.awt.im.InputContext#dispatchEvent InputContext.dispatchEvent}
-     *     when a client component receives a FOCUS_LOST event,
-     * <li>when switching from this input method to a different one using the
-     *     user interface or
-     *     {@link java.awt.im.InputContext#selectInputMethod InputContext.selectInputMethod},
-     * <li>before {@link #removeNotify removeNotify} if the current client component is
-     *     removed.
-     * </ul>
-     * The method is only called when the input method is active.
-     *
-     * @param isTemporary whether the focus change is temporary
-     */
-    public void deactivate(boolean isTemporary) {
-        //System.out.println("deactivated");
-    }
-
-    /**
-     * Closes or hides all windows opened by this input method instance or
-     * its class.
-     * <p>
-     * This method is called
-     * <ul>
-     * <li>before calling {@link #activate activate} on an instance of a different input
-     *     method class,
-     * <li>before calling {@link #dispose dispose} on this input method.
-     * </ul>
-     * The method is only called when the input method is inactive.
-     */
-    public void hideWindows() {
-    }
-
-    /**
-     * Notifies the input method that a client component has been
-     * removed from its containment hierarchy, or that input method
-     * support has been disabled for the component.
-     * <p>
-     * This method is called by {@link java.awt.im.InputContext#removeNotify InputContext.removeNotify}.
-     * <p>
-     * The method is only called when the input method is inactive.
-     */
-    public void removeNotify() {
-    }
-
-    /**
-     * Ends any input composition that may currently be going on in this
-     * context. Depending on the platform and possibly user preferences,
-     * this may commit or delete uncommitted text. Any changes to the text
-     * are communicated to the active component using an input method event.
-     *
-     * <p>
-     * A text editing component may call this in a variety of situations,
-     * for example, when the user moves the insertion point within the text
-     * (but outside the composed text), or when the component's text is
-     * saved to a file or copied to the clipboard.
-     * <p>
-     * This method is called
-     * <ul>
-     * <li>by {@link java.awt.im.InputContext#endComposition InputContext.endComposition},
-     * <li>by {@link java.awt.im.InputContext#dispatchEvent InputContext.dispatchEvent}
-     *     when switching to a different client component
-     * <li>when switching from this input method to a different one using the
-     *     user interface or
-     *     {@link java.awt.im.InputContext#selectInputMethod InputContext.selectInputMethod}.
-     * </ul>
-     */
-    public void endComposition() {
-
-        impl.endComposition();
-    }
-
-    /**
-     * Disposes of the input method and releases the resources used by it.
-     * In particular, the input method should dispose windows and close files that are no
-     * longer needed.
-     * <p>
-     * This method is called by {@link java.awt.im.InputContext#dispose InputContext.dispose}.
-     * <p>
-     * The method is only called when the input method is inactive.
-     * No method of this interface is called on this instance after dispose.
-     */
-    public void dispose() {
-    }
-
-    /**
-     * Returns a control object from this input method, or null. A
-     * control object provides methods that control the behavior of the
-     * input method or obtain information from the input method. The type
-     * of the object is an input method specific class. Clients have to
-     * compare the result against known input method control object
-     * classes and cast to the appropriate class to invoke the methods
-     * provided.
-     * <p>
-     * This method is called by
-     * {@link java.awt.im.InputContext#getInputMethodControlObject InputContext.getInputMethodControlObject}.
-     *
-     * @return a control object from this input method, or null
-     */
-    public Object getControlObject() {
-
-        return null;
-    }
-}
--- a/jdk/src/share/classes/com/sun/inputmethods/internal/indicim/IndicInputMethodImpl.java	Tue Jul 20 16:09:44 2010 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,475 +0,0 @@
-/*
- * Copyright (c) 2002, 2004, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * (C) Copyright IBM Corp. 2000 - All Rights Reserved
- *
- * The original version of this source code and documentation is
- * copyrighted and owned by IBM. These materials are provided
- * under terms of a License Agreement between IBM and Sun.
- * This technology is protected by multiple US and International
- * patents. This notice and attribution to IBM may not be removed.
- *
- */
-
-package com.sun.inputmethods.internal.indicim;
-
-import java.awt.im.spi.InputMethodContext;
-
-import java.awt.event.KeyEvent;
-import java.awt.event.InputMethodEvent;
-import java.awt.font.TextAttribute;
-import java.awt.font.TextHitInfo;
-
-import java.text.AttributedCharacterIterator;
-
-import java.util.Hashtable;
-import java.util.HashSet;
-import java.util.Map;
-import java.util.Set;
-
-class IndicInputMethodImpl {
-
-    protected char[] KBD_MAP;
-
-    private static final char SUBSTITUTION_BASE = '\uff00';
-
-    // Indexed by map value - SUBSTITUTION_BASE
-    protected char[][] SUBSTITUTION_TABLE;
-
-    // Invalid character.
-    private static final char INVALID_CHAR              = '\uffff';
-
-    // Unmapped versions of some interesting characters.
-    private static final char KEY_SIGN_VIRAMA           = '\u0064'; // or just 'd'??
-    private static final char KEY_SIGN_NUKTA            = '\u005d';  // or just ']'??
-
-    // Two succeeding viramas are replaced by one virama and one ZWNJ.
-    // Viram followed by Nukta is replaced by one VIRAMA and one ZWJ
-    private static final char ZWJ                       = '\u200d';
-    private static final char ZWNJ                      = '\u200c';
-
-    // Backspace
-    private static final char BACKSPACE                 = '\u0008';
-
-    // Sorted list of characters which can be followed by Nukta
-    protected char[] JOIN_WITH_NUKTA;
-
-    // Nukta form of the above characters
-    protected char[] NUKTA_FORM;
-
-    private int log2;
-    private int power;
-    private int extra;
-
-    // cached TextHitInfo. Only one type of TextHitInfo is required.
-    private static final TextHitInfo ZERO_TRAILING_HIT_INFO = TextHitInfo.trailing(0);
-
-    /**
-     * Returns the index of the given character in the JOIN_WITH_NUKTA array.
-     * If character is not found, -1 is returned.
-     */
-    private int nuktaIndex(char ch) {
-
-        if (JOIN_WITH_NUKTA == null) {
-            return -1;
-        }
-
-        int probe = power;
-        int index = 0;
-
-        if (JOIN_WITH_NUKTA[extra] <= ch) {
-            index = extra;
-        }
-
-        while (probe > (1 << 0)) {
-            probe >>= 1;
-
-            if (JOIN_WITH_NUKTA[index + probe] <= ch) {
-                index += probe;
-            }
-        }
-
-        if (JOIN_WITH_NUKTA[index] != ch) {
-            index = -1;
-        }
-
-        return index;
-    }
-
-    /**
-     * Returns the equivalent character for hindi locale.
-     * @param originalChar The original character.
-     */
-    private char getMappedChar( char originalChar )
-    {
-        if (originalChar <= KBD_MAP.length) {
-            return KBD_MAP[originalChar];
-        }
-
-        return originalChar;
-    }//getMappedChar()
-
-    // Array used to hold the text to be sent.
-    // If the last character was not committed it is stored in text[0].
-    // The variable totalChars give an indication of whether the last
-    // character was committed or not. If at any time ( but not within a
-    // a call to dispatchEvent ) totalChars is not equal to 0 ( it can
-    // only be 1 otherwise ) the last character was not committed.
-    private char [] text = new char[4];
-
-    // this is always 0 before and after call to dispatchEvent. This character assumes
-    // significance only within a call to dispatchEvent.
-    private int committedChars = 0;// number of committed characters
-
-    // the total valid characters in variable text currently.
-    private int totalChars = 0;//number of total characters ( committed + composed )
-
-    private boolean lastCharWasVirama = false;
-
-    private InputMethodContext context;
-
-    //
-    // Finds the high bit by binary searching
-    // through the bits in n.
-    //
-    private static byte highBit(int n)
-    {
-        if (n <= 0) {
-            return -32;
-        }
-
-        byte bit = 0;
-
-        if (n >= 1 << 16) {
-            n >>= 16;
-            bit += 16;
-        }
-
-        if (n >= 1 << 8) {
-            n >>= 8;
-            bit += 8;
-        }
-
-        if (n >= 1 << 4) {
-            n >>= 4;
-            bit += 4;
-        }
-
-        if (n >= 1 << 2) {
-            n >>= 2;
-            bit += 2;
-        }
-
-        if (n >= 1 << 1) {
-            n >>= 1;
-            bit += 1;
-        }
-
-        return bit;
-    }
-
-    IndicInputMethodImpl(char[] keyboardMap, char[] joinWithNukta, char[] nuktaForm,
-                         char[][] substitutionTable) {
-        KBD_MAP = keyboardMap;
-        JOIN_WITH_NUKTA = joinWithNukta;
-        NUKTA_FORM = nuktaForm;
-        SUBSTITUTION_TABLE = substitutionTable;
-
-        if (JOIN_WITH_NUKTA != null) {
-            int log2 = highBit(JOIN_WITH_NUKTA.length);
-
-            power = 1 << log2;
-            extra = JOIN_WITH_NUKTA.length - power;
-        } else {
-            power = extra = 0;
-        }
-
-    }
-
-    void setInputMethodContext(InputMethodContext context) {
-
-        this.context = context;
-    }
-
-    void handleKeyTyped(KeyEvent kevent) {
-
-        char keyChar = kevent.getKeyChar();
-        char currentChar = getMappedChar(keyChar);
-
-        // The Explicit and Soft Halanta case.
-        if ( lastCharWasVirama ) {
-            switch (keyChar) {
-            case KEY_SIGN_NUKTA:
-                currentChar = ZWJ;
-                break;
-            case KEY_SIGN_VIRAMA:
-                currentChar = ZWNJ;
-                break;
-            default:
-            }//endSwitch
-        }//endif
-
-        if (currentChar == INVALID_CHAR) {
-            kevent.consume();
-            return;
-        }
-
-        if (currentChar == BACKSPACE) {
-            lastCharWasVirama = false;
-
-            if (totalChars > 0) {
-                totalChars = committedChars = 0;
-            } else {
-                return;
-            }
-        }
-        else if (keyChar == KEY_SIGN_NUKTA) {
-            int nuktaIndex = nuktaIndex(text[0]);
-
-            if (nuktaIndex != -1) {
-                text[0] = NUKTA_FORM[nuktaIndex];
-            } else {
-                // the last character was committed, commit just Nukta.
-                // Note : the lastChar must have been committed if it is not one of
-                // the characters which combine with nukta.
-                // the state must be totalChars = committedChars = 0;
-                text[totalChars++] = currentChar;
-            }
-
-            committedChars += 1;
-        }
-        else {
-            int nuktaIndex = nuktaIndex(currentChar);
-
-            if (nuktaIndex != -1) {
-                // Commit everything but currentChar
-                text[totalChars++] = currentChar;
-                committedChars = totalChars-1;
-            } else {
-                if (currentChar >= SUBSTITUTION_BASE) {
-                    char[] sub = SUBSTITUTION_TABLE[currentChar - SUBSTITUTION_BASE];
-
-                    System.arraycopy(sub, 0, text, totalChars, sub.length);
-                    totalChars += sub.length;
-                } else {
-                    text[totalChars++] = currentChar;
-                }
-
-                committedChars = totalChars;
-            }
-        }
-
-        ACIText aText = new ACIText( text, 0, totalChars, committedChars );
-        int composedCharLength = totalChars - committedChars;
-        TextHitInfo caret=null,visiblePosition=null;
-        switch( composedCharLength ) {
-            case 0:
-                break;
-            case 1:
-                visiblePosition = caret = ZERO_TRAILING_HIT_INFO;
-                break;
-            default:
-                assert false : "The code should not reach here. There is no case where there can be more than one character pending.";
-        }
-
-        context.dispatchInputMethodEvent(InputMethodEvent.INPUT_METHOD_TEXT_CHANGED,
-                                         aText,
-                                         committedChars,
-                                         caret,
-                                         visiblePosition);
-
-        if (totalChars == 0) {
-            text[0] = INVALID_CHAR;
-        } else {
-            text[0] = text[totalChars - 1];// make text[0] hold the last character
-        }
-
-        lastCharWasVirama =  keyChar == KEY_SIGN_VIRAMA && !lastCharWasVirama;
-
-        totalChars -= committedChars;
-        committedChars = 0;
-        // state now text[0] = last character
-        // totalChars = ( last character committed )? 0 : 1;
-        // committedChars = 0;
-
-        kevent.consume();// prevent client from getting this event.
-    }//dispatchEvent()
-
-    void endComposition() {
-        if( totalChars != 0 ) {// if some character is not committed.
-            ACIText aText = new ACIText( text, 0, totalChars, totalChars );
-            context.dispatchInputMethodEvent( InputMethodEvent.INPUT_METHOD_TEXT_CHANGED,
-                                aText, totalChars, null, null );
-            totalChars = committedChars = 0;
-            text[0] = INVALID_CHAR;
-            lastCharWasVirama = false;
-        }//end if
-    }//endComposition()
-
-    // custom AttributedCharacterIterator -- much lightweight since currently there is no
-    // attribute defined on the text being generated by the input method.
-    private class ACIText implements AttributedCharacterIterator {
-        private char [] text = null;
-        private int committed = 0;
-        private int index = 0;
-
-        ACIText( char [] chArray, int offset, int length, int committed ) {
-            this.text = new char[length];
-            this.committed = committed;
-            System.arraycopy( chArray, offset, text, 0, length );
-        }//c'tor
-
-        // CharacterIterator methods.
-        public char first() {
-            return _setIndex( 0 );
-        }
-
-        public char last() {
-            if( text.length == 0 ) {
-                return _setIndex( text.length );
-            }
-            return _setIndex( text.length - 1 );
-        }
-
-        public char current() {
-            if( index == text.length )
-                return DONE;
-            return text[index];
-        }
-
-        public char next() {
-            if( index == text.length ) {
-                return DONE;
-            }
-            return _setIndex( index + 1 );
-        }
-
-        public char previous() {
-            if( index == 0 )
-                return DONE;
-            return _setIndex( index - 1 );
-        }
-
-        public char setIndex(int position) {
-            if( position < 0 || position > text.length ) {
-                throw new IllegalArgumentException();
-            }
-            return _setIndex( position );
-        }
-
-        public int getBeginIndex() {
-            return 0;
-        }
-
-        public int getEndIndex() {
-            return text.length;
-        }
-
-        public int getIndex() {
-            return index;
-        }
-
-        public Object clone() {
-            try {
-                ACIText clone = (ACIText) super.clone();
-                return clone;
-            } catch (CloneNotSupportedException e) {
-                throw new InternalError();
-            }
-        }
-
-
-        // AttributedCharacterIterator methods.
-        public int getRunStart() {
-            return index >= committed ? committed : 0;
-        }
-
-        public int getRunStart(AttributedCharacterIterator.Attribute attribute) {
-            return (index >= committed &&
-                attribute == TextAttribute.INPUT_METHOD_UNDERLINE) ? committed : 0;
-        }
-
-        public int getRunStart(Set<? extends Attribute> attributes) {
-            return (index >= committed &&
-                    attributes.contains(TextAttribute.INPUT_METHOD_UNDERLINE)) ? committed : 0;
-        }
-
-        public int getRunLimit() {
-            return index < committed ? committed : text.length;
-        }
-
-        public int getRunLimit(AttributedCharacterIterator.Attribute attribute) {
-            return (index < committed &&
-                    attribute == TextAttribute.INPUT_METHOD_UNDERLINE) ? committed : text.length;
-        }
-
-        public int getRunLimit(Set<? extends Attribute> attributes) {
-            return (index < committed &&
-                    attributes.contains(TextAttribute.INPUT_METHOD_UNDERLINE)) ? committed : text.length;
-        }
-
-        public Map getAttributes() {
-            Hashtable result = new Hashtable();
-            if (index >= committed && committed < text.length) {
-                result.put(TextAttribute.INPUT_METHOD_UNDERLINE,
-                           TextAttribute.UNDERLINE_LOW_ONE_PIXEL);
-            }
-            return result;
-        }
-
-        public Object getAttribute(AttributedCharacterIterator.Attribute attribute) {
-            if (index >= committed &&
-                committed < text.length &&
-                attribute == TextAttribute.INPUT_METHOD_UNDERLINE) {
-
-                return TextAttribute.UNDERLINE_LOW_ONE_PIXEL;
-            }
-            return null;
-        }
-
-        public Set getAllAttributeKeys() {
-            HashSet result = new HashSet();
-            if (committed < text.length) {
-                result.add(TextAttribute.INPUT_METHOD_UNDERLINE);
-            }
-            return result;
-        }
-
-        // private methods
-
-        /**
-         * This is always called with valid i ( 0 < i <= text.length )
-         */
-        private char _setIndex( int i ) {
-            index = i;
-            if( i == text.length ) {
-                return DONE;
-            }
-            return text[i];
-        }//_setIndex()
-
-    }//end of inner class
-}
--- a/jdk/src/share/classes/com/sun/inputmethods/internal/indicim/java.awt.im.spi.InputMethodDescriptor	Tue Jul 20 16:09:44 2010 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1 +0,0 @@
-com.sun.inputmethods.internal.indicim.DevanagariInputMethodDescriptor
--- a/jdk/src/share/classes/com/sun/inputmethods/internal/indicim/resources/DisplayNames.properties	Tue Jul 20 16:09:44 2010 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,6 +0,0 @@
-#
-# Default Input method display names for Indic input methods
-#
-
-DisplayName.Devanagari  = Devanagari Input Method
-
--- a/jdk/src/share/classes/com/sun/inputmethods/internal/indicim/resources/DisplayNames_de.properties	Tue Jul 20 16:09:44 2010 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,5 +0,0 @@
-#
-# Default Input method display names for Indic input methods
-#
-
-DisplayName.Devanagari  = Devanagari Input Method
--- a/jdk/src/share/classes/com/sun/inputmethods/internal/indicim/resources/DisplayNames_es.properties	Tue Jul 20 16:09:44 2010 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,5 +0,0 @@
-#
-# Default Input method display names for Indic input methods
-#
-
-DisplayName.Devanagari  = Devanagari Input Method
--- a/jdk/src/share/classes/com/sun/inputmethods/internal/indicim/resources/DisplayNames_fr.properties	Tue Jul 20 16:09:44 2010 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,5 +0,0 @@
-#
-# Default Input method display names for Indic input methods
-#
-
-DisplayName.Devanagari  = Devanagari Input Method
--- a/jdk/src/share/classes/com/sun/inputmethods/internal/indicim/resources/DisplayNames_it.properties	Tue Jul 20 16:09:44 2010 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,5 +0,0 @@
-#
-# Default Input method display names for Indic input methods
-#
-
-DisplayName.Devanagari  = Devanagari Input Method
--- a/jdk/src/share/classes/com/sun/inputmethods/internal/indicim/resources/DisplayNames_ja.properties	Tue Jul 20 16:09:44 2010 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,5 +0,0 @@
-#
-# Default Input method display names for Indic input methods
-#
-
-DisplayName.Devanagari  = \u30c7\u30fc\u30f4\u30a1\u30ca\u30fc\u30ac\u30ea\u30fc\u30a4\u30f3\u30d7\u30c3\u30c8\u30e1\u30bd\u30c3\u30c9
--- a/jdk/src/share/classes/com/sun/inputmethods/internal/indicim/resources/DisplayNames_ko.properties	Tue Jul 20 16:09:44 2010 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,5 +0,0 @@
-#
-# Default Input method display names for Indic input methods
-#
-
-DisplayName.Devanagari  = Devanagari \uc785\ub825 \uba54\uc18c\ub4dc
--- a/jdk/src/share/classes/com/sun/inputmethods/internal/indicim/resources/DisplayNames_sv.properties	Tue Jul 20 16:09:44 2010 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,5 +0,0 @@
-#
-# Default Input method display names for Indic input methods
-#
-
-DisplayName.Devanagari  = Devanagari Input Method
--- a/jdk/src/share/classes/com/sun/inputmethods/internal/indicim/resources/DisplayNames_zh_CN.properties	Tue Jul 20 16:09:44 2010 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,5 +0,0 @@
-#
-# Default Input method display names for Indic input methods
-#
-
-DisplayName.Devanagari  = Devanagari \u8f93\u5165\u6cd5
--- a/jdk/src/share/classes/com/sun/inputmethods/internal/indicim/resources/DisplayNames_zh_TW.properties	Tue Jul 20 16:09:44 2010 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,5 +0,0 @@
-#
-# Default Input method display names for Indic input methods
-#
-
-DisplayName.Devanagari  = Devanagari \u8f38\u5165\u6cd5
--- a/jdk/src/share/classes/com/sun/inputmethods/internal/thaiim/ThaiInputMethod.java	Tue Jul 20 16:09:44 2010 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,437 +0,0 @@
-/*
- * Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- *
- * (C) Copyright IBM Corp. 2000 - All Rights Reserved
- *
- * The original version of this source code and documentation is
- * copyrighted and owned by IBM. These materials are provided
- * under terms of a License Agreement between IBM and Sun.
- * This technology is protected by multiple US and International
- * patents. This notice and attribution to IBM may not be removed.
- *
- */
-
-package com.sun.inputmethods.internal.thaiim;
-
-import java.awt.im.spi.InputMethod;
-import java.awt.im.spi.InputMethodContext;
-
-import java.awt.AWTEvent;
-import java.awt.Rectangle;
-
-import java.awt.event.KeyEvent;
-import java.awt.event.MouseEvent;
-
-import java.lang.Character.Subset;
-
-import java.util.Locale;
-
-class ThaiInputMethod implements InputMethod {
-
-    private ThaiInputMethodImpl impl;
-    private Locale locale;
-
-    ThaiInputMethod(Locale theLocale, ThaiInputMethodImpl theImplementation) {
-        locale = theLocale;
-        impl = theImplementation;
-    }
-
-    /**
-     * Sets the input method context, which is used to dispatch input method
-     * events to the client component and to request information from
-     * the client component.
-     * <p>
-     * This method is called once immediately after instantiating this input
-     * method.
-     *
-     * @param context the input method context for this input method
-     * @exception NullPointerException if <code>context</code> is null
-     */
-    public void setInputMethodContext(InputMethodContext context) {
-
-        impl.setInputMethodContext(context);
-    }
-
-    /**
-     * Attempts to set the input locale. If the input method supports the
-     * desired locale, it changes its behavior to support input for the locale
-     * and returns true.
-     * Otherwise, it returns false and does not change its behavior.
-     * <p>
-     * This method is called
-     * <ul>
-     * <li>by {@link java.awt.im.InputContext#selectInputMethod InputContext.selectInputMethod},
-     * <li>when switching to this input method through the user interface if the user
-     *     specified a locale or if the previously selected input method's
-     *     {@link java.awt.im.spi.InputMethod#getLocale getLocale} method
-     *     returns a non-null value.
-     * </ul>
-     *
-     * @param locale locale to input
-     * @return whether the specified locale is supported
-     * @exception NullPointerException if <code>locale</code> is null
-     */
-    public boolean setLocale(Locale locale) {
-
-        if (locale.getLanguage().equals(this.locale.getLanguage())) {
-            //System.out.println("returning true for locale " + locale);
-            return true;
-        }
-        else {
-            //System.out.println("returning false for locale " + locale);
-            return false;
-        }
-    }
-
-    /**
-     * Returns the current input locale. Might return null in exceptional cases.
-     * <p>
-     * This method is called
-     * <ul>
-     * <li>by {@link java.awt.im.InputContext#getLocale InputContext.getLocale} and
-     * <li>when switching from this input method to a different one through the
-     *     user interface.
-     * </ul>
-     *
-     * @return the current input locale, or null
-     */
-    public Locale getLocale() {
-
-        return locale;
-    }
-
-    /**
-     * Sets the subsets of the Unicode character set that this input method
-     * is allowed to input. Null may be passed in to indicate that all
-     * characters are allowed.
-     * <p>
-     * This method is called
-     * <ul>
-     * <li>immediately after instantiating this input method,
-     * <li>when switching to this input method from a different one, and
-     * <li>by {@link java.awt.im.InputContext#setCharacterSubsets InputContext.setCharacterSubsets}.
-     * </ul>
-     *
-     * @param subsets the subsets of the Unicode character set from which
-     * characters may be input
-     */
-    public void setCharacterSubsets(Subset[] subsets) {
-    }
-
-    /**
-     * Enables or disables this input method for composition,
-     * depending on the value of the parameter <code>enable</code>.
-     * <p>
-     * An input method that is enabled for composition interprets incoming
-     * events for both composition and control purposes, while a
-     * disabled input method does not interpret events for composition.
-     * Note however that events are passed on to the input method regardless
-     * whether it is enabled or not, and that an input method that is disabled
-     * for composition may still interpret events for control purposes,
-     * including to enable or disable itself for composition.
-     * <p>
-     * This method is called
-     * <ul>
-     * <li>by {@link java.awt.im.InputContext#setCompositionEnabled InputContext.setCompositionEnabled},
-     * <li>when switching to this input method from a different one using the
-     *     user interface or
-     *     {@link java.awt.im.InputContext#selectInputMethod InputContext.selectInputMethod},
-     *     if the previously selected input method's
-     *     {@link java.awt.im.spi.InputMethod#isCompositionEnabled isCompositionEnabled}
-     *     method returns without throwing an exception.
-     * </ul>
-     *
-     * @param enable whether to enable the input method for composition
-     * @throws UnsupportedOperationException if this input method does not
-     * support the enabling/disabling operation
-     * @see #isCompositionEnabled
-     */
-    public void setCompositionEnabled(boolean enable) {
-
-        throw new UnsupportedOperationException();
-    }
-
-    /**
-     * Determines whether this input method is enabled.
-     * An input method that is enabled for composition interprets incoming
-     * events for both composition and control purposes, while a
-     * disabled input method does not interpret events for composition.
-     * <p>
-     * This method is called
-     * <ul>
-     * <li>by {@link java.awt.im.InputContext#isCompositionEnabled InputContext.isCompositionEnabled} and
-     * <li>when switching from this input method to a different one using the
-     *     user interface or
-     *     {@link java.awt.im.InputContext#selectInputMethod InputContext.selectInputMethod}.
-     * </ul>
-     *
-     * @return <code>true</code> if this input method is enabled for
-     * composition; <code>false</code> otherwise.
-     * @throws UnsupportedOperationException if this input method does not
-     * support checking whether it is enabled for composition
-     * @see #setCompositionEnabled
-     */
-    public boolean isCompositionEnabled() {
-
-        return true;
-    }
-
-    /**
-     * Starts the reconversion operation. The input method obtains the
-     * text to be reconverted from the current client component using the
-     * {@link java.awt.im.InputMethodRequests#getSelectedText InputMethodRequests.getSelectedText}
-     * method. It can use other <code>InputMethodRequests</code>
-     * methods to request additional information required for the
-     * reconversion operation. The composed and committed text
-     * produced by the operation is sent to the client component as a
-     * sequence of <code>InputMethodEvent</code>s. If the given text
-     * cannot be reconverted, the same text should be sent to the
-     * client component as committed text.
-     * <p>
-     * This method is called by
-     * {@link java.awt.im.InputContext#reconvert() InputContext.reconvert}.
-     *
-     * @throws UnsupportedOperationException if the input method does not
-     * support the reconversion operation.
-     */
-    public void reconvert() {
-
-        throw new UnsupportedOperationException("This input method does not reconvert.");
-    }
-
-    /**
-     * Dispatches the event to the input method. If input method support is
-     * enabled for the focussed component, incoming events of certain types
-     * are dispatched to the current input method for this component before
-     * they are dispatched to the component's methods or event listeners.
-     * The input method decides whether it needs to handle the event. If it
-     * does, it also calls the event's <code>consume</code> method; this
-     * causes the event to not get dispatched to the component's event
-     * processing methods or event listeners.
-     * <p>
-     * Events are dispatched if they are instances of InputEvent or its
-     * subclasses.
-     * This includes instances of the AWT classes KeyEvent and MouseEvent.
-     * <p>
-     * This method is called by {@link java.awt.im.InputContext#dispatchEvent InputContext.dispatchEvent}.
-     *
-     * @param event the event being dispatched to the input method
-     * @exception NullPointerException if <code>event</code> is null
-     */
-    public void dispatchEvent(AWTEvent event) {
-
-        if (event instanceof KeyEvent) {
-
-            KeyEvent keyEvent = (KeyEvent) event;
-            if (event.getID() == KeyEvent.KEY_TYPED) {
-                //System.out.println("handled event " + event);
-                impl.handleKeyTyped(keyEvent);
-            }
-        }
-        else {
-            //System.out.println("did not handle event " + event);
-        }
-    }
-
-    /**
-     * Notifies this input method of changes in the client window
-     * location or state. This method is called while this input
-     * method is the current input method of its input context and
-     * notifications for it are enabled (see {@link
-     * InputMethodContext#enableClientWindowNotification
-     * InputMethodContext.enableClientWindowNotification}). Calls
-     * to this method are temporarily suspended if the input context's
-     * {@link java.awt.im.InputContext#removeNotify removeNotify}
-     * method is called, and resume when the input method is activated
-     * for a new client component. It is called in the following
-     * situations:
-     * <ul>
-     * <li>
-     * when the window containing the current client component changes
-     * in location, size, visibility, iconification state, or when the
-     * window is closed.</li>
-     * <li>
-     * from <code> enableClientWindowNotification(inputMethod,
-     * true)</code> if the current client component exists,</li>
-     * <li>
-     * when activating the input method for the first time after it
-     * called
-     * <code>enableClientWindowNotification(inputMethod,
-     * true)</code> if during the call no current client component was
-     * available,</li>
-     * <li>
-     * when activating the input method for a new client component
-     * after the input context's removeNotify method has been
-     * called.</li>
-     * </ul>
-     * @param bounds client window's {@link
-     * java.awt.Component#getBounds bounds} on the screen; or null if
-     * the client window is iconified or invisible
-     */
-    public void notifyClientWindowChange(Rectangle bounds) {
-    }
-
-    /**
-     * Activates the input method for immediate input processing.
-     * <p>
-     * If an input method provides its own windows, it should make sure
-     * at this point that all necessary windows are open and visible.
-     * <p>
-     * This method is called
-     * <ul>
-     * <li>by {@link java.awt.im.InputContext#dispatchEvent InputContext.dispatchEvent}
-     *     when a client component receives a FOCUS_GAINED event,
-     * <li>when switching to this input method from a different one using the
-     *     user interface or
-     *     {@link java.awt.im.InputContext#selectInputMethod InputContext.selectInputMethod}.
-     * </ul>
-     * The method is only called when the input method is inactive.
-     * A newly instantiated input method is assumed to be inactive.
-     */
-    public void activate() {
-        //System.out.println("activated");
-    }
-
-    /**
-     * Deactivates the input method.
-     * The isTemporary argument has the same meaning as in
-     * {@link java.awt.event.FocusEvent#isTemporary FocusEvent.isTemporary}.
-     * <p>
-     * If an input method provides its own windows, only windows that relate
-     * to the current composition (such as a lookup choice window) should be
-     * closed at this point.
-     * It is possible that the input method will be immediately activated again
-     * for a different client component, and closing and reopening more
-     * persistent windows (such as a control panel) would create unnecessary
-     * screen flicker.
-     * Before an instance of a different input method class is activated,
-     * {@link #hideWindows} is called on the current input method.
-     * <p>
-     * This method is called
-     * <ul>
-     * <li>by {@link java.awt.im.InputContext#dispatchEvent InputContext.dispatchEvent}
-     *     when a client component receives a FOCUS_LOST event,
-     * <li>when switching from this input method to a different one using the
-     *     user interface or
-     *     {@link java.awt.im.InputContext#selectInputMethod InputContext.selectInputMethod},
-     * <li>before {@link #removeNotify removeNotify} if the current client component is
-     *     removed.
-     * </ul>
-     * The method is only called when the input method is active.
-     *
-     * @param isTemporary whether the focus change is temporary
-     */
-    public void deactivate(boolean isTemporary) {
-        //System.out.println("deactivated");
-    }
-
-    /**
-     * Closes or hides all windows opened by this input method instance or
-     * its class.
-     * <p>
-     * This method is called
-     * <ul>
-     * <li>before calling {@link #activate activate} on an instance of a different input
-     *     method class,
-     * <li>before calling {@link #dispose dispose} on this input method.
-     * </ul>
-     * The method is only called when the input method is inactive.
-     */
-    public void hideWindows() {
-    }
-
-    /**
-     * Notifies the input method that a client component has been
-     * removed from its containment hierarchy, or that input method
-     * support has been disabled for the component.
-     * <p>
-     * This method is called by {@link java.awt.im.InputContext#removeNotify InputContext.removeNotify}.
-     * <p>
-     * The method is only called when the input method is inactive.
-     */
-    public void removeNotify() {
-    }
-
-    /**
-     * Ends any input composition that may currently be going on in this
-     * context. Depending on the platform and possibly user preferences,
-     * this may commit or delete uncommitted text. Any changes to the text
-     * are communicated to the active component using an input method event.
-     *
-     * <p>
-     * A text editing component may call this in a variety of situations,
-     * for example, when the user moves the insertion point within the text
-     * (but outside the composed text), or when the component's text is
-     * saved to a file or copied to the clipboard.
-     * <p>
-     * This method is called
-     * <ul>
-     * <li>by {@link java.awt.im.InputContext#endComposition InputContext.endComposition},
-     * <li>by {@link java.awt.im.InputContext#dispatchEvent InputContext.dispatchEvent}
-     *     when switching to a different client component
-     * <li>when switching from this input method to a different one using the
-     *     user interface or
-     *     {@link java.awt.im.InputContext#selectInputMethod InputContext.selectInputMethod}.
-     * </ul>
-     */
-    public void endComposition() {
-
-        impl.endComposition();
-    }
-
-    /**
-     * Disposes of the input method and releases the resources used by it.
-     * In particular, the input method should dispose windows and close files that are no
-     * longer needed.
-     * <p>
-     * This method is called by {@link java.awt.im.InputContext#dispose InputContext.dispose}.
-     * <p>
-     * The method is only called when the input method is inactive.
-     * No method of this interface is called on this instance after dispose.
-     */
-    public void dispose() {
-    }
-
-    /**
-     * Returns a control object from this input method, or null. A
-     * control object provides methods that control the behavior of the
-     * input method or obtain information from the input method. The type
-     * of the object is an input method specific class. Clients have to
-     * compare the result against known input method control object
-     * classes and cast to the appropriate class to invoke the methods
-     * provided.
-     * <p>
-     * This method is called by
-     * {@link java.awt.im.InputContext#getInputMethodControlObject InputContext.getInputMethodControlObject}.
-     *
-     * @return a control object from this input method, or null
-     */
-    public Object getControlObject() {
-
-        return null;
-    }
-}
--- a/jdk/src/share/classes/com/sun/inputmethods/internal/thaiim/ThaiInputMethodDescriptor.java	Tue Jul 20 16:09:44 2010 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,99 +0,0 @@
-/*
- * Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- *
- * (C) Copyright IBM Corp. 2000 - All Rights Reserved
- *
- * The original version of this source code and documentation is
- * copyrighted and owned by IBM. These materials are provided
- * under terms of a License Agreement between IBM and Sun.
- * This technology is protected by multiple US and International
- * patents. This notice and attribution to IBM may not be removed.
- *
- */
-
-package com.sun.inputmethods.internal.thaiim;
-
-import java.awt.Image;
-import java.awt.im.spi.InputMethod;
-import java.awt.im.spi.InputMethodDescriptor;
-import java.util.Locale;
-import java.util.MissingResourceException;
-import java.util.ResourceBundle;
-
-public class ThaiInputMethodDescriptor implements InputMethodDescriptor {
-
-    static final Locale THAI = new Locale("th");
-
-    public ThaiInputMethodDescriptor() {
-    }
-
-    /**
-     * @see java.awt.im.spi.InputMethodDescriptor#getAvailableLocales
-     */
-    public Locale[] getAvailableLocales() {
-        return new Locale[] { THAI };
-    }
-
-    /**
-     * @see java.awt.im.spi.InputMethodDescriptor#hasDynamicLocaleList
-     */
-    public boolean hasDynamicLocaleList() {
-        return false;
-    }
-
-    /**
-     * @see java.awt.im.spi.InputMethodDescriptor#getInputMethodDisplayName
-     */
-    public synchronized String getInputMethodDisplayName(Locale inputLocale, Locale displayLanguage) {
-        try {
-            ResourceBundle resources = ResourceBundle.getBundle(
-                "com.sun.inputmethods.internal.thaiim.resources.DisplayNames", displayLanguage);
-            return resources.getString("DisplayName.Thai");
-        } catch (MissingResourceException mre) {
-            return "Thai Input Method";
-        }
-    }
-
-    /**
-     * @see java.awt.im.spi.InputMethodDescriptor#getInputMethodIcon
-     */
-    public Image getInputMethodIcon(Locale inputLocale) {
-        return null;
-    }
-
-    /**
-     * @see java.awt.im.spi.InputMethodDescriptor#createInputMethod
-     */
-    public InputMethod createInputMethod() throws Exception {
-        ThaiInputMethodImpl impl = new ThaiInputMethodImpl();
-        return new ThaiInputMethod(THAI, impl);
-    }
-
-    public String toString() {
-        return getClass().getName();
-    }
-}
--- a/jdk/src/share/classes/com/sun/inputmethods/internal/thaiim/ThaiInputMethodImpl.java	Tue Jul 20 16:09:44 2010 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,235 +0,0 @@
-/*
- * Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- *
- * (C) Copyright IBM Corp. 2000 - All Rights Reserved
- *
- * The original version of this source code and documentation is
- * copyrighted and owned by IBM. These materials are provided
- * under terms of a License Agreement between IBM and Sun.
- * This technology is protected by multiple US and International
- * patents. This notice and attribution to IBM may not be removed.
- *
- */
-
-package com.sun.inputmethods.internal.thaiim;
-
-import java.awt.im.InputMethodRequests;
-import java.awt.im.spi.InputMethodContext;
-
-import java.awt.Toolkit;
-import java.awt.event.KeyEvent;
-import java.awt.event.InputMethodEvent;
-import java.awt.font.TextAttribute;
-import java.awt.font.TextHitInfo;
-
-import java.text.AttributedCharacterIterator;
-import java.text.AttributedString;
-
-class ThaiInputMethodImpl {
-
-    private static final char[] keyboardMap = {
-        /* 00 */ '\u0000',
-        /* 01 */ '\u0001',
-        /* 02 */ '\u0002',
-        /* 03 */ '\u0003',
-        /* 04 */ '\u0004',
-        /* 05 */ '\u0005',
-        /* 06 */ '\u0006',
-        /* 07 */ '\u0007',
-        /* 08 */ '\u0008',
-        /* 09 */ '\u0009',
-        /* 0A */ '\012',
-        /* 0B */ '\u000B',
-        /* 0C */ '\u000C',
-        /* 0D */ '\015',
-        /* 0E */ '\u000E',
-        /* 0F */ '\u000F',
-        /* 10 */ '\u0010',
-        /* 11 */ '\u0011',
-        /* 12 */ '\u0012',
-        /* 13 */ '\u0013',
-        /* 14 */ '\u0014',
-        /* 15 */ '\u0015',
-        /* 16 */ '\u0016',
-        /* 17 */ '\u0017',
-        /* 18 */ '\u0018',
-        /* 19 */ '\u0019',
-        /* 1A */ '\u001A',
-        /* 1B */ '\u001B',
-        /* 1C */ '\u001C',
-        /* 1D */ '\u001D',
-        /* 1E */ '\u001E',
-        /* 1F */ '\u001F',
-        /* 20 */ '\u0020',
-        /* 21 */ '\u0e45',   // '!'
-        /* 22 */ '\u002e',   // '"'
-        /* 23 */ '\u0e52',   // '#'
-        /* 24 */ '\u0e53',   // '$'
-        /* 25 */ '\u0e54',   // '%'
-        /* 26 */ '\u0e4e',   // '&'
-        /* 27 */ '\u0e07',   // '''
-        /* 28 */ '\u0e56',   // '('
-        /* 29 */ '\u0e57',   // ')'
-        /* 2A */ '\u0e55',   // '*'
-        /* 2B */ '\u0e59',   // '+'
-        /* 2C */ '\u0e21',   // ','
-        /* 2D */ '\u0e02',   // '-'
-        /* 2E */ '\u0e43',   // '.'
-        /* 2F */ '\u0e1d',   // '/'
-        /* 30 */ '\u0e08',   // '0'
-        /* 31 */ '\u0e3f',   // '1'
-        /* 32 */ '\u002f',   // '2'
-        /* 33 */ '\u002d',   // '3'
-        /* 34 */ '\u0e20',   // '4'
-        /* 35 */ '\u0e16',   // '5'
-        /* 36 */ '\u0e38',   // '6'
-        /* 37 */ '\u0e36',   // '7'
-        /* 38 */ '\u0e04',   // '8'
-        /* 39 */ '\u0e15',   // '9'
-        /* 3A */ '\u0e0b',   // ':'
-        /* 3B */ '\u0e27',   // ';'
-        /* 3C */ '\u0e12',   // '<'
-        /* 3D */ '\u0e0a',   // '='
-        /* 3E */ '\u0e2c',   // '>'
-        /* 3F */ '\u0e26',   // '?'
-        /* 40 */ '\u0e51',   // '@'
-        /* 41 */ '\u0e24',   // 'A'
-        /* 42 */ '\u0e3a',   // 'B'
-        /* 43 */ '\u0e09',   // 'C'
-        /* 44 */ '\u0e0f',   // 'D'
-        /* 45 */ '\u0e0e',   // 'E'
-        /* 46 */ '\u0e42',   // 'F'
-        /* 47 */ '\u0e0c',   // 'G'
-        /* 48 */ '\u0e47',   // 'H'
-        /* 49 */ '\u0e13',   // 'I'
-        /* 4A */ '\u0e4b',   // 'J'
-        /* 4B */ '\u0e29',   // 'K'
-        /* 4C */ '\u0e28',   // 'L'
-        /* 4D */ '\u003f',   // 'M'
-        /* 4E */ '\u0e4c',   // 'N'
-        /* 4F */ '\u0e2f',   // 'O'
-        /* 50 */ '\u0e0d',   // 'P'
-        /* 51 */ '\u0e50',   // 'Q'
-        /* 52 */ '\u0e11',   // 'R'
-        /* 53 */ '\u0e06',   // 'S'
-        /* 54 */ '\u0e18',   // 'T'
-        /* 55 */ '\u0e4a',   // 'U'
-        /* 56 */ '\u0e2e',   // 'V'
-        /* 57 */ '\u0022',   // 'W'
-        /* 58 */ '\u0029',   // 'X'
-        /* 59 */ '\u0e4d',   // 'Y'
-        /* 5A */ '\u0028',   // 'Z'
-        /* 5B */ '\u0e1a',   // '['
-        /* 5C */ '\u0e05',   // '\'
-        /* 5D */ '\u0e25',   // ']'
-        /* 5E */ '\u0e39',   // '^'
-        /* 5F */ '\u0e58',   // '_'
-        /* 60 */ '\u0e4f',   // '`'
-        /* 61 */ '\u0e1f',   // 'a'
-        /* 62 */ '\u0e34',   // 'b'
-        /* 63 */ '\u0e41',   // 'c'
-        /* 64 */ '\u0e01',   // 'd'
-        /* 65 */ '\u0e33',   // 'e'
-        /* 66 */ '\u0e14',   // 'f'
-        /* 67 */ '\u0e40',   // 'g'
-        /* 68 */ '\u0e49',   // 'h'
-        /* 69 */ '\u0e23',   // 'i'
-        /* 6A */ '\u0e48',   // 'j'
-        /* 6B */ '\u0e32',   // 'k'
-        /* 6C */ '\u0e2a',   // 'l'
-        /* 6D */ '\u0e17',   // 'm'
-        /* 6E */ '\u0e37',   // 'n'
-        /* 6F */ '\u0e19',   // 'o'
-        /* 70 */ '\u0e22',   // 'p'
-        /* 71 */ '\u0e46',   // 'q'
-        /* 72 */ '\u0e1e',   // 'r'
-        /* 73 */ '\u0e2b',   // 's'
-        /* 74 */ '\u0e30',   // 't'
-        /* 75 */ '\u0e35',   // 'u'
-        /* 76 */ '\u0e2d',   // 'v'
-        /* 77 */ '\u0e44',   // 'w'
-        /* 78 */ '\u0e1b',   // 'x'
-        /* 79 */ '\u0e31',   // 'y'
-        /* 7A */ '\u0e1c',   // 'z'
-        /* 7B */ '\u0e10',   // '{'
-        /* 7C */ '\u0e03',   // '|'
-        /* 7D */ '\u002c',   // '}'
-        /* 7E */ '\u0e5b',   // '~'
-        /* 7F */ '\u007F'    //
-    };
-
-    // cached TextHitInfo. Only one type of TextHitInfo is required.
-    private static final TextHitInfo ZERO_TRAILING_HIT_INFO = TextHitInfo.trailing(0);
-
-    private ThaiRules rules;
-
-    /**
-     * Returns the equivalent character for thai locale.
-     * @param originalChar The original character.
-     */
-    private char getMappedChar( char originalChar )
-    {
-        if (originalChar <= keyboardMap.length) {
-            return keyboardMap[originalChar];
-        }
-
-        return originalChar;
-    }//getMappedChar()
-
-    private InputMethodContext context;
-
-    void setInputMethodContext(InputMethodContext context) {
-        this.context = context;
-        rules = new ThaiRules((InputMethodRequests)context);
-    }
-
-    void handleKeyTyped(KeyEvent kevent) {
-        char keyChar = kevent.getKeyChar();
-        char currentChar = getMappedChar(keyChar);
-        if (!Character.UnicodeBlock.THAI.equals(Character.UnicodeBlock.of(currentChar))) {
-            // don't care
-            return;
-        } else if (rules.isInputValid(currentChar)) {
-            Character tmp = new Character(currentChar);
-            String tmp2 = tmp.toString();
-            context.dispatchInputMethodEvent(InputMethodEvent.INPUT_METHOD_TEXT_CHANGED,
-                                             (new AttributedString(tmp2)).getIterator(),
-                                             1,
-                                             ZERO_TRAILING_HIT_INFO,
-                                             ZERO_TRAILING_HIT_INFO);
-        } else {
-            // input sequence is not allowed
-            Toolkit.getDefaultToolkit().beep();
-        }
-
-        kevent.consume();// prevent client from getting this event.
-        return;
-    }//dispatchEvent()
-
-    void endComposition() {
-    }//endComposition()
-}
--- a/jdk/src/share/classes/com/sun/inputmethods/internal/thaiim/ThaiRules.java	Tue Jul 20 16:09:44 2010 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,348 +0,0 @@
-/*
- * Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package com.sun.inputmethods.internal.thaiim;
-
-import java.awt.im.InputMethodRequests;
-
-public class ThaiRules {
-
-    public static final char BASE = 0x0e00;
-
-    public static final byte NON  =  0;
-    public static final byte CONS =  1;
-    public static final byte LV   =  2;
-    public static final byte FV1  =  3;
-    public static final byte FV2  =  4;
-    public static final byte FV3  =  5;
-    public static final byte FV4  =  6;
-    /* Note that FV4 is added. It is not in WTT.
-     * We need it for SARA AM since it has a
-     * weired characteristic to share the same
-     * cell with whatever consonant preceeds it.
-     */
-    public static final byte BV1  =  7;
-    public static final byte BV2  =  8;
-    public static final byte BD   =  9;
-    public static final byte TONE = 10;
-    public static final byte AD1  = 11;
-    public static final byte AD2  = 12;
-    public static final byte AD3  = 13;
-    public static final byte AV1  = 14;
-    public static final byte AV2  = 15;
-    public static final byte AV3  = 16;
-
-    /**
-     * Constants for validity checking and auto correction
-     */
-    public static final byte STRICT    = 0;
-    public static final byte LOOSE     = 1;
-    public static final byte NOREPLACE = 2;
-
-    public static final byte[] CHARTYPE = {
-    /* 0e00 UNUSED                      */      NON,
-    /* THAI CHARACTER KO KAI            */      CONS,
-    /* THAI CHARACTER KHO KHAI          */      CONS,
-    /* THAI CHARACTER KHO KHUAT         */      CONS,
-    /* THAI CHARACTER KHO KHWAI         */      CONS,
-    /* THAI CHARACTER KHO KHON          */      CONS,
-    /* THAI CHARACTER KHO RAKHANG       */      CONS,
-    /* THAI CHARACTER NGO NGU           */      CONS,
-    /* THAI CHARACTER CHO CHAN          */      CONS,
-    /* THAI CHARACTER CHO CHING         */      CONS,
-    /* THAI CHARACTER CHO CHANG         */      CONS,
-    /* THAI CHARACTER SO SO             */      CONS,
-    /* THAI CHARACTER CHO CHOE          */      CONS,
-    /* THAI CHARACTER YO YING           */      CONS,
-    /* THAI CHARACTER DO CHADA          */      CONS,
-    /* THAI CHARACTER TO PATAK          */      CONS,
-    /* THAI CHARACTER THO THAN          */      CONS,
-    /* THAI CHARACTER THO NANGMONTHO    */      CONS,
-    /* THAI CHARACTER THO PHUTHAO       */      CONS,
-    /* THAI CHARACTER NO NEN            */      CONS,
-    /* THAI CHARACTER DO DEK            */      CONS,
-    /* THAI CHARACTER TO TAO            */      CONS,
-    /* THAI CHARACTER THO THUNG         */      CONS,
-    /* THAI CHARACTER THO THAHAN        */      CONS,
-    /* THAI CHARACTER THO THONG         */      CONS,
-    /* THAI CHARACTER NO NU             */      CONS,
-    /* THAI CHARACTER BO BAIMAI         */      CONS,
-    /* THAI CHARACTER PO PLA            */      CONS,
-    /* THAI CHARACTER PHO PHUNG         */      CONS,
-    /* THAI CHARACTER FO FA             */      CONS,
-    /* THAI CHARACTER PHO PHAN          */      CONS,
-    /* THAI CHARACTER FO FAN            */      CONS,
-    /* THAI CHARACTER PHO SAMPHAO       */      CONS,
-    /* THAI CHARACTER MO MA             */      CONS,
-    /* THAI CHARACTER YO YAK            */      CONS,
-    /* THAI CHARACTER RO RUA            */      CONS,
-    /* THAI CHARACTER RU                */      FV3,
-    /* THAI CHARACTER LO LING           */      CONS,
-    /* THAI CHARACTER LU                */      FV3,
-    /* THAI CHARACTER WO WAEN           */      CONS,
-    /* THAI CHARACTER SO SALA           */      CONS,
-    /* THAI CHARACTER SO RUSI           */      CONS,
-    /* THAI CHARACTER SO SUA            */      CONS,
-    /* THAI CHARACTER HO HIP            */      CONS,
-    /* THAI CHARACTER LO CHULA          */      CONS,
-    /* THAI CHARACTER O ANG             */      CONS,
-    /* THAI CHARACTER HO NOKHUK         */      CONS,
-    /* THAI CHARACTER PAIYANNOI         */      NON,
-    /* THAI CHARACTER SARA A            */      FV1,
-    /* THAI CHARACTER MAI HAN-AKAT      */      AV2,
-    /* THAI CHARACTER SARA AA           */      FV1,
-    /* THAI CHARACTER SARA AM           */      FV4,
-    /* THAI CHARACTER SARA I            */      AV1,
-    /* THAI CHARACTER SARA II           */      AV3,
-    /* THAI CHARACTER SARA UE           */      AV2,
-    /* THAI CHARACTER SARA UEE          */      AV3,
-    /* THAI CHARACTER SARA U            */      BV1,
-    /* THAI CHARACTER SARA UU           */      BV2,
-    /* THAI CHARACTER PHINTHU           */      BD,
-    /* 0e3b UNUSED                      */      NON,
-    /* 0e3c UNUSED                      */      NON,
-    /* 0e3d UNUSED                      */      NON,
-    /* 0e3e UNUSED                      */      NON,
-    /* THAI CURRENCY SYMBOL BAHT        */      NON,
-    /* THAI CHARACTER SARA E            */      LV,
-    /* THAI CHARACTER SARA AE           */      LV,
-    /* THAI CHARACTER SARA O            */      LV,
-    /* THAI CHARACTER SARA AI MAIMUAN   */      LV,
-    /* THAI CHARACTER SARA AI MAIMALAI  */      LV,
-    /* THAI CHARACTER LAKKHANGYAO       */      FV2,
-    /* THAI CHARACTER MAIYAMOK          */      NON,
-    /* THAI CHARACTER MAITAIKHU         */      AD2,
-    /* THAI CHARACTER MAI EK            */      TONE,
-    /* THAI CHARACTER MAI THO           */      TONE,
-    /* THAI CHARACTER MAI TRI           */      TONE,
-    /* THAI CHARACTER MAI CHATTAWA      */      TONE,
-    /* THAI CHARACTER THANTHAKHAT       */      AD1,
-    /* THAI CHARACTER NIKHAHIT          */      AD3,
-    /* THAI CHARACTER YAMAKKAN          */      AD3,
-    /* THAI CHARACTER FONGMAN           */      NON,
-    /* THAI DIGIT ZERO                  */      NON,
-    /* THAI DIGIT ONE                   */      NON,
-    /* THAI DIGIT TWO                   */      NON,
-    /* THAI DIGIT THREE                 */      NON,
-    /* THAI DIGIT FOUR                  */      NON,
-    /* THAI DIGIT FIVE                  */      NON,
-    /* THAI DIGIT SIX                   */      NON,
-    /* THAI DIGIT SEVEN                 */      NON,
-    /* THAI DIGIT EIGHT                 */      NON,
-    /* THAI DIGIT NINE                  */      NON,
-    /* THAI CHARACTER ANGKHANKHU        */      NON,
-    /* THAI CHARACTER KHOMUT            */      NON
-    };
-
-    private InputMethodRequests requests;
-
-    ThaiRules(InputMethodRequests requests) {
-        this.requests = requests;
-    }
-
-    public static byte getCharType(char c) {
-        byte cType;
-        int ci = ((int) c) - (int) BASE;
-        if (ci < 0 || ci >= CHARTYPE.length)
-            cType = NON;
-        else
-            cType = CHARTYPE[ci];
-        return cType;
-    }
-
-    private static boolean isValid(char c1, char c2, int[] validityArray) {
-        return ((validityArray[getCharType(c1)]
-                & (1 << getCharType(c2))) != 0);
-    }
-
-    /**
-     * VALIDITY is a bit matrix defining whether one
-     * character is allowed to be typed in after the
-     * previous one (array index). Determining the
-     * validity is done by bit-anding the 2nd char
-     * type's mask (obtained by 1 << chartype) with
-     * the array element indexed by the first char
-     * type. If the result is non-zero, the 2nd
-     * character is allowed to follow the first.
-     */
-
-    /* Please note that the bits in the comment below
-     * are displayed least significant bit first.
-     * The actual value reflexs this representation
-     * when the bits are swapped.
-     */
-
-    private static final int[] INPUTVALIDITY = {
-    /* NON  1110 010  0 0000 0000 0 */          0x00027,
-    /* CONS 1111 111  1 1111 1111 1 */          0x1ffff,
-    /* LV   0100 000  0 0000 0000 0 */          0x00002,
-    /* FV1  1110 010  0 0000 0000 0 */          0x00027,
-    /* FV2  1110 010  0 0000 0000 0 */          0x00027,
-    /* FV3  1110 110  0 0000 0000 0 */          0x00037,
-    /* FV4  1110 010  0 0000 0000 0 */          0x00027,
-    /* BV1  1110 010  0 0011 0000 0 */          0x00c27,
-    /* BV2  1110 010  0 0010 0000 0 */          0x00427,
-    /* BD   1110 010  0 0000 0000 0 */          0x00027,
-    /* TONE 1111 011  0 0000 0000 0 */          0x0006f,
-    /* AD1  1110 010  0 0000 0000 0 */          0x00027,
-    /* AD2  1110 010  0 0000 0000 0 */          0x00027,
-    /* AD3  1110 010  0 0000 0000 0 */          0x00027,
-    /* AV1  1110 010  0 0011 0000 0 */          0x00c27,
-    /* AV2  1110 010  0 0010 0000 0 */          0x00427,
-    /* AV3  1110 010  0 0010 0100 0 */          0x02427
-    };
-
-    private static final int[] COMPOSABLE = {
-    /* NON  0000 000  0 0000 0000 0 */          0x00000,
-    /* CONS 0000 001  1 1111 1111 1 */          0x1ffc0,
-    /* LV   0000 000  0 0000 0000 0 */          0x00000,
-    /* FV1  0000 000  0 0000 0000 0 */          0x00000,
-    /* FV2  0000 000  0 0000 0000 0 */          0x00000,
-    /* FV3  0000 000  0 0000 0000 0 */          0x00000,
-    /* FV4  0000 000  0 0000 0000 0 */          0x00000,
-    /* BV1  0000 000  0 0011 0000 0 */          0x00c00,
-    /* BV2  0000 000  0 0010 0000 0 */          0x00400,
-    /* BD   0000 000  0 0000 0000 0 */          0x00000,
-    /* TONE 0000 001  0 0000 0000 0 */          0x00040,
-    /* AD1  0000 000  0 0000 0000 0 */          0x00000,
-    /* AD2  0000 000  0 0000 0000 0 */          0x00000,
-    /* AD3  0000 000  0 0000 0000 0 */          0x00000,
-    /* AV1  0000 000  0 0011 0000 0 */          0x00c00,
-    /* AV2  0000 000  0 0010 0000 0 */          0x00400,
-    /* AV3  0000 000  0 0010 0100 0 */          0x02400
-    };
-
-    private static final int[] REPLACABLE = {
-    /* NON  0000 000  0 0000 0000 0 */          0x00000,
-    /* CONS 0000 000  0 0000 0000 0 */          0x00000,
-    /* LV   0000 000  0 0000 0000 0 */          0x00000,
-    /* FV1  0000 000  0 0000 0000 0 */          0x00000,
-    /* FV2  0000 000  0 0000 0000 0 */          0x00000,
-    /* FV3  0000 000  0 0000 0000 0 */          0x00000,
-    /* FV4  0000 001  1 1001 1111 1 */          0x1f9c0,
-    /* BV1  0000 001  1 1100 1111 1 */          0x1f3c0,
-    /* BV2  0000 001  1 1101 1111 1 */          0x1fbc0,
-    /* BD   0000 001  1 1111 1111 1 */          0x1ffc0,
-    /* TONE 0000 000  0 0111 1100 0 */          0x03e00,
-    /* AD1  0000 001  0 1111 1101 1 */          0x1bf40,
-    /* AD2  0000 001  1 1111 1111 1 */          0x1ffc0,
-    /* AD3  0000 001  1 1111 1111 0 */          0x0ffc0,
-    /* AV1  0000 001  1 1100 1111 1 */          0x1f3c0,
-    /* AV2  0000 001  1 1101 1111 1 */          0x1fbc0,
-    /* AV3  0000 001  1 1101 1011 1 */          0x1dbc0
-    };
-
-    private static final int[] SWAPPABLE = {
-    /* NON  0000 000  0 0000 0000 0 */          0x00000,
-    /* CONS 0000 000  0 0000 0000 0 */          0x00000,
-    /* LV   0000 000  0 0000 0000 0 */          0x00000,
-    /* FV1  0000 000  0 0000 0000 0 */          0x00000,
-    /* FV2  0000 000  0 0000 0000 0 */          0x00000,
-    /* FV3  0000 000  0 0000 0000 0 */          0x00000,
-    /* FV4  0000 000  0 0010 0000 0 */          0x00400,
-    /* BV1  0000 000  0 0000 0000 0 */          0x00000,
-    /* BV2  0000 000  0 0000 0000 0 */          0x00000,
-    /* BD   0000 000  0 0000 0000 0 */          0x00000,
-    /* TONE 0000 000  1 1000 0011 1 */          0x1c180,
-    /* AD1  0000 000  1 0000 0010 0 */          0x04080,
-    /* AD2  0000 000  0 0000 0000 0 */          0x00000,
-    /* AD3  0000 000  0 0000 0000 1 */          0x10000,
-    /* AV1  0000 000  0 0000 0000 0 */          0x00000,
-    /* AV2  0000 000  0 0000 0000 0 */          0x00000,
-    /* AV3  0000 000  0 0000 0000 0 */          0x00000
-    };
-
-    public static boolean isInputValid(char c1, char c2) {
-        return isValid(c1, c2, INPUTVALIDITY);
-    }
-
-    public static boolean isComposable(char c1, char c2) {
-        return isValid(c1, c2, COMPOSABLE);
-    }
-
-    public static boolean isSwappable(char c1, char c2) {
-        return isValid(c1, c2, SWAPPABLE);
-    }
-
-    public static boolean isReplacable(char c1, char c2) {
-        return isValid(c1, c2, REPLACABLE);
-    }
-
-    public static boolean isForward(char c) {
-        return (getCharType(c) < FV4);
-    }
-
-    public static boolean isDead(char c) {
-        return (getCharType(c) > FV3);
-    }
-
-    public boolean isInputValid(char current) {
-        int offset = requests.getInsertPositionOffset();
-        if (offset == 0) {
-            byte charType = getCharType(current);
-            return ((charType < FV1) || (charType == FV3));
-        }
-        else {
-            char prev = requests.getCommittedText(offset-1, offset, null).first();
-
-            if(isForward(current)) {
-                if (isInputValid(prev, current)) {
-                    if (getCharType(prev) == TONE &&
-                        getCharType(current) == FV1) {
-                        if (offset == 1) {
-                            return true;
-                        } else {
-                            char pprev =
-                                requests.getCommittedText(offset-2, offset-1, null).first();
-                            return isInputValid(pprev, current);
-                        }
-                    } else {
-                        return true;
-                    }
-                } else if (prev == '\u0e32' &&       // SARA AA
-                           current  == '\u0e30') {   // SARA A
-                    return true;
-                } else if (prev == '\u0e4d' &&       // NIKAHIT
-                           current  == '\u0e32') {   // SARA AA
-                                                     // Special compose to SARA AM
-                    return true;
-                } else {
-                    return false;
-                }
-            } else {
-                if(isInputValid(prev, current)) {
-                    if (getCharType(prev) == TONE &&
-                        getCharType(current) == FV4) {
-                        return (offset != 1);
-                    } else {
-                        return true;
-                    }
-                } else {
-                    return false;
-                }
-            }
-        }
-    }
-}
--- a/jdk/src/share/classes/com/sun/inputmethods/internal/thaiim/java.awt.im.spi.InputMethodDescriptor	Tue Jul 20 16:09:44 2010 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1 +0,0 @@
-com.sun.inputmethods.internal.thaiim.ThaiInputMethodDescriptor
--- a/jdk/src/share/classes/com/sun/inputmethods/internal/thaiim/resources/DisplayNames.properties	Tue Jul 20 16:09:44 2010 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,6 +0,0 @@
-#
-# Default Input method display names for Thai input methods
-#
-
-DisplayName.Thai     = Thai Input Method
-
--- a/jdk/src/share/classes/com/sun/java/swing/plaf/gtk/GTKPainter.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/share/classes/com/sun/java/swing/plaf/gtk/GTKPainter.java	Wed Jul 21 09:57:21 2010 -0700
@@ -1440,10 +1440,6 @@
             }
         }
 
-        public Insets getBorderInsets(Component c) {
-            return getBorderInsets(c, null);
-        }
-
         public Insets getBorderInsets(Component c, Insets i) {
             SynthContext context = getContext(c);
 
--- a/jdk/src/share/classes/com/sun/java/swing/plaf/motif/MotifFileChooserUI.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/share/classes/com/sun/java/swing/plaf/motif/MotifFileChooserUI.java	Wed Jul 21 09:57:21 2010 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -271,7 +271,9 @@
     }
 
     public void uninstallUI(JComponent c) {
-        getFileChooser().removeAll();
+        c.removePropertyChangeListener(filterComboBoxModel);
+        approveButton.removeActionListener(getApproveSelectionAction());
+        filenameTextField.removeActionListener(getApproveSelectionAction());
         super.uninstallUI(c);
     }
 
@@ -515,6 +517,7 @@
 
     public void uninstallComponents(JFileChooser fc) {
         fc.removeAll();
+        bottomPanel = null;
         if (filterComboBoxModel != null) {
             fc.removePropertyChangeListener(filterComboBoxModel);
         }
--- a/jdk/src/share/classes/com/sun/java/swing/plaf/windows/WindowsComboBoxUI.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/share/classes/com/sun/java/swing/plaf/windows/WindowsComboBoxUI.java	Wed Jul 21 09:57:21 2010 -0700
@@ -424,7 +424,7 @@
             State rv;
             rv = super.getState();
             if (rv != State.DISABLED
-                && ! comboBox.isEditable()
+                && comboBox != null && ! comboBox.isEditable()
                 && XPStyle.getXP().isSkinDefined(comboBox,
                                                  Part.CP_DROPDOWNBUTTONRIGHT)) {
                 /*
--- a/jdk/src/share/classes/com/sun/java/swing/plaf/windows/WindowsTableHeaderUI.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/share/classes/com/sun/java/swing/plaf/windows/WindowsTableHeaderUI.java	Wed Jul 21 09:57:21 2010 -0700
@@ -35,6 +35,7 @@
 import static com.sun.java.swing.plaf.windows.TMSchema.*;
 import static com.sun.java.swing.plaf.windows.XPStyle.*;
 import sun.swing.table.*;
+import sun.swing.SwingUtilities2;
 
 
 public class WindowsTableHeaderUI extends BasicTableHeaderUI {
@@ -163,18 +164,13 @@
             return this;
         }
 
-        private int viewIndexForColumn(TableColumn aColumn) {
-            if (aColumn != null) {
-                return header.getTable().convertColumnIndexToView(
-                        aColumn.getModelIndex());
-            }
-            return -1;
-        }
-
         public void paint(Graphics g) {
             Dimension size = getSize();
             State state = State.NORMAL;
-            if (column == viewIndexForColumn(header.getDraggedColumn())) {
+            TableColumn draggedColumn = header.getDraggedColumn();
+            if (draggedColumn != null &&
+                    column == SwingUtilities2.convertColumnIndexToView(
+                            header.getColumnModel(), draggedColumn.getModelIndex())) {
                 state = State.PRESSED;
             } else if (isSelected || hasFocus || hasRollover) {
                 state = State.HOT;
--- a/jdk/src/share/classes/com/sun/java/util/jar/pack/Constants.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/share/classes/com/sun/java/util/jar/pack/Constants.java	Wed Jul 21 09:57:21 2010 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2005, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 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
@@ -47,10 +47,13 @@
 
     public final static short JAVA5_MAX_CLASS_MAJOR_VERSION = 49;
     public final static short JAVA5_MAX_CLASS_MINOR_VERSION = 0;
-    // NOTE: ASSUMED for now
+
     public final static short JAVA6_MAX_CLASS_MAJOR_VERSION = 50;
     public final static short JAVA6_MAX_CLASS_MINOR_VERSION = 0;
 
+    public final static short JAVA7_MAX_CLASS_MAJOR_VERSION = 51;
+    public final static short JAVA7_MAX_CLASS_MINOR_VERSION = 0;
+
     public final static int JAVA_PACKAGE_MAGIC = 0xCAFED00D;
     public final static int JAVA5_PACKAGE_MAJOR_VERSION = 150;
     public final static int JAVA5_PACKAGE_MINOR_VERSION = 7;
--- a/jdk/src/share/classes/com/sun/java/util/jar/pack/Package.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/share/classes/com/sun/java/util/jar/pack/Package.java	Wed Jul 21 09:57:21 2010 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2005, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 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
@@ -57,8 +57,8 @@
     // These fields can be adjusted by driver properties.
     short min_class_majver = JAVA_MIN_CLASS_MAJOR_VERSION;
     short min_class_minver = JAVA_MIN_CLASS_MINOR_VERSION;
-    short max_class_majver = JAVA6_MAX_CLASS_MAJOR_VERSION;
-    short max_class_minver = JAVA6_MAX_CLASS_MINOR_VERSION;
+    short max_class_majver = JAVA7_MAX_CLASS_MAJOR_VERSION;
+    short max_class_minver = JAVA7_MAX_CLASS_MINOR_VERSION;
 
     short observed_max_class_majver = min_class_majver;
     short observed_max_class_minver = min_class_minver;
@@ -122,13 +122,16 @@
     void choosePackageVersion() {
         assert(package_majver <= 0);  // do not call this twice
         int classver = getHighestClassVersion();
-        if (classver != 0 &&
-            (classver >>> 16) < JAVA6_MAX_CLASS_MAJOR_VERSION) {
-            // There are only old classfiles in this segment.
+        if (classver == 0 || (classver >>> 16) < JAVA6_MAX_CLASS_MAJOR_VERSION) {
+            // There are only old classfiles in this segment or resources
             package_majver = JAVA5_PACKAGE_MAJOR_VERSION;
             package_minver = JAVA5_PACKAGE_MINOR_VERSION;
+        } else if ((classver >>> 16) == JAVA6_MAX_CLASS_MAJOR_VERSION) {
+            package_majver = JAVA6_PACKAGE_MAJOR_VERSION;
+            package_minver = JAVA6_PACKAGE_MINOR_VERSION;
         } else {
-            // Normal case.  Use the newest archive format.
+            // Normal case.  Use the newest archive format, when available
+            // TODO: replace the following with JAVA7* when the need arises
             package_majver = JAVA6_PACKAGE_MAJOR_VERSION;
             package_minver = JAVA6_PACKAGE_MINOR_VERSION;
         }
--- a/jdk/src/share/classes/com/sun/java/util/jar/pack/PropMap.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/share/classes/com/sun/java/util/jar/pack/PropMap.java	Wed Jul 21 09:57:21 2010 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003,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
@@ -90,8 +90,8 @@
         props.put(Utils.PACK_DEFAULT_TIMEZONE,
                   String.valueOf(Boolean.getBoolean(Utils.PACK_DEFAULT_TIMEZONE)));
 
-        // Limit segment size to less than a megabyte.
-        props.put(Pack200.Packer.SEGMENT_LIMIT, ""+(1*1000*1000));
+        // The segment size is unlimited
+        props.put(Pack200.Packer.SEGMENT_LIMIT, "");
 
         // Preserve file ordering by default.
         props.put(Pack200.Packer.KEEP_FILE_ORDER, Pack200.Packer.TRUE);
--- a/jdk/src/share/classes/com/sun/jndi/dns/DnsClient.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/share/classes/com/sun/jndi/dns/DnsClient.java	Wed Jul 21 09:57:21 2010 -0700
@@ -525,11 +525,11 @@
         }
         byte[] pkt;
         if ((pkt = (byte[]) resps.get(xid)) != null) {
+            checkResponseCode(new Header(pkt, pkt.length));
             synchronized (queuesLock) {
                 resps.remove(xid);
                 reqs.remove(xid);
             }
-            checkResponseCode(new Header(pkt, pkt.length));
 
             if (debug) {
                 dprint("FOUND (" + Thread.currentThread() +
@@ -562,12 +562,12 @@
                 dprint("XID MATCH:" + xid);
             }
 
+            checkResponseCode(hdr);
             // remove the response for the xid if received by some other thread.
             synchronized (queuesLock) {
                 resps.remove(xid);
                 reqs.remove(xid);
             }
-            checkResponseCode(hdr);
             return true;
         }
 
--- a/jdk/src/share/classes/com/sun/org/apache/xml/internal/security/utils/Base64.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/share/classes/com/sun/org/apache/xml/internal/security/utils/Base64.java	Wed Jul 21 09:57:21 2010 -0700
@@ -41,7 +41,7 @@
  * @author Raul Benito(Of the xerces copy, and little adaptations).
  * @author Anli Shundi
  * @author Christian Geuer-Pollmann
- * @see <A HREF="ftp://ftp.isi.edu/in-notes/rfc2045.txt">RFC 2045</A>
+ * @see <A HREF="http://www.ietf.org/rfc/rfc2045.txt">RFC 2045</A>
  * @see com.sun.org.apache.xml.internal.security.transforms.implementations.TransformBase64Decode
  */
 public class Base64 {
--- a/jdk/src/share/classes/com/sun/security/auth/LdapPrincipal.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/share/classes/com/sun/security/auth/LdapPrincipal.java	Wed Jul 21 09:57:21 2010 -0700
@@ -31,7 +31,7 @@
 
 /**
  * A principal identified by a distinguished name as specified by
- * <a href="http://ietf.org//rfc/rfc2253.txt">RFC 2253</a>.
+ * <a href="http://www.ietf.org/rfc/rfc2253.txt">RFC 2253</a>.
  *
  * <p>
  * After successful authentication, a user {@link java.security.Principal}
@@ -122,7 +122,7 @@
 
     /**
      * Creates a string representation of this principal's name in the format
-     * defined by <a href="http://ietf.org/rfc/rfc2253.txt">RFC 2253</a>.
+     * defined by <a href="http://www.ietf.org/rfc/rfc2253.txt">RFC 2253</a>.
      * If the name has zero components an empty string is returned.
      *
      * @return The principal's string name.
--- a/jdk/src/share/classes/com/sun/security/sasl/CramMD5Client.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/share/classes/com/sun/security/sasl/CramMD5Client.java	Wed Jul 21 09:57:21 2010 -0700
@@ -33,7 +33,7 @@
 
 /**
   * Implements the CRAM-MD5 SASL client-side mechanism.
-  * (<A HREF="ftp://ftp.isi.edu/in-notes/rfc2195.txt">RFC 2195</A>).
+  * (<A HREF="http://www.ietf.org/rfc/rfc2195.txt">RFC 2195</A>).
   * CRAM-MD5 has no initial response. It receives bytes from
   * the server as a challenge, which it hashes by using MD5 and the password.
   * It concatenates the authentication ID with this result and returns it
--- a/jdk/src/share/classes/com/sun/security/sasl/CramMD5Server.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/share/classes/com/sun/security/sasl/CramMD5Server.java	Wed Jul 21 09:57:21 2010 -0700
@@ -38,7 +38,7 @@
 
 /**
   * Implements the CRAM-MD5 SASL server-side mechanism.
-  * (<A HREF="ftp://ftp.isi.edu/in-notes/rfc2195.txt">RFC 2195</A>).
+  * (<A HREF="http://www.ietf.org/rfc/rfc2195.txt">RFC 2195</A>).
   * CRAM-MD5 has no initial response.
   *
   * client <---- M={random, timestamp, server-fqdn} ------- server
--- a/jdk/src/share/classes/com/sun/security/sasl/ExternalClient.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/share/classes/com/sun/security/sasl/ExternalClient.java	Wed Jul 21 09:57:21 2010 -0700
@@ -29,7 +29,7 @@
 
 /**
   * Implements the EXTERNAL SASL client mechanism.
-  * (<A HREF="ftp://ftp.isi.edu/in-notes/rfc2222.txt">RFC 2222</A>).
+  * (<A HREF="http://www.ietf.org/rfc/rfc2222.txt">RFC 2222</A>).
   * The EXTERNAL mechanism returns the optional authorization ID as
   * the initial response. It processes no challenges.
   *
--- a/jdk/src/share/classes/com/sun/security/sasl/gsskerb/GssKrb5Client.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/share/classes/com/sun/security/sasl/gsskerb/GssKrb5Client.java	Wed Jul 21 09:57:21 2010 -0700
@@ -39,10 +39,10 @@
 
 /**
   * Implements the GSSAPI SASL client mechanism for Kerberos V5.
-  * (<A HREF="ftp://ftp.isi.edu/in-notes/rfc2222.txt">RFC 2222</A>,
+  * (<A HREF="http://www.ietf.org/rfc/rfc2222.txt">RFC 2222</A>,
   * <a HREF="http://www.ietf.org/internet-drafts/draft-ietf-cat-sasl-gssapi-04.txt">draft-ietf-cat-sasl-gssapi-04.txt</a>).
   * It uses the Java Bindings for GSSAPI
-  * (<A HREF="ftp://ftp.isi.edu/in-notes/rfc2853.txt">RFC 2853</A>)
+  * (<A HREF="http://www.ietf.org/rfc/rfc2853.txt">RFC 2853</A>)
   * for getting GSSAPI/Kerberos V5 support.
   *
   * The client/server interactions are:
--- a/jdk/src/share/classes/com/sun/security/sasl/gsskerb/GssKrb5Server.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/share/classes/com/sun/security/sasl/gsskerb/GssKrb5Server.java	Wed Jul 21 09:57:21 2010 -0700
@@ -39,7 +39,7 @@
 
 /**
   * Implements the GSSAPI SASL server mechanism for Kerberos V5.
-  * (<A HREF="ftp://ftp.isi.edu/in-notes/rfc2222.txt">RFC 2222</A>,
+  * (<A HREF="http://www.ietf.org/rfc/rfc2222.txt">RFC 2222</A>,
   * <a HREF="http://www.ietf.org/internet-drafts/draft-ietf-cat-sasl-gssapi-00.txt">draft-ietf-cat-sasl-gssapi-00.txt</a>).
   *
   * Expects thread's Subject to contain server's Kerberos credentials
--- a/jdk/src/share/classes/com/sun/servicetag/Registry.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/share/classes/com/sun/servicetag/Registry.java	Wed Jul 21 09:57:21 2010 -0700
@@ -67,7 +67,6 @@
     // 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 boolean supportsHelperClass = true; // default
     private static File stclient = null;
     private static String stclientPath = null;
     private static Registry registry = new Registry();
@@ -81,17 +80,6 @@
 
     private synchronized static String getSTclient() {
         if (!initialized) {
-            // the system property always overrides the default setting
-            if (System.getProperty(SVCTAG_STHELPER_SUPPORTED) != null) {
-                supportsHelperClass = Boolean.getBoolean(SVCTAG_STHELPER_SUPPORTED);
-            }
-
-            // This is only used for testing
-            stclientPath = System.getProperty(SVCTAG_STCLIENT_CMD);
-            if (stclientPath != null) {
-                return stclientPath;
-            }
-
             // Initialization to determine the platform's stclient pathname
             String os = System.getProperty("os.name");
             if (os.equals("SunOS")) {
@@ -108,10 +96,26 @@
             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();
         }
@@ -142,8 +146,8 @@
      * @return {@code true} if the {@code Registry} class is supported;
      * otherwise, return {@code false}.
      */
-    public static boolean isSupported() {
-        return (getSTclient() != null && supportsHelperClass);
+    public static synchronized boolean isSupported() {
+        return getSTclient() != null;
     }
 
     private static List<String> getCommandList() {
Binary file jdk/src/share/classes/com/sun/servicetag/resources/jdk_header.png has changed
--- a/jdk/src/share/classes/com/sun/servicetag/resources/register.html	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/share/classes/com/sun/servicetag/resources/register.html	Wed Jul 21 09:57:21 2010 -0700
@@ -53,13 +53,13 @@
   </tr>
   <tr>
     <td>&nbsp;</td>
-    <td><p class="style1">Thank you for installing the
+    <td><p class="style1">Thank you for installing the 
         <strong> Java Development Kit @@JDK_VERSION@@ </strong>
-        from Sun Microsystems. </p>
+        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 Sun developer products, services and training </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>
@@ -68,11 +68,11 @@
           <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@@">
+              <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 Sun product. </span></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>
@@ -81,16 +81,16 @@
     <tr>
        <td>&nbsp;</td>
        <td bgcolor="#f1f7df">
-       <p class="style3">Sun Microsystems, Inc. respects your privacy.
-    We will use your personal information for communications
-    and management of your Sun Online Account, the services
-    and applications you access using your Sun Online Account,
+       <p class="style3">Oracle Corporation respects your privacy. 
+    We will use your personal information for communications 
+    and management of your Sun Online Account, the services 
+    and applications you access using your Sun Online Account, 
     and the products and systems you register with your Sun Online Account.</p>
-                <p class="style3">For more information on the data that will be collected as
+                <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>
+          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 Sun's Privacy Policy see <a href="http://www.sun.com/privacy/">http://www.sun.com/privacy/</a> or contact <a class="moz-txt-link-rfc2396E" href="mailto:privacy@sun.com">privacy@sun.com.</a></p></td>
+          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>
--- a/jdk/src/share/classes/com/sun/servicetag/resources/register_ja.html	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/share/classes/com/sun/servicetag/resources/register_ja.html	Wed Jul 21 09:57:21 2010 -0700
@@ -50,11 +50,11 @@
   <tr>
     <td>&nbsp;</td>
 
-    <td><p class="style1">Sun Microsystems ã®<strong> Java Development Kit @@JDK_VERSION@@ </strong>をインストールã—ã¦ã„ãŸã ãã€ã‚ã‚ŠãŒã¨ã†ã”ã–ã„ã¾ã™ã€‚ </p>
+    <td><p class="style1">Oracle Corporation ã®<strong> Java Development Kit @@JDK_VERSION@@ </strong>をインストールã—ã¦ã„ãŸã ãã€ã‚ã‚ŠãŒã¨ã†ã”ã–ã„ã¾ã™ã€‚ </p>
         <p class="style1">製å“登録をã™ã‚‹ã¨ã€æ¬¡ã®ã‚ˆã†ãªç‰¹å…¸ã‚’å—ã‘ã‚‹ã“ã¨ãŒã§ãã¾ã™ã€‚</p>
         <ul class="style1">
           <li> 最新ã®ãƒãƒ¼ã‚¸ãƒ§ãƒ³ã€ãƒ‘ッãƒã€ãŠã‚ˆã³æ›´æ–°ã«ã¤ã„ã¦ã®é€šçŸ¥</li>
-          <li> Sun ã®é–‹ç™ºè€…å‘ã‘製å“ã€ã‚µãƒ¼ãƒ“スã€ãŠã‚ˆã³ãƒˆãƒ¬ãƒ¼ãƒ‹ãƒ³ã‚°ã®ç‰¹åˆ¥è²©å£² </li>
+          <li> Oracle ã®é–‹ç™ºè€…å‘ã‘製å“ã€ã‚µãƒ¼ãƒ“スã€ãŠã‚ˆã³ãƒˆãƒ¬ãƒ¼ãƒ‹ãƒ³ã‚°ã®ç‰¹åˆ¥è²©å£² </li>
           <li> アーリーリリースãŠã‚ˆã³ãƒ‰ã‚­ãƒ¥ãƒ¡ãƒ³ãƒˆã¸ã®ã‚¢ã‚¯ã‚»ã‚¹ </li>
         </ul>
         <p class="style1">製å“登録ã¯ç„¡æ–™ã§ã‚ã‚Šã€è¿…速ã§ç°¡å˜ã§ã™ã€‚</p>
@@ -62,11 +62,11 @@
           <p class="style1">å¿…è¦ã«ãªã‚‹ã®ã¯ã€Sun 開発者å‘ã‘ãƒãƒƒãƒˆãƒ¯ãƒ¼ã‚¯ã‚¢ã‚«ã‚¦ãƒ³ãƒˆã¾ãŸã¯ãã®ä»–ã® Sun オンラインアカウントã ã‘ã§ã™ã€‚ ã¾ã ã‚¢ã‚«ã‚¦ãƒ³ãƒˆãŒãªã„å ´åˆã¯ã€ã‚¢ã‚«ã‚¦ãƒ³ãƒˆã®ä½œæˆãŒæ±‚ã‚られã¾ã™ã€‚ </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@@">
+              <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">ã“ã® Sun 製å“を登録ã™ã‚‹ã«ã¯ã€ã‚¤ãƒ³ã‚¿ãƒ¼ãƒãƒƒãƒˆã«æŽ¥ç¶šã—ã¦ã„ã‚‹å¿…è¦ãŒã‚ã‚Šã¾ã™ã€‚ </span></td>
+              <td width="570"><span class="style3">ã“ã® Oracle 製å“を登録ã™ã‚‹ã«ã¯ã€ã‚¤ãƒ³ã‚¿ãƒ¼ãƒãƒƒãƒˆã«æŽ¥ç¶šã—ã¦ã„ã‚‹å¿…è¦ãŒã‚ã‚Šã¾ã™ã€‚ </span></td>
             </tr>
 	  </table>
 	</blockquote>
@@ -75,8 +75,8 @@
    <tr>
        <td>&nbsp;</td>
 	<td bgcolor="#f1f7df">
-        <p class="style3">Sun Microsystems, Inc. ã¯ã€ãŠå®¢æ§˜ã®ãƒ—ライãƒã‚·ãƒ¼ã‚’å°Šé‡ã—ã¾ã™ã€‚ ãŠå®¢æ§˜ã®å€‹äººæƒ…å ±ã¯ã€ãŠå®¢æ§˜ã® Sun オンラインアカウントã€ãŠå®¢æ§˜ãŒ Sun オンラインアカウントを使用ã—ã¦ã‚¢ã‚¯ã‚»ã‚¹ã™ã‚‹ã‚µãƒ¼ãƒ“スã¨ã‚¢ãƒ—リケーションã€ãŠã‚ˆã³ãŠå®¢æ§˜ãŒ Sun オンラインアカウントã§ç™»éŒ²ã™ã‚‹è£½å“ã¨ã‚·ã‚¹ãƒ†ãƒ ã®é€šä¿¡ã¨ç®¡ç†ã«ä½¿ç”¨ã—ã¾ã™ã€‚</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> Sun ã®ãƒ—ライãƒã‚·ãƒ¼ãƒãƒªã‚·ãƒ¼ã«ã¤ã„ã¦ã®è©³ç´°ã¯ã€<a href="http://jp.sun.com/privacy/">http://jp.sun.com/privacy/</a> ã‚’å‚ç…§ã™ã‚‹ã‹ã€<a class="moz-txt-link-rfc2396E" href="http://jp.sun.com/cgi-bin/contact/comment.cgi?url=http://jp.sun.com/privacy/">ãŠå•ã„åˆã‚ã›ãƒ•ã‚©ãƒ¼ãƒ </a>ã‹ã‚‰ãŠå•ã„åˆã‚ã›ãã ã•ã„。</p></td>
+        <p class="style3">Oracle Corporation ã¯ã€ãŠå®¢æ§˜ã®ãƒ—ライãƒã‚·ãƒ¼ã‚’å°Šé‡ã—ã¾ã™ã€‚ ãŠå®¢æ§˜ã®å€‹äººæƒ…å ±ã¯ã€ãŠå®¢æ§˜ã® Sun オンラインアカウントã€ãŠå®¢æ§˜ãŒ Sun オンラインアカウントを使用ã—ã¦ã‚¢ã‚¯ã‚»ã‚¹ã™ã‚‹ã‚µãƒ¼ãƒ“スã¨ã‚¢ãƒ—リケーションã€ãŠã‚ˆã³ãŠå®¢æ§˜ãŒ Sun オンラインアカウントã§ç™»éŒ²ã™ã‚‹è£½å“ã¨ã‚·ã‚¹ãƒ†ãƒ ã®é€šä¿¡ã¨ç®¡ç†ã«ä½¿ç”¨ã—ã¾ã™ã€‚</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>
--- a/jdk/src/share/classes/com/sun/servicetag/resources/register_zh_CN.html	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/share/classes/com/sun/servicetag/resources/register_zh_CN.html	Wed Jul 21 09:57:21 2010 -0700
@@ -51,11 +51,11 @@
   <tr>
     <td>&nbsp;</td>
 
-<td><p class="style1">感谢您安装 Sun Microsystems 的 <strong>Java Development Kit @@JDK_VERSION@@</strong>。 </p>
+<td><p class="style1">感谢您安装 Oracle Corporation 的 <strong>Java Development Kit @@JDK_VERSION@@</strong>。 </p>
 <p class="style1">注册产å“åŽæ‚¨å°†èŽ·å¾—如下增值æœåŠ¡ï¼š</p>
         <ul class="style1">
 <li> 获得新版本ã€ä¿®è¡¥ç¨‹åºå’Œæ›´æ–°çš„通知æœåŠ¡</li>
-<li> 获得有关 Sun å¼€å‘者产å“ã€æœåŠ¡å’ŒåŸ¹è®­çš„优惠 </li>
+<li> 获得有关 Oracle å¼€å‘者产å“ã€æœåŠ¡å’ŒåŸ¹è®­çš„优惠 </li>
 <li> 获得对早期版本和文档的访问æƒé™ </li>
         </ul>
 <p class="style1">产å“注册是å…费的,å³å¿«é€Ÿåˆè½»æ¾ï¼</p>
@@ -63,11 +63,11 @@
 <p class="style1">您需è¦å…·æœ‰ Sun å¼€å‘者网络或其他 Sun è”机å¸æˆ·ã€‚如果您没有,系统将æ示您创建一个。 </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@@">
+              <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 æ¥æ³¨å†Œæ­¤ Sun 产å“。 </span></td>
+<td width="570"><span class="style3">您需è¦è¿žæŽ¥åˆ° Internet æ¥æ³¨å†Œæ­¤ Oracle 产å“。 </span></td>
             </tr>
 	  </table>
 	</blockquote>
@@ -76,8 +76,8 @@
     <tr>
        <td>&nbsp;</td>
 	<td bgcolor="#f1f7df">
-        <p class="style3">Sun Microsystems, Inc. å°Šé‡æ‚¨çš„éšç§ã€‚我们会将您的个人信æ¯ç”¨äºŽé€šä¿¡å’Œ Sun è”机å¸æˆ·çš„管ç†ã€Sun è”机å¸æˆ·è®¿é—®çš„æœåŠ¡å’Œåº”用程åºä»¥åŠç”¨äºŽä½¿ç”¨ Sun è”机å¸æˆ·æ³¨å†Œçš„产å“和系统。</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>有关 Sun éšç§æ”¿ç­–的更多信æ¯ï¼Œè¯·è®¿é—® <a href="http://www.sun.com/privacy/">http://www.sun.com/privacy/</a> 或与 <a class="moz-txt-link-rfc2396E" href="mailto:privacy@sun.com">privacy@sun.com</a> è”系。</p></td>
+        <p class="style3">Oracle å°Šé‡æ‚¨çš„éšç§ã€‚我们会将您的个人信æ¯ç”¨äºŽé€šä¿¡å’Œ Sun è”机å¸æˆ·çš„管ç†ã€Sun è”机å¸æˆ·è®¿é—®çš„æœåŠ¡å’Œåº”用程åºä»¥åŠç”¨äºŽä½¿ç”¨ Sun è”机å¸æˆ·æ³¨å†Œçš„产å“和系统。</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>
--- a/jdk/src/share/classes/java/awt/EventDispatchThread.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/share/classes/java/awt/EventDispatchThread.java	Wed Jul 21 09:57:21 2010 -0700
@@ -61,85 +61,43 @@
  * @since 1.1
  */
 class EventDispatchThread extends Thread {
+
     private static final PlatformLogger eventLog = PlatformLogger.getLogger("java.awt.event.EventDispatchThread");
 
     private EventQueue theQueue;
     private boolean doDispatch = true;
+    private boolean threadDeathCaught = false;
+
     private static final int ANY_EVENT = -1;
 
     private Vector<EventFilter> eventFilters = new Vector<EventFilter>();
-    // used in handleException
-    private int modalFiltersCount = 0;
 
     EventDispatchThread(ThreadGroup group, String name, EventQueue queue) {
         super(group, name);
-        theQueue = queue;
+        setEventQueue(queue);
     }
 
-    void stopDispatchingImpl(boolean wait) {
-        // Note: We stop dispatching via a flag rather than using
-        // Thread.interrupt() because we can't guarantee that the wait()
-        // we interrupt will be EventQueue.getNextEvent()'s.  -fredx 8-11-98
-
-        StopDispatchEvent stopEvent = new StopDispatchEvent();
-
-        // wait for the dispatcher to complete
-        if (Thread.currentThread() != this) {
-
-            // fix 4122683, 4128923
-            // Post an empty event to ensure getNextEvent is unblocked
-            //
-            // We have to use postEventPrivate instead of postEvent because
-            // EventQueue.pop calls EventDispatchThread.stopDispatching.
-            // Calling SunToolkit.flushPendingEvents in this case could
-            // lead to deadlock.
-            theQueue.postEventPrivate(stopEvent);
-
-            if (wait) {
-                try {
-                    join();
-                } catch(InterruptedException e) {
-                }
-            }
-        } else {
-            stopEvent.dispatch();
-        }
-
-        theQueue.detachDispatchThread(this, false);
-    }
-
+    /*
+     * Must be called on EDT only, that's why no synchronization
+     */
     public void stopDispatching() {
-        stopDispatchingImpl(true);
-    }
-
-    public void stopDispatchingLater() {
-        stopDispatchingImpl(false);
-    }
-
-    class StopDispatchEvent extends AWTEvent implements ActiveEvent {
-        /*
-         * serialVersionUID
-         */
-        static final long serialVersionUID = -3692158172100730735L;
-
-        public StopDispatchEvent() {
-            super(EventDispatchThread.this,0);
-        }
-
-        public void dispatch() {
-            doDispatch = false;
-        }
+        doDispatch = false;
     }
 
     public void run() {
-        try {
-            pumpEvents(new Conditional() {
-                public boolean evaluate() {
-                    return true;
+        while (true) {
+            try {
+                pumpEvents(new Conditional() {
+                    public boolean evaluate() {
+                        return true;
+                    }
+                });
+            } finally {
+                EventQueue eq = getEventQueue();
+                if (eq.detachDispatchThread(this) || threadDeathCaught) {
+                    break;
                 }
-            });
-        } finally {
-            theQueue.detachDispatchThread(this, true);
+            }
         }
     }
 
@@ -190,7 +148,6 @@
                         }
                     }
                     eventFilters.add(k, filter);
-                    modalFiltersCount++;
                 } else {
                     eventFilters.add(filter);
                 }
@@ -200,28 +157,25 @@
 
     void removeEventFilter(EventFilter filter) {
         synchronized (eventFilters) {
-            if (eventFilters.contains(filter)) {
-                if (filter instanceof ModalEventFilter) {
-                    modalFiltersCount--;
-                }
-                eventFilters.remove(filter);
-            }
+            eventFilters.remove(filter);
         }
     }
 
     boolean pumpOneEventForFilters(int id) {
+        AWTEvent event = null;
+        boolean eventOK = false;
         try {
-            AWTEvent event;
-            boolean eventOK;
-            EventQueueDelegate.Delegate delegate =
-                EventQueueDelegate.getDelegate();
+            EventQueue eq = null;
+            EventQueueDelegate.Delegate delegate = null;
             do {
+                // EventQueue may change during the dispatching
+                eq = getEventQueue();
+                delegate = EventQueueDelegate.getDelegate();
+
                 if (delegate != null && id == ANY_EVENT) {
-                    event = delegate.getNextEvent(theQueue);
+                    event = delegate.getNextEvent(eq);
                 } else {
-                    event = (id == ANY_EVENT)
-                        ? theQueue.getNextEvent()
-                        : theQueue.getNextEvent(id);
+                    event = (id == ANY_EVENT) ? eq.getNextEvent() : eq.getNextEvent(id);
                 }
 
                 eventOK = true;
@@ -252,13 +206,15 @@
             if (delegate != null) {
                 handle = delegate.beforeDispatch(event);
             }
-            theQueue.dispatchEvent(event);
+            eq.dispatchEvent(event);
             if (delegate != null) {
                 delegate.afterDispatch(event, handle);
             }
+
             return true;
         }
         catch (ThreadDeath death) {
+            threadDeathCaught = true;
             return false;
 
         }
@@ -267,12 +223,10 @@
                           // Threads in the AppContext
 
         }
-        // Can get and throw only unchecked exceptions
-        catch (RuntimeException e) {
-            processException(e);
-        } catch (Error e) {
+        catch (Throwable e) {
             processException(e);
         }
+
         return true;
     }
 
@@ -281,14 +235,14 @@
             eventLog.fine("Processing exception: " + e);
         }
         getUncaughtExceptionHandler().uncaughtException(this, e);
-        // don't rethrow the exception to avoid EDT recreation
     }
 
-    boolean isDispatching(EventQueue eq) {
-        return theQueue.equals(eq);
+    public synchronized EventQueue getEventQueue() {
+        return theQueue;
     }
-
-    EventQueue getEventQueue() { return theQueue; }
+    public synchronized void setEventQueue(EventQueue eq) {
+        theQueue = eq;
+    }
 
     private static class HierarchyEventFilter implements EventFilter {
         private Component modalComponent;
--- a/jdk/src/share/classes/java/awt/EventQueue.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/share/classes/java/awt/EventQueue.java	Wed Jul 21 09:57:21 2010 -0700
@@ -138,6 +138,15 @@
     private final Lock pushPopLock;
     private final Condition pushPopCond;
 
+    /*
+     * Dummy runnable to wake up EDT from getNextEvent() after
+     push/pop is performed
+     */
+    private final static Runnable dummyRunnable = new Runnable() {
+        public void run() {
+        }
+    };
+
     private EventDispatchThread dispatchThread;
 
     private final ThreadGroup threadGroup =
@@ -219,22 +228,22 @@
      * @param theEvent an instance of <code>java.awt.AWTEvent</code>,
      *          or a subclass of it
      */
-    final void postEventPrivate(AWTEvent theEvent) {
+    private final void postEventPrivate(AWTEvent theEvent) {
         theEvent.isPosted = true;
         pushPopLock.lock();
         try {
-            if (dispatchThread == null && nextQueue == null) {
+            if (nextQueue != null) {
+                // Forward the event to the top of EventQueue stack
+                nextQueue.postEventPrivate(theEvent);
+                return;
+            }
+            if (dispatchThread == null) {
                 if (theEvent.getSource() == AWTAutoShutdown.getInstance()) {
                     return;
                 } else {
                     initDispatchThread();
                 }
             }
-            if (nextQueue != null) {
-                // Forward event to top of EventQueue stack.
-                nextQueue.postEventPrivate(theEvent);
-                return;
-            }
             postEvent(theEvent, getPriority(theEvent));
         } finally {
             pushPopLock.unlock();
@@ -242,29 +251,20 @@
     }
 
     private static int getPriority(AWTEvent theEvent) {
-        if (theEvent instanceof PeerEvent &&
-            (((PeerEvent)theEvent).getFlags() &
-                PeerEvent.ULTIMATE_PRIORITY_EVENT) != 0)
-        {
-            return ULTIMATE_PRIORITY;
+        if (theEvent instanceof PeerEvent) {
+            PeerEvent peerEvent = (PeerEvent)theEvent;
+            if ((peerEvent.getFlags() & PeerEvent.ULTIMATE_PRIORITY_EVENT) != 0) {
+                return ULTIMATE_PRIORITY;
+            }
+            if ((peerEvent.getFlags() & PeerEvent.PRIORITY_EVENT) != 0) {
+                return HIGH_PRIORITY;
+            }
+            if ((peerEvent.getFlags() & PeerEvent.LOW_PRIORITY_EVENT) != 0) {
+                return LOW_PRIORITY;
+            }
         }
-
-        if (theEvent instanceof PeerEvent &&
-            (((PeerEvent)theEvent).getFlags() &
-                PeerEvent.PRIORITY_EVENT) != 0)
-        {
-            return HIGH_PRIORITY;
-        }
-
-        if (theEvent instanceof PeerEvent &&
-            (((PeerEvent)theEvent).getFlags() &
-                PeerEvent.LOW_PRIORITY_EVENT) != 0)
-        {
-            return LOW_PRIORITY;
-        }
-
         int id = theEvent.getID();
-        if (id == PaintEvent.PAINT || id == PaintEvent.UPDATE) {
+        if ((id >= PaintEvent.PAINT_FIRST) && (id <= PaintEvent.PAINT_LAST)) {
             return LOW_PRIORITY;
         }
         return NORM_PRIORITY;
@@ -501,16 +501,9 @@
             SunToolkit.flushPendingEvents();
             pushPopLock.lock();
             try {
-                for (int i = NUM_PRIORITIES - 1; i >= 0; i--) {
-                    if (queues[i].head != null) {
-                        EventQueueItem entry = queues[i].head;
-                        queues[i].head = entry.next;
-                        if (entry.next == null) {
-                            queues[i].tail = null;
-                        }
-                        uncacheEQItem(entry);
-                        return entry.event;
-                    }
+                AWTEvent event = getNextEventPrivate();
+                if (event != null) {
+                    return event;
                 }
                 AWTAutoShutdown.getInstance().notifyThreadFree(dispatchThread);
                 pushPopCond.await();
@@ -520,6 +513,24 @@
         } while(true);
     }
 
+    /*
+     * Must be called under the lock. Doesn't call flushPendingEvents()
+     */
+    AWTEvent getNextEventPrivate() throws InterruptedException {
+        for (int i = NUM_PRIORITIES - 1; i >= 0; i--) {
+            if (queues[i].head != null) {
+                EventQueueItem entry = queues[i].head;
+                queues[i].head = entry.next;
+                if (entry.next == null) {
+                    queues[i].tail = null;
+                }
+                uncacheEQItem(entry);
+                return entry.event;
+            }
+        }
+        return null;
+    }
+
     AWTEvent getNextEvent(int id) throws InterruptedException {
         do {
             /*
@@ -659,7 +670,9 @@
                 dispatchThread.stopDispatching();
             }
         } else {
-            System.err.println("unable to dispatch event: " + event);
+            if (eventLog.isLoggable(PlatformLogger.FINE)) {
+                eventLog.fine("Unable to dispatch event: " + event);
+            }
         }
     }
 
@@ -761,15 +774,23 @@
 
         pushPopLock.lock();
         try {
-            EventQueue toPush = this;
-            while (toPush.nextQueue != null) {
-                toPush = toPush.nextQueue;
+            EventQueue topQueue = this;
+            while (topQueue.nextQueue != null) {
+                topQueue = topQueue.nextQueue;
+            }
+
+            if ((topQueue.dispatchThread != null) &&
+                (topQueue.dispatchThread.getEventQueue() == this))
+            {
+                newEventQueue.dispatchThread = topQueue.dispatchThread;
+                topQueue.dispatchThread.setEventQueue(newEventQueue);
             }
 
             // Transfer all events forward to new EventQueue.
-            while (toPush.peekEvent() != null) {
+            while (topQueue.peekEvent() != null) {
                 try {
-                    newEventQueue.postEventPrivate(toPush.getNextEvent());
+                    // Use getNextEventPrivate() as it doesn't call flushPendingEvents()
+                    newEventQueue.postEventPrivate(topQueue.getNextEventPrivate());
                 } catch (InterruptedException ie) {
                     if (eventLog.isLoggable(PlatformLogger.FINE)) {
                         eventLog.fine("Interrupted push", ie);
@@ -777,28 +798,21 @@
                 }
             }
 
-            newEventQueue.previousQueue = toPush;
+            // Wake up EDT waiting in getNextEvent(), so it can
+            // pick up a new EventQueue. Post the waking event before
+            // topQueue.nextQueue is assigned, otherwise the event would
+            // go newEventQueue
+            topQueue.postEventPrivate(new InvocationEvent(topQueue, dummyRunnable));
 
-            /*
-             * Stop the event dispatch thread associated with the currently
-             * active event queue, so that after the new queue is pushed
-             * on the top this event dispatch thread won't prevent AWT from
-             * being automatically shut down.
-             * Use stopDispatchingLater() to avoid deadlock: stopDispatching()
-             * waits for the dispatch thread to exit, which in turn waits
-             * for the lock in EQ.detachDispatchThread(), which is hold by
-             * this method.
-             */
-            if (toPush.dispatchThread != null) {
-                toPush.dispatchThread.stopDispatchingLater();
+            newEventQueue.previousQueue = topQueue;
+            topQueue.nextQueue = newEventQueue;
+
+            AppContext appContext = AppContext.getAppContext();
+            if (appContext.get(AppContext.EVENT_QUEUE_KEY) == topQueue) {
+                appContext.put(AppContext.EVENT_QUEUE_KEY, newEventQueue);
             }
 
-            toPush.nextQueue = newEventQueue;
-
-            AppContext appContext = AppContext.getAppContext();
-            if (appContext.get(AppContext.EVENT_QUEUE_KEY) == toPush) {
-                appContext.put(AppContext.EVENT_QUEUE_KEY, newEventQueue);
-            }
+            pushPopCond.signalAll();
         } finally {
             pushPopLock.unlock();
         }
@@ -822,44 +836,51 @@
             eventLog.fine("EventQueue.pop(" + this + ")");
         }
 
-        EventDispatchThread dt = null;
         pushPopLock.lock();
         try {
-            EventQueue toPop = this;
-            while (toPop.nextQueue != null) {
-                toPop = toPop.nextQueue;
+            EventQueue topQueue = this;
+            while (topQueue.nextQueue != null) {
+                topQueue = topQueue.nextQueue;
             }
-            EventQueue prev = toPop.previousQueue;
-            if (prev == null) {
+            EventQueue prevQueue = topQueue.previousQueue;
+            if (prevQueue == null) {
                 throw new EmptyStackException();
             }
-            toPop.previousQueue = null;
+
+            topQueue.previousQueue = null;
+            prevQueue.nextQueue = null;
 
             // Transfer all events back to previous EventQueue.
-            prev.nextQueue = null;
-            while (toPop.peekEvent() != null) {
+            while (topQueue.peekEvent() != null) {
                 try {
-                    prev.postEventPrivate(toPop.getNextEvent());
+                    prevQueue.postEventPrivate(topQueue.getNextEventPrivate());
                 } catch (InterruptedException ie) {
                     if (eventLog.isLoggable(PlatformLogger.FINE)) {
                         eventLog.fine("Interrupted pop", ie);
                     }
                 }
             }
-            AppContext appContext = AppContext.getAppContext();
-            if (appContext.get(AppContext.EVENT_QUEUE_KEY) == this) {
-                appContext.put(AppContext.EVENT_QUEUE_KEY, prev);
+
+            if ((topQueue.dispatchThread != null) &&
+                (topQueue.dispatchThread.getEventQueue() == this))
+            {
+                prevQueue.dispatchThread = topQueue.dispatchThread;
+                topQueue.dispatchThread.setEventQueue(prevQueue);
             }
 
-            dt = toPop.dispatchThread;
+            AppContext appContext = AppContext.getAppContext();
+            if (appContext.get(AppContext.EVENT_QUEUE_KEY) == this) {
+                appContext.put(AppContext.EVENT_QUEUE_KEY, prevQueue);
+            }
+
+            // Wake up EDT waiting in getNextEvent(), so it can
+            // pick up a new EventQueue
+            topQueue.postEventPrivate(new InvocationEvent(topQueue, dummyRunnable));
+
+            pushPopCond.signalAll();
         } finally {
             pushPopLock.unlock();
         }
-
-        if (dt != null) {
-            dt.stopDispatching(); // Must be done outside synchronized
-                                  // block to avoid possible deadlock
-        }
     }
 
     /**
@@ -907,9 +928,9 @@
         try {
             AppContext appContext = AppContext.getAppContext();
             if (dispatchThread == null && !threadGroup.isDestroyed() && !appContext.isDisposed()) {
-                dispatchThread = (EventDispatchThread)
-                    AccessController.doPrivileged(new PrivilegedAction() {
-                        public Object run() {
+                dispatchThread = AccessController.doPrivileged(
+                    new PrivilegedAction<EventDispatchThread>() {
+                        public EventDispatchThread run() {
                             EventDispatchThread t =
                                 new EventDispatchThread(threadGroup,
                                                         name,
@@ -919,7 +940,8 @@
                             t.setDaemon(false);
                             return t;
                         }
-                    });
+                    }
+                );
                 AWTAutoShutdown.getInstance().notifyThreadBusy(dispatchThread);
                 dispatchThread.start();
             }
@@ -928,7 +950,7 @@
         }
     }
 
-    final void detachDispatchThread(EventDispatchThread edt, boolean restart) {
+    final boolean detachDispatchThread(EventDispatchThread edt) {
         /*
          * This synchronized block is to secure that the event dispatch
          * thread won't die in the middle of posting a new event to the
@@ -939,26 +961,21 @@
          */
         pushPopLock.lock();
         try {
-            EventDispatchThread oldDispatchThread = dispatchThread;
-            if (dispatchThread == edt) {
-                dispatchThread = null;
-            }
-            if (restart) {
+            if (edt == dispatchThread) {
                 /*
-                 * Event dispatch thread dies in case of an uncaught exception.
-                 * A new event dispatch thread for this queue will be started
-                 * only if a new event is posted to it. In case if no more
-                 * events are posted after this thread died all events that
-                 * currently are in the queue will never be dispatched.
+                 * Don't detach the thread if any events are pending. Not
+                 * sure if it's a possible scenario, though.
                  *
                  * Fix for 4648733. Check both the associated java event
                  * queue and the PostEventQueue.
                  */
                 if ((peekEvent() != null) || !SunToolkit.isPostEventQueueEmpty()) {
-                    initDispatchThread();
+                    return false;
                 }
-                AWTAutoShutdown.getInstance().notifyThreadFree(oldDispatchThread);
+                dispatchThread = null;
             }
+            AWTAutoShutdown.getInstance().notifyThreadFree(edt);
+            return true;
         } finally {
             pushPopLock.unlock();
         }
--- a/jdk/src/share/classes/java/awt/Font.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/share/classes/java/awt/Font.java	Wed Jul 21 09:57:21 2010 -0700
@@ -343,6 +343,10 @@
      * Identify a font resource of type TRUETYPE.
      * Used to specify a TrueType font resource to the
      * {@link #createFont} method.
+     * The TrueType format was extended to become the OpenType
+     * format, which adds support for fonts with Postscript outlines,
+     * this tag therefore references these fonts, as well as those
+     * with TrueType outlines.
      * @since 1.3
      */
 
--- a/jdk/src/share/classes/java/beans/DefaultPersistenceDelegate.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/share/classes/java/beans/DefaultPersistenceDelegate.java	Wed Jul 21 09:57:21 2010 -0700
@@ -222,6 +222,25 @@
 
     // Write out the properties of this instance.
     private void initBean(Class type, Object oldInstance, Object newInstance, Encoder out) {
+        for (Field field : type.getFields()) {
+            int mod = field.getModifiers();
+            if (Modifier.isFinal(mod) || Modifier.isStatic(mod) || Modifier.isTransient(mod)) {
+                continue;
+            }
+            try {
+                Expression oldGetExp = new Expression(field, "get", new Object[] { oldInstance });
+                Expression newGetExp = new Expression(field, "get", new Object[] { newInstance });
+                Object oldValue = oldGetExp.getValue();
+                Object newValue = newGetExp.getValue();
+                out.writeExpression(oldGetExp);
+                if (!equals(newValue, out.get(oldValue))) {
+                    out.writeStatement(new Statement(field, "set", new Object[] { oldInstance, oldValue }));
+                }
+            }
+            catch (Exception exception) {
+                out.getExceptionListener().exceptionThrown(exception);
+            }
+        }
         BeanInfo info;
         try {
             info = Introspector.getBeanInfo(type);
--- a/jdk/src/share/classes/java/beans/Encoder.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/share/classes/java/beans/Encoder.java	Wed Jul 21 09:57:21 2010 -0700
@@ -194,13 +194,8 @@
      * @see java.beans.BeanInfo#getBeanDescriptor
      */
     public PersistenceDelegate getPersistenceDelegate(Class<?> type) {
-        synchronized (this.finder) {
-            PersistenceDelegate pd = this.finder.find(type);
-            if (pd != null) {
-                return pd;
-            }
-        }
-        return MetaData.getPersistenceDelegate(type);
+        PersistenceDelegate pd = this.finder.find(type);
+        return (pd != null) ? pd : MetaData.getPersistenceDelegate(type);
     }
 
     /**
@@ -214,9 +209,7 @@
      * @see java.beans.BeanInfo#getBeanDescriptor
      */
     public void setPersistenceDelegate(Class<?> type, PersistenceDelegate delegate) {
-        synchronized (this.finder) {
-            this.finder.register(type, delegate);
-        }
+        this.finder.register(type, delegate);
     }
 
     /**
--- a/jdk/src/share/classes/java/beans/EventSetDescriptor.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/share/classes/java/beans/EventSetDescriptor.java	Wed Jul 21 09:57:21 2010 -0700
@@ -27,6 +27,7 @@
 
 import java.lang.ref.Reference;
 import java.lang.reflect.Method;
+import java.lang.reflect.Modifier;
 
 /**
  * An EventSetDescriptor describes a group of events that a given Java
@@ -175,10 +176,8 @@
         setRemoveListenerMethod(getMethod(sourceClass, removeListenerMethodName, 1));
 
         // Be more forgiving of not finding the getListener method.
-        Method method = Introspector.findMethod(sourceClass,
-                                                getListenerMethodName, 0);
-        if (method != null) {
-            setGetListenerMethod(method);
+        if (getListenerMethodName != null) {
+            setGetListenerMethod(Introspector.findInstanceMethod(sourceClass, getListenerMethodName));
         }
     }
 
@@ -188,7 +187,7 @@
             return null;
         }
         Method method = Introspector.findMethod(cls, name, args);
-        if (method == null) {
+        if ((method == null) || Modifier.isStatic(method.getModifiers())) {
             throw new IntrospectionException("Method not found: " + name +
                                              " on class " + cls.getName());
         }
--- a/jdk/src/share/classes/java/beans/IndexedPropertyDescriptor.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/share/classes/java/beans/IndexedPropertyDescriptor.java	Wed Jul 21 09:57:21 2010 -0700
@@ -189,16 +189,11 @@
                     indexedReadMethodName = Introspector.GET_PREFIX + getBaseName();
                 }
             }
-
-            Class[] args = { int.class };
-
-            indexedReadMethod = Introspector.findMethod(cls, indexedReadMethodName,
-                                                        1, args);
+            indexedReadMethod = Introspector.findInstanceMethod(cls, indexedReadMethodName, int.class);
             if (indexedReadMethod == null) {
                 // no "is" method, so look for a "get" method.
                 indexedReadMethodName = Introspector.GET_PREFIX + getBaseName();
-                indexedReadMethod = Introspector.findMethod(cls, indexedReadMethodName,
-                                                            1, args);
+                indexedReadMethod = Introspector.findInstanceMethod(cls, indexedReadMethodName, int.class);
             }
             setIndexedReadMethod0(indexedReadMethod);
         }
@@ -270,8 +265,7 @@
             if (indexedWriteMethodName == null) {
                 indexedWriteMethodName = Introspector.SET_PREFIX + getBaseName();
             }
-            indexedWriteMethod = Introspector.findMethod(cls, indexedWriteMethodName,
-                         2, (type == null) ? null : new Class[] { int.class, type });
+            indexedWriteMethod = Introspector.findInstanceMethod(cls, indexedWriteMethodName, int.class, type);
             if (indexedWriteMethod != null) {
                 if (!indexedWriteMethod.getReturnType().equals(void.class)) {
                     indexedWriteMethod = null;
--- a/jdk/src/share/classes/java/beans/Introspector.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/share/classes/java/beans/Introspector.java	Wed Jul 21 09:57:21 2010 -0700
@@ -28,6 +28,7 @@
 import com.sun.beans.WeakCache;
 import com.sun.beans.finder.BeanInfoFinder;
 import com.sun.beans.finder.ClassFinder;
+import com.sun.beans.finder.MethodFinder;
 
 import java.lang.ref.Reference;
 import java.lang.ref.SoftReference;
@@ -157,21 +158,23 @@
         if (!ReflectUtil.isPackageAccessible(beanClass)) {
             return (new Introspector(beanClass, null, USE_ALL_BEANINFO)).getBeanInfo();
         }
+        Map<Class<?>, BeanInfo> beanInfoCache;
+        BeanInfo beanInfo;
         synchronized (BEANINFO_CACHE) {
-            Map<Class<?>, BeanInfo> beanInfoCache =
-                    (Map<Class<?>, BeanInfo>) AppContext.getAppContext().get(BEANINFO_CACHE);
-
+            beanInfoCache = (Map<Class<?>, BeanInfo>) AppContext.getAppContext().get(BEANINFO_CACHE);
             if (beanInfoCache == null) {
                 beanInfoCache = new WeakHashMap<Class<?>, BeanInfo>();
                 AppContext.getAppContext().put(BEANINFO_CACHE, beanInfoCache);
             }
-            BeanInfo beanInfo = beanInfoCache.get(beanClass);
-            if (beanInfo == null) {
-                beanInfo = (new Introspector(beanClass, null, USE_ALL_BEANINFO)).getBeanInfo();
+            beanInfo = beanInfoCache.get(beanClass);
+        }
+        if (beanInfo == null) {
+            beanInfo = new Introspector(beanClass, null, USE_ALL_BEANINFO).getBeanInfo();
+            synchronized (BEANINFO_CACHE) {
                 beanInfoCache.put(beanClass, beanInfo);
             }
-            return beanInfo;
         }
+        return beanInfo;
     }
 
     /**
@@ -301,10 +304,7 @@
      */
 
     public static String[] getBeanInfoSearchPath() {
-        BeanInfoFinder finder = getFinder();
-        synchronized (finder) {
-            return finder.getPackages();
-        }
+        return getFinder().getPackages();
     }
 
     /**
@@ -328,10 +328,7 @@
         if (sm != null) {
             sm.checkPropertiesAccess();
         }
-        BeanInfoFinder finder = getFinder();
-        synchronized (finder) {
-            finder.setPackages(path);
-        }
+        getFinder().setPackages(path);
     }
 
 
@@ -453,10 +450,7 @@
      * @return Instance of an explicit BeanInfo class or null if one isn't found.
      */
     private static BeanInfo findExplicitBeanInfo(Class beanClass) {
-        BeanInfoFinder finder = getFinder();
-        synchronized (finder) {
-            return finder.find(beanClass);
-        }
+        return getFinder().find(beanClass);
     }
 
     /**
@@ -849,8 +843,8 @@
                 Method read = result.getReadMethod();
 
                 if (read == null && write != null) {
-                    read = findMethod(result.getClass0(),
-                                      GET_PREFIX + NameGenerator.capitalize(result.getName()), 0);
+                    read = findInstanceMethod(result.getClass0(),
+                                              GET_PREFIX + NameGenerator.capitalize(result.getName()));
                     if (read != null) {
                         try {
                             result.setReadMethod(read);
@@ -860,9 +854,9 @@
                     }
                 }
                 if (write == null && read != null) {
-                    write = findMethod(result.getClass0(),
-                                       SET_PREFIX + NameGenerator.capitalize(result.getName()), 1,
-                                       new Class[] { FeatureDescriptor.getReturnType(result.getClass0(), read) });
+                    write = findInstanceMethod(result.getClass0(),
+                                               SET_PREFIX + NameGenerator.capitalize(result.getName()),
+                                               FeatureDescriptor.getReturnType(result.getClass0(), read));
                     if (write != null) {
                         try {
                             result.setWriteMethod(write);
@@ -1286,90 +1280,27 @@
     // Package private support methods.
     //======================================================================
 
-    /**
-     * Internal support for finding a target methodName with a given
-     * parameter list on a given class.
-     */
-    private static Method internalFindMethod(Class start, String methodName,
-                                                 int argCount, Class args[]) {
-        // For overriden methods we need to find the most derived version.
-        // So we start with the given class and walk up the superclass chain.
-
-        Method method = null;
-
-        for (Class cl = start; cl != null; cl = cl.getSuperclass()) {
-            Method methods[] = getPublicDeclaredMethods(cl);
-            for (int i = 0; i < methods.length; i++) {
-                method = methods[i];
-                if (method == null) {
-                    continue;
+    static Method findMethod(Class<?> type, String name, int args) {
+        for (Method method : type.getMethods()) {
+            if (method.getName().equals(name) && (args == method.getParameterTypes().length)) {
+                try {
+                    return MethodFinder.findAccessibleMethod(method);
                 }
-
-                // 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;
-                                    continue;
-                                }
-                            }
-                            if (different) {
-                                continue;
-                            }
-                        }
-                    }
-                    return method;
+                catch (NoSuchMethodException exception) {
+                    // continue search for a method with the specified count of parameters
                 }
             }
         }
-        method = null;
-
-        // Now check any inherited interfaces.  This is necessary both when
-        // the argument class is itself an interface, and when the argument
-        // class is an abstract class.
-        Class ifcs[] = start.getInterfaces();
-        for (int i = 0 ; i < ifcs.length; i++) {
-            // Note: The original implementation had both methods calling
-            // the 3 arg method. This is preserved but perhaps it should
-            // pass the args array instead of null.
-            method = internalFindMethod(ifcs[i], methodName, argCount, null);
-            if (method != null) {
-                break;
-            }
-        }
-        return method;
+        return null;
     }
 
-    /**
-     * Find a target methodName on a given class.
-     */
-    static Method findMethod(Class cls, String methodName, int argCount) {
-        return findMethod(cls, methodName, argCount, null);
-    }
-
-    /**
-     * Find a target methodName with specific parameter list on a given class.
-     * <p>
-     * Used in the contructors of the EventSetDescriptor,
-     * PropertyDescriptor and the IndexedPropertyDescriptor.
-     * <p>
-     * @param cls The Class object on which to retrieve the method.
-     * @param methodName Name of the method.
-     * @param argCount Number of arguments for the desired method.
-     * @param args Array of argument types for the method.
-     * @return the method or null if not found
-     */
-    static Method findMethod(Class cls, String methodName, int argCount,
-                             Class args[]) {
-        if (methodName == null) {
+    static Method findInstanceMethod(Class<?> type, String name, Class<?>... args) {
+        try {
+            return MethodFinder.findInstanceMethod(type, name, args);
+        }
+        catch (NoSuchMethodException exception) {
             return null;
         }
-        return internalFindMethod(cls, methodName, argCount, args);
     }
 
     /**
--- a/jdk/src/share/classes/java/beans/MetaData.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/share/classes/java/beans/MetaData.java	Wed Jul 21 09:57:21 2010 -0700
@@ -701,56 +701,6 @@
 // AWT
 
 /**
- * The persistence delegate for {@link Dimension}.
- * It is impossible to use {@link DefaultPersistenceDelegate}
- * because all getters have return types that differ from parameter types
- * of the constructor {@link Dimension#Dimension(int, int)}.
- *
- * @author Sergey A. Malenkov
- */
-final class java_awt_Dimension_PersistenceDelegate extends PersistenceDelegate {
-    protected boolean mutatesTo(Object oldInstance, Object newInstance) {
-        return oldInstance.equals(newInstance);
-    }
-
-    protected Expression instantiate(Object oldInstance, Encoder out) {
-        Dimension dimension = (Dimension) oldInstance;
-        Object[] args = new Object[] {
-                dimension.width,
-                dimension.height,
-        };
-        return new Expression(dimension, dimension.getClass(), "new", args);
-    }
-}
-
-/**
- * The persistence delegate for {@link GridBagConstraints}.
- * It is impossible to use {@link DefaultPersistenceDelegate}
- * because this class does not have any properties.
- *
- * @author Sergey A. Malenkov
- */
-final class java_awt_GridBagConstraints_PersistenceDelegate extends PersistenceDelegate {
-    protected Expression instantiate(Object oldInstance, Encoder out) {
-        GridBagConstraints gbc = (GridBagConstraints) oldInstance;
-        Object[] args = new Object[] {
-                gbc.gridx,
-                gbc.gridy,
-                gbc.gridwidth,
-                gbc.gridheight,
-                gbc.weightx,
-                gbc.weighty,
-                gbc.anchor,
-                gbc.fill,
-                gbc.insets,
-                gbc.ipadx,
-                gbc.ipady,
-        };
-        return new Expression(gbc, gbc.getClass(), "new", args);
-    }
-}
-
-/**
  * The persistence delegate for {@link Insets}.
  * It is impossible to use {@link DefaultPersistenceDelegate}
  * because this class does not have any properties.
@@ -775,54 +725,6 @@
 }
 
 /**
- * The persistence delegate for {@link Point}.
- * It is impossible to use {@link DefaultPersistenceDelegate}
- * because all getters have return types that differ from parameter types
- * of the constructor {@link Point#Point(int, int)}.
- *
- * @author Sergey A. Malenkov
- */
-final class java_awt_Point_PersistenceDelegate extends PersistenceDelegate {
-    protected boolean mutatesTo(Object oldInstance, Object newInstance) {
-        return oldInstance.equals(newInstance);
-    }
-
-    protected Expression instantiate(Object oldInstance, Encoder out) {
-        Point point = (Point) oldInstance;
-        Object[] args = new Object[] {
-                point.x,
-                point.y,
-        };
-        return new Expression(point, point.getClass(), "new", args);
-    }
-}
-
-/**
- * The persistence delegate for {@link Rectangle}.
- * It is impossible to use {@link DefaultPersistenceDelegate}
- * because all getters have return types that differ from parameter types
- * of the constructor {@link Rectangle#Rectangle(int, int, int, int)}.
- *
- * @author Sergey A. Malenkov
- */
-final class java_awt_Rectangle_PersistenceDelegate extends PersistenceDelegate {
-    protected boolean mutatesTo(Object oldInstance, Object newInstance) {
-        return oldInstance.equals(newInstance);
-    }
-
-    protected Expression instantiate(Object oldInstance, Encoder out) {
-        Rectangle rectangle = (Rectangle) oldInstance;
-        Object[] args = new Object[] {
-                rectangle.x,
-                rectangle.y,
-                rectangle.width,
-                rectangle.height,
-        };
-        return new Expression(rectangle, rectangle.getClass(), "new", args);
-    }
-}
-
-/**
  * The persistence delegate for {@link Font}.
  * It is impossible to use {@link DefaultPersistenceDelegate}
  * because size of the font can be float value.
--- a/jdk/src/share/classes/java/beans/MethodDescriptor.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/share/classes/java/beans/MethodDescriptor.java	Wed Jul 21 09:57:21 2010 -0700
@@ -82,21 +82,21 @@
         Method method = getMethod0();
         if (method == null) {
             Class cls = getClass0();
-            if (cls != null) {
+            String name = getName();
+            if ((cls != null) && (name != null)) {
                 Class[] params = getParams();
                 if (params == null) {
                     for (int i = 0; i < 3; i++) {
                         // Find methods for up to 2 params. We are guessing here.
                         // This block should never execute unless the classloader
                         // that loaded the argument classes disappears.
-                        method = Introspector.findMethod(cls, getName(), i, null);
+                        method = Introspector.findMethod(cls, name, i);
                         if (method != null) {
                             break;
                         }
                     }
                 } else {
-                    method = Introspector.findMethod(cls, getName(),
-                                                     params.length, params);
+                    method = Statement.getMethod(cls, name, params);
                 }
                 setMethod(method);
             }
--- a/jdk/src/share/classes/java/beans/PropertyDescriptor.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/share/classes/java/beans/PropertyDescriptor.java	Wed Jul 21 09:57:21 2010 -0700
@@ -112,9 +112,7 @@
         // If this class or one of its base classes allow PropertyChangeListener,
         // then we assume that any properties we discover are "bound".
         // See Introspector.getTargetPropertyInfo() method.
-        String name = "addPropertyChangeListener";
-        Class[] args = {PropertyChangeListener.class};
-        this.bound = (null != Introspector.findMethod(beanClass, name, args.length, args));
+        this.bound = null != Introspector.findInstanceMethod(beanClass, "addPropertyChangeListener", PropertyChangeListener.class);
     }
 
     /**
@@ -225,10 +223,10 @@
             // property type is.  For booleans, there can be "is" and "get"
             // methods.  If an "is" method exists, this is the official
             // reader method so look for this one first.
-            readMethod = Introspector.findMethod(cls, readMethodName, 0);
+            readMethod = Introspector.findInstanceMethod(cls, readMethodName);
             if (readMethod == null) {
                 readMethodName = Introspector.GET_PREFIX + getBaseName();
-                readMethod = Introspector.findMethod(cls, readMethodName, 0);
+                readMethod = Introspector.findInstanceMethod(cls, readMethodName);
             }
             try {
                 setReadMethod(readMethod);
@@ -293,8 +291,7 @@
                 writeMethodName = Introspector.SET_PREFIX + getBaseName();
             }
 
-            writeMethod = Introspector.findMethod(cls, writeMethodName, 1,
-                          (type == null) ? null : new Class[] { type });
+            writeMethod = Introspector.findInstanceMethod(cls, writeMethodName, type);
             if (writeMethod != null) {
                 if (!writeMethod.getReturnType().equals(void.class)) {
                     writeMethod = null;
--- a/jdk/src/share/classes/java/beans/PropertyEditorManager.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/share/classes/java/beans/PropertyEditorManager.java	Wed Jul 21 09:57:21 2010 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1996, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1996, 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
@@ -81,10 +81,7 @@
         if (sm != null) {
             sm.checkPropertiesAccess();
         }
-        PropertyEditorFinder finder = getFinder();
-        synchronized (finder) {
-            finder.register(targetType, editorClass);
-        }
+        getFinder().register(targetType, editorClass);
     }
 
     /**
@@ -95,10 +92,7 @@
      * The result is null if no suitable editor can be found.
      */
     public static PropertyEditor findEditor(Class<?> targetType) {
-        PropertyEditorFinder finder = getFinder();
-        synchronized (finder) {
-            return finder.find(targetType);
-        }
+        return getFinder().find(targetType);
     }
 
     /**
@@ -110,10 +104,7 @@
      *         e.g. Sun implementation initially sets to  {"sun.beans.editors"}.
      */
     public static String[] getEditorSearchPath() {
-        PropertyEditorFinder finder = getFinder();
-        synchronized (finder) {
-            return finder.getPackages();
-        }
+        return getFinder().getPackages();
     }
 
     /**
@@ -134,10 +125,7 @@
         if (sm != null) {
             sm.checkPropertiesAccess();
         }
-        PropertyEditorFinder finder = getFinder();
-        synchronized (finder) {
-            finder.setPackages(path);
-        }
+        getFinder().setPackages(path);
     }
 
     private static PropertyEditorFinder getFinder() {
--- a/jdk/src/share/classes/java/beans/XMLDecoder.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/share/classes/java/beans/XMLDecoder.java	Wed Jul 21 09:57:21 2010 -0700
@@ -60,7 +60,7 @@
  *
  * @author Philip Milne
  */
-public class XMLDecoder {
+public class XMLDecoder implements AutoCloseable {
     private final DocumentHandler handler = new DocumentHandler();
     private final InputSource input;
     private Object owner;
--- a/jdk/src/share/classes/java/beans/XMLEncoder.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/share/classes/java/beans/XMLEncoder.java	Wed Jul 21 09:57:21 2010 -0700
@@ -204,7 +204,7 @@
  *
  * @author Philip Milne
  */
-public class XMLEncoder extends Encoder {
+public class XMLEncoder extends Encoder implements AutoCloseable {
 
     private final CharsetEncoder encoder;
     private final String charset;
@@ -407,7 +407,20 @@
                    os.writeObject(this);
             */
             mark(oldStm);
-            statementList(oldStm.getTarget()).add(oldStm);
+            Object target = oldStm.getTarget();
+            if (target instanceof Field) {
+                String method = oldStm.getMethodName();
+                Object[] args = oldStm.getArguments();
+                if ((method == null) || (args == null)) {
+                }
+                else if (method.equals("get") && (args.length == 1)) {
+                    target = args[0];
+                }
+                else if (method.equals("set") && (args.length == 2)) {
+                    target = args[0];
+                }
+            }
+            statementList(target).add(oldStm);
         }
         catch (Exception e) {
             getExceptionListener().exceptionThrown(new Exception("XMLEncoder: discarding statement " + oldStm, e));
@@ -703,7 +716,9 @@
                 statements.add(exp);
             }
             outputValue(target, outer, false);
-            outputValue(value, outer, isArgument);
+            if (expression) {
+                outputValue(value, outer, isArgument);
+            }
             return;
         }
         if (expression && (d.refs > 1)) {
@@ -722,8 +737,10 @@
         }
         else if ((!expression && methodName.startsWith("set") && args.length == 1) ||
                  (expression && methodName.startsWith("get") && args.length == 0)) {
-            attributes = attributes + " property=" +
-                quote(Introspector.decapitalize(methodName.substring(3)));
+            if (3 < methodName.length()) {
+                attributes = attributes + " property=" +
+                    quote(Introspector.decapitalize(methodName.substring(3)));
+            }
         }
         else if (!methodName.equals("new") && !methodName.equals("newInstance")) {
             attributes = attributes + " method=" + quote(methodName);
--- a/jdk/src/share/classes/java/dyn/CallSite.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/share/classes/java/dyn/CallSite.java	Wed Jul 21 09:57:21 2010 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2008, 2009, Oracle and/or its affiliates. All rights reserved.
+ * 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
@@ -25,25 +25,32 @@
 
 package java.dyn;
 
-import sun.dyn.util.BytecodeName;
 import sun.dyn.Access;
+import sun.dyn.MemberName;
 import sun.dyn.CallSiteImpl;
-import sun.dyn.MethodHandleImpl;
 
 /**
- * An {@code invokedynamic} call site, as reified by the
- * containing class's bootstrap method.
- * Every call site object corresponds to a distinct instance
- * of the <code>invokedynamic</code> instruction, and vice versa.
- * Every call site has one state variable, called the {@code target}.
- * It is typed as a {@link MethodHandle}.  This state is never null, and
- * it is the responsibility of the bootstrap method to produce call sites
- * which have been pre-linked to an initial target method.
+ * A {@code CallSite} reifies an {@code invokedynamic} instruction from bytecode,
+ * and controls its linkage.
+ * Every linked {@code CallSite} object corresponds to a distinct instance
+ * of the {@code invokedynamic} instruction, and vice versa.
  * <p>
- * (Note:  The bootstrap method may elect to produce call sites of a
+ * Every linked {@code CallSite} object has one state variable,
+ * a {@link MethodHandle} reference called the {@code target}.
+ * This reference is never null.  Though it can change its value
+ * successive values must always have exactly the {@link MethodType method type}
+ * called for by the bytecodes of the associated {@code invokedynamic} instruction
+ * <p>
+ * It is the responsibility of each class's
+ * {@link Linkage#registerBootstrapMethod(Class, MethodHandle) bootstrap method}
+ * to produce call sites which have been pre-linked to an initial target method.
+ * The required {@link MethodType type} for the target method is a parameter
+ * to each bootstrap method call.
+ * <p>
+ * The bootstrap method may elect to produce call sites of a
  * language-specific subclass of {@code CallSite}.  In such a case,
  * the subclass may claim responsibility for initializing its target to
- * a non-null value, by overriding {@link #initialTarget}.)
+ * a non-null value, by overriding {@link #initialTarget}.
  * <p>
  * An {@code invokedynamic} instruction which has not yet been executed
  * is said to be <em>unlinked</em>.  When an unlinked call site is executed,
@@ -52,54 +59,139 @@
  * value to the new call site's target variable, the method {@link #initialTarget}
  * is called to produce the new call site's first target method.
  * <p>
+ * A freshly-created {@code CallSite} object is not yet in a linked state.
+ * An unlinked {@code CallSite} object reports null for its {@code callerClass}.
+ * When the JVM receives a {@code CallSite} object from a bootstrap method,
+ * it first ensures that its target is non-null and of the correct type.
+ * The JVM then links the {@code CallSite} object to the call site instruction,
+ * enabling the {@code callerClass} to return the class in which the instruction occurs.
+ * <p>
+ * Next, the JVM links the instruction to the {@code CallSite}, at which point
+ * any further execution of the {@code invokedynamic} instruction implicitly
+ * invokes the current target of the {@code CallSite} object.
+ * After this two-way linkage, both the instruction and the {@code CallSite}
+ * object are said to be linked.
+ * <p>
+ * This state of linkage continues until the method containing the
+ * dynamic call site is garbage collected, or the dynamic call site
+ * is invalidated by an explicit request.
+ * <p>
+ * Linkage happens once in the lifetime of any given {@code CallSite} object.
+ * Because of call site invalidation, this linkage can be repeated for
+ * a single {@code invokedynamic} instruction, with multiple {@code CallSite} objects.
+ * When a {@code CallSite} is unlinked from an {@code invokedynamic} instruction,
+ * the instruction is reset so that it is no longer associated with
+ * the {@code CallSite} object, but the {@code CallSite} does not change
+ * state.
+ * <p>
+ * Here is a sample use of call sites and bootstrap methods which links every
+ * dynamic call site to print its arguments:
+<blockquote><pre><!-- see indy-demo/src/PrintArgsDemo.java -->
+private static void printArgs(Object... args) {
+  System.out.println(java.util.Arrays.deepToString(args));
+}
+private static final MethodHandle printArgs;
+static {
+  MethodHandles.Lookup lookup = MethodHandles.lookup();
+  Class thisClass = lookup.lookupClass();  // (who am I?)
+  printArgs = lookup.findStatic(thisClass,
+      "printArgs", MethodType.methodType(void.class, Object[].class));
+  Linkage.registerBootstrapMethod("bootstrapDynamic");
+}
+private static CallSite bootstrapDynamic(Class caller, String name, MethodType type) {
+  // ignore caller and name, but match the type:
+  return new CallSite(MethodHandles.collectArguments(printArgs, type));
+}
+</pre></blockquote>
  * @see Linkage#registerBootstrapMethod(java.lang.Class, java.dyn.MethodHandle)
  * @author John Rose, JSR 292 EG
  */
 public class CallSite
-        // Note: This is an implementation inheritance hack, and will be removed
-        // with a JVM change which moves the required hidden state onto this class.
-        extends CallSiteImpl
 {
     private static final Access IMPL_TOKEN = Access.getToken();
 
-    /*
+    // 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)
 
-    // Fields used only by the JVM.  Do not use or change.
-    private Object vmmethod;
-    int callerMID, callerBCI;  // supplied by the JVM
-
+    // The actual payload of this call site:
     private MethodHandle target;
 
-    final Object caller;  // usually a class
-    final String name;
-    final MethodType type;
-    */
+    // Remove this field for PFD and delete deprecated methods:
+    private MemberName calleeNameRemoveForPFD;
+
+    /**
+     * Make a blank call site object.
+     * Before it is returned from a bootstrap method, this {@code CallSite} object
+     * must be provided with
+     * a target method via a call to {@link CallSite#setTarget(MethodHandle) setTarget},
+     * or by a subclass override of {@link CallSite#initialTarget(Class,String,MethodType) initialTarget}.
+     */
+    public CallSite() {
+    }
 
     /**
-     * Make a call site given the parameters from a call to the bootstrap method.
-     * The resulting call site is in an unlinked state, which means that before
-     * it is returned from a bootstrap method call it must be provided with
-     * a target method via a call to {@link CallSite#setTarget}.
-     * @param caller the class in which the relevant {@code invokedynamic} instruction occurs
-     * @param name the name specified by the {@code invokedynamic} instruction
-     * @param type the method handle type derived from descriptor of the {@code invokedynamic} instruction
+     * Make a blank call site object, possibly equipped with an initial target method handle.
+     * The initial target reference may be null, in which case the {@code CallSite} object
+     * must be provided with a target method via a call to {@link CallSite#setTarget},
+     * or by a subclass override of {@link CallSite#initialTarget}.
+     * @param target the method handle which will be the initial target of the call site, or null if there is none yet
      */
-    public CallSite(Object caller, String name, MethodType type) {
-        super(IMPL_TOKEN, caller, name, type);
+    public CallSite(MethodHandle target) {
+        this.target = target;
     }
 
-    private static void privateInitializeCallSite(CallSite site, int callerMID, int callerBCI) {
-        site.callerMID = callerMID;
-        site.callerBCI = callerBCI;
-        site.ensureTarget();
+    /** @deprecated transitional form defined in EDR but removed in PFD */
+    public CallSite(Class<?> caller, String name, MethodType type) {
+        this.calleeNameRemoveForPFD = new MemberName(caller, name, type);
+    }
+    /** @deprecated transitional form defined in EDR but removed in PFD */
+    public Class<?> callerClass() {
+        MemberName callee = this.calleeNameRemoveForPFD;
+        return callee == null ? null : callee.getDeclaringClass();
+    }
+    /** @deprecated transitional form defined in EDR but removed in PFD */
+    public String name() {
+        MemberName callee = this.calleeNameRemoveForPFD;
+        return callee == null ? null : callee.getName();
+    }
+    /** @deprecated transitional form defined in EDR but removed in PFD */
+    public MethodType type() {
+        MemberName callee = this.calleeNameRemoveForPFD;
+        return callee == null ? (target == null ? null : target.type()) : callee.getMethodType();
+    }
+    /** @deprecated transitional form defined in EDR but removed in PFD */
+    protected MethodHandle initialTarget() {
+        return initialTarget(callerClass(), name(), type());
     }
-    private void ensureTarget() {
-        // Note use of super, which accesses the field directly,
-        // without deferring to possible subclass overrides.
-        if (super.getTarget() == null) {
-            super.setTarget(this.initialTarget());
-            super.getTarget().type();  // provoke NPE if still null
+
+    /** Report if the JVM has linked this {@code CallSite} object to a dynamic call site instruction.
+     *  Once it is linked, it is never unlinked.
+     */
+    private boolean isLinked() {
+        return vmmethod != null;
+    }
+
+    /** 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.isLinked()) {
+            throw new InvokeDynamicBootstrapError("call site has already been linked to an invokedynamic instruction");
         }
+        MethodHandle target = this.target;
+        if (target == null) {
+            this.target = target = this.initialTarget(callerMethod.getDeclaringClass(), name, type);
+        }
+        if (!target.type().equals(type)) {
+            throw wrongTargetType(target, type);
+        }
+        this.vmindex  = callerBCI;
+        this.vmmethod = callerMethod;
+        assert(this.isLinked());
     }
 
     /**
@@ -108,14 +200,18 @@
      * the method {@code initialTarget} is called to produce an initial
      * non-null target.  (Live call sites must never have null targets.)
      * <p>
+     * The arguments are the same as those passed to the bootstrap method.
+     * Thus, a bootstrap method is free to ignore the arguments and simply
+     * create a "blank" {@code CallSite} object of an appropriate subclass.
+     * <p>
      * If the bootstrap method itself does not initialize the call site,
      * this method must be overridden, because it just raises an
      * {@code InvokeDynamicBootstrapError}, which in turn causes the
      * linkage of the {@code invokedynamic} instruction to terminate
      * abnormally.
      */
-    protected MethodHandle initialTarget() {
-        throw new InvokeDynamicBootstrapError("target must be initialized before call site is linked: "+this);
+    protected MethodHandle initialTarget(Class<?> callerClass, String name, MethodType type) {
+        throw new InvokeDynamicBootstrapError("target must be initialized before call site is linked: "+name+type);
     }
 
     /**
@@ -137,11 +233,11 @@
      * @see #setTarget
      */
     public MethodHandle getTarget() {
-        return super.getTarget();
+        return target;
     }
 
     /**
-     * Link or relink the call site, by setting its target method.
+     * Set the target method of this call site.
      * <p>
      * The interactions of {@code setTarget} with memory are the same
      * as of a write to an ordinary variable, such as an array element or a
@@ -152,96 +248,46 @@
      * Stronger guarantees can be created by putting appropriate operations
      * into the bootstrap method and/or the target methods used
      * at any given call site.
-     * @param target the new target, or null if it is to be unlinked
+     * @param newTarget the new target
      * @throws NullPointerException if the proposed new target is null
-     * @throws WrongMethodTypeException if the proposed new target
-     *         has a method type that differs from the call site's {@link #type()}
+     * @throws WrongMethodTypeException if the call site is linked and the proposed new target
+     *         has a method type that differs from the previous target
      */
-    public void setTarget(MethodHandle target) {
-        checkTarget(target);
-        super.setTarget(target);
-    }
-
-    protected void checkTarget(MethodHandle target) {
-        target.type();  // provoke NPE
-        if (!canSetTarget(target))
-            throw new WrongMethodTypeException(String.valueOf(target)+target.type()+" should be of type "+type());
-    }
-
-    protected boolean canSetTarget(MethodHandle target) {
-        return (target != null && target.type() == type());
-    }
-
-    /**
-     * Report the class containing the call site.
-     * This is an immutable property of the call site, set from the first argument to the constructor.
-     * @return class containing the call site
-     */
-    public Class<?> callerClass() {
-        return (Class) caller;
+    public void setTarget(MethodHandle newTarget) {
+        MethodType newType = newTarget.type();  // null check!
+        MethodHandle oldTarget = this.target;
+        if (oldTarget == null) {
+            // CallSite is not yet linked.
+            assert(!isLinked());
+            this.target = newTarget;  // might be null!
+            return;
+        }
+        MethodType oldType = oldTarget.type();
+        if (!newTarget.type().equals(oldType))
+            throw wrongTargetType(newTarget, oldType);
+        if (oldTarget != newTarget)
+            CallSiteImpl.setCallSiteTarget(IMPL_TOKEN, this, newTarget);
     }
 
-    /**
-     * Report the method name specified in the {@code invokedynamic} instruction.
-     * This is an immutable property of the call site, set from the second argument to the constructor.
-     * <p>
-     * Note that the name is a JVM bytecode name, and as such can be any
-     * non-empty string, as long as it does not contain certain "dangerous"
-     * characters such as slash {@code '/'} and dot {@code '.'}.
-     * See the Java Virtual Machine specification for more details.
-     * <p>
-     * Application such as a language runtimes may need to encode
-     * arbitrary program element names and other configuration information
-     * into the name.  A standard convention for doing this is
-     * <a href="http://blogs.sun.com/jrose/entry/symbolic_freedom_in_the_vm">specified here</a>.
-     * @return method name specified by the call site
-     */
-    public String name() {
-        return name;
+    private static WrongMethodTypeException wrongTargetType(MethodHandle target, MethodType type) {
+        return new WrongMethodTypeException(String.valueOf(target)+target.type()+" should be of type "+type);
     }
 
-    /**
-     * Report the method name specified in the {@code invokedynamic} instruction,
-     * as a series of components, individually demangled according to
-     * the standard convention
-     * <a href="http://blogs.sun.com/jrose/entry/symbolic_freedom_in_the_vm">specified here</a>.
-     * <p>
-     * Non-empty runs of characters between dangerous characters are demangled.
-     * Each component is either a completely arbitrary demangled string,
-     * or else a character constant for a punctuation character, typically ':'.
-     * (In principle, the character can be any dangerous character that the
-     * JVM lets through in a method name, such as '$' or ']'.
-     * Runtime implementors are encouraged to use colon ':' for building
-     * structured names.)
-     * <p>
-     * In the common case where the name contains no dangerous characters,
-     * the result is an array whose only element array is the demangled
-     * name at the call site.  Such a demangled name can be any sequence
-     * of any number of any unicode characters.
-     * @return method name components specified by the call site
+    /** Produce a printed representation that displays information about this call site
+     *  that may be useful to the human reader.
      */
-    public Object[] nameComponents() {
-        return BytecodeName.parseBytecodeName(name);
-    }
-
-    /**
-     * Report the resolved result and parameter types of this call site,
-     * which are derived from its bytecode-level invocation descriptor.
-     * The types are packaged into a {@link MethodType}.
-     * Any linked target of this call site must be exactly this method type.
-     * This is an immutable property of the call site, set from the third argument to the constructor.
-     * @return method type specified by the call site
-     */
-    public MethodType type() {
-        return type;
-    }
-
     @Override
     public String toString() {
-        return "CallSite#"+hashCode()+"["+name+type+" => "+getTarget()+"]";
+        StringBuilder buf = new StringBuilder("CallSite#");
+        buf.append(hashCode());
+        if (!isLinked())
+            buf.append("[unlinked]");
+        else
+            buf.append("[")
+                .append("from ").append(vmmethod.getDeclaringClass().getName())
+                .append(" : ").append(getTarget().type())
+                .append(" => ").append(getTarget())
+                .append("]");
+        return buf.toString();
     }
-
-    // Package-local constant:
-    static final MethodHandle GET_TARGET = MethodHandleImpl.getLookup(IMPL_TOKEN).
-            findVirtual(CallSite.class, "getTarget", MethodType.methodType(MethodHandle.class));
 }
--- a/jdk/src/share/classes/java/dyn/InvokeDynamic.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/share/classes/java/dyn/InvokeDynamic.java	Wed Jul 21 09:57:21 2010 -0700
@@ -26,27 +26,25 @@
 package java.dyn;
 
 /**
- * Syntactic marker to request javac to emit an {@code invokedynamic} instruction.
- * An {@code invokedynamic} instruction is a 5-byte bytecoded instruction
- * which begins with an opcode byte of value 186 ({@code 0xBA}),
- * and is followed by a two-byte index of a {@code NameAndType} constant
- * pool entry, then by two zero bytes.  The constant pool reference gives
- * the method name and argument and return types of the call site; there
- * is no other information provided at the call site.
+ * {@code InvokeDynamic} is a class with neither methods nor instances,
+ * which serves only as a syntactic marker in Java source code for
+ * an {@code invokedynamic} instruction.
+ * (See <a href="package-summary.html#jvm_mods">the package information</a> for specifics on this instruction.)
  * <p>
  * The {@code invokedynamic} instruction is incomplete without a target method.
- * The target method is a property of the reified call site object
- * (of type {@link CallSite}) which is in a one-to-one association with each
- * corresponding {@code invokedynamic} instruction.  The call site object
- * is initially produced by a <em>bootstrap method</em> associated with
- * the call site, via the various overloadings of {@link Linkage#registerBootstrapMethod}.
+ * The target method is a property of the reified {@linkplain CallSite call site object}
+ * which is linked to each active {@code invokedynamic} instruction.
+ * The call site object is initially produced by a
+ * {@linkplain java.dyn.Linkage#registerBootstrapMethod(Class, MethodHandle) bootstrap method}
+ * associated with the class whose bytecodes include the dynamic call site.
  * <p>
  * The type {@code InvokeDynamic} has no particular meaning as a
  * class or interface supertype, or an object type; it can never be instantiated.
  * Logically, it denotes a source of all dynamically typed methods.
- * It may be viewed as a pure syntactic marker (an importable one) of static calls.
+ * It may be viewed as a pure syntactic marker of static calls.
+ * It may be imported for ease of use.
  * <p>
- * Here are some examples of usage:
+ * Here are some examples:
  * <p><blockquote><pre>
  * Object x; String s; int i;
  * x = InvokeDynamic.greet("world"); // greet(Ljava/lang/String;)Ljava/lang/Object;
@@ -65,6 +63,7 @@
  * which must be registered by the static initializer of the enclosing class.
  * @author John Rose, JSR 292 EG
  */
+@MethodHandle.PolymorphicSignature
 public final class InvokeDynamic {
     private InvokeDynamic() { throw new InternalError(); }  // do not instantiate
 
--- a/jdk/src/share/classes/java/dyn/InvokeDynamicBootstrapError.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/share/classes/java/dyn/InvokeDynamicBootstrapError.java	Wed Jul 21 09:57:21 2010 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2008, 2009, Oracle and/or its affiliates. All rights reserved.
+ * 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
@@ -27,24 +27,29 @@
 
 /**
  * Thrown to indicate that an {@code invokedynamic} instruction has
- * failed to find its bootstrap method, or the bootstrap method has
- * failed to provide a call site with a non-null target.
+ * failed to find its
+ * {@linkplain Linkage#registerBootstrapMethod(Class, MethodHandle) bootstrap method},
+ * or the bootstrap method has
+ * failed to provide a
+ * {@linkplain CallSite} call site with a non-null {@linkplain MethodHandle target}
+ * of the correct {@linkplain MethodType method type}.
  * <p>
- * The boostrap method must have been declared during a class's initialization
- * by a call to {@link Linkage#registerBootstrapMethod}.
+ * The bootstrap method must have been declared during a class's initialization
+ * by a call to one of the overloadings of
+ * {@link Linkage#registerBootstrapMethod registerBootstrapMethod}.
  *
  * @author John Rose, JSR 292 EG
  */
 public class InvokeDynamicBootstrapError extends LinkageError {
     /**
-     * Constructs a {@code InvokeDynamicBootstrapError} with no detail message.
+     * Constructs an {@code InvokeDynamicBootstrapError} with no detail message.
      */
     public InvokeDynamicBootstrapError() {
         super();
     }
 
     /**
-     * Constructs a {@code InvokeDynamicBootstrapError} with the specified
+     * Constructs an {@code InvokeDynamicBootstrapError} with the specified
      * detail message.
      *
      * @param s the detail message.
--- a/jdk/src/share/classes/java/dyn/JavaMethodHandle.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/share/classes/java/dyn/JavaMethodHandle.java	Wed Jul 21 09:57:21 2010 -0700
@@ -28,7 +28,8 @@
 import sun.dyn.Access;
 
 /**
- * A Java method handle extends the basic method handle type with additional
+ * A Java method handle is a deprecated proposal for extending
+ * the basic method handle type with additional
  * programmer defined methods and fields.
  * Its behavior as a method handle is determined at instance creation time,
  * by providing the new instance with an "entry point" method handle
@@ -62,11 +63,11 @@
  * greeter.run();  // prints "hello, world"
  * // Statically typed method handle invocation (most direct):
  * MethodHandle mh = greeter;
- * mh.&lt;void&gt;invoke();  // also prints "hello, world"
+ * mh.&lt;void&gt;invokeExact();  // also prints "hello, world"
  * // Dynamically typed method handle invocation:
- * MethodHandles.invoke(greeter);  // also prints "hello, world"
+ * MethodHandles.invokeExact(greeter);  // also prints "hello, world"
  * greeter.setGreeting("howdy");
- * mh.invoke();  // prints "howdy, world" (object-like mutable behavior)
+ * mh.invokeExact();  // prints "howdy, world" (object-like mutable behavior)
  * </pre></blockquote>
  * <p>
  * In the example of {@code Greeter}, the method {@code run} provides the entry point.
@@ -81,7 +82,7 @@
  * inner class:
  * <p><blockquote><pre>
  * // We can also do this with symbolic names and/or inner classes:
- * MethodHandles.invoke(new JavaMethodHandle("yow") {
+ * MethodHandles.invokeExact(new JavaMethodHandle("yow") {
  *     void yow() { System.out.println("yow, world"); }
  * });
  * </pre></blockquote>
@@ -101,7 +102,7 @@
  *     Greeter greeter = new Greeter("world");
  *     greeter.run();  // prints "hello, world"
  *     MethodHandle mh = MethodHanndles.insertArgument(Greeter.RUN, 0, greeter);
- *     mh.invoke();  // also prints "hello, world"
+ *     mh.invokeExact();  // also prints "hello, world"
  * </pre></blockquote>
  * Note that the method handle must be separately created as a view on the base object.
  * This increases footprint, complexity, and dynamic indirections.
@@ -113,7 +114,7 @@
  *     MethodHandle greeter = new JavaMethodHandle("run") {
  *         private void run() { System.out.println("hello, "+greetee); }
  *     }
- *     greeter.invoke();  // prints "hello, world"
+ *     greeter.invokeExact();  // prints "hello, world"
  * </pre></blockquote>
  * <p>
  * Here is an abstract parameterized lvalue, efficiently expressed as a subtype of MethodHandle,
@@ -137,10 +138,12 @@
  *         public Number get(long i)           { return stuff[(int)i]; }
  *         public void   set(long i, Object x) {        stuff[(int)i] = x; }
  *     }
- *     int x = (Integer) stuffPtr.&lt;Number&gt;invoke(1L);  // 456
- *     stuffPtr.setter().&lt;void&gt;invoke(0L, (Number) 789);  // replaces 123 with 789
+ *     int x = (Integer) stuffPtr.&lt;Number&gt;invokeExact(1L);  // 456
+ *     stuffPtr.setter().&lt;void&gt;invokeExact(0L, (Number) 789);  // replaces 123 with 789
  * </pre></blockquote>
  * @see MethodHandle
+ * @deprecated The JSR 292 EG intends to replace {@code JavaMethodHandle} with
+ * an interface-based API for mixing method handle behavior with other classes.
  * @author John Rose, JSR 292 EG
  */
 public abstract class JavaMethodHandle
--- a/jdk/src/share/classes/java/dyn/Linkage.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/share/classes/java/dyn/Linkage.java	Wed Jul 21 09:57:21 2010 -0700
@@ -25,14 +25,19 @@
 
 package java.dyn;
 
+import java.lang.annotation.Annotation;
 import java.dyn.MethodHandles.Lookup;
 import java.util.WeakHashMap;
 import sun.dyn.Access;
+import sun.dyn.MethodHandleImpl;
 import sun.reflect.Reflection;
 import static sun.dyn.util.VerifyAccess.checkBootstrapPrivilege;
+import static sun.dyn.MemberName.newIllegalArgumentException;
 
 /**
- * Static methods which control the linkage of invokedynamic call sites.
+ * This class consists exclusively of static methods that control
+ * the linkage of {@code invokedynamic} instructions, and specifically
+ * their reification as {@link CallSite} objects.
  * @author John Rose, JSR 292 EG
  */
 public class Linkage {
@@ -42,102 +47,137 @@
 
     /**
      * <em>PROVISIONAL API, WORK IN PROGRESS:</em>
-     * Register a <em>bootstrap method</em> to use when linking a given caller class.
-     * It must be a method handle of a type equivalent to {@link CallSite#CallSite}.
-     * In other words, it must act as a factory method which accepts the arguments
-     * to {@code CallSite}'s constructor (a class, a string, and a method type),
+     * Register a <em>bootstrap method</em> to use when linking dynamic call sites within
+     * a given caller class.
+     * <p>
+     * A bootstrap method must be a method handle with a return type of {@link CallSite}
+     * and the following arguments:
+     * <ul>
+     * <li>the class containing the {@code invokedynamic} instruction, for which the bootstrap method was registered
+     * <li>the name of the method being invoked (a {@link String})
+     * <li>the type of the method being invoked (a {@link MethodType})
+     * <li><em>TBD</em> optionally, an unordered array of {@link Annotation}s attached to the call site
+     *     <em>(Until this feature is implemented, this will always receive an empty array.)</em>
+     * </ul>
+     * <em>(TBD: The final argument type may be missing from the method handle's type.
+     * Additional arguments may be added in the future.)</em>
+     * The bootstrap method acts as a factory method which accepts the given arguments
      * and returns a {@code CallSite} object (possibly of a subclass of {@code CallSite}).
      * <p>
-     * The registration will fail with an {@code IllegalStateException} if any of the following conditions hold:
+     * The registration must take place exactly once, either before the class has begun
+     * being initialized, or from within the class's static initializer.
+     * Registration will fail with an exception if any of the following conditions hold:
      * <ul>
-     * <li>The caller of this method is in a different package than the {@code callerClass},
+     * <li>The immediate caller of this method is in a different package than the given caller class,
      *     and there is a security manager, and its {@code checkPermission} call throws
      *     when passed {@link LinkagePermission}("registerBootstrapMethod",callerClass).
-     * <li>The given class already has a bootstrap method from a previous
-     *     call to this method.
-     * <li>The given class is already fully initialized.
-     * <li>The given class is in the process of initialization, in another thread.
-     * <li>The same {@code CallSite} object has already been returned from
-     * a bootstrap method call to another {@code invokedynamic} call site.
+     * <li>The given caller class already has a bootstrap method registered.
+     * <li>The given caller class is already fully initialized.
+     * <li>The given caller class is in the process of initialization, in another thread.
      * </ul>
      * Because of these rules, a class may install its own bootstrap method in
      * a static initializer.
      * @param callerClass a class that may have {@code invokedynamic} sites
      * @param bootstrapMethod the method to use to bootstrap all such sites
+     * @exception IllegalArgumentException if the class argument is null or
+     *            a primitive class, or if the bootstrap method is the wrong type
+     * @exception IllegalStateException if the class already has a bootstrap
+     *            method, or if the its static initializer has already run
+     *            or is already running in another thread
+     * @exception SecurityException if there is a security manager installed,
+     *            and a {@link LinkagePermission} check fails for "registerBootstrapMethod"
      */
     public static
     void registerBootstrapMethod(Class callerClass, MethodHandle bootstrapMethod) {
         Class callc = Reflection.getCallerClass(2);
         checkBootstrapPrivilege(callc, callerClass, "registerBootstrapMethod");
         checkBSM(bootstrapMethod);
-        synchronized (bootstrapMethods) {
-            if (bootstrapMethods.containsKey(callerClass))
-                throw new IllegalStateException("bootstrap method already declared in "+callerClass);
-            bootstrapMethods.put(callerClass, bootstrapMethod);
-        }
+        MethodHandleImpl.registerBootstrap(IMPL_TOKEN, callerClass, bootstrapMethod);
     }
 
-    static void checkBSM(MethodHandle mh) {
-        if (mh == null)  throw new IllegalArgumentException("null bootstrap method");
-        if (mh.type() == OLD_BOOTSTRAP_METHOD_TYPE) // FIXME: delete at EDR/PFD
-            throw new WrongMethodTypeException("bootstrap method must be a CallSite factory");
-        if (mh.type() != BOOTSTRAP_METHOD_TYPE)
-            throw new WrongMethodTypeException(mh.toString());
+    static private void checkBSM(MethodHandle mh) {
+        if (mh == null)  throw newIllegalArgumentException("null bootstrap method");
+        if (mh.type() == BOOTSTRAP_METHOD_TYPE_2)
+            // For now, always pass an empty array for the Annotations argument
+            mh = MethodHandles.insertArguments(mh, BOOTSTRAP_METHOD_TYPE_2.parameterCount()-1,
+                                               (Object)NO_ANNOTATIONS);
+        if (mh.type() == BOOTSTRAP_METHOD_TYPE)  return;
+        throw new WrongMethodTypeException(mh.toString());
+    }
+    static private final Annotation[] NO_ANNOTATIONS = { };
+
+    /**
+     * <em>PROVISIONAL API, WORK IN PROGRESS:</em>
+     * Simplified version of {@code registerBootstrapMethod} for self-registration,
+     * to be called from a static initializer.
+     * Finds a static method of the required type in the
+     * given runtime class, and installs it on the caller class.
+     * @throws NoSuchMethodException if there is no such method
+     * @throws IllegalStateException if the caller class's static initializer
+     *         has already run, or is already running in another thread
+     */
+    public static
+    void registerBootstrapMethod(Class<?> runtime, String name) {
+        Class callerClass = Reflection.getCallerClass(2);
+        registerBootstrapMethodLookup(callerClass, runtime, name);
     }
 
     /**
      * <em>PROVISIONAL API, WORK IN PROGRESS:</em>
-     * Simplified version of registerBootstrapMethod for self-registration,
+     * Simplified version of {@code registerBootstrapMethod} for self-registration,
      * to be called from a static initializer.
      * Finds a static method of the required type in the
-     * given class, and installs it on the caller.
+     * caller class itself, and installs it on the caller class.
      * @throws IllegalArgumentException if there is no such method
+     * @throws IllegalStateException if the caller class's static initializer
+     *         has already run, or is already running in another thread
      */
     public static
-    void registerBootstrapMethod(Class<?> runtime, String name) {
-        Class callc = Reflection.getCallerClass(2);
-        Lookup lookup = new Lookup(IMPL_TOKEN, callc);
-        MethodHandle bootstrapMethod =
-            lookup.findStatic(runtime, name, BOOTSTRAP_METHOD_TYPE);
-        // FIXME: exception processing wrong here
+    void registerBootstrapMethod(String name) {
+        Class callerClass = Reflection.getCallerClass(2);
+        registerBootstrapMethodLookup(callerClass, callerClass, name);
+    }
+
+    private static
+    void registerBootstrapMethodLookup(Class<?> callerClass, Class<?> runtime, String name) {
+        Lookup lookup = new Lookup(IMPL_TOKEN, callerClass);
+        MethodHandle bootstrapMethod;
+        // Try both types.  TBD
+        try {
+            bootstrapMethod = lookup.findStatic(runtime, name, BOOTSTRAP_METHOD_TYPE_2);
+        } catch (NoAccessException ex) {
+            bootstrapMethod = null;
+        }
+        if (bootstrapMethod == null) {
+            try {
+                bootstrapMethod = lookup.findStatic(runtime, name, BOOTSTRAP_METHOD_TYPE);
+            } catch (NoAccessException ex) {
+                throw new IllegalArgumentException("no such bootstrap method in "+runtime+": "+name, ex);
+            }
+        }
         checkBSM(bootstrapMethod);
-        Linkage.registerBootstrapMethod(callc, bootstrapMethod);
+        MethodHandleImpl.registerBootstrap(IMPL_TOKEN, callerClass, bootstrapMethod);
     }
 
     /**
      * <em>PROVISIONAL API, WORK IN PROGRESS:</em>
-     * Simplified version of registerBootstrapMethod for self-registration,
-     * to be called from a static initializer.
-     * Finds a static method of the required type in the
-     * caller's class, and installs it on the caller.
-     * @throws IllegalArgumentException if there is no such method
-     */
-    public static
-    void registerBootstrapMethod(String name) {
-        Class callc = Reflection.getCallerClass(2);
-        Lookup lookup = new Lookup(IMPL_TOKEN, callc);
-        MethodHandle bootstrapMethod =
-            lookup.findStatic(callc, name, BOOTSTRAP_METHOD_TYPE);
-        // FIXME: exception processing wrong here
-        checkBSM(bootstrapMethod);
-        Linkage.registerBootstrapMethod(callc, bootstrapMethod);
-    }
-
-    /**
-     * <em>PROVISIONAL API, WORK IN PROGRESS:</em>
-     * Report the bootstrap method registered for a given class.
+     * Report the bootstrap method registered for a given caller class.
      * Returns null if the class has never yet registered a bootstrap method.
      * Only callers privileged to set the bootstrap method may inquire
      * about it, because a bootstrap method is potentially a back-door entry
      * point into its class.
+     * @exception IllegalArgumentException if the argument is null or
+     *            a primitive class
+     * @exception SecurityException if there is a security manager installed,
+     *            and the immediate caller of this method is not in the same
+     *            package as the caller class
+     *            and a {@link LinkagePermission} check fails for "getBootstrapMethod"
      */
     public static
     MethodHandle getBootstrapMethod(Class callerClass) {
         Class callc = Reflection.getCallerClass(2);
-        checkBootstrapPrivilege(callc, callerClass, "registerBootstrapMethod");
-        synchronized (bootstrapMethods) {
-            return bootstrapMethods.get(callerClass);
-        }
+        checkBootstrapPrivilege(callc, callerClass, "getBootstrapMethod");
+        return MethodHandleImpl.getBootstrap(IMPL_TOKEN, callerClass);
     }
 
     /**
@@ -148,13 +188,10 @@
     public static final MethodType BOOTSTRAP_METHOD_TYPE
             = MethodType.methodType(CallSite.class,
                                     Class.class, String.class, MethodType.class);
-
-    private static final MethodType OLD_BOOTSTRAP_METHOD_TYPE
-            = MethodType.methodType(Object.class,
-                                    CallSite.class, Object[].class);
-
-    private static final WeakHashMap<Class, MethodHandle> bootstrapMethods =
-            new WeakHashMap<Class, MethodHandle>();
+    static final MethodType BOOTSTRAP_METHOD_TYPE_2
+            = MethodType.methodType(CallSite.class,
+                                    Class.class, String.class, MethodType.class,
+                                    Annotation[].class);
 
     /**
      * <em>PROVISIONAL API, WORK IN PROGRESS:</em>
@@ -182,10 +219,8 @@
 
     /**
      * <em>PROVISIONAL API, WORK IN PROGRESS:</em>
-     * Invalidate all <code>invokedynamic</code> call sites in the bytecodes
+     * Invalidate all {@code invokedynamic} call sites in the bytecodes
      * of any methods of the given class.
-     * (These are exactly those sites which report the given class
-     * via the {@link CallSite#callerClass()} method.)
      * <p>
      * When this method returns, every matching <code>invokedynamic</code>
      * instruction will invoke its bootstrap method on next call.
@@ -201,18 +236,4 @@
         }
         throw new UnsupportedOperationException("NYI");
     }
-
-    private static Object doNotBootstrap(CallSite site, Object... arguments) {
-        throw new UnsupportedOperationException("call site must not have null target: "+site);
-    }
-
-    private static final MethodHandle DO_NOT_BOOTSTRAP =
-            MethodHandles.Lookup.IMPL_LOOKUP.findStatic(Linkage.class, "doNotBootstrap",
-                OLD_BOOTSTRAP_METHOD_TYPE);
-
-    // Up-call from the JVM.  Obsolete.  FIXME: Delete from VM then from here.
-    static
-    MethodHandle findBootstrapMethod(Class callerClass, Class searchBootstrapClass) {
-        return DO_NOT_BOOTSTRAP;
-    }
 }
--- a/jdk/src/share/classes/java/dyn/LinkagePermission.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/share/classes/java/dyn/LinkagePermission.java	Wed Jul 21 09:57:21 2010 -0700
@@ -31,23 +31,17 @@
 import java.util.StringTokenizer;
 
 /**
- * This class is for runtime permissions. A RuntimePermission
- * contains a name (also referred to as a "target name") but
+ * This class is for managing runtime permission checking for
+ * operations performed by methods in the {@link Linkage} class.
+ * Like a {@link RuntimePermission}, on which it is modeled,
+ * a {@code LinkagePermission} contains a target name but
  * no actions list; you either have the named permission
  * or you don't.
- *
- * <P>
- * The target name is the name of the runtime permission (see below). The
- * naming convention follows the  hierarchical property naming convention.
- * Also, an asterisk
- * may appear at the end of the name, following a ".", or by itself, to
- * signify a wildcard match. For example: "loadLibrary.*" or "*" is valid,
- * "*loadLibrary" or "a*b" is not valid.
- * <P>
- * The following table lists all the possible RuntimePermission target names,
+ * <p>
+ * The following table lists all the possible {@code LinkagePermission} target names,
  * and for each provides a description of what the permission allows
  * and a discussion of the risks of granting code the permission.
- * <P>
+ * <p>
  *
  * <table border=1 cellpadding=5 summary="permission target name,
  *  what the target allows,and associated risks">
@@ -59,15 +53,17 @@
  *
  * <tr>
  *   <td>registerBootstrapMethod.{class name}</td>
- *   <td>Specifying a bootstrap method for invokedynamic, within a class of the given name</td>
+ *   <td>Specifying a bootstrap method for {@code invokedynamic} instructions within a class of the given name</td>
  *   <td>An attacker could attempt to attach a bootstrap method to a class which
- *       has just been loaded, thus gaining control of its invokedynamic calls.</td>
+ *       has just been loaded, thus gaining control of its {@code invokedynamic} calls.</td>
  * </tr>
  *
  * <tr>
  *   <td>invalidateAll</td>
  *   <td>Force the relinking of invokedynamic call sites everywhere.</td>
- *   <td>This could allow an attacker to slow down the system, or perhaps surface timing bugs in a dynamic language implementations, by forcing redundant relinking operations.</td>
+ *   <td>This could allow an attacker to slow down the system,
+ *       or perhaps expose timing bugs in a dynamic language implementations,
+ *       by forcing redundant relinking operations.</td>
  * </tr>
  *
  *
@@ -78,7 +74,7 @@
  * </tr>
  * </table>
  *
- * @see java.security.BasicPermission
+ * @see java.security.RuntimePermission
  * @see java.lang.SecurityManager
  *
  * @author John Rose, JSR 292 EG
--- a/jdk/src/share/classes/java/dyn/MethodHandle.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/share/classes/java/dyn/MethodHandle.java	Wed Jul 21 09:57:21 2010 -0700
@@ -34,32 +34,34 @@
 import static sun.dyn.MemberName.newIllegalArgumentException;  // utility
 
 /**
- * A method handle is a typed reference to the entry point of a method.
+ * A method handle is a typed, directly executable reference to a method,
+ * constructor, field, or similar low-level operation, with optional
+ * conversion or substitution of arguments or return values.
  * <p>
  * Method handles are strongly typed according to signature.
  * They are not distinguished by method name or enclosing class.
  * A method handle must be invoked under a signature which exactly matches
- * the method handle's own type.
+ * the method handle's own {@link MethodType method type}.
  * <p>
- * Every method handle confesses its type via the <code>type</code> accessor.
+ * Every method handle confesses its type via the {@code type} accessor.
  * The structure of this type is a series of classes, one of which is
- * the return type of the method (or <code>void.class</code> if none).
+ * the return type of the method (or {@code void.class} if none).
  * <p>
  * Every method handle appears as an object containing a method named
- * <code>invoke</code>, whose signature exactly matches
+ * {@code invoke}, whose signature exactly matches
  * the method handle's type.
  * A Java method call expression, which compiles to an
- * <code>invokevirtual</code> instruction,
+ * {@code invokevirtual} instruction,
  * can invoke this method from Java source code.
  * <p>
  * Every call to a method handle specifies an intended method type,
  * which must exactly match the type of the method handle.
- * (The type is specified in the <code>invokevirtual</code> instruction,
+ * (The type is specified in the {@code invokevirtual} instruction,
  * via a {@code CONSTANT_NameAndType} constant pool entry.)
  * The call looks within the receiver object for a method
- * named <code>invoke</code> of the intended method type.
+ * named {@code invoke} of the intended method type.
  * The call fails with a {@link WrongMethodTypeException}
- * if the method does not exist, even if there is an <code>invoke</code>
+ * if the method does not exist, even if there is an {@code invoke}
  * method of a closely similar signature.
  * As with other kinds
  * of methods in the JVM, signature matching during method linkage
@@ -76,13 +78,13 @@
  * They should not be passed to untrusted code.
  * <p>
  * Bytecode in an extended JVM can directly call a method handle's
- * <code>invoke</code> from an <code>invokevirtual</code> instruction.
- * The receiver class type must be <code>MethodHandle</code> and the method name
- * must be <code>invoke</code>.  The signature of the invocation
+ * {@code invoke} from an {@code invokevirtual} instruction.
+ * The receiver class type must be {@code MethodHandle} and the method name
+ * must be {@code invoke}.  The signature of the invocation
  * (after resolving symbolic type names) must exactly match the method type
  * of the target method.
  * <p>
- * Every <code>invoke</code> method always throws {@link Exception},
+ * Every {@code invoke} method always throws {@link Exception},
  * which is to say that there is no static restriction on what a method handle
  * can throw.  Since the JVM does not distinguish between checked
  * and unchecked exceptions (other than by their class, of course),
@@ -92,11 +94,11 @@
  * throw {@code Exception}, or else must catch all checked exceptions locally.
  * <p>
  * Bytecode in an extended JVM can directly obtain a method handle
- * for any accessible method from a <code>ldc</code> instruction
- * which refers to a <code>CONSTANT_Methodref</code> or
- * <code>CONSTANT_InterfaceMethodref</code> constant pool entry.
+ * for any accessible method from a {@code ldc} instruction
+ * which refers to a {@code CONSTANT_Methodref} or
+ * {@code CONSTANT_InterfaceMethodref} constant pool entry.
  * <p>
- * All JVMs can also use a reflective API called <code>MethodHandles</code>
+ * All JVMs can also use a reflective API called {@code MethodHandles}
  * for creating and calling method handles.
  * <p>
  * A method reference may refer either to a static or non-static method.
@@ -104,7 +106,7 @@
  * receiver argument, prepended before any other arguments.
  * In the method handle's type, the initial receiver argument is typed
  * according to the class under which the method was initially requested.
- * (E.g., if a non-static method handle is obtained via <code>ldc</code>,
+ * (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>
  * When a method handle to a virtual method is invoked, the method is
@@ -113,38 +115,38 @@
  * A non-virtual method handles to a specific virtual method implementation
  * can also be created.  These do not perform virtual lookup based on
  * receiver type.  Such a method handle simulates the effect of
- * an <code>invokespecial</code> instruction to the same method.
+ * an {@code invokespecial} instruction to the same method.
  * <p>
  * Here are some examples of usage:
  * <p><blockquote><pre>
- * Object x, y; String s; int i;
- * MethodType mt; MethodHandle mh;
- * MethodHandles.Lookup lookup = MethodHandles.lookup();
- * // mt is {(char,char) =&gt; String}
- * mt = MethodType.make(String.class, char.class, char.class);
- * mh = lookup.findVirtual(String.class, "replace", mt);
- * // (Ljava/lang/String;CC)Ljava/lang/String;
- * s = mh.&lt;String&gt;invoke("daddy",'d','n');
- * assert(s.equals("nanny"));
- * // weakly typed invocation (using MHs.invoke)
- * s = (String) MethodHandles.invoke(mh, "sappy", 'p', 'v');
- * assert(s.equals("savvy"));
- * // mt is {Object[] =&gt; List}
- * mt = MethodType.make(java.util.List.class, Object[].class);
- * mh = lookup.findStatic(java.util.Arrays.class, "asList", mt);
- * // mt is {(Object,Object,Object) =&gt; Object}
- * mt = MethodType.makeGeneric(3);
- * mh = MethodHandles.collectArguments(mh, mt);
- * // mt is {(Object,Object,Object) =&gt; Object}
- * // (Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
- * x = mh.invoke((Object)1, (Object)2, (Object)3);
- * assert(x.equals(java.util.Arrays.asList(1,2,3)));
- * // mt is { =&gt; int}
- * mt = MethodType.make(int.class);
- * mh = lookup.findVirtual(java.util.List.class, "size", mt);
- * // (Ljava/util/List;)I
- * i = mh.&lt;int&gt;invoke(java.util.Arrays.asList(1,2,3));
- * assert(i == 3);
+Object x, y; String s; int i;
+MethodType mt; MethodHandle mh;
+MethodHandles.Lookup lookup = MethodHandles.lookup();
+// mt is {(char,char) =&gt; String}
+mt = MethodType.methodType(String.class, char.class, char.class);
+mh = lookup.findVirtual(String.class, "replace", mt);
+// (Ljava/lang/String;CC)Ljava/lang/String;
+s = mh.&lt;String&gt;invokeExact("daddy",'d','n');
+assert(s.equals("nanny"));
+// weakly typed invocation (using MHs.invoke)
+s = (String) mh.invokeVarargs("sappy", 'p', 'v');
+assert(s.equals("savvy"));
+// mt is {Object[] =&gt; List}
+mt = MethodType.methodType(java.util.List.class, Object[].class);
+mh = lookup.findStatic(java.util.Arrays.class, "asList", mt);
+// mt is {(Object,Object,Object) =&gt; Object}
+mt = MethodType.genericMethodType(3);
+mh = MethodHandles.collectArguments(mh, mt);
+// mt is {(Object,Object,Object) =&gt; Object}
+// (Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
+x = mh.invokeExact((Object)1, (Object)2, (Object)3);
+assert(x.equals(java.util.Arrays.asList(1,2,3)));
+// mt is { =&gt; int}
+mt = MethodType.methodType(int.class);
+mh = lookup.findVirtual(java.util.List.class, "size", mt);
+// (Ljava/util/List;)I
+i = mh.&lt;int&gt;invokeExact(java.util.Arrays.asList(1,2,3));
+assert(i == 3);
  * </pre></blockquote>
  * Each of the above calls generates a single invokevirtual instruction
  * with the name {@code invoke} and the type descriptors indicated in the comments.
@@ -167,6 +169,14 @@
  * those of multiple arities.  It is impossible to represent such
  * genericity with a Java type parameter.</li>
  * </ol>
+ * Signature polymorphic methods in this class appear to be documented
+ * as having type parameters for return types and a parameter, but that is
+ * merely a documentation convention.  These type parameters do
+ * not play a role in type-checking method handle invocations.
+ * <p>
+ * Note: Like classes and strings, method handles that correspond directly
+ * to fields and methods can be represented directly as constants to be
+ * loaded by {@code ldc} bytecodes.
  *
  * @see MethodType
  * @see MethodHandles
@@ -180,7 +190,15 @@
     private static Access IMPL_TOKEN = Access.getToken();
 
     // interface MethodHandle<R throws X extends Exception,A...>
-    // { MethodType<R throws X,A...> type(); public R invoke(A...) throws X; }
+    // { 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 signature polymorphic.
+     */
+    @java.lang.annotation.Target({java.lang.annotation.ElementType.METHOD,java.lang.annotation.ElementType.TYPE})
+    @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.CLASS)
+    @interface PolymorphicSignature { }
 
     private MethodType type;
 
@@ -232,85 +250,38 @@
         return MethodHandleImpl.getNameString(IMPL_TOKEN, this);
     }
 
-    //// First draft of the "Method Handle Kernel API" discussed at the JVM Language Summit, 9/2009.
+    //// This is the "Method Handle Kernel API" discussed at the JVM Language Summit, 9/2009.
     //// Implementations here currently delegate to statics in MethodHandles.  Some of those statics
     //// will be deprecated.  Others will be kept as "algorithms" to supply degrees of freedom
     //// not present in the Kernel API.
 
     /**
      * <em>PROVISIONAL API, WORK IN PROGRESS:</em>
-     * Perform an exact invocation.  The signature at the call site of {@code invokeExact} must
+     * Invoke the method handle, allowing any caller signature, but requiring an exact signature match.
+     * The signature at the call site of {@code invokeExact} must
      * exactly match this method handle's {@code type}.
      * No conversions are allowed on arguments or return values.
-     * <em>This is not yet implemented, pending required compiler and JVM support.</em>
      */
-    public final <T> T invokeExact(Object... arguments) throws Throwable {
-        // This is an approximate implementation, which discards the caller's signature and refuses the call.
-        throw new InternalError("not yet implemented");
-    }
+    public final native @PolymorphicSignature <R,A> R invokeExact(A... args) throws Throwable;
+
+    // FIXME: remove this transitional form
+    /** @deprecated transitional form defined in EDR but removed in PFD */
+    public final native @PolymorphicSignature <R,A> R invoke(A... args) throws Throwable;
 
     /**
      * <em>PROVISIONAL API, WORK IN PROGRESS:</em>
-     * Perform a generic invocation.  The signature at the call site of {@code invokeExact} must
+     * Invoke the method handle, allowing any caller signature,
+     * and performing simple conversions for arguments and return types.
+     * The signature at the call site of {@code invokeGeneric} must
      * have the same arity as this method handle's {@code type}.
      * The same conversions are allowed on arguments or return values as are supported by
      * by {@link MethodHandles#convertArguments}.
      * If the call site signature exactly matches this method handle's {@code type},
      * the call proceeds as if by {@link #invokeExact}.
-     * <em>This is not fully implemented, pending required compiler and JVM support.</em>
      */
-    // This is an approximate implementation, which discards the caller's signature.
-    // When it is made signature polymorphic, the overloadings will disappear.
-    public final <T> T invokeGeneric() throws Throwable {
-        MethodHandle invoker = invokers(this.type()).genericInvoker();
-        return invoker.<T>invoke(this);
-    }
-    public final <T> T invokeGeneric(Object a0) throws Throwable {
-        MethodHandle invoker = invokers(this.type()).genericInvoker();
-        return invoker.<T>invoke(this, a0);
-    }
-    public final <T> T invokeGeneric(Object a0, Object a1) throws Throwable {
-        MethodHandle invoker = invokers(this.type()).genericInvoker();
-        return invoker.<T>invoke(this, a0, a1);
-    }
-    public final <T> T invokeGeneric(Object a0, Object a1, Object a2) throws Throwable {
-        MethodHandle invoker = invokers(this.type()).genericInvoker();
-        return invoker.<T>invoke(this, a0, a1, a2);
-    }
-    public final <T> T invokeGeneric(Object a0, Object a1, Object a2, Object a3) throws Throwable {
-        MethodHandle invoker = invokers(this.type()).genericInvoker();
-        return invoker.<T>invoke(this, a0, a1, a2, a3);
-    }
-    public final <T> T invokeGeneric(Object a0, Object a1, Object a2, Object a3,
-                  Object a4) throws Throwable {
-        MethodHandle invoker = invokers(this.type()).genericInvoker();
-        return invoker.<T>invoke(this, a0, a1, a2, a3, a4);
-    }
-    public final <T> T invokeGeneric(Object a0, Object a1, Object a2, Object a3,
-                  Object a4, Object a5) throws Throwable {
-        MethodHandle invoker = invokers(this.type()).genericInvoker();
-        return invoker.<T>invoke(this, a0, a1, a2, a3, a4, a5);
-    }
-    public final <T> T invokeGeneric(Object a0, Object a1, Object a2, Object a3,
-                  Object a4, Object a5, Object a6) throws Throwable {
-        MethodHandle invoker = invokers(this.type()).genericInvoker();
-        return invoker.<T>invoke(this, a0, a1, a2, a3, a4, a5, a6);
-    }
-    public final <T> T invokeGeneric(Object a0, Object a1, Object a2, Object a3,
-                  Object a4, Object a5, Object a6, Object a7) throws Throwable {
-        MethodHandle invoker = invokers(this.type()).genericInvoker();
-        return invoker.<T>invoke(this, a0, a1, a2, a3, a4, a5, a6, a7);
-    }
-    public final <T> T invokeGeneric(Object a0, Object a1, Object a2, Object a3,
-                  Object a4, Object a5, Object a6, Object a7, Object a8) throws Throwable {
-        MethodHandle invoker = invokers(this.type()).genericInvoker();
-        return invoker.<T>invoke(this, a0, a1, a2, a3, a4, a5, a6, a7, a8);
-    }
-    public final <T> T invokeGeneric(Object a0, Object a1, Object a2, Object a3,
-                  Object a4, Object a5, Object a6, Object a7, Object a8, Object a9) throws Throwable {
-        MethodHandle invoker = invokers(this.type()).genericInvoker();
-        return invoker.<T>invoke(this, a0, a1, a2, a3, a4, a5, a6, a7, a8, a9);
-    }
+    public final native @PolymorphicSignature <R,A> R invokeGeneric(A... args) throws Throwable;
+
+    // ?? public final native @PolymorphicSignature <R,A,V> R invokeVarargs(A args, V[] varargs) throws Throwable;
 
     /**
      * <em>PROVISIONAL API, WORK IN PROGRESS:</em>
@@ -341,47 +312,47 @@
      * This call is equivalent to the following code:
      * <p><blockquote><pre>
      *   MethodHandle invoker = MethodHandles.genericInvoker(this.type(), 0, true);
-     *   Object result = invoker.invoke(this, arguments);
+     *   Object result = invoker.invokeExact(this, arguments);
      * </pre></blockquote>
      * @param arguments the arguments to pass to the target
      * @return the result returned by the target
      * @see MethodHandles#genericInvoker
      */
-    public final Object invokeVarargs(Object[] arguments) throws Throwable {
+    public final Object invokeVarargs(Object... arguments) throws Throwable {
         int argc = arguments == null ? 0 : arguments.length;
         MethodType type = type();
         if (argc <= 10) {
             MethodHandle invoker = MethodHandles.invokers(type).genericInvoker();
             switch (argc) {
-                case 0:  return invoker.invoke(this);
-                case 1:  return invoker.invoke(this,
+                case 0:  return invoker.invokeExact(this);
+                case 1:  return invoker.invokeExact(this,
                                     arguments[0]);
-                case 2:  return invoker.invoke(this,
+                case 2:  return invoker.invokeExact(this,
                                     arguments[0], arguments[1]);
-                case 3:  return invoker.invoke(this,
+                case 3:  return invoker.invokeExact(this,
                                     arguments[0], arguments[1], arguments[2]);
-                case 4:  return invoker.invoke(this,
+                case 4:  return invoker.invokeExact(this,
                                     arguments[0], arguments[1], arguments[2],
                                     arguments[3]);
-                case 5:  return invoker.invoke(this,
+                case 5:  return invoker.invokeExact(this,
                                     arguments[0], arguments[1], arguments[2],
                                     arguments[3], arguments[4]);
-                case 6:  return invoker.invoke(this,
+                case 6:  return invoker.invokeExact(this,
                                     arguments[0], arguments[1], arguments[2],
                                     arguments[3], arguments[4], arguments[5]);
-                case 7:  return invoker.invoke(this,
+                case 7:  return invoker.invokeExact(this,
                                     arguments[0], arguments[1], arguments[2],
                                     arguments[3], arguments[4], arguments[5],
                                     arguments[6]);
-                case 8:  return invoker.invoke(this,
+                case 8:  return invoker.invokeExact(this,
                                     arguments[0], arguments[1], arguments[2],
                                     arguments[3], arguments[4], arguments[5],
                                     arguments[6], arguments[7]);
-                case 9:  return invoker.invoke(this,
+                case 9:  return invoker.invokeExact(this,
                                     arguments[0], arguments[1], arguments[2],
                                     arguments[3], arguments[4], arguments[5],
                                     arguments[6], arguments[7], arguments[8]);
-                case 10:  return invoker.invoke(this,
+                case 10:  return invoker.invokeExact(this,
                                     arguments[0], arguments[1], arguments[2],
                                     arguments[3], arguments[4], arguments[5],
                                     arguments[6], arguments[7], arguments[8],
@@ -391,7 +362,7 @@
 
         // more than ten arguments get boxed in a varargs list:
         MethodHandle invoker = MethodHandles.invokers(type).varargsInvoker(0);
-        return invoker.invoke(this, arguments);
+        return invoker.invokeExact(this, arguments);
     }
     /** Equivalent to {@code invokeVarargs(arguments.toArray())}. */
     public final Object invokeVarargs(java.util.List<?> arguments) throws Throwable {
--- a/jdk/src/share/classes/java/dyn/MethodHandles.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/share/classes/java/dyn/MethodHandles.java	Wed Jul 21 09:57:21 2010 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2008, 2009, Oracle and/or its affiliates. All rights reserved.
+ * 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
@@ -44,13 +44,13 @@
 import static sun.dyn.MemberName.newNoAccessException;
 
 /**
- * Fundamental operations and utilities for MethodHandle.
- * They fall into several categories:
+ * This class consists exclusively of static methods that operate on or return
+ * method handles. They fall into several categories:
  * <ul>
- * <li>Reifying methods and fields.  This is subject to access checks.
- * <li>Invoking method handles on dynamically typed arguments and/or varargs arrays.
- * <li>Combining or transforming pre-existing method handles into new ones.
- * <li>Miscellaneous emulation of common JVM operations or control flow patterns.
+ * <li>Factory methods which create method handles for methods and fields.
+ * <li>Invoker methods which can invoke method handles on dynamically typed arguments and/or varargs arrays.
+ * <li>Combinator methods, which combine or transforming pre-existing method handles into new ones.
+ * <li>Factory methods which create method handles that emulate other common JVM operations or control flow patterns.
  * </ul>
  * <p>
  * @author John Rose, JSR 292 EG
@@ -66,36 +66,44 @@
 
     //// Method handle creation from ordinary methods.
 
-    /** Create a {@link Lookup} lookup object on the caller.
-     *
+    /**
+     * Return a {@link Lookup lookup object} on the caller,
+     * which has the capability to access any method handle that the caller has access to,
+     * including direct method handles to private fields and methods.
+     * This lookup object is a <em>capability</em> which may be delegated to trusted agents.
+     * Do not store it in place where untrusted code can access it.
      */
     public static Lookup lookup() {
         return new Lookup();
     }
 
-    /** Version of lookup which is trusted minimally.
-     *  It can only be used to create method handles to
-     *  publicly accessible members.
+    /**
+     * Return a {@link Lookup lookup object} which is trusted minimally.
+     * It can only be used to create method handles to
+     * publicly accessible fields and methods.
      */
     public static Lookup publicLookup() {
         return Lookup.PUBLIC_LOOKUP;
     }
 
     /**
-     * A factory object for creating method handles, when the creation
-     * requires access checking.  Method handles do not perform
+     * A <em>lookup object</em> is a factory for creating method handles,
+     * when the creation requires access checking.
+     * Method handles do not perform
      * access checks when they are called; this is a major difference
      * from reflective {@link Method}, which performs access checking
-     * against every caller, on every call.  Method handle access
-     * restrictions are enforced when a method handle is created.
+     * against every caller, on every call.
+     * Therefore, method handle access
+     * restrictions must be enforced when a method handle is created.
      * The caller class against which those restrictions are enforced
-     * is known as the "lookup class".  {@link Lookup} embodies an
+     * is known as the {@linkplain #lookupClass lookup class}.
+     * A lookup object embodies an
      * authenticated lookup class, and can be used to create any number
      * of access-checked method handles, all checked against a single
      * lookup class.
      * <p>
      * A class which needs to create method handles will call
-     * {@code MethodHandles.lookup()} to create a factory for itself.
+     * {@link MethodHandles#lookup MethodHandles.lookup} to create a factory for itself.
      * It may then use this factory to create method handles on
      * all of its methods, including private ones.
      * It may also delegate the lookup (e.g., to a metaobject protocol)
@@ -104,12 +112,13 @@
      * checked against the original lookup class, and not with any higher
      * privileges.
      * <p>
-     * Note that access checks only apply to named and reflected methods.
-     * Other method handle creation methods, such as {@link #convertArguments},
+     * Access checks only apply to named and reflected methods.
+     * Other method handle creation methods, such as
+     * {@link #convertArguments MethodHandles.convertArguments},
      * do not require any access checks, and can be done independently
      * of any lookup class.
-     * <p>
-     * <em>A note about error conditions:<em>  A lookup can fail, because
+     * <h3>How access errors are handled</h3>
+     * A lookup can fail, because
      * the containing class is not accessible to the lookup class, or
      * because the desired class member is missing, or because the
      * desired class member is not accessible to the lookup class.
@@ -124,8 +133,25 @@
      */
     public static final
     class Lookup {
+        /** The class on behalf of whom the lookup is being performed. */
         private final Class<?> lookupClass;
 
+        /** The allowed sorts of members which may be looked up (public, etc.), with STRICT for package. */
+        private final int allowedModes;
+
+        private static final int
+            PUBLIC    = Modifier.PUBLIC,
+            PACKAGE   = Modifier.STRICT,
+            PROTECTED = Modifier.PROTECTED,
+            PRIVATE   = Modifier.PRIVATE,
+            ALL_MODES = (PUBLIC | PACKAGE | PROTECTED | PRIVATE),
+            TRUSTED   = -1;
+
+        private static int fixmods(int mods) {
+            mods &= (ALL_MODES - PACKAGE);
+            return (mods != 0) ? mods : PACKAGE;
+        }
+
         /** Which class is performing the lookup?  It is this class against
          *  which checks are performed for visibility and access permissions.
          *  <p>
@@ -136,57 +162,90 @@
             return lookupClass;
         }
 
+        // This is just for calling out to MethodHandleImpl.
+        private Class<?> lookupClassOrNull() {
+            return (allowedModes == TRUSTED) ? null : lookupClass;
+        }
+
+        /** Which types of members can this lookup object produce?
+         *  The result is a bit-mask of the modifier bits PUBLIC, PROTECTED, PRIVATE, and STRICT.
+         *  The modifier bit STRICT stands in for the (non-existent) package protection mode.
+         */
+        int lookupModes() {
+            return allowedModes & ALL_MODES;
+        }
+
         /** Embody the current class (the lookupClass) as a lookup class
          * for method handle creation.
          * Must be called by from a method in this package,
          * which in turn is called by a method not in this package.
+         * <p>
          * Also, don't make it private, lest javac interpose
          * an access$N method.
          */
         Lookup() {
-            this(IMPL_TOKEN, getCallerClassAtEntryPoint());
+            this(getCallerClassAtEntryPoint(), ALL_MODES);
+            // make sure we haven't accidentally picked up a privileged class:
+            checkUnprivilegedlookupClass(lookupClass);
         }
 
         Lookup(Access token, Class<?> lookupClass) {
-            // make sure we haven't accidentally picked up a privileged class:
-            checkUnprivilegedlookupClass(lookupClass);
+            this(lookupClass, ALL_MODES);
+            Access.check(token);
+        }
+
+        private Lookup(Class<?> lookupClass, int allowedModes) {
             this.lookupClass = lookupClass;
+            this.allowedModes = allowedModes;
         }
 
         /**
-         * Create a lookup on the specified class.
-         * The result is guaranteed to have no more access privileges
-         * than the original.
+         * Create a lookup on the specified new lookup class.
+         * The resulting object will report the specified
+         * class as its own {@link #lookupClass}.
+         * <p>
+         * However, the resulting {@code Lookup} object is guaranteed
+         * to have no more access capabilities than the original.
+         * In particular:<ul>
+         * <li>If the new lookup class differs from the old one,
+         * protected members will not be accessible by virtue of inheritance.
+         * <li>If the new lookup class is in a different package
+         * than the old one, protected and default (package) members will not be accessible.
+         * <li>If the new lookup class is not within the same package member
+         * as the old one, private members will not be accessible.
+         * <li>In all cases, public members will continue to be accessible.
+         * </ul>
          */
-        public Lookup in(Class<?> newLookupClass) {
-            if (this == PUBLIC_LOOKUP)  return PUBLIC_LOOKUP;
-            if (newLookupClass == null)  return PUBLIC_LOOKUP;
-            if (newLookupClass == lookupClass)  return this;
-            if (this != IMPL_LOOKUP) {
-                if (!VerifyAccess.isSamePackage(lookupClass, newLookupClass))
-                    throw newNoAccessException(new MemberName(newLookupClass), this);
-                checkUnprivilegedlookupClass(newLookupClass);
+        public Lookup in(Class<?> requestedLookupClass) {
+            requestedLookupClass.getClass();  // null check
+            if (allowedModes == TRUSTED)  // IMPL_LOOKUP can make any lookup at all
+                return new Lookup(requestedLookupClass, ALL_MODES);
+            if (requestedLookupClass == this.lookupClass)
+                return this;  // keep same capabilities
+            int newModes = (allowedModes & (ALL_MODES & ~PROTECTED));
+            if ((newModes & PACKAGE) != 0
+                && !VerifyAccess.isSamePackage(this.lookupClass, requestedLookupClass)) {
+                newModes &= ~(PACKAGE|PRIVATE);
             }
-            return new Lookup(newLookupClass);
-        }
-
-        private Lookup(Class<?> lookupClass) {
-            this.lookupClass = lookupClass;
+            if ((newModes & PRIVATE) != 0
+                && !VerifyAccess.isSamePackageMember(this.lookupClass, requestedLookupClass)) {
+                newModes &= ~PRIVATE;
+            }
+            checkUnprivilegedlookupClass(requestedLookupClass);
+            return new Lookup(requestedLookupClass, newModes);
         }
 
         // Make sure outer class is initialized first.
         static { IMPL_TOKEN.getClass(); }
 
-        private static final Class<?> PUBLIC_ONLY = sun.dyn.empty.Empty.class;
-
         /** Version of lookup which is trusted minimally.
          *  It can only be used to create method handles to
          *  publicly accessible members.
          */
-        static final Lookup PUBLIC_LOOKUP = new Lookup(PUBLIC_ONLY);
+        static final Lookup PUBLIC_LOOKUP = new Lookup(Object.class, PUBLIC);
 
         /** Package-private version of lookup which is trusted. */
-        static final Lookup IMPL_LOOKUP = new Lookup(null);
+        static final Lookup IMPL_LOOKUP = new Lookup(Object.class, TRUSTED);
         static { MethodHandleImpl.initLookup(IMPL_TOKEN, IMPL_LOOKUP); }
 
         private static void checkUnprivilegedlookupClass(Class<?> lookupClass) {
@@ -195,13 +254,35 @@
                 throw newIllegalArgumentException("illegal lookupClass: "+lookupClass);
         }
 
+        /** Display the name of the class.
+         *  If there are restrictions on the access permitted to this lookup,
+         *  display those also.
+         */
         @Override
         public String toString() {
-            if (lookupClass == PUBLIC_ONLY)
-                return "public";
-            if (lookupClass == null)
-                return "privileged";
-            return lookupClass.getName();
+            String modestr;
+            String cname = lookupClass.getName();
+            switch (allowedModes) {
+            case TRUSTED:
+                return "/trusted";
+            case PUBLIC:
+                modestr = "/public";
+                if (lookupClass == Object.class)
+                    return modestr;
+                break;
+            case PUBLIC|PACKAGE:
+                return cname + "/package";
+            case 0:  // should not happen
+                return cname + "/empty";
+            case ALL_MODES:
+                return cname;
+            }
+            StringBuilder buf = new StringBuilder(cname);
+            if ((allowedModes & PUBLIC) != 0)     buf.append("/public");
+            if ((allowedModes & PACKAGE) != 0)    buf.append("/package");
+            if ((allowedModes & PROTECTED) != 0)  buf.append("/protected");
+            if ((allowedModes & PRIVATE) != 0)    buf.append("/private");
+            return buf.toString();
         }
 
         // call this from an entry point method in Lookup with extraFrames=0.
@@ -219,11 +300,11 @@
          * The type of the method handle will be that of the method.
          * (Since static methods do not take receivers, there is no
          * additional receiver argument inserted into the method handle type,
-         * as there would be with {@linkplain #findVirtual} or {@linkplain #findSpecial}.)
+         * as there would be with {@link #findVirtual} or {@link #findSpecial}.)
          * The method and all its argument types must be accessible to the lookup class.
          * If the method's class has not yet been initialized, that is done
          * immediately, before the method handle is returned.
-         * @param defc the class from which the method is accessed
+         * @param refc the class from which the method is accessed
          * @param name the name of the method
          * @param type the type of the method
          * @return the desired method handle
@@ -231,18 +312,16 @@
          * @exception NoAccessException if the method does not exist or access checking fails
          */
         public
-        MethodHandle findStatic(Class<?> defc, String name, MethodType type) throws NoAccessException {
-            MemberName method = IMPL_NAMES.resolveOrFail(new MemberName(defc, name, type, Modifier.STATIC), true, lookupClass());
-            VerifyAccess.checkName(method, this);
-            checkStatic(true, method, this);
-            //throw NoSuchMethodException
-            return MethodHandleImpl.findMethod(IMPL_TOKEN, method, false, lookupClass());
+        MethodHandle findStatic(Class<?> refc, String name, MethodType type) throws NoAccessException {
+            MemberName method = resolveOrFail(refc, name, type, true);
+            checkMethod(refc, method, true);
+            return MethodHandleImpl.findMethod(IMPL_TOKEN, method, false, lookupClassOrNull());
         }
 
         /**
          * Produce a method handle for a virtual method.
          * The type of the method handle will be that of the method,
-         * with the receiver type ({@code defc}) prepended.
+         * with the receiver type (usually {@code refc}) prepended.
          * The method and all its argument types must be accessible to the lookup class.
          * <p>
          * (<em>BUG NOTE:</em> The type {@code Object} may be prepended instead
@@ -257,18 +336,44 @@
          * implementation to enter.
          * (The dispatching action is identical with that performed by an
          * {@code invokevirtual} or {@code invokeinterface} instruction.)
-         * @param defc the class or interface from which the method is accessed
+         * @param refc the class or interface from which the method is accessed
          * @param name the name of the method
          * @param type the type of the method, with the receiver argument omitted
          * @return the desired method handle
          * @exception SecurityException <em>TBD</em>
          * @exception NoAccessException if the method does not exist or access checking fails
          */
-        public MethodHandle findVirtual(Class<?> defc, String name, MethodType type) throws NoAccessException {
-            MemberName method = IMPL_NAMES.resolveOrFail(new MemberName(defc, name, type), true, lookupClass());
-            VerifyAccess.checkName(method, this);
-            checkStatic(false, method, this);
-            return MethodHandleImpl.findMethod(IMPL_TOKEN, method, true, lookupClass());
+        public MethodHandle findVirtual(Class<?> refc, String name, MethodType type) throws NoAccessException {
+            MemberName method = resolveOrFail(refc, name, type, false);
+            checkMethod(refc, method, false);
+            MethodHandle mh = MethodHandleImpl.findMethod(IMPL_TOKEN, method, true, lookupClassOrNull());
+            return restrictProtectedReceiver(method, mh);
+        }
+
+        /**
+         * Produce a method handle which creates an object and initializes it, using
+         * the constructor of the specified type.
+         * The parameter types of the method handle will be those of the constructor,
+         * while the return type will be a reference to the constructor's class.
+         * The constructor and all its argument types must be accessible to the lookup class.
+         * If the constructor's class has not yet been initialized, that is done
+         * immediately, before the method handle is returned.
+         * <p>
+         * Note:  The requested type must have a return type of {@code void}.
+         * This is consistent with the JVM's treatment of constructor signatures.
+         * @param refc the class or interface from which the method is accessed
+         * @param type the type of the method, with the receiver argument omitted, and a void return type
+         * @return the desired method handle
+         * @exception SecurityException <em>TBD</em>
+         * @exception NoAccessException if the method does not exist or access checking fails
+         */
+        public MethodHandle findConstructor(Class<?> refc, MethodType type) throws NoAccessException {
+            String name = "<init>";
+            MemberName ctor = resolveOrFail(refc, name, type, false, false, lookupClassOrNull());
+            assert(ctor.isConstructor());
+            checkAccess(refc, ctor);
+            MethodHandle rawMH = MethodHandleImpl.findMethod(IMPL_TOKEN, ctor, false, lookupClassOrNull());
+            return MethodHandleImpl.makeAllocator(IMPL_TOKEN, rawMH);
         }
 
         /**
@@ -287,27 +392,87 @@
          * <p>
          * If the explicitly specified caller class is not identical with the
          * lookup class, a security check TBD is performed.
-         * @param defc the class or interface from which the method is accessed
-         * @param name the name of the method, or "<init>" for a constructor
+         * @param refc the class or interface from which the method is accessed
+         * @param name the name of the method (which must not be "&lt;init&gt;")
          * @param type the type of the method, with the receiver argument omitted
          * @param specialCaller the proposed calling class to perform the {@code invokespecial}
          * @return the desired method handle
          * @exception SecurityException <em>TBD</em>
          * @exception NoAccessException if the method does not exist or access checking fails
          */
-        public MethodHandle findSpecial(Class<?> defc, String name, MethodType type,
+        public MethodHandle findSpecial(Class<?> refc, String name, MethodType type,
                                         Class<?> specialCaller) throws NoAccessException {
-            checkSpecialCaller(specialCaller, this);
-            Lookup slookup = this.in(specialCaller);
-            MemberName method = IMPL_NAMES.resolveOrFail(new MemberName(defc, name, type), false, slookup.lookupClass());
-            VerifyAccess.checkName(method, this);
-            checkStatic(false, method, this);
-            if (name.equals("<init>")) {
-                throw newNoAccessException("cannot directly invoke a constructor", method, null);
-            } else if (defc.isInterface() || !defc.isAssignableFrom(specialCaller)) {
-                throw newNoAccessException("method must be in a superclass of lookup class", method, slookup.lookupClass());
-            }
-            return MethodHandleImpl.findMethod(IMPL_TOKEN, method, false, slookup.lookupClass());
+            checkSpecialCaller(specialCaller);
+            MemberName method = resolveOrFail(refc, name, type, false, false, specialCaller);
+            checkMethod(refc, method, false);
+            MethodHandle mh = MethodHandleImpl.findMethod(IMPL_TOKEN, method, false, specialCaller);
+            return restrictReceiver(method, mh, specialCaller);
+        }
+
+        /**
+         * <em>PROVISIONAL API, WORK IN PROGRESS:</em>
+         * Produce a method handle giving read access to a non-static field.
+         * The type of the method handle will have a return type of the field's
+         * value type.
+         * The method handle's single argument will be the instance containing
+         * the field.
+         * Access checking is performed immediately on behalf of the lookup class.
+         * @param name the field's name
+         * @param type the field's type
+         * @return a method handle which can load values from the field
+         * @exception NoAccessException if access checking fails
+         */
+        public MethodHandle findGetter(Class<?> refc, String name, Class<?> type) throws NoAccessException {
+            return makeAccessor(refc, name, type, false, false);
+        }
+
+        /**
+         * <em>PROVISIONAL API, WORK IN PROGRESS:</em>
+         * Produce a method handle giving write access to a non-static field.
+         * The type of the method handle will have a void return type.
+         * The method handle will take two arguments, the instance containing
+         * the field, and the value to be stored.
+         * The second argument will be of the field's value type.
+         * Access checking is performed immediately on behalf of the lookup class.
+         * @param name the field's name
+         * @param type the field's type
+         * @return a method handle which can store values into the field
+         * @exception NoAccessException if access checking fails
+         */
+        public MethodHandle findSetter(Class<?> refc, String name, Class<?> type) throws NoAccessException {
+            return makeAccessor(refc, name, type, false, true);
+        }
+
+        /**
+         * <em>PROVISIONAL API, WORK IN PROGRESS:</em>
+         * Produce a method handle giving read access to a static field.
+         * The type of the method handle will have a return type of the field's
+         * value type.
+         * The method handle will take no arguments.
+         * Access checking is performed immediately on behalf of the lookup class.
+         * @param name the field's name
+         * @param type the field's type
+         * @return a method handle which can load values from the field
+         * @exception NoAccessException if access checking fails
+         */
+        public MethodHandle findStaticGetter(Class<?> refc, String name, Class<?> type) throws NoAccessException {
+            return makeAccessor(refc, name, type, true, false);
+        }
+
+        /**
+         * <em>PROVISIONAL API, WORK IN PROGRESS:</em>
+         * Produce a method handle giving write access to a static field.
+         * The type of the method handle will have a void return type.
+         * The method handle will take a single
+         * argument, of the field's value type, the value to be stored.
+         * Access checking is performed immediately on behalf of the lookup class.
+         * @param name the field's name
+         * @param type the field's type
+         * @return a method handle which can store values into the field
+         * @exception NoAccessException if access checking fails
+         */
+        public MethodHandle findStaticSetter(Class<?> refc, String name, Class<?> type) throws NoAccessException {
+            return makeAccessor(refc, name, type, true, true);
         }
 
         /**
@@ -323,7 +488,7 @@
          * <p>
          * This is equivalent to the following expression:
          * <code>
-         * {@link #insertArguments}({@link #findVirtual}(defc, name, type), receiver)
+         * {@link #insertArguments insertArguments}({@link #findVirtual findVirtual}(defc, name, type), receiver)
          * </code>
          * where {@code defc} is either {@code receiver.getClass()} or a super
          * type of that class, in which the requested method is accessible
@@ -336,15 +501,13 @@
          * @exception NoAccessException if the method does not exist or access checking fails
          */
         public MethodHandle bind(Object receiver, String name, MethodType type) throws NoAccessException {
-            Class<? extends Object> rcvc = receiver.getClass(); // may get NPE
-            MemberName reference = new MemberName(rcvc, name, type);
-            MemberName method = IMPL_NAMES.resolveOrFail(reference, true, lookupClass());
-            VerifyAccess.checkName(method, this);
-            checkStatic(false, method, this);
-            MethodHandle dmh = MethodHandleImpl.findMethod(IMPL_TOKEN, method, true, lookupClass());
+            Class<? extends Object> refc = receiver.getClass(); // may get NPE
+            MemberName method = resolveOrFail(refc, name, type, false);
+            checkMethod(refc, method, false);
+            MethodHandle dmh = MethodHandleImpl.findMethod(IMPL_TOKEN, method, true, lookupClassOrNull());
             MethodHandle bmh = MethodHandleImpl.bindReceiver(IMPL_TOKEN, dmh, receiver);
             if (bmh == null)
-                throw newNoAccessException(method, this);
+                throw newNoAccessException(method, lookupClass());
             return bmh;
         }
 
@@ -364,29 +527,37 @@
          * @exception NoAccessException if access checking fails
          */
         public MethodHandle unreflect(Method m) throws NoAccessException {
-            return unreflectImpl(new MemberName(m), m.isAccessible(), true, false, this);
+            MemberName method = new MemberName(m);
+            assert(method.isMethod());
+            if (!m.isAccessible())  checkMethod(method.getDeclaringClass(), method, method.isStatic());
+            MethodHandle mh = MethodHandleImpl.findMethod(IMPL_TOKEN, method, true, lookupClassOrNull());
+            if (!m.isAccessible())  mh = restrictProtectedReceiver(method, mh);
+            return mh;
         }
 
         /**
          * <em>PROVISIONAL API, WORK IN PROGRESS:</em>
          * Produce a method handle for a reflected method.
          * It will bypass checks for overriding methods on the receiver,
-         * as if by the {@code invokespecial} instruction.
+         * as if by a {@code invokespecial} instruction from within the {@code specialCaller}.
          * The type of the method handle will be that of the method,
-         * with the receiver type prepended.
+         * with the special caller type prepended (and <em>not</em> the receiver of the method).
          * If the method's {@code accessible} flag is not set,
          * access checking is performed immediately on behalf of the lookup class,
          * as if {@code invokespecial} instruction were being linked.
          * @param m the reflected method
+         * @param specialCaller the class nominally calling the method
          * @return a method handle which can invoke the reflected method
          * @exception NoAccessException if access checking fails
          */
         public MethodHandle unreflectSpecial(Method m, Class<?> specialCaller) throws NoAccessException {
-            checkSpecialCaller(specialCaller, this);
-            Lookup slookup = this.in(specialCaller);
-            MemberName mname = new MemberName(m);
-            checkStatic(false, mname, this);
-            return unreflectImpl(mname, m.isAccessible(), false, false, slookup);
+            checkSpecialCaller(specialCaller);
+            MemberName method = new MemberName(m);
+            assert(method.isMethod());
+            // ignore m.isAccessible:  this is a new kind of access
+            checkMethod(m.getDeclaringClass(), method, false);
+            MethodHandle mh = MethodHandleImpl.findMethod(IMPL_TOKEN, method, false, lookupClassOrNull());
+            return restrictReceiver(method, mh, specialCaller);
         }
 
         /**
@@ -400,13 +571,16 @@
          * <p>
          * If the constructor's {@code accessible} flag is not set,
          * access checking is performed immediately on behalf of the lookup class.
-         * @param ctor the reflected constructor
+         * @param c the reflected constructor
          * @return a method handle which can invoke the reflected constructor
          * @exception NoAccessException if access checking fails
          */
-        public MethodHandle unreflectConstructor(Constructor ctor) throws NoAccessException {
-            MemberName m = new MemberName(ctor);
-            return unreflectImpl(m, ctor.isAccessible(), false, false, this);
+        public MethodHandle unreflectConstructor(Constructor c) throws NoAccessException {
+            MemberName ctor = new MemberName(c);
+            assert(ctor.isConstructor());
+            if (!c.isAccessible())  checkAccess(c.getDeclaringClass(), ctor);
+            MethodHandle rawCtor = MethodHandleImpl.findMethod(IMPL_TOKEN, ctor, false, lookupClassOrNull());
+            return MethodHandleImpl.makeAllocator(IMPL_TOKEN, rawCtor);
         }
 
         /**
@@ -424,8 +598,7 @@
          * @exception NoAccessException if access checking fails
          */
         public MethodHandle unreflectGetter(Field f) throws NoAccessException {
-            MemberName m = new MemberName(f);
-            return unreflectImpl(m, f.isAccessible(), false, false, this);
+            return makeAccessor(f.getDeclaringClass(), new MemberName(f), f.isAccessible(), false);
         }
 
         /**
@@ -443,75 +616,134 @@
          * @exception NoAccessException if access checking fails
          */
         public MethodHandle unreflectSetter(Field f) throws NoAccessException {
-            MemberName m = new MemberName(f);
-            return unreflectImpl(m, f.isAccessible(), false, true, this);
+            return makeAccessor(f.getDeclaringClass(), new MemberName(f), f.isAccessible(), true);
+        }
+
+        /// Helper methods, all package-private.
+
+        MemberName resolveOrFail(Class<?> refc, String name, Class<?> type, boolean isStatic) {
+            checkSymbolicClass(refc);  // do this before attempting to resolve
+            int mods = (isStatic ? Modifier.STATIC : 0);
+            return IMPL_NAMES.resolveOrFail(new MemberName(refc, name, type, mods), true, lookupClassOrNull());
+        }
+
+        MemberName resolveOrFail(Class<?> refc, String name, MethodType type, boolean isStatic) {
+            checkSymbolicClass(refc);  // do this before attempting to resolve
+            int mods = (isStatic ? Modifier.STATIC : 0);
+            return IMPL_NAMES.resolveOrFail(new MemberName(refc, name, type, mods), true, lookupClassOrNull());
+        }
+
+        MemberName resolveOrFail(Class<?> refc, String name, MethodType type, boolean isStatic,
+                                 boolean searchSupers, Class<?> specialCaller) {
+            checkSymbolicClass(refc);  // do this before attempting to resolve
+            int mods = (isStatic ? Modifier.STATIC : 0);
+            return IMPL_NAMES.resolveOrFail(new MemberName(refc, name, type, mods), searchSupers, specialCaller);
+        }
+
+        void checkSymbolicClass(Class<?> refc) {
+            Class<?> caller = lookupClassOrNull();
+            if (caller != null && !VerifyAccess.isClassAccessible(refc, caller))
+                throw newNoAccessException("symbolic reference class is not public", new MemberName(refc), caller);
+        }
+
+        void checkMethod(Class<?> refc, MemberName m, boolean wantStatic) {
+            String message;
+            if (m.isConstructor())
+                message = "expected a method, not a constructor";
+            else if (!m.isMethod())
+                message = "expected a method";
+            else if (wantStatic != m.isStatic())
+                message = wantStatic ? "expected a static method" : "expected a non-static method";
+            else
+                { checkAccess(refc, m); return; }
+            throw newNoAccessException(message, m, lookupClass());
+        }
+
+        void checkAccess(Class<?> refc, MemberName m) {
+            int allowedModes = this.allowedModes;
+            if (allowedModes == TRUSTED)  return;
+            int mods = m.getModifiers();
+            if (Modifier.isPublic(mods) && Modifier.isPublic(refc.getModifiers()))
+                return;  // common case
+            int requestedModes = fixmods(mods);  // adjust 0 => PACKAGE
+            if ((requestedModes & allowedModes) != 0
+                && VerifyAccess.isMemberAccessible(refc, m.getDeclaringClass(),
+                                                   mods, lookupClass()))
+                return;
+            if (((requestedModes & ~allowedModes) & PROTECTED) != 0
+                && VerifyAccess.isSamePackage(m.getDeclaringClass(), lookupClass()))
+                // Protected members can also be checked as if they were package-private.
+                return;
+            throw newNoAccessException(accessFailedMessage(refc, m), m, lookupClass());
         }
 
-    }
-
-    static /*must not be public*/
-    MethodHandle findStaticFrom(Lookup lookup,
-                                Class<?> defc, String name, MethodType type) throws NoAccessException {
-        MemberName method = IMPL_NAMES.resolveOrFail(new MemberName(defc, name, type, Modifier.STATIC), true, lookup.lookupClass());
-        VerifyAccess.checkName(method, lookup);
-        checkStatic(true, method, lookup);
-        return MethodHandleImpl.findMethod(IMPL_TOKEN, method, false, lookup.lookupClass());
-    }
+        String accessFailedMessage(Class<?> refc, MemberName m) {
+            Class<?> defc = m.getDeclaringClass();
+            int mods = m.getModifiers();
+            if (!VerifyAccess.isClassAccessible(defc, lookupClass()))
+                return "class is not public";
+            if (refc != defc && !VerifyAccess.isClassAccessible(refc, lookupClass()))
+                return "symbolic reference "+refc.getName()+" is not public";
+            if (Modifier.isPublic(mods))
+                return "access to public member failed";  // (how?)
+            else if (allowedModes == PUBLIC)
+                return "member is not public";
+            if (Modifier.isPrivate(mods))
+                return "member is private";
+            if (Modifier.isProtected(mods))
+                return "member is protected";
+            return "member is private to package";
+        }
 
-    static void checkStatic(boolean wantStatic, MemberName m, Lookup lookup) {
-        if (wantStatic != m.isStatic()) {
-            String message = wantStatic ? "expected a static method" : "expected a non-static method";
-            throw newNoAccessException(message, m, lookup.lookupClass());
+        void checkSpecialCaller(Class<?> specialCaller) {
+            if (allowedModes == TRUSTED)  return;
+            if (!VerifyAccess.isSamePackageMember(specialCaller, lookupClass()))
+                throw newNoAccessException("no private access for invokespecial",
+                                           new MemberName(specialCaller), lookupClass());
         }
-    }
-
-    static void checkSpecialCaller(Class<?> specialCaller, Lookup lookup) {
-        if (lookup == Lookup.IMPL_LOOKUP)
-            return;  // privileged action
-        assert(lookup.lookupClass() != null);
-        if (!VerifyAccess.isSamePackageMember(specialCaller, lookup.lookupClass()))
-            throw newNoAccessException("no private access", new MemberName(specialCaller), lookup.lookupClass());
-    }
 
-    // Helper for creating handles on reflected methods and constructors.
-    static MethodHandle unreflectImpl(MemberName m, boolean isAccessible,
-                                      boolean doDispatch, boolean isSetter, Lookup lookup) {
-        MethodType narrowMethodType = null;
-        Class<?> defc = m.getDeclaringClass();
-        boolean isSpecialInvoke = m.isInvocable() && !doDispatch;
-        int mods = m.getModifiers();
-        if (m.isStatic()) {
-            if (!isAccessible &&
-                    VerifyAccess.isAccessible(defc, mods, lookup.lookupClass(), false) == null)
-                throw newNoAccessException(m, lookup);
-        } else {
-            Class<?> constraint;
-            if (isAccessible) {
-                // abbreviated access check for "unlocked" method
-                constraint = doDispatch ? defc : lookup.lookupClass();
-            } else {
-                constraint = VerifyAccess.isAccessible(defc, mods, lookup.lookupClass(), isSpecialInvoke);
+        MethodHandle restrictProtectedReceiver(MemberName method, MethodHandle mh) {
+            // 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()
+                || allowedModes == TRUSTED
+                || VerifyAccess.isSamePackageMember(method.getDeclaringClass(), lookupClass()))
+                return mh;
+            else
+                return restrictReceiver(method, mh, lookupClass());
+        }
+        MethodHandle restrictReceiver(MemberName method, MethodHandle mh, Class<?> caller) {
+            assert(!method.isStatic());
+            Class<?> defc = method.getDeclaringClass();  // receiver type of mh is too wide
+            if (defc.isInterface() || !defc.isAssignableFrom(caller)) {
+                throw newNoAccessException("caller class must be a subclass below the method", method, caller);
             }
-            if (constraint == null) {
-                throw newNoAccessException(m, lookup);
-            }
-            if (constraint != defc && !constraint.isAssignableFrom(defc)) {
-                if (!defc.isAssignableFrom(constraint))
-                    throw newNoAccessException("receiver must be in caller class", m, lookup.lookupClass());
-                if (m.isInvocable())
-                    narrowMethodType = m.getInvocationType().changeParameterType(0, constraint);
-                else if (m.isField())
-                    narrowMethodType = (!isSetter
-                                        ? MethodType.methodType(m.getFieldType(), constraint)
-                                        : MethodType.methodType(void.class, constraint, m.getFieldType()));
-            }
+            MethodType rawType = mh.type();
+            if (rawType.parameterType(0) == caller)  return mh;
+            MethodType narrowType = rawType.changeParameterType(0, caller);
+            return MethodHandleImpl.convertArguments(IMPL_TOKEN, mh, narrowType, rawType, null);
         }
-        if (m.isInvocable())
-            return MethodHandleImpl.findMethod(IMPL_TOKEN, m, doDispatch, lookup.lookupClass());
-        else if (m.isField())
-            return MethodHandleImpl.accessField(IMPL_TOKEN, m, isSetter, lookup.lookupClass());
-        else
-            throw new InternalError();
+
+        MethodHandle makeAccessor(Class<?> refc, String name, Class<?> type,
+                                  boolean isStatic, boolean isSetter) throws NoAccessException {
+            MemberName field = resolveOrFail(refc, name, type, isStatic);
+            if (isStatic != field.isStatic())
+                throw newNoAccessException(isStatic
+                                           ? "expected a static field"
+                                           : "expected a non-static field",
+                                           field, lookupClass());
+            return makeAccessor(refc, field, false, isSetter);
+        }
+
+        MethodHandle makeAccessor(Class<?> refc, MemberName field,
+                                  boolean trusted, boolean isSetter) throws NoAccessException {
+            assert(field.isField());
+            if (trusted)
+                return MethodHandleImpl.accessField(IMPL_TOKEN, field, isSetter, lookupClassOrNull());
+            checkAccess(refc, field);
+            MethodHandle mh = MethodHandleImpl.accessField(IMPL_TOKEN, field, isSetter, lookupClassOrNull());
+            return restrictProtectedReceiver(field, mh);
+        }
     }
 
     /**
@@ -667,10 +899,15 @@
      */
     public static
     MethodHandle dynamicInvoker(CallSite site) {
-        MethodHandle getTarget = MethodHandleImpl.bindReceiver(IMPL_TOKEN, CallSite.GET_TARGET, site);
+        MethodHandle getCSTarget = GET_TARGET;
+        if (getCSTarget == null)
+            GET_TARGET = getCSTarget = Lookup.IMPL_LOOKUP.
+                findVirtual(CallSite.class, "getTarget", MethodType.methodType(MethodHandle.class));
+        MethodHandle getTarget = MethodHandleImpl.bindReceiver(IMPL_TOKEN, getCSTarget, site);
         MethodHandle invoker = exactInvoker(site.type());
         return foldArguments(invoker, getTarget);
     }
+    private static MethodHandle GET_TARGET = null;  // link this lazily, not eagerly
 
     static Invokers invokers(MethodType type) {
         return MethodTypeImpl.invokers(IMPL_TOKEN, type);
@@ -1025,15 +1262,15 @@
      * <p><blockquote><pre>
      *   MethodHandle cat = MethodHandles.lookup().
      *     findVirtual(String.class, "concat", String.class, String.class);
-     *   System.out.println(cat.&lt;String&gt;invoke("x", "y")); // xy
+     *   System.out.println(cat.&lt;String&gt;invokeExact("x", "y")); // xy
      *   MethodHandle d0 = dropArguments(cat, 0, String.class);
-     *   System.out.println(d0.&lt;String&gt;invoke("x", "y", "z")); // xy
+     *   System.out.println(d0.&lt;String&gt;invokeExact("x", "y", "z")); // xy
      *   MethodHandle d1 = dropArguments(cat, 1, String.class);
-     *   System.out.println(d1.&lt;String&gt;invoke("x", "y", "z")); // xz
+     *   System.out.println(d1.&lt;String&gt;invokeExact("x", "y", "z")); // xz
      *   MethodHandle d2 = dropArguments(cat, 2, String.class);
-     *   System.out.println(d2.&lt;String&gt;invoke("x", "y", "z")); // yz
+     *   System.out.println(d2.&lt;String&gt;invokeExact("x", "y", "z")); // yz
      *   MethodHandle d12 = dropArguments(cat, 1, String.class, String.class);
-     *   System.out.println(d12.&lt;String&gt;invoke("w", "x", "y", "z")); // wz
+     *   System.out.println(d12.&lt;String&gt;invokeExact("w", "x", "y", "z")); // wz
      * </pre></blockquote>
      * @param target the method handle to invoke after the argument is dropped
      * @param valueTypes the type(s) of the argument to drop
@@ -1254,7 +1491,7 @@
             MethodHandle dispatch = compose(choose, test);
             // dispatch = \(a...).(test(a...) ? target : fallback)
             return combineArguments(invoke, dispatch, 0);
-            // return \(a...).((test(a...) ? target : fallback).invoke(a...))
+            // return \(a...).((test(a...) ? target : fallback).invokeExact(a...))
         } */
         return MethodHandleImpl.makeGuardWithTest(IMPL_TOKEN, test, target, fallback);
     }
@@ -1325,22 +1562,4 @@
     MethodHandle throwException(Class<?> returnType, Class<? extends Throwable> exType) {
         return MethodHandleImpl.throwException(IMPL_TOKEN, MethodType.methodType(returnType, exType));
     }
-
-    /** Alias for {@link MethodType#methodType}. */
-    @Deprecated // "use MethodType.methodType instead"
-    public static MethodType methodType(Class<?> rtype) {
-        return MethodType.methodType(rtype);
-    }
-
-    /** Alias for {@link MethodType#methodType}. */
-    @Deprecated // "use MethodType.methodType instead"
-    public static MethodType methodType(Class<?> rtype, Class<?> ptype) {
-        return MethodType.methodType(rtype, ptype);
-    }
-
-    /** Alias for {@link MethodType#methodType}. */
-    @Deprecated // "use MethodType.methodType instead"
-    public static MethodType methodType(Class<?> rtype, Class<?> ptype0, Class<?>... ptypes) {
-        return MethodType.methodType(rtype, ptype0, ptypes);
-    }
 }
--- a/jdk/src/share/classes/java/dyn/MethodType.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/share/classes/java/dyn/MethodType.java	Wed Jul 21 09:57:21 2010 -0700
@@ -36,15 +36,24 @@
 import static sun.dyn.MemberName.newIllegalArgumentException;
 
 /**
- * Run-time token used to match call sites with method handles.
+ * A method type represents the arguments and return type accepted and
+ * returned by a method handle, or the arguments and return type passed
+ * and expected  by a method handle caller.  Method types must be properly
+ * matched between a method handle and all its callers,
+ * and the JVM's operations enforce this matching at all times.
+ * <p>
  * The structure is a return type accompanied by any number of parameter types.
  * The types (primitive, void, and reference) are represented by Class objects.
+ * <p>
  * All instances of <code>MethodType</code> are immutable.
  * Two instances are completely interchangeable if they compare equal.
- * Equality depends exactly on the return and parameter types.
+ * Equality depends on pairwise correspondence of the return and parameter types and on nothing else.
  * <p>
- * This type can be created only by factory methods, which manage interning.
- *
+ * This type can be created only by factory methods.
+ * All factory methods may cache values, though caching is not guaranteed.
+ * <p>
+ * Note: Like classes and strings, method types can be represented directly
+ * as constants to be loaded by {@code ldc} bytecodes.
  * @author John Rose, JSR 292 EG
  */
 public final
@@ -109,7 +118,7 @@
     /** Find or create an instance of the given method type.
      * @param rtype  the return type
      * @param ptypes the parameter types
-     * @return the interned method type with the given parts
+     * @return a method type with the given parts
      * @throws NullPointerException if rtype or any ptype is null
      * @throws IllegalArgumentException if any of the ptypes is void
      */
@@ -626,7 +635,7 @@
     }
 
     /** Convenience method for {@link #methodType(java.lang.Class, java.lang.Class[])}.
-     * Find or create an instance (interned) of the given method type.
+     * Find or create an instance of the given method type.
      * Any class or interface name embedded in the signature string
      * will be resolved by calling {@link ClassLoader#loadClass(java.lang.String)}
      * on the given loader (or if it is null, on the system class loader).
--- a/jdk/src/share/classes/java/dyn/NoAccessException.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/share/classes/java/dyn/NoAccessException.java	Wed Jul 21 09:57:21 2010 -0700
@@ -27,11 +27,12 @@
 
 /**
  * Thrown to indicate that a caller has attempted to create a method handle
- * which calls a method to which the caller does not have access.
+ * which accesses a field, method, or class to which the caller does not have access.
  * This unchecked exception is analogous to {@link IllegalAccessException},
  * which is a checked exception thrown when reflective invocation fails
  * because of an access check.  With method handles, this same access
- * checking is performed on behalf of the method handle creator,
+ * checking is performed by the {@link MethodHandles.Lookup lookup object}
+ * on behalf of the method handle creator,
  * at the time of creation.
  * @author John Rose, JSR 292 EG
  */
--- a/jdk/src/share/classes/java/dyn/package-info.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/share/classes/java/dyn/package-info.java	Wed Jul 21 09:57:21 2010 -0700
@@ -27,6 +27,105 @@
  * <em>PROVISIONAL API, WORK IN PROGRESS:</em>
  * This package contains dynamic language support provided directly by
  * the Java core class libraries and virtual machine.
+ * <p>
+ * Certain types in this package have special relations to dynamic
+ * language support in the virtual machine:
+ * <ul>
+ * <li>In source code, a call to
+ * {@link java.dyn.MethodHandle#invokeExact   MethodHandle.invokeExact} or
+ * {@link java.dyn.MethodHandle#invokeGeneric MethodHandle.invokeGeneric}
+ * will compile and link, regardless of the requested type signature.
+ * As usual, the Java compiler emits an {@code invokevirtual}
+ * instruction with the given signature against the named method.
+ * The JVM links any such call (regardless of signature) to a dynamically
+ * typed method handle invocation.  In the case of {@code invokeGeneric},
+ * argument and return value conversions are applied.
+ *
+ * <li>In source code, the class {@link java.dyn.InvokeDynamic} appears to accept
+ * any static method invocation, of any name and any signature.
+ * But instead of emitting
+ * an {@code invokestatic} instruction for such a call, the Java compiler emits
+ * an {@code invokedynamic} instruction with the given name and signature.
+ *
+ * <li>When the JVM links an {@code invokedynamic} instruction, it calls the
+ * {@linkplain java.dyn.Linkage#registerBootstrapMethod(Class, MethodHandle) bootstrap method}
+ * of the containing class to obtain a {@linkplain java.dyn.CallSite call site} object through which
+ * the call site will link its target {@linkplain java.dyn.MethodHandle method handle}.
+ *
+ * <li>The JVM bytecode format supports immediate constants of
+ * the classes {@link java.dyn.MethodHandle} and {@link java.dyn.MethodType}.
+ * </ul>
+ *
+ * <h2><a name="jvm_mods"></a>Corresponding JVM bytecode format changes</h2>
+ * <em>The following low-level information is presented here as a preview of
+ * changes being made to the Java Virtual Machine specification for JSR 292.</em>
+ *
+ * <h3>{@code invokedynamic} instruction format</h3>
+ * In bytecode, an {@code invokedynamic} instruction is formatted as five bytes.
+ * The first byte is the opcode 186 (hexadecimal {@code BA}).
+ * The next two bytes are a constant pool index (in the same format as for the other {@code invoke} instructions).
+ * The final two bytes are reserved for future use and required to be zero.
+ * The constant pool reference is to a entry with tag {@code CONSTANT_NameAndType}
+ * (decimal 12).  It is thus not a method reference of any sort, but merely
+ * the method name, argument types, and return type of the dynamic call site.
+ * <em>(TBD: The EG is discussing the possibility of a special constant pool entry type,
+ * so that other information may be added, such as a per-instruction bootstrap
+ * method and/or annotations.)</em>
+ *
+ * <h3>constant pool entries for {@code MethodType}s</h3>
+ * If a constant pool entry has the tag {@code CONSTANT_MethodType} (decimal 16),
+ * it must contain exactly two more bytes, which are an index to a {@code CONSTANT_Utf8}
+ * entry which represents a method type signature.  The JVM will ensure that on first
+ * execution of an {@code ldc} instruction for this entry, a {@link java.dyn.MethodType}
+ * will be created which represents the signature.
+ * Any classes mentioned in the {@code MethodType} will be loaded if necessary,
+ * but not initialized.
+ * Access checking and error reporting is performed exactly as it is for
+ * references by {@code ldc} instructions to {@code CONSTANT_Class} constants.
+ *
+ * <h3>constant pool entries for {@code MethodHandle}s</h3>
+ * If a constant pool entry has the tag {@code CONSTANT_MethodHandle} (decimal 15),
+ * it must contain exactly three more bytes.  The first byte after the tag is a subtag
+ * value in the range 1 through 9, and the last two are an index to a
+ * {@code CONSTANT_Fieldref}, {@code CONSTANT_Methodref}, or
+ * {@code CONSTANT_InterfaceMethodref} entry which represents a field or method
+ * for which a method handle is to be created.
+ * The JVM will ensure that on first execution of an {@code ldc} instruction
+ * for this entry, a {@link java.dyn.MethodHandle} will be created which represents
+ * the field or method reference, according to the specific mode implied by the subtag.
+ * <p>
+ * As with {@code CONSTANT_Class} and {@code CONSTANT_MethodType} constants,
+ * the {@code Class} or {@code MethodType} object which reifies the field or method's
+ * type is created.  Any classes mentioned in this reificaiton will be loaded if necessary,
+ * but not initialized, and access checking and error reporting performed as usual.
+ * <p>
+ * The method handle itself will have a type and behavior determined by the subtag as follows:
+ * <code>
+ * <table border=1 cellpadding=5 summary="CONSTANT_MethodHandle subtypes">
+ * <tr><th>N</th><th>subtag name</th><th>member</th><th>MH type</th><th>MH behavior</th></tr>
+ * <tr><td>1</td><td>REF_getField</td><td>C.f:T</td><td>(C)T</td><td>getfield C.f:T</td></tr>
+ * <tr><td>2</td><td>REF_getStatic</td><td>C.f:T</td><td>(&nbsp;)T</td><td>getstatic C.f:T</td></tr>
+ * <tr><td>3</td><td>REF_putField</td><td>C.f:T</td><td>(C,T)void</td><td>putfield C.f:T</td></tr>
+ * <tr><td>4</td><td>REF_putStatic</td><td>C.f:T</td><td>(T)void</td><td>putstatic C.f:T</td></tr>
+ * <tr><td>5</td><td>REF_invokeVirtual</td><td>C.m(A*)T</td><td>(C,A*)T</td><td>invokevirtual C.m(A*)T</td></tr>
+ * <tr><td>6</td><td>REF_invokeStatic</td><td>C.m(A*)T</td><td>(C,A*)T</td><td>invokestatic C.m(A*)T</td></tr>
+ * <tr><td>7</td><td>REF_invokeSpecial</td><td>C.m(A*)T</td><td>(C,A*)T</td><td>invokespecial C.m(A*)T</td></tr>
+ * <tr><td>8</td><td>REF_newInvokeSpecial</td><td>C.&lt;init&gt;(A*)void</td><td>(A*)C</td><td>new C; dup; invokespecial C.&lt;init&gt;(A*)void</td></tr>
+ * <tr><td>9</td><td>REF_invokeInterface</td><td>C.m(A*)T</td><td>(C,A*)T</td><td>invokeinterface C.m(A*)T</td></tr>
+ * </table>
+ * </code>
+ * <p>
+ * The special names {@code <init>} and {@code <clinit>} are not allowed except for subtag 8 as shown.
+ * <p>
+ * The verifier applies the same access checks and restrictions for these references as for the hypothetical
+ * bytecode instructions specified in the last column of the table.  In particular, method handles to
+ * private and protected members can be created in exactly those classes for which the corresponding
+ * normal accesses are legal.
+ * <p>
+ * None of these constant types force class initialization.
+ * Method handles for subtags {@code REF_getStatic}, {@code REF_putStatic}, and {@code REF_invokeStatic}
+ * may force class initialization on their first invocation, just like the corresponding bytecodes.
+ *
  * @author John Rose, JSR 292 EG
  */
 
--- a/jdk/src/share/classes/java/io/Bits.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/share/classes/java/io/Bits.java	Wed Jul 21 09:57:21 2010 -0700
@@ -41,51 +41,39 @@
     }
 
     static char getChar(byte[] b, int off) {
-        return (char) (((b[off + 1] & 0xFF) << 0) +
-                       ((b[off + 0]) << 8));
+        return (char) ((b[off + 1] & 0xFF) +
+                       (b[off] << 8));
     }
 
     static short getShort(byte[] b, int off) {
-        return (short) (((b[off + 1] & 0xFF) << 0) +
-                        ((b[off + 0]) << 8));
+        return (short) ((b[off + 1] & 0xFF) +
+                        (b[off] << 8));
     }
 
     static int getInt(byte[] b, int off) {
-        return ((b[off + 3] & 0xFF) << 0) +
-               ((b[off + 2] & 0xFF) << 8) +
+        return ((b[off + 3] & 0xFF)      ) +
+               ((b[off + 2] & 0xFF) <<  8) +
                ((b[off + 1] & 0xFF) << 16) +
-               ((b[off + 0]) << 24);
+               ((b[off    ]       ) << 24);
     }
 
     static float getFloat(byte[] b, int off) {
-        int i = ((b[off + 3] & 0xFF) << 0) +
-                ((b[off + 2] & 0xFF) << 8) +
-                ((b[off + 1] & 0xFF) << 16) +
-                ((b[off + 0]) << 24);
-        return Float.intBitsToFloat(i);
+        return Float.intBitsToFloat(getInt(b, off));
     }
 
     static long getLong(byte[] b, int off) {
-        return ((b[off + 7] & 0xFFL) << 0) +
-               ((b[off + 6] & 0xFFL) << 8) +
+        return ((b[off + 7] & 0xFFL)      ) +
+               ((b[off + 6] & 0xFFL) <<  8) +
                ((b[off + 5] & 0xFFL) << 16) +
                ((b[off + 4] & 0xFFL) << 24) +
                ((b[off + 3] & 0xFFL) << 32) +
                ((b[off + 2] & 0xFFL) << 40) +
                ((b[off + 1] & 0xFFL) << 48) +
-               (((long) b[off + 0]) << 56);
+               (((long) b[off])      << 56);
     }
 
     static double getDouble(byte[] b, int off) {
-        long j = ((b[off + 7] & 0xFFL) << 0) +
-                 ((b[off + 6] & 0xFFL) << 8) +
-                 ((b[off + 5] & 0xFFL) << 16) +
-                 ((b[off + 4] & 0xFFL) << 24) +
-                 ((b[off + 3] & 0xFFL) << 32) +
-                 ((b[off + 2] & 0xFFL) << 40) +
-                 ((b[off + 1] & 0xFFL) << 48) +
-                 (((long) b[off + 0]) << 56);
-        return Double.longBitsToDouble(j);
+        return Double.longBitsToDouble(getLong(b, off));
     }
 
     /*
@@ -98,50 +86,38 @@
     }
 
     static void putChar(byte[] b, int off, char val) {
-        b[off + 1] = (byte) (val >>> 0);
-        b[off + 0] = (byte) (val >>> 8);
+        b[off + 1] = (byte) (val      );
+        b[off    ] = (byte) (val >>> 8);
     }
 
     static void putShort(byte[] b, int off, short val) {
-        b[off + 1] = (byte) (val >>> 0);
-        b[off + 0] = (byte) (val >>> 8);
+        b[off + 1] = (byte) (val      );
+        b[off    ] = (byte) (val >>> 8);
     }
 
     static void putInt(byte[] b, int off, int val) {
-        b[off + 3] = (byte) (val >>> 0);
-        b[off + 2] = (byte) (val >>> 8);
+        b[off + 3] = (byte) (val       );
+        b[off + 2] = (byte) (val >>>  8);
         b[off + 1] = (byte) (val >>> 16);
-        b[off + 0] = (byte) (val >>> 24);
+        b[off    ] = (byte) (val >>> 24);
     }
 
     static void putFloat(byte[] b, int off, float val) {
-        int i = Float.floatToIntBits(val);
-        b[off + 3] = (byte) (i >>> 0);
-        b[off + 2] = (byte) (i >>> 8);
-        b[off + 1] = (byte) (i >>> 16);
-        b[off + 0] = (byte) (i >>> 24);
+        putInt(b, off,  Float.floatToIntBits(val));
     }
 
     static void putLong(byte[] b, int off, long val) {
-        b[off + 7] = (byte) (val >>> 0);
-        b[off + 6] = (byte) (val >>> 8);
+        b[off + 7] = (byte) (val       );
+        b[off + 6] = (byte) (val >>>  8);
         b[off + 5] = (byte) (val >>> 16);
         b[off + 4] = (byte) (val >>> 24);
         b[off + 3] = (byte) (val >>> 32);
         b[off + 2] = (byte) (val >>> 40);
         b[off + 1] = (byte) (val >>> 48);
-        b[off + 0] = (byte) (val >>> 56);
+        b[off    ] = (byte) (val >>> 56);
     }
 
     static void putDouble(byte[] b, int off, double val) {
-        long j = Double.doubleToLongBits(val);
-        b[off + 7] = (byte) (j >>> 0);
-        b[off + 6] = (byte) (j >>> 8);
-        b[off + 5] = (byte) (j >>> 16);
-        b[off + 4] = (byte) (j >>> 24);
-        b[off + 3] = (byte) (j >>> 32);
-        b[off + 2] = (byte) (j >>> 40);
-        b[off + 1] = (byte) (j >>> 48);
-        b[off + 0] = (byte) (j >>> 56);
+        putLong(b, off, Double.doubleToLongBits(val));
     }
 }
--- a/jdk/src/share/classes/java/io/Closeable.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/share/classes/java/io/Closeable.java	Wed Jul 21 09:57:21 2010 -0700
@@ -28,14 +28,14 @@
 import java.io.IOException;
 
 /**
- * A <tt>Closeable</tt> is a source or destination of data that can be closed.
+ * A {@code Closeable} is a source or destination of data that can be closed.
  * The close method is invoked to release resources that the object is
  * holding (such as open files).
  *
  * @since 1.5
  */
 
-public interface Closeable {
+public interface Closeable extends AutoCloseable {
 
     /**
      * Closes this stream and releases any system resources associated
@@ -45,5 +45,4 @@
      * @throws IOException if an I/O error occurs
      */
     public void close() throws IOException;
-
 }
--- a/jdk/src/share/classes/java/io/ObjectInput.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/share/classes/java/io/ObjectInput.java	Wed Jul 21 09:57:21 2010 -0700
@@ -36,7 +36,7 @@
  * @see java.io.ObjectInputStream
  * @since   JDK1.1
  */
-public interface ObjectInput extends DataInput {
+public interface ObjectInput extends DataInput, AutoCloseable {
     /**
      * Read and return an object. The class that implements this interface
      * defines where the object is "read" from.
--- a/jdk/src/share/classes/java/io/ObjectOutput.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/share/classes/java/io/ObjectOutput.java	Wed Jul 21 09:57:21 2010 -0700
@@ -36,7 +36,7 @@
  * @see java.io.ObjectInputStream
  * @since   JDK1.1
  */
-public interface ObjectOutput extends DataOutput {
+public interface ObjectOutput extends DataOutput, AutoCloseable {
     /**
      * Write an object to the underlying storage or stream.  The
      * class that implements this interface defines how the object is
--- a/jdk/src/share/classes/java/lang/AbstractStringBuilder.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/share/classes/java/lang/AbstractStringBuilder.java	Wed Jul 21 09:57:21 2010 -0700
@@ -117,7 +117,7 @@
      * size check or synchronization.
      */
     void expandCapacity(int minimumCapacity) {
-        int newCapacity = value.length * 2;
+        int newCapacity = value.length * 2 + 2;
         if (newCapacity - minimumCapacity < 0)
             newCapacity = minimumCapacity;
         if (newCapacity < 0) {
@@ -721,20 +721,19 @@
      * {@code codePoint} isn't a valid Unicode code point
      */
     public AbstractStringBuilder appendCodePoint(int codePoint) {
-        if (!Character.isValidCodePoint(codePoint)) {
+        final int count = this.count;
+
+        if (Character.isBmpCodePoint(codePoint)) {
+            ensureCapacityInternal(count + 1);
+            value[count] = (char) codePoint;
+            this.count = count + 1;
+        } else if (Character.isValidCodePoint(codePoint)) {
+            ensureCapacityInternal(count + 2);
+            Character.toSurrogates(codePoint, value, count);
+            this.count = count + 2;
+        } else {
             throw new IllegalArgumentException();
         }
-        int n = 1;
-        if (codePoint >= Character.MIN_SUPPLEMENTARY_CODE_POINT) {
-            n++;
-        }
-        ensureCapacityInternal(count + n);
-        if (n == 1) {
-            value[count++] = (char) codePoint;
-        } else {
-            Character.toSurrogates(codePoint, value, count);
-            count += n;
-        }
         return this;
     }
 
--- a/jdk/src/share/classes/java/lang/AssertionError.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/share/classes/java/lang/AssertionError.java	Wed Jul 21 09:57:21 2010 -0700
@@ -66,7 +66,7 @@
      * defined in <i>The Java Language Specification, Second
      * Edition</i>, Section 15.18.1.1.
      *<p>
-     * If the specified object is an instance of <tt>Throwable</tt>, it
+     * If the specified object is an instance of {@code Throwable}, it
      * becomes the <i>cause</i> of the newly constructed assertion error.
      *
      * @param detailMessage value to be used in constructing detail message
@@ -149,4 +149,21 @@
     public AssertionError(double detailMessage) {
         this("" +  detailMessage);
     }
+
+    /**
+     * Constructs a new {@code AssertionError} with the specified
+     * detail message and cause.
+     *
+     * <p>Note that the detail message associated with
+     * {@code cause} is <i>not</i> automatically incorporated in
+     * this error's detail message.
+     *
+     * @param  message the detail message, may be {@code null}
+     * @param  cause the cause, may be {@code null}
+     *
+     * @since 1.7
+     */
+    public AssertionError(String message, Throwable cause) {
+        super(message, cause);
+    }
 }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/src/share/classes/java/lang/AutoCloseable.java	Wed Jul 21 09:57:21 2010 -0700
@@ -0,0 +1,47 @@
+/*
+ * Copyright (c) 2009, 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 java.lang;
+
+/**
+ * A resource that must be closed when it is no longer needed.
+ *
+ * @author Josh Bloch
+ * @since 1.7
+ */
+public interface AutoCloseable {
+    /**
+     * Close this resource, relinquishing any underlying resources.
+     * This method is invoked automatically by the automatic resource
+     * management block construct.
+     *
+     * <p>Classes implementing this method are strongly encouraged to
+     * be declared to throw more specific exceptions (or no exception
+     * at all, if the close cannot fail).
+     *
+     * @throws Exception if this resource cannot be closed
+     */
+    void close() throws Exception;
+}
--- a/jdk/src/share/classes/java/lang/Character.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/share/classes/java/lang/Character.java	Wed Jul 21 09:57:21 2010 -0700
@@ -24,6 +24,8 @@
  */
 
 package java.lang;
+
+import java.util.Arrays;
 import java.util.Map;
 import java.util.HashMap;
 import java.util.Locale;
@@ -66,17 +68,16 @@
  * definition</i></a> of the U+<i>n</i> notation in the Unicode
  * standard.)
  *
- * <p>The set of characters from U+0000 to U+FFFF is sometimes
- * referred to as the <em>Basic Multilingual Plane (BMP)</em>. <a
- * name="supplementary">Characters</a> whose code points are greater
+ * <p><a name="BMP">The set of characters from U+0000 to U+FFFF is
+ * sometimes referred to as the <em>Basic Multilingual Plane (BMP)</em>.
+ * <a name="supplementary">Characters</a> whose code points are greater
  * than U+FFFF are called <em>supplementary character</em>s.  The Java
- * 2 platform uses the UTF-16 representation in <code>char</code>
- * arrays and in the <code>String</code> and <code>StringBuffer</code>
- * classes. In this representation, supplementary characters are
- * represented as a pair of <code>char</code> values, the first from
- * the <em>high-surrogates</em> range, (&#92;uD800-&#92;uDBFF), the
- * second from the <em>low-surrogates</em> range
- * (&#92;uDC00-&#92;uDFFF).
+ * platform uses the UTF-16 representation in <code>char</code> arrays and
+ * in the <code>String</code> and <code>StringBuffer</code> classes. In
+ * this representation, supplementary characters are represented as a pair
+ * of <code>char</code> values, the first from the <em>high-surrogates</em>
+ * range, (&#92;uD800-&#92;uDBFF), the second from the
+ * <em>low-surrogates</em> range (&#92;uDC00-&#92;uDFFF).
  *
  * <p>A <code>char</code> value, therefore, represents Basic
  * Multilingual Plane (BMP) code points, including the surrogate
@@ -114,10 +115,12 @@
  * @author  Lee Boynton
  * @author  Guy Steele
  * @author  Akira Tanaka
+ * @author  Martin Buchholz
+ * @author  Ulf Zibis
  * @since   1.0
  */
 public final
-class Character extends Object implements java.io.Serializable, Comparable<Character> {
+class Character implements java.io.Serializable, Comparable<Character> {
     /**
      * The minimum radix available for conversion to and from strings.
      * The constant value of this field is the smallest value permitted
@@ -126,10 +129,10 @@
      * method, and the <code>toString</code> method of class
      * <code>Integer</code>.
      *
-     * @see     java.lang.Character#digit(char, int)
-     * @see     java.lang.Character#forDigit(int, int)
-     * @see     java.lang.Integer#toString(int, int)
-     * @see     java.lang.Integer#valueOf(java.lang.String)
+     * @see     Character#digit(char, int)
+     * @see     Character#forDigit(int, int)
+     * @see     Integer#toString(int, int)
+     * @see     Integer#valueOf(String)
      */
     public static final int MIN_RADIX = 2;
 
@@ -141,10 +144,10 @@
      * method, and the <code>toString</code> method of class
      * <code>Integer</code>.
      *
-     * @see     java.lang.Character#digit(char, int)
-     * @see     java.lang.Character#forDigit(int, int)
-     * @see     java.lang.Integer#toString(int, int)
-     * @see     java.lang.Integer#valueOf(java.lang.String)
+     * @see     Character#digit(char, int)
+     * @see     Character#forDigit(int, int)
+     * @see     Integer#toString(int, int)
+     * @see     Integer#valueOf(String)
      */
     public static final int MAX_RADIX = 36;
 
@@ -154,7 +157,7 @@
      *
      * @since   1.0.2
      */
-    public static final char   MIN_VALUE = '\u0000';
+    public static final char MIN_VALUE = '\u0000';
 
     /**
      * The constant value of this field is the largest value of type
@@ -162,7 +165,7 @@
      *
      * @since   1.0.2
      */
-    public static final char   MAX_VALUE = '\uFFFF';
+    public static final char MAX_VALUE = '\uFFFF';
 
     /**
      * The <code>Class</code> instance representing the primitive type
@@ -170,230 +173,201 @@
      *
      * @since   1.1
      */
+    @SuppressWarnings("unchecked")
     public static final Class<Character> TYPE = Class.getPrimitiveClass("char");
 
-   /*
-    * Normative general types
-    */
-
-   /*
-    * General character types
-    */
-
-   /**
-    * General category "Cn" in the Unicode specification.
-    * @since   1.1
-    */
-    public static final byte
-        UNASSIGNED                  = 0;
-
-   /**
-    * General category "Lu" in the Unicode specification.
-    * @since   1.1
-    */
-    public static final byte
-        UPPERCASE_LETTER            = 1;
-
-   /**
-    * General category "Ll" in the Unicode specification.
-    * @since   1.1
-    */
-    public static final byte
-        LOWERCASE_LETTER            = 2;
-
-   /**
-    * General category "Lt" in the Unicode specification.
-    * @since   1.1
-    */
-    public static final byte
-        TITLECASE_LETTER            = 3;
-
-   /**
-    * General category "Lm" in the Unicode specification.
-    * @since   1.1
-    */
-    public static final byte
-        MODIFIER_LETTER             = 4;
-
-   /**
-    * General category "Lo" in the Unicode specification.
-    * @since   1.1
-    */
-    public static final byte
-        OTHER_LETTER                = 5;
-
-   /**
-    * General category "Mn" in the Unicode specification.
-    * @since   1.1
-    */
-    public static final byte
-        NON_SPACING_MARK            = 6;
-
-   /**
-    * General category "Me" in the Unicode specification.
-    * @since   1.1
-    */
-    public static final byte
-        ENCLOSING_MARK              = 7;
-
-   /**
-    * General category "Mc" in the Unicode specification.
-    * @since   1.1
-    */
-    public static final byte
-        COMBINING_SPACING_MARK      = 8;
-
-   /**
-    * General category "Nd" in the Unicode specification.
-    * @since   1.1
-    */
-    public static final byte
-        DECIMAL_DIGIT_NUMBER        = 9;
-
-   /**
-    * General category "Nl" in the Unicode specification.
-    * @since   1.1
-    */
-    public static final byte
-        LETTER_NUMBER               = 10;
-
-   /**
-    * General category "No" in the Unicode specification.
-    * @since   1.1
-    */
-    public static final byte
-        OTHER_NUMBER                = 11;
-
-   /**
-    * General category "Zs" in the Unicode specification.
-    * @since   1.1
-    */
-    public static final byte
-        SPACE_SEPARATOR             = 12;
-
-   /**
-    * General category "Zl" in the Unicode specification.
-    * @since   1.1
-    */
-    public static final byte
-        LINE_SEPARATOR              = 13;
-
-   /**
-    * General category "Zp" in the Unicode specification.
-    * @since   1.1
-    */
-    public static final byte
-        PARAGRAPH_SEPARATOR         = 14;
-
-   /**
-    * General category "Cc" in the Unicode specification.
-    * @since   1.1
-    */
-    public static final byte
-        CONTROL                     = 15;
-
-   /**
-    * General category "Cf" in the Unicode specification.
-    * @since   1.1
-    */
-    public static final byte
-        FORMAT                      = 16;
-
-   /**
-    * General category "Co" in the Unicode specification.
-    * @since   1.1
-    */
-    public static final byte
-        PRIVATE_USE                 = 18;
-
-   /**
-    * General category "Cs" in the Unicode specification.
-    * @since   1.1
-    */
-    public static final byte
-        SURROGATE                   = 19;
-
-   /**
-    * General category "Pd" in the Unicode specification.
-    * @since   1.1
-    */
-    public static final byte
-        DASH_PUNCTUATION            = 20;
-
-   /**
-    * General category "Ps" in the Unicode specification.
-    * @since   1.1
-    */
-    public static final byte
-        START_PUNCTUATION           = 21;
-
-   /**
-    * General category "Pe" in the Unicode specification.
-    * @since   1.1
-    */
-    public static final byte
-        END_PUNCTUATION             = 22;
-
-   /**
-    * General category "Pc" in the Unicode specification.
-    * @since   1.1
-    */
-    public static final byte
-        CONNECTOR_PUNCTUATION       = 23;
-
-   /**
-    * General category "Po" in the Unicode specification.
-    * @since   1.1
-    */
-    public static final byte
-        OTHER_PUNCTUATION           = 24;
-
-   /**
-    * General category "Sm" in the Unicode specification.
-    * @since   1.1
-    */
-    public static final byte
-        MATH_SYMBOL                 = 25;
-
-   /**
-    * General category "Sc" in the Unicode specification.
-    * @since   1.1
-    */
-    public static final byte
-        CURRENCY_SYMBOL             = 26;
-
-   /**
-    * General category "Sk" in the Unicode specification.
-    * @since   1.1
-    */
-    public static final byte
-        MODIFIER_SYMBOL             = 27;
-
-   /**
-    * General category "So" in the Unicode specification.
-    * @since   1.1
-    */
-    public static final byte
-        OTHER_SYMBOL                = 28;
-
-   /**
-    * General category "Pi" in the Unicode specification.
-    * @since   1.4
-    */
-    public static final byte
-        INITIAL_QUOTE_PUNCTUATION   = 29;
-
-   /**
-    * General category "Pf" in the Unicode specification.
-    * @since   1.4
-    */
-    public static final byte
-        FINAL_QUOTE_PUNCTUATION     = 30;
+    /*
+     * Normative general types
+     */
+
+    /*
+     * General character types
+     */
+
+    /**
+     * General category "Cn" in the Unicode specification.
+     * @since   1.1
+     */
+    public static final byte UNASSIGNED = 0;
+
+    /**
+     * General category "Lu" in the Unicode specification.
+     * @since   1.1
+     */
+    public static final byte UPPERCASE_LETTER = 1;
+
+    /**
+     * General category "Ll" in the Unicode specification.
+     * @since   1.1
+     */
+    public static final byte LOWERCASE_LETTER = 2;
+
+    /**
+     * General category "Lt" in the Unicode specification.
+     * @since   1.1
+     */
+    public static final byte TITLECASE_LETTER = 3;
+
+    /**
+     * General category "Lm" in the Unicode specification.
+     * @since   1.1
+     */
+    public static final byte MODIFIER_LETTER = 4;
+
+    /**
+     * General category "Lo" in the Unicode specification.
+     * @since   1.1
+     */
+    public static final byte OTHER_LETTER = 5;
+
+    /**
+     * General category "Mn" in the Unicode specification.
+     * @since   1.1
+     */
+    public static final byte NON_SPACING_MARK = 6;
+
+    /**
+     * General category "Me" in the Unicode specification.
+     * @since   1.1
+     */
+    public static final byte ENCLOSING_MARK = 7;
+
+    /**
+     * General category "Mc" in the Unicode specification.
+     * @since   1.1
+     */
+    public static final byte COMBINING_SPACING_MARK = 8;
+
+    /**
+     * General category "Nd" in the Unicode specification.
+     * @since   1.1
+     */
+    public static final byte DECIMAL_DIGIT_NUMBER        = 9;
+
+    /**
+     * General category "Nl" in the Unicode specification.
+     * @since   1.1
+     */
+    public static final byte LETTER_NUMBER = 10;
+
+    /**
+     * General category "No" in the Unicode specification.
+     * @since   1.1
+     */
+    public static final byte OTHER_NUMBER = 11;
+
+    /**
+     * General category "Zs" in the Unicode specification.
+     * @since   1.1
+     */
+    public static final byte SPACE_SEPARATOR = 12;
+
+    /**
+     * General category "Zl" in the Unicode specification.
+     * @since   1.1
+     */
+    public static final byte LINE_SEPARATOR = 13;
+
+    /**
+     * General category "Zp" in the Unicode specification.
+     * @since   1.1
+     */
+    public static final byte PARAGRAPH_SEPARATOR = 14;
+
+    /**
+     * General category "Cc" in the Unicode specification.
+     * @since   1.1
+     */
+    public static final byte CONTROL = 15;
+
+    /**
+     * General category "Cf" in the Unicode specification.
+     * @since   1.1
+     */
+    public static final byte FORMAT = 16;
+
+    /**
+     * General category "Co" in the Unicode specification.
+     * @since   1.1
+     */
+    public static final byte PRIVATE_USE = 18;
+
+    /**
+     * General category "Cs" in the Unicode specification.
+     * @since   1.1
+     */
+    public static final byte SURROGATE = 19;
+
+    /**
+     * General category "Pd" in the Unicode specification.
+     * @since   1.1
+     */
+    public static final byte DASH_PUNCTUATION = 20;
+
+    /**
+     * General category "Ps" in the Unicode specification.
+     * @since   1.1
+     */
+    public static final byte START_PUNCTUATION = 21;
+
+    /**
+     * General category "Pe" in the Unicode specification.
+     * @since   1.1
+     */
+    public static final byte END_PUNCTUATION = 22;
+
+    /**
+     * General category "Pc" in the Unicode specification.
+     * @since   1.1
+     */
+    public static final byte CONNECTOR_PUNCTUATION = 23;
+
+    /**
+     * General category "Po" in the Unicode specification.
+     * @since   1.1
+     */
+    public static final byte OTHER_PUNCTUATION = 24;
+
+    /**
+     * General category "Sm" in the Unicode specification.
+     * @since   1.1
+     */
+    public static final byte MATH_SYMBOL = 25;
+
+    /**
+     * General category "Sc" in the Unicode specification.
+     * @since   1.1
+     */
+    public static final byte CURRENCY_SYMBOL = 26;
+
+    /**
+     * General category "Sk" in the Unicode specification.
+     * @since   1.1
+     */
+    public static final byte MODIFIER_SYMBOL = 27;
+
+    /**
+     * General category "So" in the Unicode specification.
+     * @since   1.1
+     */
+    public static final byte OTHER_SYMBOL = 28;
+
+    /**
+     * General category "Pi" in the Unicode specification.
+     * @since   1.4
+     */
+    public static final byte INITIAL_QUOTE_PUNCTUATION = 29;
+
+    /**
+     * General category "Pf" in the Unicode specification.
+     * @since   1.4
+     */
+    public static final byte FINAL_QUOTE_PUNCTUATION = 30;
 
     /**
      * Error flag. Use int (code point) to avoid confusion with U+FFFF.
      */
-     static final int ERROR = 0xFFFFFFFF;
+    static final int ERROR = 0xFFFFFFFF;
 
 
     /**
@@ -401,7 +375,7 @@
      * values have undefined directionality in the Unicode specification.
      * @since 1.4
      */
-     public static final byte DIRECTIONALITY_UNDEFINED = -1;
+    public static final byte DIRECTIONALITY_UNDEFINED = -1;
 
     /**
      * Strong bidirectional character type "L" in the Unicode specification.
@@ -608,9 +582,9 @@
     /**
      * Instances of this class represent particular subsets of the Unicode
      * character set.  The only family of subsets defined in the
-     * <code>Character</code> class is <code>{@link Character.UnicodeBlock
-     * UnicodeBlock}</code>.  Other portions of the Java API may define other
-     * subsets for their own purposes.
+     * <code>Character</code> class is {@link Character.UnicodeBlock}.
+     * Other portions of the Java API may define other subsets for their
+     * own purposes.
      *
      * @since 1.2
      */
@@ -623,6 +597,7 @@
          *
          * @exception NullPointerException if name is <code>null</code>
          * @param  name  The name of this subset
+         * @exception NullPointerException if name is <code>null</code>
          */
         protected Subset(String name) {
             if (name == null) {
@@ -661,6 +636,9 @@
         }
     }
 
+    // See http://www.unicode.org/Public/UNIDATA/Blocks.txt
+    // for the latest specification of Unicode Blocks.
+
     /**
      * A family of character subsets representing the character blocks in the
      * Unicode specification. Character blocks generally define characters
@@ -671,37 +649,35 @@
      */
     public static final class UnicodeBlock extends Subset {
 
-        private static Map map = new HashMap();
-
-        /**
-         * Create a UnicodeBlock with the given identifier name.
+        private static Map<String, UnicodeBlock> map
+            = new HashMap<String, UnicodeBlock>(256);
+
+        /**
+         * Creates a UnicodeBlock with the given identifier name.
          * This name must be the same as the block identifier.
          */
         private UnicodeBlock(String idName) {
             super(idName);
-            map.put(idName.toUpperCase(Locale.US), this);
+            map.put(idName, this);
         }
 
         /**
-         * Create a UnicodeBlock with the given identifier name and
+         * Creates a UnicodeBlock with the given identifier name and
          * alias name.
          */
         private UnicodeBlock(String idName, String alias) {
             this(idName);
-            map.put(alias.toUpperCase(Locale.US), this);
+            map.put(alias, this);
         }
 
         /**
-         * Create a UnicodeBlock with the given identifier name and
+         * Creates a UnicodeBlock with the given identifier name and
          * alias names.
          */
-        private UnicodeBlock(String idName, String[] aliasName) {
+        private UnicodeBlock(String idName, String... aliases) {
             this(idName);
-            if (aliasName != null) {
-                for(int x=0; x<aliasName.length; ++x) {
-                    map.put(aliasName[x].toUpperCase(Locale.US), this);
-                }
-            }
+            for (String alias : aliases)
+                map.put(alias, this);
         }
 
         /**
@@ -709,51 +685,63 @@
          * @since 1.2
          */
         public static final UnicodeBlock  BASIC_LATIN =
-            new UnicodeBlock("BASIC_LATIN", new String[] {"Basic Latin", "BasicLatin" });
+            new UnicodeBlock("BASIC_LATIN",
+                             "BASIC LATIN",
+                             "BASICLATIN");
 
         /**
          * Constant for the "Latin-1 Supplement" Unicode character block.
          * @since 1.2
          */
         public static final UnicodeBlock LATIN_1_SUPPLEMENT =
-            new UnicodeBlock("LATIN_1_SUPPLEMENT", new String[]{ "Latin-1 Supplement", "Latin-1Supplement"});
+            new UnicodeBlock("LATIN_1_SUPPLEMENT",
+                             "LATIN-1 SUPPLEMENT",
+                             "LATIN-1SUPPLEMENT");
 
         /**
          * Constant for the "Latin Extended-A" Unicode character block.
          * @since 1.2
          */
         public static final UnicodeBlock LATIN_EXTENDED_A =
-            new UnicodeBlock("LATIN_EXTENDED_A", new String[]{ "Latin Extended-A", "LatinExtended-A"});
+            new UnicodeBlock("LATIN_EXTENDED_A",
+                             "LATIN EXTENDED-A",
+                             "LATINEXTENDED-A");
 
         /**
          * Constant for the "Latin Extended-B" Unicode character block.
          * @since 1.2
          */
         public static final UnicodeBlock LATIN_EXTENDED_B =
-            new UnicodeBlock("LATIN_EXTENDED_B", new String[] {"Latin Extended-B", "LatinExtended-B"});
+            new UnicodeBlock("LATIN_EXTENDED_B",
+                             "LATIN EXTENDED-B",
+                             "LATINEXTENDED-B");
 
         /**
          * Constant for the "IPA Extensions" Unicode character block.
          * @since 1.2
          */
         public static final UnicodeBlock IPA_EXTENSIONS =
-            new UnicodeBlock("IPA_EXTENSIONS", new String[] {"IPA Extensions", "IPAExtensions"});
+            new UnicodeBlock("IPA_EXTENSIONS",
+                             "IPA EXTENSIONS",
+                             "IPAEXTENSIONS");
 
         /**
          * Constant for the "Spacing Modifier Letters" Unicode character block.
          * @since 1.2
          */
         public static final UnicodeBlock SPACING_MODIFIER_LETTERS =
-            new UnicodeBlock("SPACING_MODIFIER_LETTERS", new String[] { "Spacing Modifier Letters",
-                                                                        "SpacingModifierLetters"});
+            new UnicodeBlock("SPACING_MODIFIER_LETTERS",
+                             "SPACING MODIFIER LETTERS",
+                             "SPACINGMODIFIERLETTERS");
 
         /**
          * Constant for the "Combining Diacritical Marks" Unicode character block.
          * @since 1.2
          */
         public static final UnicodeBlock COMBINING_DIACRITICAL_MARKS =
-            new UnicodeBlock("COMBINING_DIACRITICAL_MARKS", new String[] {"Combining Diacritical Marks",
-                                                                          "CombiningDiacriticalMarks" });
+            new UnicodeBlock("COMBINING_DIACRITICAL_MARKS",
+                             "COMBINING DIACRITICAL MARKS",
+                             "COMBININGDIACRITICALMARKS");
 
         /**
          * Constant for the "Greek and Coptic" Unicode character block.
@@ -762,8 +750,10 @@
          *
          * @since 1.2
          */
-        public static final UnicodeBlock GREEK
-            = new UnicodeBlock("GREEK", new String[] {"Greek and Coptic", "GreekandCoptic"});
+        public static final UnicodeBlock GREEK =
+            new UnicodeBlock("GREEK",
+                             "GREEK AND COPTIC",
+                             "GREEKANDCOPTIC");
 
         /**
          * Constant for the "Cyrillic" Unicode character block.
@@ -889,44 +879,54 @@
          * @since 1.2
          */
         public static final UnicodeBlock HANGUL_JAMO =
-            new UnicodeBlock("HANGUL_JAMO", new String[] {"Hangul Jamo", "HangulJamo"});
+            new UnicodeBlock("HANGUL_JAMO",
+                             "HANGUL JAMO",
+                             "HANGULJAMO");
 
         /**
          * Constant for the "Latin Extended Additional" Unicode character block.
          * @since 1.2
          */
         public static final UnicodeBlock LATIN_EXTENDED_ADDITIONAL =
-            new UnicodeBlock("LATIN_EXTENDED_ADDITIONAL", new String[] {"Latin Extended Additional",
-                                                                        "LatinExtendedAdditional"});
+            new UnicodeBlock("LATIN_EXTENDED_ADDITIONAL",
+                             "LATIN EXTENDED ADDITIONAL",
+                             "LATINEXTENDEDADDITIONAL");
 
         /**
          * Constant for the "Greek Extended" Unicode character block.
          * @since 1.2
          */
         public static final UnicodeBlock GREEK_EXTENDED =
-            new UnicodeBlock("GREEK_EXTENDED", new String[] {"Greek Extended", "GreekExtended"});
+            new UnicodeBlock("GREEK_EXTENDED",
+                             "GREEK EXTENDED",
+                             "GREEKEXTENDED");
 
         /**
          * Constant for the "General Punctuation" Unicode character block.
          * @since 1.2
          */
         public static final UnicodeBlock GENERAL_PUNCTUATION =
-            new UnicodeBlock("GENERAL_PUNCTUATION", new String[] {"General Punctuation", "GeneralPunctuation"});
+            new UnicodeBlock("GENERAL_PUNCTUATION",
+                             "GENERAL PUNCTUATION",
+                             "GENERALPUNCTUATION");
 
         /**
          * Constant for the "Superscripts and Subscripts" Unicode character block.
          * @since 1.2
          */
         public static final UnicodeBlock SUPERSCRIPTS_AND_SUBSCRIPTS =
-            new UnicodeBlock("SUPERSCRIPTS_AND_SUBSCRIPTS", new String[] {"Superscripts and Subscripts",
-                                                                          "SuperscriptsandSubscripts" });
+            new UnicodeBlock("SUPERSCRIPTS_AND_SUBSCRIPTS",
+                             "SUPERSCRIPTS AND SUBSCRIPTS",
+                             "SUPERSCRIPTSANDSUBSCRIPTS");
 
         /**
          * Constant for the "Currency Symbols" Unicode character block.
          * @since 1.2
          */
         public static final UnicodeBlock CURRENCY_SYMBOLS =
-            new UnicodeBlock("CURRENCY_SYMBOLS", new String[] { "Currency Symbols", "CurrencySymbols"});
+            new UnicodeBlock("CURRENCY_SYMBOLS",
+                             "CURRENCY SYMBOLS",
+                             "CURRENCYSYMBOLS");
 
         /**
          * Constant for the "Combining Diacritical Marks for Symbols" Unicode character block.
@@ -935,24 +935,29 @@
          * @since 1.2
          */
         public static final UnicodeBlock COMBINING_MARKS_FOR_SYMBOLS =
-            new UnicodeBlock("COMBINING_MARKS_FOR_SYMBOLS", new String[] {"Combining Diacritical Marks for Symbols",
-                                                                                                                                                   "CombiningDiacriticalMarksforSymbols",
-                                                                           "Combining Marks for Symbols",
-                                                                           "CombiningMarksforSymbols" });
+            new UnicodeBlock("COMBINING_MARKS_FOR_SYMBOLS",
+                             "COMBINING DIACRITICAL MARKS FOR SYMBOLS",
+                             "COMBININGDIACRITICALMARKSFORSYMBOLS",
+                             "COMBINING MARKS FOR SYMBOLS",
+                             "COMBININGMARKSFORSYMBOLS");
 
         /**
          * Constant for the "Letterlike Symbols" Unicode character block.
          * @since 1.2
          */
         public static final UnicodeBlock LETTERLIKE_SYMBOLS =
-            new UnicodeBlock("LETTERLIKE_SYMBOLS", new String[] { "Letterlike Symbols", "LetterlikeSymbols"});
+            new UnicodeBlock("LETTERLIKE_SYMBOLS",
+                             "LETTERLIKE SYMBOLS",
+                             "LETTERLIKESYMBOLS");
 
         /**
          * Constant for the "Number Forms" Unicode character block.
          * @since 1.2
          */
         public static final UnicodeBlock NUMBER_FORMS =
-            new UnicodeBlock("NUMBER_FORMS", new String[] {"Number Forms", "NumberForms"});
+            new UnicodeBlock("NUMBER_FORMS",
+                             "NUMBER FORMS",
+                             "NUMBERFORMS");
 
         /**
          * Constant for the "Arrows" Unicode character block.
@@ -966,68 +971,81 @@
          * @since 1.2
          */
         public static final UnicodeBlock MATHEMATICAL_OPERATORS =
-            new UnicodeBlock("MATHEMATICAL_OPERATORS", new String[] {"Mathematical Operators",
-                                                                     "MathematicalOperators"});
+            new UnicodeBlock("MATHEMATICAL_OPERATORS",
+                             "MATHEMATICAL OPERATORS",
+                             "MATHEMATICALOPERATORS");
 
         /**
          * Constant for the "Miscellaneous Technical" Unicode character block.
          * @since 1.2
          */
         public static final UnicodeBlock MISCELLANEOUS_TECHNICAL =
-            new UnicodeBlock("MISCELLANEOUS_TECHNICAL", new String[] {"Miscellaneous Technical",
-                                                                      "MiscellaneousTechnical"});
+            new UnicodeBlock("MISCELLANEOUS_TECHNICAL",
+                             "MISCELLANEOUS TECHNICAL",
+                             "MISCELLANEOUSTECHNICAL");
 
         /**
          * Constant for the "Control Pictures" Unicode character block.
          * @since 1.2
          */
         public static final UnicodeBlock CONTROL_PICTURES =
-            new UnicodeBlock("CONTROL_PICTURES", new String[] {"Control Pictures", "ControlPictures"});
+            new UnicodeBlock("CONTROL_PICTURES",
+                             "CONTROL PICTURES",
+                             "CONTROLPICTURES");
 
         /**
          * Constant for the "Optical Character Recognition" Unicode character block.
          * @since 1.2
          */
         public static final UnicodeBlock OPTICAL_CHARACTER_RECOGNITION =
-            new UnicodeBlock("OPTICAL_CHARACTER_RECOGNITION", new String[] {"Optical Character Recognition",
-                                                                            "OpticalCharacterRecognition"});
+            new UnicodeBlock("OPTICAL_CHARACTER_RECOGNITION",
+                             "OPTICAL CHARACTER RECOGNITION",
+                             "OPTICALCHARACTERRECOGNITION");
 
         /**
          * Constant for the "Enclosed Alphanumerics" Unicode character block.
          * @since 1.2
          */
         public static final UnicodeBlock ENCLOSED_ALPHANUMERICS =
-            new UnicodeBlock("ENCLOSED_ALPHANUMERICS", new String[] {"Enclosed Alphanumerics",
-                                                                     "EnclosedAlphanumerics"});
+            new UnicodeBlock("ENCLOSED_ALPHANUMERICS",
+                             "ENCLOSED ALPHANUMERICS",
+                             "ENCLOSEDALPHANUMERICS");
 
         /**
          * Constant for the "Box Drawing" Unicode character block.
          * @since 1.2
          */
         public static final UnicodeBlock BOX_DRAWING =
-            new UnicodeBlock("BOX_DRAWING", new String[] {"Box Drawing", "BoxDrawing"});
+            new UnicodeBlock("BOX_DRAWING",
+                             "BOX DRAWING",
+                             "BOXDRAWING");
 
         /**
          * Constant for the "Block Elements" Unicode character block.
          * @since 1.2
          */
         public static final UnicodeBlock BLOCK_ELEMENTS =
-            new UnicodeBlock("BLOCK_ELEMENTS", new String[] {"Block Elements", "BlockElements"});
+            new UnicodeBlock("BLOCK_ELEMENTS",
+                             "BLOCK ELEMENTS",
+                             "BLOCKELEMENTS");
 
         /**
          * Constant for the "Geometric Shapes" Unicode character block.
          * @since 1.2
          */
         public static final UnicodeBlock GEOMETRIC_SHAPES =
-            new UnicodeBlock("GEOMETRIC_SHAPES", new String[] {"Geometric Shapes", "GeometricShapes"});
+            new UnicodeBlock("GEOMETRIC_SHAPES",
+                             "GEOMETRIC SHAPES",
+                             "GEOMETRICSHAPES");
 
         /**
          * Constant for the "Miscellaneous Symbols" Unicode character block.
          * @since 1.2
          */
         public static final UnicodeBlock MISCELLANEOUS_SYMBOLS =
-            new UnicodeBlock("MISCELLANEOUS_SYMBOLS", new String[] {"Miscellaneous Symbols",
-                                                                    "MiscellaneousSymbols"});
+            new UnicodeBlock("MISCELLANEOUS_SYMBOLS",
+                             "MISCELLANEOUS SYMBOLS",
+                             "MISCELLANEOUSSYMBOLS");
 
         /**
          * Constant for the "Dingbats" Unicode character block.
@@ -1041,8 +1059,9 @@
          * @since 1.2
          */
         public static final UnicodeBlock CJK_SYMBOLS_AND_PUNCTUATION =
-            new UnicodeBlock("CJK_SYMBOLS_AND_PUNCTUATION", new String[] {"CJK Symbols and Punctuation",
-                                                                          "CJKSymbolsandPunctuation"});
+            new UnicodeBlock("CJK_SYMBOLS_AND_PUNCTUATION",
+                             "CJK SYMBOLS AND PUNCTUATION",
+                             "CJKSYMBOLSANDPUNCTUATION");
 
         /**
          * Constant for the "Hiragana" Unicode character block.
@@ -1070,8 +1089,9 @@
          * @since 1.2
          */
         public static final UnicodeBlock HANGUL_COMPATIBILITY_JAMO =
-            new UnicodeBlock("HANGUL_COMPATIBILITY_JAMO", new String[] {"Hangul Compatibility Jamo",
-                                                                        "HangulCompatibilityJamo"});
+            new UnicodeBlock("HANGUL_COMPATIBILITY_JAMO",
+                             "HANGUL COMPATIBILITY JAMO",
+                             "HANGULCOMPATIBILITYJAMO");
 
         /**
          * Constant for the "Kanbun" Unicode character block.
@@ -1085,37 +1105,45 @@
          * @since 1.2
          */
         public static final UnicodeBlock ENCLOSED_CJK_LETTERS_AND_MONTHS =
-            new UnicodeBlock("ENCLOSED_CJK_LETTERS_AND_MONTHS", new String[] {"Enclosed CJK Letters and Months",
-                                                                              "EnclosedCJKLettersandMonths"});
+            new UnicodeBlock("ENCLOSED_CJK_LETTERS_AND_MONTHS",
+                             "ENCLOSED CJK LETTERS AND MONTHS",
+                             "ENCLOSEDCJKLETTERSANDMONTHS");
 
         /**
          * Constant for the "CJK Compatibility" Unicode character block.
          * @since 1.2
          */
         public static final UnicodeBlock CJK_COMPATIBILITY =
-            new UnicodeBlock("CJK_COMPATIBILITY", new String[] {"CJK Compatibility", "CJKCompatibility"});
+            new UnicodeBlock("CJK_COMPATIBILITY",
+                             "CJK COMPATIBILITY",
+                             "CJKCOMPATIBILITY");
 
         /**
          * Constant for the "CJK Unified Ideographs" Unicode character block.
          * @since 1.2
          */
         public static final UnicodeBlock CJK_UNIFIED_IDEOGRAPHS =
-            new UnicodeBlock("CJK_UNIFIED_IDEOGRAPHS", new String[] {"CJK Unified Ideographs",
-                                                                     "CJKUnifiedIdeographs"});
+            new UnicodeBlock("CJK_UNIFIED_IDEOGRAPHS",
+                             "CJK UNIFIED IDEOGRAPHS",
+                             "CJKUNIFIEDIDEOGRAPHS");
 
         /**
          * Constant for the "Hangul Syllables" Unicode character block.
          * @since 1.2
          */
         public static final UnicodeBlock HANGUL_SYLLABLES =
-            new UnicodeBlock("HANGUL_SYLLABLES", new String[] {"Hangul Syllables", "HangulSyllables"});
+            new UnicodeBlock("HANGUL_SYLLABLES",
+                             "HANGUL SYLLABLES",
+                             "HANGULSYLLABLES");
 
         /**
          * Constant for the "Private Use Area" Unicode character block.
          * @since 1.2
          */
         public static final UnicodeBlock PRIVATE_USE_AREA =
-            new UnicodeBlock("PRIVATE_USE_AREA", new String[] {"Private Use Area", "PrivateUseArea"});
+            new UnicodeBlock("PRIVATE_USE_AREA",
+                             "PRIVATE USE AREA",
+                             "PRIVATEUSEAREA");
 
         /**
          * Constant for the "CJK Compatibility Ideographs" Unicode character block.
@@ -1123,56 +1151,62 @@
          */
         public static final UnicodeBlock CJK_COMPATIBILITY_IDEOGRAPHS =
             new UnicodeBlock("CJK_COMPATIBILITY_IDEOGRAPHS",
-                             new String[] {"CJK Compatibility Ideographs",
-                                           "CJKCompatibilityIdeographs"});
+                             "CJK COMPATIBILITY IDEOGRAPHS",
+                             "CJKCOMPATIBILITYIDEOGRAPHS");
 
         /**
          * Constant for the "Alphabetic Presentation Forms" Unicode character block.
          * @since 1.2
          */
         public static final UnicodeBlock ALPHABETIC_PRESENTATION_FORMS =
-            new UnicodeBlock("ALPHABETIC_PRESENTATION_FORMS", new String[] {"Alphabetic Presentation Forms",
-                                                                            "AlphabeticPresentationForms"});
+            new UnicodeBlock("ALPHABETIC_PRESENTATION_FORMS",
+                             "ALPHABETIC PRESENTATION FORMS",
+                             "ALPHABETICPRESENTATIONFORMS");
 
         /**
          * Constant for the "Arabic Presentation Forms-A" Unicode character block.
          * @since 1.2
          */
         public static final UnicodeBlock ARABIC_PRESENTATION_FORMS_A =
-            new UnicodeBlock("ARABIC_PRESENTATION_FORMS_A", new String[] {"Arabic Presentation Forms-A",
-                                                                          "ArabicPresentationForms-A"});
+            new UnicodeBlock("ARABIC_PRESENTATION_FORMS_A",
+                             "ARABIC PRESENTATION FORMS-A",
+                             "ARABICPRESENTATIONFORMS-A");
 
         /**
          * Constant for the "Combining Half Marks" Unicode character block.
          * @since 1.2
          */
         public static final UnicodeBlock COMBINING_HALF_MARKS =
-            new UnicodeBlock("COMBINING_HALF_MARKS", new String[] {"Combining Half Marks",
-                                                                   "CombiningHalfMarks"});
+            new UnicodeBlock("COMBINING_HALF_MARKS",
+                             "COMBINING HALF MARKS",
+                             "COMBININGHALFMARKS");
 
         /**
          * Constant for the "CJK Compatibility Forms" Unicode character block.
          * @since 1.2
          */
         public static final UnicodeBlock CJK_COMPATIBILITY_FORMS =
-            new UnicodeBlock("CJK_COMPATIBILITY_FORMS", new String[] {"CJK Compatibility Forms",
-                                                                      "CJKCompatibilityForms"});
+            new UnicodeBlock("CJK_COMPATIBILITY_FORMS",
+                             "CJK COMPATIBILITY FORMS",
+                             "CJKCOMPATIBILITYFORMS");
 
         /**
          * Constant for the "Small Form Variants" Unicode character block.
          * @since 1.2
          */
         public static final UnicodeBlock SMALL_FORM_VARIANTS =
-            new UnicodeBlock("SMALL_FORM_VARIANTS", new String[] {"Small Form Variants",
-                                                                  "SmallFormVariants"});
+            new UnicodeBlock("SMALL_FORM_VARIANTS",
+                             "SMALL FORM VARIANTS",
+                             "SMALLFORMVARIANTS");
 
         /**
          * Constant for the "Arabic Presentation Forms-B" Unicode character block.
          * @since 1.2
          */
         public static final UnicodeBlock ARABIC_PRESENTATION_FORMS_B =
-            new UnicodeBlock("ARABIC_PRESENTATION_FORMS_B", new String[] {"Arabic Presentation Forms-B",
-                                                                          "ArabicPresentationForms-B"});
+            new UnicodeBlock("ARABIC_PRESENTATION_FORMS_B",
+                             "ARABIC PRESENTATION FORMS-B",
+                             "ARABICPRESENTATIONFORMS-B");
 
         /**
          * Constant for the "Halfwidth and Fullwidth Forms" Unicode character block.
@@ -1180,8 +1214,8 @@
          */
         public static final UnicodeBlock HALFWIDTH_AND_FULLWIDTH_FORMS =
             new UnicodeBlock("HALFWIDTH_AND_FULLWIDTH_FORMS",
-                             new String[] {"Halfwidth and Fullwidth Forms",
-                                           "HalfwidthandFullwidthForms"});
+                             "HALFWIDTH AND FULLWIDTH FORMS",
+                             "HALFWIDTHANDFULLWIDTHFORMS");
 
         /**
          * Constant for the "Specials" Unicode character block.
@@ -1250,97 +1284,108 @@
          */
         public static final UnicodeBlock UNIFIED_CANADIAN_ABORIGINAL_SYLLABICS =
             new UnicodeBlock("UNIFIED_CANADIAN_ABORIGINAL_SYLLABICS",
-                             new String[] {"Unified Canadian Aboriginal Syllabics",
-                                           "UnifiedCanadianAboriginalSyllabics"});
+                             "UNIFIED CANADIAN ABORIGINAL SYLLABICS",
+                             "UNIFIEDCANADIANABORIGINALSYLLABICS");
 
         /**
          * Constant for the "Ogham" Unicode character block.
          * @since 1.4
          */
         public static final UnicodeBlock OGHAM =
-                             new UnicodeBlock("OGHAM");
+            new UnicodeBlock("OGHAM");
 
         /**
          * Constant for the "Runic" Unicode character block.
          * @since 1.4
          */
         public static final UnicodeBlock RUNIC =
-                             new UnicodeBlock("RUNIC");
+            new UnicodeBlock("RUNIC");
 
         /**
          * Constant for the "Khmer" Unicode character block.
          * @since 1.4
          */
         public static final UnicodeBlock KHMER =
-                             new UnicodeBlock("KHMER");
+            new UnicodeBlock("KHMER");
 
         /**
          * Constant for the "Mongolian" Unicode character block.
          * @since 1.4
          */
         public static final UnicodeBlock MONGOLIAN =
-                             new UnicodeBlock("MONGOLIAN");
+            new UnicodeBlock("MONGOLIAN");
 
         /**
          * Constant for the "Braille Patterns" Unicode character block.
          * @since 1.4
          */
         public static final UnicodeBlock BRAILLE_PATTERNS =
-            new UnicodeBlock("BRAILLE_PATTERNS", new String[] {"Braille Patterns",
-                                                               "BraillePatterns"});
+            new UnicodeBlock("BRAILLE_PATTERNS",
+                             "BRAILLE PATTERNS",
+                             "BRAILLEPATTERNS");
 
         /**
          * Constant for the "CJK Radicals Supplement" Unicode character block.
          * @since 1.4
          */
         public static final UnicodeBlock CJK_RADICALS_SUPPLEMENT =
-             new UnicodeBlock("CJK_RADICALS_SUPPLEMENT", new String[] {"CJK Radicals Supplement",
-                                                                       "CJKRadicalsSupplement"});
+            new UnicodeBlock("CJK_RADICALS_SUPPLEMENT",
+                             "CJK RADICALS SUPPLEMENT",
+                             "CJKRADICALSSUPPLEMENT");
 
         /**
          * Constant for the "Kangxi Radicals" Unicode character block.
          * @since 1.4
          */
         public static final UnicodeBlock KANGXI_RADICALS =
-            new UnicodeBlock("KANGXI_RADICALS", new String[] {"Kangxi Radicals", "KangxiRadicals"});
+            new UnicodeBlock("KANGXI_RADICALS",
+                             "KANGXI RADICALS",
+                             "KANGXIRADICALS");
 
         /**
          * Constant for the "Ideographic Description Characters" Unicode character block.
          * @since 1.4
          */
         public static final UnicodeBlock IDEOGRAPHIC_DESCRIPTION_CHARACTERS =
-            new UnicodeBlock("IDEOGRAPHIC_DESCRIPTION_CHARACTERS", new String[] {"Ideographic Description Characters",
-                                                                                 "IdeographicDescriptionCharacters"});
+            new UnicodeBlock("IDEOGRAPHIC_DESCRIPTION_CHARACTERS",
+                             "IDEOGRAPHIC DESCRIPTION CHARACTERS",
+                             "IDEOGRAPHICDESCRIPTIONCHARACTERS");
 
         /**
          * Constant for the "Bopomofo Extended" Unicode character block.
          * @since 1.4
          */
         public static final UnicodeBlock BOPOMOFO_EXTENDED =
-            new UnicodeBlock("BOPOMOFO_EXTENDED", new String[] {"Bopomofo Extended",
-                                                                "BopomofoExtended"});
+            new UnicodeBlock("BOPOMOFO_EXTENDED",
+                             "BOPOMOFO EXTENDED",
+                             "BOPOMOFOEXTENDED");
 
         /**
          * Constant for the "CJK Unified Ideographs Extension A" Unicode character block.
          * @since 1.4
          */
         public static final UnicodeBlock CJK_UNIFIED_IDEOGRAPHS_EXTENSION_A =
-            new UnicodeBlock("CJK_UNIFIED_IDEOGRAPHS_EXTENSION_A", new String[] {"CJK Unified Ideographs Extension A",
-                                                                                 "CJKUnifiedIdeographsExtensionA"});
+            new UnicodeBlock("CJK_UNIFIED_IDEOGRAPHS_EXTENSION_A",
+                             "CJK UNIFIED IDEOGRAPHS EXTENSION A",
+                             "CJKUNIFIEDIDEOGRAPHSEXTENSIONA");
 
         /**
          * Constant for the "Yi Syllables" Unicode character block.
          * @since 1.4
          */
         public static final UnicodeBlock YI_SYLLABLES =
-            new UnicodeBlock("YI_SYLLABLES", new String[] {"Yi Syllables", "YiSyllables"});
+            new UnicodeBlock("YI_SYLLABLES",
+                             "YI SYLLABLES",
+                             "YISYLLABLES");
 
         /**
          * Constant for the "Yi Radicals" Unicode character block.
          * @since 1.4
          */
         public static final UnicodeBlock YI_RADICALS =
-            new UnicodeBlock("YI_RADICALS", new String[] {"Yi Radicals", "YiRadicals"});
+            new UnicodeBlock("YI_RADICALS",
+                             "YI RADICALS",
+                             "YIRADICALS");
 
 
         /**
@@ -1349,10 +1394,10 @@
          */
         public static final UnicodeBlock CYRILLIC_SUPPLEMENTARY =
             new UnicodeBlock("CYRILLIC_SUPPLEMENTARY",
-                             new String[] {"Cyrillic Supplementary",
-                                           "CyrillicSupplementary",
-                                           "Cyrillic Supplement",
-                                           "CyrillicSupplement"});
+                             "CYRILLIC SUPPLEMENTARY",
+                             "CYRILLICSUPPLEMENTARY",
+                             "CYRILLIC SUPPLEMENT",
+                             "CYRILLICSUPPLEMENT");
 
         /**
          * Constant for the "Tagalog" Unicode character block.
@@ -1394,21 +1439,27 @@
          * @since 1.5
          */
         public static final UnicodeBlock TAI_LE =
-            new UnicodeBlock("TAI_LE", new String[] {"Tai Le", "TaiLe"});
+            new UnicodeBlock("TAI_LE",
+                             "TAI LE",
+                             "TAILE");
 
         /**
          * Constant for the "Khmer Symbols" Unicode character block.
          * @since 1.5
          */
         public static final UnicodeBlock KHMER_SYMBOLS =
-            new UnicodeBlock("KHMER_SYMBOLS", new String[] {"Khmer Symbols", "KhmerSymbols"});
+            new UnicodeBlock("KHMER_SYMBOLS",
+                             "KHMER SYMBOLS",
+                             "KHMERSYMBOLS");
 
         /**
          * Constant for the "Phonetic Extensions" Unicode character block.
          * @since 1.5
          */
         public static final UnicodeBlock PHONETIC_EXTENSIONS =
-            new UnicodeBlock("PHONETIC_EXTENSIONS", new String[] {"Phonetic Extensions", "PhoneticExtensions"});
+            new UnicodeBlock("PHONETIC_EXTENSIONS",
+                             "PHONETIC EXTENSIONS",
+                             "PHONETICEXTENSIONS");
 
         /**
          * Constant for the "Miscellaneous Mathematical Symbols-A" Unicode character block.
@@ -1416,33 +1467,35 @@
          */
         public static final UnicodeBlock MISCELLANEOUS_MATHEMATICAL_SYMBOLS_A =
             new UnicodeBlock("MISCELLANEOUS_MATHEMATICAL_SYMBOLS_A",
-                             new String[]{"Miscellaneous Mathematical Symbols-A",
-                                          "MiscellaneousMathematicalSymbols-A"});
+                             "MISCELLANEOUS MATHEMATICAL SYMBOLS-A",
+                             "MISCELLANEOUSMATHEMATICALSYMBOLS-A");
 
         /**
          * Constant for the "Supplemental Arrows-A" Unicode character block.
          * @since 1.5
          */
         public static final UnicodeBlock SUPPLEMENTAL_ARROWS_A =
-            new UnicodeBlock("SUPPLEMENTAL_ARROWS_A", new String[] {"Supplemental Arrows-A",
-                                                                    "SupplementalArrows-A"});
+            new UnicodeBlock("SUPPLEMENTAL_ARROWS_A",
+                             "SUPPLEMENTAL ARROWS-A",
+                             "SUPPLEMENTALARROWS-A");
 
         /**
          * Constant for the "Supplemental Arrows-B" Unicode character block.
          * @since 1.5
          */
         public static final UnicodeBlock SUPPLEMENTAL_ARROWS_B =
-            new UnicodeBlock("SUPPLEMENTAL_ARROWS_B", new String[] {"Supplemental Arrows-B",
-                                                                    "SupplementalArrows-B"});
+            new UnicodeBlock("SUPPLEMENTAL_ARROWS_B",
+                             "SUPPLEMENTAL ARROWS-B",
+                             "SUPPLEMENTALARROWS-B");
 
         /**
          * Constant for the "Miscellaneous Mathematical Symbols-B" Unicode character block.
          * @since 1.5
          */
-        public static final UnicodeBlock MISCELLANEOUS_MATHEMATICAL_SYMBOLS_B
-                = new UnicodeBlock("MISCELLANEOUS_MATHEMATICAL_SYMBOLS_B",
-                                   new String[] {"Miscellaneous Mathematical Symbols-B",
-                                                 "MiscellaneousMathematicalSymbols-B"});
+        public static final UnicodeBlock MISCELLANEOUS_MATHEMATICAL_SYMBOLS_B =
+            new UnicodeBlock("MISCELLANEOUS_MATHEMATICAL_SYMBOLS_B",
+                             "MISCELLANEOUS MATHEMATICAL SYMBOLS-B",
+                             "MISCELLANEOUSMATHEMATICALSYMBOLS-B");
 
         /**
          * Constant for the "Supplemental Mathematical Operators" Unicode character block.
@@ -1450,127 +1503,151 @@
          */
         public static final UnicodeBlock SUPPLEMENTAL_MATHEMATICAL_OPERATORS =
             new UnicodeBlock("SUPPLEMENTAL_MATHEMATICAL_OPERATORS",
-                             new String[]{"Supplemental Mathematical Operators",
-                                          "SupplementalMathematicalOperators"} );
+                             "SUPPLEMENTAL MATHEMATICAL OPERATORS",
+                             "SUPPLEMENTALMATHEMATICALOPERATORS");
 
         /**
          * Constant for the "Miscellaneous Symbols and Arrows" Unicode character block.
          * @since 1.5
          */
         public static final UnicodeBlock MISCELLANEOUS_SYMBOLS_AND_ARROWS =
-            new UnicodeBlock("MISCELLANEOUS_SYMBOLS_AND_ARROWS", new String[] {"Miscellaneous Symbols and Arrows",
-                                                                               "MiscellaneousSymbolsandArrows"});
+            new UnicodeBlock("MISCELLANEOUS_SYMBOLS_AND_ARROWS",
+                             "MISCELLANEOUS SYMBOLS AND ARROWS",
+                             "MISCELLANEOUSSYMBOLSANDARROWS");
 
         /**
          * Constant for the "Katakana Phonetic Extensions" Unicode character block.
          * @since 1.5
          */
         public static final UnicodeBlock KATAKANA_PHONETIC_EXTENSIONS =
-            new UnicodeBlock("KATAKANA_PHONETIC_EXTENSIONS", new String[] {"Katakana Phonetic Extensions",
-                                                                           "KatakanaPhoneticExtensions"});
+            new UnicodeBlock("KATAKANA_PHONETIC_EXTENSIONS",
+                             "KATAKANA PHONETIC EXTENSIONS",
+                             "KATAKANAPHONETICEXTENSIONS");
 
         /**
          * Constant for the "Yijing Hexagram Symbols" Unicode character block.
          * @since 1.5
          */
         public static final UnicodeBlock YIJING_HEXAGRAM_SYMBOLS =
-            new UnicodeBlock("YIJING_HEXAGRAM_SYMBOLS", new String[] {"Yijing Hexagram Symbols",
-                                                                      "YijingHexagramSymbols"});
+            new UnicodeBlock("YIJING_HEXAGRAM_SYMBOLS",
+                             "YIJING HEXAGRAM SYMBOLS",
+                             "YIJINGHEXAGRAMSYMBOLS");
 
         /**
          * Constant for the "Variation Selectors" Unicode character block.
          * @since 1.5
          */
         public static final UnicodeBlock VARIATION_SELECTORS =
-            new UnicodeBlock("VARIATION_SELECTORS", new String[] {"Variation Selectors", "VariationSelectors"});
+            new UnicodeBlock("VARIATION_SELECTORS",
+                             "VARIATION SELECTORS",
+                             "VARIATIONSELECTORS");
 
         /**
          * Constant for the "Linear B Syllabary" Unicode character block.
          * @since 1.5
          */
         public static final UnicodeBlock LINEAR_B_SYLLABARY =
-            new UnicodeBlock("LINEAR_B_SYLLABARY", new String[] {"Linear B Syllabary", "LinearBSyllabary"});
+            new UnicodeBlock("LINEAR_B_SYLLABARY",
+                             "LINEAR B SYLLABARY",
+                             "LINEARBSYLLABARY");
 
         /**
          * Constant for the "Linear B Ideograms" Unicode character block.
          * @since 1.5
          */
         public static final UnicodeBlock LINEAR_B_IDEOGRAMS =
-            new UnicodeBlock("LINEAR_B_IDEOGRAMS", new String[] {"Linear B Ideograms", "LinearBIdeograms"});
+            new UnicodeBlock("LINEAR_B_IDEOGRAMS",
+                             "LINEAR B IDEOGRAMS",
+                             "LINEARBIDEOGRAMS");
 
         /**
          * Constant for the "Aegean Numbers" Unicode character block.
          * @since 1.5
          */
         public static final UnicodeBlock AEGEAN_NUMBERS =
-            new UnicodeBlock("AEGEAN_NUMBERS", new String[] {"Aegean Numbers", "AegeanNumbers"});
+            new UnicodeBlock("AEGEAN_NUMBERS",
+                             "AEGEAN NUMBERS",
+                             "AEGEANNUMBERS");
 
         /**
          * Constant for the "Old Italic" Unicode character block.
          * @since 1.5
          */
         public static final UnicodeBlock OLD_ITALIC =
-            new UnicodeBlock("OLD_ITALIC", new String[] {"Old Italic", "OldItalic"});
+            new UnicodeBlock("OLD_ITALIC",
+                             "OLD ITALIC",
+                             "OLDITALIC");
 
         /**
          * Constant for the "Gothic" Unicode character block.
          * @since 1.5
          */
-        public static final UnicodeBlock GOTHIC = new UnicodeBlock("GOTHIC");
+        public static final UnicodeBlock GOTHIC =
+            new UnicodeBlock("GOTHIC");
 
         /**
          * Constant for the "Ugaritic" Unicode character block.
          * @since 1.5
          */
-        public static final UnicodeBlock UGARITIC = new UnicodeBlock("UGARITIC");
+        public static final UnicodeBlock UGARITIC =
+            new UnicodeBlock("UGARITIC");
 
         /**
          * Constant for the "Deseret" Unicode character block.
          * @since 1.5
          */
-        public static final UnicodeBlock DESERET = new UnicodeBlock("DESERET");
+        public static final UnicodeBlock DESERET =
+            new UnicodeBlock("DESERET");
 
         /**
          * Constant for the "Shavian" Unicode character block.
          * @since 1.5
          */
-        public static final UnicodeBlock SHAVIAN = new UnicodeBlock("SHAVIAN");
+        public static final UnicodeBlock SHAVIAN =
+            new UnicodeBlock("SHAVIAN");
 
         /**
          * Constant for the "Osmanya" Unicode character block.
          * @since 1.5
          */
-        public static final UnicodeBlock OSMANYA = new UnicodeBlock("OSMANYA");
+        public static final UnicodeBlock OSMANYA =
+            new UnicodeBlock("OSMANYA");
 
         /**
          * Constant for the "Cypriot Syllabary" Unicode character block.
          * @since 1.5
          */
         public static final UnicodeBlock CYPRIOT_SYLLABARY =
-            new UnicodeBlock("CYPRIOT_SYLLABARY", new String[] {"Cypriot Syllabary", "CypriotSyllabary"});
+            new UnicodeBlock("CYPRIOT_SYLLABARY",
+                             "CYPRIOT SYLLABARY",
+                             "CYPRIOTSYLLABARY");
 
         /**
          * Constant for the "Byzantine Musical Symbols" Unicode character block.
          * @since 1.5
          */
         public static final UnicodeBlock BYZANTINE_MUSICAL_SYMBOLS =
-            new UnicodeBlock("BYZANTINE_MUSICAL_SYMBOLS", new String[] {"Byzantine Musical Symbols",
-                                                                        "ByzantineMusicalSymbols"});
+            new UnicodeBlock("BYZANTINE_MUSICAL_SYMBOLS",
+                             "BYZANTINE MUSICAL SYMBOLS",
+                             "BYZANTINEMUSICALSYMBOLS");
 
         /**
          * Constant for the "Musical Symbols" Unicode character block.
          * @since 1.5
          */
         public static final UnicodeBlock MUSICAL_SYMBOLS =
-            new UnicodeBlock("MUSICAL_SYMBOLS", new String[] {"Musical Symbols", "MusicalSymbols"});
+            new UnicodeBlock("MUSICAL_SYMBOLS",
+                             "MUSICAL SYMBOLS",
+                             "MUSICALSYMBOLS");
 
         /**
          * Constant for the "Tai Xuan Jing Symbols" Unicode character block.
          * @since 1.5
          */
         public static final UnicodeBlock TAI_XUAN_JING_SYMBOLS =
-            new UnicodeBlock("TAI_XUAN_JING_SYMBOLS", new String[] {"Tai Xuan Jing Symbols",
-                                                                     "TaiXuanJingSymbols"});
+            new UnicodeBlock("TAI_XUAN_JING_SYMBOLS",
+                             "TAI XUAN JING SYMBOLS",
+                             "TAIXUANJINGSYMBOLS");
 
         /**
          * Constant for the "Mathematical Alphanumeric Symbols" Unicode character block.
@@ -1578,7 +1655,8 @@
          */
         public static final UnicodeBlock MATHEMATICAL_ALPHANUMERIC_SYMBOLS =
             new UnicodeBlock("MATHEMATICAL_ALPHANUMERIC_SYMBOLS",
-                             new String[] {"Mathematical Alphanumeric Symbols", "MathematicalAlphanumericSymbols"});
+                             "MATHEMATICAL ALPHANUMERIC SYMBOLS",
+                             "MATHEMATICALALPHANUMERICSYMBOLS");
 
         /**
          * Constant for the "CJK Unified Ideographs Extension B" Unicode character block.
@@ -1586,7 +1664,8 @@
          */
         public static final UnicodeBlock CJK_UNIFIED_IDEOGRAPHS_EXTENSION_B =
             new UnicodeBlock("CJK_UNIFIED_IDEOGRAPHS_EXTENSION_B",
-                             new String[] {"CJK Unified Ideographs Extension B", "CJKUnifiedIdeographsExtensionB"});
+                             "CJK UNIFIED IDEOGRAPHS EXTENSION B",
+                             "CJKUNIFIEDIDEOGRAPHSEXTENSIONB");
 
         /**
          * Constant for the "CJK Compatibility Ideographs Supplement" Unicode character block.
@@ -1594,22 +1673,24 @@
          */
         public static final UnicodeBlock CJK_COMPATIBILITY_IDEOGRAPHS_SUPPLEMENT =
             new UnicodeBlock("CJK_COMPATIBILITY_IDEOGRAPHS_SUPPLEMENT",
-                             new String[]{"CJK Compatibility Ideographs Supplement",
-                                          "CJKCompatibilityIdeographsSupplement"});
+                             "CJK COMPATIBILITY IDEOGRAPHS SUPPLEMENT",
+                             "CJKCOMPATIBILITYIDEOGRAPHSSUPPLEMENT");
 
         /**
          * Constant for the "Tags" Unicode character block.
          * @since 1.5
          */
-        public static final UnicodeBlock TAGS = new UnicodeBlock("TAGS");
+        public static final UnicodeBlock TAGS =
+            new UnicodeBlock("TAGS");
 
         /**
          * Constant for the "Variation Selectors Supplement" Unicode character block.
          * @since 1.5
          */
         public static final UnicodeBlock VARIATION_SELECTORS_SUPPLEMENT =
-            new UnicodeBlock("VARIATION_SELECTORS_SUPPLEMENT", new String[] {"Variation Selectors Supplement",
-                                                                             "VariationSelectorsSupplement"});
+            new UnicodeBlock("VARIATION_SELECTORS_SUPPLEMENT",
+                             "VARIATION SELECTORS SUPPLEMENT",
+                             "VARIATIONSELECTORSSUPPLEMENT");
 
         /**
          * Constant for the "Supplementary Private Use Area-A" Unicode character block.
@@ -1617,8 +1698,8 @@
          */
         public static final UnicodeBlock SUPPLEMENTARY_PRIVATE_USE_AREA_A =
             new UnicodeBlock("SUPPLEMENTARY_PRIVATE_USE_AREA_A",
-                             new String[] {"Supplementary Private Use Area-A",
-                                           "SupplementaryPrivateUseArea-A"});
+                             "SUPPLEMENTARY PRIVATE USE AREA-A",
+                             "SUPPLEMENTARYPRIVATEUSEAREA-A");
 
         /**
          * Constant for the "Supplementary Private Use Area-B" Unicode character block.
@@ -1626,39 +1707,44 @@
          */
         public static final UnicodeBlock SUPPLEMENTARY_PRIVATE_USE_AREA_B =
             new UnicodeBlock("SUPPLEMENTARY_PRIVATE_USE_AREA_B",
-                             new String[] {"Supplementary Private Use Area-B",
-                                           "SupplementaryPrivateUseArea-B"});
+                             "SUPPLEMENTARY PRIVATE USE AREA-B",
+                             "SUPPLEMENTARYPRIVATEUSEAREA-B");
 
         /**
          * Constant for the "High Surrogates" Unicode character block.
          * This block represents codepoint values in the high surrogate
-         * range: 0xD800 through 0xDB7F
+         * range: U+D800 through U+DB7F
          *
          * @since 1.5
          */
         public static final UnicodeBlock HIGH_SURROGATES =
-            new UnicodeBlock("HIGH_SURROGATES", new String[] {"High Surrogates", "HighSurrogates"});
+            new UnicodeBlock("HIGH_SURROGATES",
+                             "HIGH SURROGATES",
+                             "HIGHSURROGATES");
 
         /**
          * Constant for the "High Private Use Surrogates" Unicode character block.
-         * This block represents codepoint values in the high surrogate
-         * range: 0xDB80 through 0xDBFF
+         * This block represents codepoint values in the private use high surrogate
+         * range: U+DB80 through U+DBFF
          *
          * @since 1.5
          */
         public static final UnicodeBlock HIGH_PRIVATE_USE_SURROGATES =
-            new UnicodeBlock("HIGH_PRIVATE_USE_SURROGATES", new String[] { "High Private Use Surrogates",
-                                                                           "HighPrivateUseSurrogates"});
+            new UnicodeBlock("HIGH_PRIVATE_USE_SURROGATES",
+                             "HIGH PRIVATE USE SURROGATES",
+                             "HIGHPRIVATEUSESURROGATES");
 
         /**
          * Constant for the "Low Surrogates" Unicode character block.
-         * This block represents codepoint values in the high surrogate
-         * range: 0xDC00 through 0xDFFF
+         * This block represents codepoint values in the low surrogate
+         * range: U+DC00 through U+DFFF
          *
          * @since 1.5
          */
         public static final UnicodeBlock LOW_SURROGATES =
-            new UnicodeBlock("LOW_SURROGATES", new String[] {"Low Surrogates", "LowSurrogates"});
+            new UnicodeBlock("LOW_SURROGATES",
+                             "LOW SURROGATES",
+                             "LOWSURROGATES");
 
         /**
          * Constant for the "Arabic Supplement" Unicode character block.
@@ -1666,14 +1752,15 @@
          */
         public static final UnicodeBlock ARABIC_SUPPLEMENT =
             new UnicodeBlock("ARABIC_SUPPLEMENT",
-                             new String[] { "Arabic Supplement",
-                                            "ArabicSupplement"});
+                             "ARABIC SUPPLEMENT",
+                             "ARABICSUPPLEMENT");
 
         /**
          * Constant for the "NKo" Unicode character block.
          * @since 1.7
          */
-        public static final UnicodeBlock NKO = new UnicodeBlock("NKO");
+        public static final UnicodeBlock NKO =
+            new UnicodeBlock("NKO");
 
         /**
          * Constant for the "Ethiopic Supplement" Unicode character block.
@@ -1681,8 +1768,8 @@
          */
         public static final UnicodeBlock ETHIOPIC_SUPPLEMENT =
             new UnicodeBlock("ETHIOPIC_SUPPLEMENT",
-                             new String[] { "Ethiopic Supplement",
-                                            "EthiopicSupplement"});
+                             "ETHIOPIC SUPPLEMENT",
+                             "ETHIOPICSUPPLEMENT");
 
         /**
          * Constant for the "New Tai Lue" Unicode character block.
@@ -1690,8 +1777,8 @@
          */
         public static final UnicodeBlock NEW_TAI_LUE =
             new UnicodeBlock("NEW_TAI_LUE",
-                             new String[] { "New Tai Lue",
-                                            "NewTaiLue"});
+                             "NEW TAI LUE",
+                             "NEWTAILUE");
 
         /**
          * Constant for the "Buginese" Unicode character block.
@@ -1718,7 +1805,8 @@
          * Constant for the "Lepcha" Unicode character block.
          * @since 1.7
          */
-        public static final UnicodeBlock LEPCHA = new UnicodeBlock("LEPCHA");
+        public static final UnicodeBlock LEPCHA =
+            new UnicodeBlock("LEPCHA");
 
         /**
          * Constant for the "Ol Chiki" Unicode character block.
@@ -1726,8 +1814,8 @@
          */
         public static final UnicodeBlock OL_CHIKI =
             new UnicodeBlock("OL_CHIKI",
-                             new String[] { "Ol Chiki",
-                                            "OlChiki"});
+                             "OL CHIKI",
+                             "OLCHIKI");
 
         /**
          * Constant for the "Phonetic Extensions Supplement" Unicode character
@@ -1736,8 +1824,8 @@
          */
         public static final UnicodeBlock PHONETIC_EXTENSIONS_SUPPLEMENT =
             new UnicodeBlock("PHONETIC_EXTENSIONS_SUPPLEMENT",
-                             new String[] { "Phonetic Extensions Supplement",
-                                            "PhoneticExtensionsSupplement"});
+                             "PHONETIC EXTENSIONS SUPPLEMENT",
+                             "PHONETICEXTENSIONSSUPPLEMENT");
 
         /**
          * Constant for the "Combining Diacritical Marks Supplement" Unicode
@@ -1746,8 +1834,8 @@
          */
         public static final UnicodeBlock COMBINING_DIACRITICAL_MARKS_SUPPLEMENT =
             new UnicodeBlock("COMBINING_DIACRITICAL_MARKS_SUPPLEMENT",
-                             new String[] { "Combining Diacritical Marks Supplement",
-                                            "CombiningDiacriticalMarksSupplement"});
+                             "COMBINING DIACRITICAL MARKS SUPPLEMENT",
+                             "COMBININGDIACRITICALMARKSSUPPLEMENT");
 
         /**
          * Constant for the "Glagolitic" Unicode character block.
@@ -1762,14 +1850,15 @@
          */
         public static final UnicodeBlock LATIN_EXTENDED_C =
             new UnicodeBlock("LATIN_EXTENDED_C",
-                             new String[] { "Latin Extended-C",
-                                            "LatinExtended-C"});
+                             "LATIN EXTENDED-C",
+                             "LATINEXTENDED-C");
 
         /**
          * Constant for the "Coptic" Unicode character block.
          * @since 1.7
          */
-        public static final UnicodeBlock COPTIC = new UnicodeBlock("COPTIC");
+        public static final UnicodeBlock COPTIC =
+            new UnicodeBlock("COPTIC");
 
         /**
          * Constant for the "Georgian Supplement" Unicode character block.
@@ -1777,8 +1866,8 @@
          */
         public static final UnicodeBlock GEORGIAN_SUPPLEMENT =
             new UnicodeBlock("GEORGIAN_SUPPLEMENT",
-                             new String[] { "Georgian Supplement",
-                                            "GeorgianSupplement"});
+                             "GEORGIAN SUPPLEMENT",
+                             "GEORGIANSUPPLEMENT");
 
         /**
          * Constant for the "Tifinagh" Unicode character block.
@@ -1793,8 +1882,8 @@
          */
         public static final UnicodeBlock ETHIOPIC_EXTENDED =
             new UnicodeBlock("ETHIOPIC_EXTENDED",
-                             new String[] { "Ethiopic Extended",
-                                            "EthiopicExtended"});
+                             "ETHIOPIC EXTENDED",
+                             "ETHIOPICEXTENDED");
 
         /**
          * Constant for the "Cyrillic Extended-A" Unicode character block.
@@ -1802,8 +1891,8 @@
          */
         public static final UnicodeBlock CYRILLIC_EXTENDED_A =
             new UnicodeBlock("CYRILLIC_EXTENDED_A",
-                             new String[] { "Cyrillic Extended-A",
-                                            "CyrillicExtended-A"});
+                             "CYRILLIC EXTENDED-A",
+                             "CYRILLICEXTENDED-A");
 
         /**
          * Constant for the "Supplemental Punctuation" Unicode character block.
@@ -1811,8 +1900,8 @@
          */
         public static final UnicodeBlock SUPPLEMENTAL_PUNCTUATION =
             new UnicodeBlock("SUPPLEMENTAL_PUNCTUATION",
-                             new String[] { "Supplemental Punctuation",
-                                            "SupplementalPunctuation"});
+                             "SUPPLEMENTAL PUNCTUATION",
+                             "SUPPLEMENTALPUNCTUATION");
 
         /**
          * Constant for the "CJK Strokes" Unicode character block.
@@ -1820,14 +1909,15 @@
          */
         public static final UnicodeBlock CJK_STROKES =
             new UnicodeBlock("CJK_STROKES",
-                             new String[] { "CJK Strokes",
-                                            "CJKStrokes"});
+                             "CJK STROKES",
+                             "CJKSTROKES");
 
         /**
          * Constant for the "Vai" Unicode character block.
          * @since 1.7
          */
-        public static final UnicodeBlock VAI = new UnicodeBlock("VAI");
+        public static final UnicodeBlock VAI =
+            new UnicodeBlock("VAI");
 
         /**
          * Constant for the "Cyrillic Extended-B" Unicode character block.
@@ -1835,8 +1925,8 @@
          */
         public static final UnicodeBlock CYRILLIC_EXTENDED_B =
             new UnicodeBlock("CYRILLIC_EXTENDED_B",
-                             new String[] { "Cyrillic Extended-B",
-                                            "CyrillicExtended-B"});
+                             "CYRILLIC EXTENDED-B",
+                             "CYRILLICEXTENDED-B");
 
         /**
          * Constant for the "Modifier Tone Letters" Unicode character block.
@@ -1844,8 +1934,8 @@
          */
         public static final UnicodeBlock MODIFIER_TONE_LETTERS =
             new UnicodeBlock("MODIFIER_TONE_LETTERS",
-                             new String[] { "Modifier Tone Letters",
-                                            "ModifierToneLetters"});
+                             "MODIFIER TONE LETTERS",
+                             "MODIFIERTONELETTERS");
 
         /**
          * Constant for the "Latin Extended-D" Unicode character block.
@@ -1853,8 +1943,8 @@
          */
         public static final UnicodeBlock LATIN_EXTENDED_D =
             new UnicodeBlock("LATIN_EXTENDED_D",
-                             new String[] { "Latin Extended-D",
-                                            "LatinExtended-D"});
+                             "LATIN EXTENDED-D",
+                             "LATINEXTENDED-D");
 
         /**
          * Constant for the "Syloti Nagri" Unicode character block.
@@ -1862,15 +1952,16 @@
          */
         public static final UnicodeBlock SYLOTI_NAGRI =
             new UnicodeBlock("SYLOTI_NAGRI",
-                             new String[] { "Syloti Nagri",
-                                            "SylotiNagri"});
+                             "SYLOTI NAGRI",
+                             "SYLOTINAGRI");
 
         /**
          * Constant for the "Phags-pa" Unicode character block.
          * @since 1.7
          */
         public static final UnicodeBlock PHAGS_PA =
-            new UnicodeBlock("PHAGS_PA", new String[] { "Phags-pa"});
+            new UnicodeBlock("PHAGS_PA",
+                             "PHAGS-PA");
 
         /**
          * Constant for the "Saurashtra" Unicode character block.
@@ -1885,20 +1976,22 @@
          */
         public static final UnicodeBlock KAYAH_LI =
             new UnicodeBlock("KAYAH_LI",
-                             new String[] { "Kayah Li",
-                                            "KayahLi"});
+                             "KAYAH LI",
+                             "KAYAHLI");
 
         /**
          * Constant for the "Rejang" Unicode character block.
          * @since 1.7
          */
-        public static final UnicodeBlock REJANG = new UnicodeBlock("REJANG");
+        public static final UnicodeBlock REJANG =
+            new UnicodeBlock("REJANG");
 
         /**
          * Constant for the "Cham" Unicode character block.
          * @since 1.7
          */
-        public static final UnicodeBlock CHAM = new UnicodeBlock("CHAM");
+        public static final UnicodeBlock CHAM =
+            new UnicodeBlock("CHAM");
 
         /**
          * Constant for the "Vertical Forms" Unicode character block.
@@ -1906,8 +1999,8 @@
          */
         public static final UnicodeBlock VERTICAL_FORMS =
             new UnicodeBlock("VERTICAL_FORMS",
-                             new String[] { "Vertical Forms",
-                                            "VerticalForms"});
+                             "VERTICAL FORMS",
+                             "VERTICALFORMS");
 
         /**
          * Constant for the "Ancient Greek Numbers" Unicode character block.
@@ -1915,8 +2008,8 @@
          */
         public static final UnicodeBlock ANCIENT_GREEK_NUMBERS =
             new UnicodeBlock("ANCIENT_GREEK_NUMBERS",
-                             new String[] { "Ancient Greek Numbers",
-                                            "AncientGreekNumbers"});
+                             "ANCIENT GREEK NUMBERS",
+                             "ANCIENTGREEKNUMBERS");
 
         /**
          * Constant for the "Ancient Symbols" Unicode character block.
@@ -1924,8 +2017,8 @@
          */
         public static final UnicodeBlock ANCIENT_SYMBOLS =
             new UnicodeBlock("ANCIENT_SYMBOLS",
-                             new String[] { "Ancient Symbols",
-                                            "AncientSymbols"});
+                             "ANCIENT SYMBOLS",
+                             "ANCIENTSYMBOLS");
 
         /**
          * Constant for the "Phaistos Disc" Unicode character block.
@@ -1933,20 +2026,22 @@
          */
         public static final UnicodeBlock PHAISTOS_DISC =
             new UnicodeBlock("PHAISTOS_DISC",
-                             new String[] { "Phaistos Disc",
-                                            "PhaistosDisc"});
+                             "PHAISTOS DISC",
+                             "PHAISTOSDISC");
 
         /**
          * Constant for the "Lycian" Unicode character block.
          * @since 1.7
          */
-        public static final UnicodeBlock LYCIAN = new UnicodeBlock("LYCIAN");
+        public static final UnicodeBlock LYCIAN =
+            new UnicodeBlock("LYCIAN");
 
         /**
          * Constant for the "Carian" Unicode character block.
          * @since 1.7
          */
-        public static final UnicodeBlock CARIAN = new UnicodeBlock("CARIAN");
+        public static final UnicodeBlock CARIAN =
+            new UnicodeBlock("CARIAN");
 
         /**
          * Constant for the "Old Persian" Unicode character block.
@@ -1954,8 +2049,8 @@
          */
         public static final UnicodeBlock OLD_PERSIAN =
             new UnicodeBlock("OLD_PERSIAN",
-                             new String[] { "Old Persian",
-                                            "OldPersian"});
+                             "OLD PERSIAN",
+                             "OLDPERSIAN");
 
         /**
          * Constant for the "Phoenician" Unicode character block.
@@ -1968,7 +2063,8 @@
          * Constant for the "Lydian" Unicode character block.
          * @since 1.7
          */
-        public static final UnicodeBlock LYDIAN = new UnicodeBlock("LYDIAN");
+        public static final UnicodeBlock LYDIAN =
+            new UnicodeBlock("LYDIAN");
 
         /**
          * Constant for the "Kharoshthi" Unicode character block.
@@ -1991,8 +2087,8 @@
          */
         public static final UnicodeBlock CUNEIFORM_NUMBERS_AND_PUNCTUATION =
             new UnicodeBlock("CUNEIFORM_NUMBERS_AND_PUNCTUATION",
-                             new String[] { "Cuneiform Numbers and Punctuation",
-                                            "CuneiformNumbersandPunctuation"});
+                             "CUNEIFORM NUMBERS AND PUNCTUATION",
+                             "CUNEIFORMNUMBERSANDPUNCTUATION");
 
         /**
          * Constant for the "Ancient Greek Musical Notation" Unicode character
@@ -2001,8 +2097,8 @@
          */
         public static final UnicodeBlock ANCIENT_GREEK_MUSICAL_NOTATION =
             new UnicodeBlock("ANCIENT_GREEK_MUSICAL_NOTATION",
-                             new String[] { "Ancient Greek Musical Notation",
-                                            "AncientGreekMusicalNotation"});
+                             "ANCIENT GREEK MUSICAL NOTATION",
+                             "ANCIENTGREEKMUSICALNOTATION");
 
         /**
          * Constant for the "Counting Rod Numerals" Unicode character block.
@@ -2010,8 +2106,8 @@
          */
         public static final UnicodeBlock COUNTING_ROD_NUMERALS =
             new UnicodeBlock("COUNTING_ROD_NUMERALS",
-                             new String[] { "Counting Rod Numerals",
-                                            "CountingRodNumerals"});
+                             "COUNTING ROD NUMERALS",
+                             "COUNTINGRODNUMERALS");
 
         /**
          * Constant for the "Mahjong Tiles" Unicode character block.
@@ -2019,8 +2115,8 @@
          */
         public static final UnicodeBlock MAHJONG_TILES =
             new UnicodeBlock("MAHJONG_TILES",
-                             new String[] { "Mahjong Tiles",
-                                            "MahjongTiles"});
+                             "MAHJONG TILES",
+                             "MAHJONGTILES");
 
         /**
          * Constant for the "Domino Tiles" Unicode character block.
@@ -2028,8 +2124,8 @@
          */
         public static final UnicodeBlock DOMINO_TILES =
             new UnicodeBlock("DOMINO_TILES",
-                             new String[] { "Domino Tiles",
-                                            "DominoTiles"});
+                             "DOMINO TILES",
+                             "DOMINOTILES");
 
         private static final int blockStarts[] = {
             0x0000,   // 0000..007F; Basic Latin
@@ -2045,7 +2141,7 @@
             0x0530,   // 0530..058F; Armenian
             0x0590,   // 0590..05FF; Hebrew
             0x0600,   // 0600..06FF; Arabic
-            0x0700,   // 0700..074F; Syria
+            0x0700,   // 0700..074F; Syriac
             0x0750,   // 0750..077F; Arabic Supplement
             0x0780,   // 0780..07BF; Thaana
             0x07C0,   // 07C0..07FF; NKo
@@ -2445,11 +2541,10 @@
          * given character, or <code>null</code> if the character is not a
          * member of a defined block.
          *
-                 * <p><b>Note:</b> This method cannot handle <a
-                 * href="Character.html#supplementary"> supplementary
-                 * characters</a>. To support all Unicode characters,
-                 * including supplementary characters, use the {@link
-                 * #of(int)} method.
+         * <p><b>Note:</b> This method cannot handle
+         * <a href="Character.html#supplementary"> supplementary
+         * characters</a>.  To support all Unicode characters, including
+         * supplementary characters, use the {@link #of(int)} method.
          *
          * @param   c  The character in question
          * @return  The <code>UnicodeBlock</code> instance representing the
@@ -2461,22 +2556,21 @@
             return of((int)c);
         }
 
-
         /**
          * Returns the object representing the Unicode block
          * containing the given character (Unicode code point), or
          * <code>null</code> if the character is not a member of a
          * defined block.
          *
-                 * @param   codePoint the character (Unicode code point) in question.
+         * @param   codePoint the character (Unicode code point) in question.
          * @return  The <code>UnicodeBlock</code> instance representing the
          *          Unicode block of which this character is a member, or
          *          <code>null</code> if the character is not a member of any
          *          Unicode block
-                 * @exception IllegalArgumentException if the specified
-                 * <code>codePoint</code> is an invalid Unicode code point.
-                 * @see Character#isValidCodePoint(int)
-                 * @since   1.5
+         * @exception IllegalArgumentException if the specified
+         * <code>codePoint</code> is an invalid Unicode code point.
+         * @see Character#isValidCodePoint(int)
+         * @since   1.5
          */
         public static UnicodeBlock of(int codePoint) {
             if (!isValidCodePoint(codePoint)) {
@@ -2518,7 +2612,7 @@
          * <li>The text representation of each constant UnicodeBlock identifier.
          * For example, this method will return the {@link #BASIC_LATIN} block if
          * provided with the "BASIC_LATIN" name. This form replaces all spaces and
-         *  hyphens in the canonical name with underscores.
+         * hyphens in the canonical name with underscores.
          * </ol>
          * Finally, character case is ignored for all of the valid block name forms.
          * For example, "BASIC_LATIN" and "basic_latin" are both valid block names.
@@ -2537,7 +2631,7 @@
          * @since 1.5
          */
         public static final UnicodeBlock forName(String blockName) {
-            UnicodeBlock block = (UnicodeBlock)map.get(blockName.toUpperCase(Locale.US));
+            UnicodeBlock block = map.get(blockName.toUpperCase(Locale.US));
             if (block == null) {
                 throw new IllegalArgumentException();
             }
@@ -2547,6 +2641,1241 @@
 
 
     /**
+     * A family of character subsets representing the character scripts
+     * defined in the <a href="http://www.unicode.org/reports/tr24/">
+     * <i>Unicode Standard Annex #24: Script Names</i></a>. Every Unicode
+     * character is assigned to a single Unicode script, either a specific
+     * script, such as {@link Character.UnicodeScript#LATIN Latin}, or
+     * one of the following three special values,
+     * {@link Character.UnicodeScript#INHERITED Inherited},
+     * {@link Character.UnicodeScript#COMMON Common} or
+     * {@link Character.UnicodeScript#UNKNOWN Unknown}.
+     *
+     * @since 1.7
+     */
+    public static enum UnicodeScript {
+        /**
+         * Unicode script "Common".
+         */
+        COMMON,
+
+        /**
+         * Unicode script "Latin".
+         */
+        LATIN,
+
+        /**
+         * Unicode script "Greek".
+         */
+        GREEK,
+
+        /**
+         * Unicode script "Cyrillic".
+         */
+        CYRILLIC,
+
+        /**
+         * Unicode script "Armenian".
+         */
+        ARMENIAN,
+
+        /**
+         * Unicode script "Hebrew".
+         */
+        HEBREW,
+
+        /**
+         * Unicode script "Arabic".
+         */
+        ARABIC,
+
+        /**
+         * Unicode script "Syriac".
+         */
+        SYRIAC,
+
+        /**
+         * Unicode script "Thaana".
+         */
+        THAANA,
+
+        /**
+         * Unicode script "Devanagari".
+         */
+        DEVANAGARI,
+
+        /**
+         * Unicode script "Bengali".
+         */
+        BENGALI,
+
+        /**
+         * Unicode script "Gurmukhi".
+         */
+        GURMUKHI,
+
+        /**
+         * Unicode script "Gujarati".
+         */
+        GUJARATI,
+
+        /**
+         * Unicode script "Oriya".
+         */
+        ORIYA,
+
+        /**
+         * Unicode script "Tamil".
+         */
+        TAMIL,
+
+        /**
+         * Unicode script "Telugu".
+         */
+        TELUGU,
+
+        /**
+         * Unicode script "Kannada".
+         */
+        KANNADA,
+
+        /**
+         * Unicode script "Malayalam".
+         */
+        MALAYALAM,
+
+        /**
+         * Unicode script "Sinhala".
+         */
+        SINHALA,
+
+        /**
+         * Unicode script "Thai".
+         */
+        THAI,
+
+        /**
+         * Unicode script "Lao".
+         */
+        LAO,
+
+        /**
+         * Unicode script "Tibetan".
+         */
+        TIBETAN,
+
+        /**
+         * Unicode script "Myanmar".
+         */
+        MYANMAR,
+
+        /**
+         * Unicode script "Georgian".
+         */
+        GEORGIAN,
+
+        /**
+         * Unicode script "Hangul".
+         */
+        HANGUL,
+
+        /**
+         * Unicode script "Ethiopic".
+         */
+        ETHIOPIC,
+
+        /**
+         * Unicode script "Cherokee".
+         */
+        CHEROKEE,
+
+        /**
+         * Unicode script "Canadian_Aboriginal".
+         */
+        CANADIAN_ABORIGINAL,
+
+        /**
+         * Unicode script "Ogham".
+         */
+        OGHAM,
+
+        /**
+         * Unicode script "Runic".
+         */
+        RUNIC,
+
+        /**
+         * Unicode script "Khmer".
+         */
+        KHMER,
+
+        /**
+         * Unicode script "Mongolian".
+         */
+        MONGOLIAN,
+
+        /**
+         * Unicode script "Hiragana".
+         */
+        HIRAGANA,
+
+        /**
+         * Unicode script "Katakana".
+         */
+        KATAKANA,
+
+        /**
+         * Unicode script "Bopomofo".
+         */
+        BOPOMOFO,
+
+        /**
+         * Unicode script "Han".
+         */
+        HAN,
+
+        /**
+         * Unicode script "Yi".
+         */
+        YI,
+
+        /**
+         * Unicode script "Old_Italic".
+         */
+        OLD_ITALIC,
+
+        /**
+         * Unicode script "Gothic".
+         */
+        GOTHIC,
+
+        /**
+         * Unicode script "Deseret".
+         */
+        DESERET,
+
+        /**
+         * Unicode script "Inherited".
+         */
+        INHERITED,
+
+        /**
+         * Unicode script "Tagalog".
+         */
+        TAGALOG,
+
+        /**
+         * Unicode script "Hanunoo".
+         */
+        HANUNOO,
+
+        /**
+         * Unicode script "Buhid".
+         */
+        BUHID,
+
+        /**
+         * Unicode script "Tagbanwa".
+         */
+        TAGBANWA,
+
+        /**
+         * Unicode script "Limbu".
+         */
+        LIMBU,
+
+        /**
+         * Unicode script "Tai_Le".
+         */
+        TAI_LE,
+
+        /**
+         * Unicode script "Linear_B".
+         */
+        LINEAR_B,
+
+        /**
+         * Unicode script "Ugaritic".
+         */
+        UGARITIC,
+
+        /**
+         * Unicode script "Shavian".
+         */
+        SHAVIAN,
+
+        /**
+         * Unicode script "Osmanya".
+         */
+        OSMANYA,
+
+        /**
+         * Unicode script "Cypriot".
+         */
+        CYPRIOT,
+
+        /**
+         * Unicode script "Braille".
+         */
+        BRAILLE,
+
+        /**
+         * Unicode script "Buginese".
+         */
+        BUGINESE,
+
+        /**
+         * Unicode script "Coptic".
+         */
+        COPTIC,
+
+        /**
+         * Unicode script "New_Tai_Lue".
+         */
+        NEW_TAI_LUE,
+
+        /**
+         * Unicode script "Glagolitic".
+         */
+        GLAGOLITIC,
+
+        /**
+         * Unicode script "Tifinagh".
+         */
+        TIFINAGH,
+
+        /**
+         * Unicode script "Syloti_Nagri".
+         */
+        SYLOTI_NAGRI,
+
+        /**
+         * Unicode script "Old_Persian".
+         */
+        OLD_PERSIAN,
+
+        /**
+         * Unicode script "Kharoshthi".
+         */
+        KHAROSHTHI,
+
+        /**
+         * Unicode script "Balinese".
+         */
+        BALINESE,
+
+        /**
+         * Unicode script "Cuneiform".
+         */
+        CUNEIFORM,
+
+        /**
+         * Unicode script "Phoenician".
+         */
+        PHOENICIAN,
+
+        /**
+         * Unicode script "Phags_Pa".
+         */
+        PHAGS_PA,
+
+        /**
+         * Unicode script "Nko".
+         */
+        NKO,
+
+        /**
+         * Unicode script "Sundanese".
+         */
+        SUNDANESE,
+
+        /**
+         * Unicode script "Lepcha".
+         */
+        LEPCHA,
+
+        /**
+         * Unicode script "Ol_Chiki".
+         */
+        OL_CHIKI,
+
+        /**
+         * Unicode script "Vai".
+         */
+        VAI,
+
+        /**
+         * Unicode script "Saurashtra".
+         */
+        SAURASHTRA,
+
+        /**
+         * Unicode script "Kayah_Li".
+         */
+        KAYAH_LI,
+
+        /**
+         * Unicode script "Rejang".
+         */
+        REJANG,
+
+        /**
+         * Unicode script "Lycian".
+         */
+        LYCIAN,
+
+        /**
+         * Unicode script "Carian".
+         */
+        CARIAN,
+
+        /**
+         * Unicode script "Lydian".
+         */
+        LYDIAN,
+
+        /**
+         * Unicode script "Cham".
+         */
+        CHAM,
+
+        /**
+         * Unicode script "Tai_Tham".
+         */
+        TAI_THAM,
+
+        /**
+         * Unicode script "Tai_Viet".
+         */
+        TAI_VIET,
+
+        /**
+         * Unicode script "Avestan".
+         */
+        AVESTAN,
+
+        /**
+         * Unicode script "Egyptian_Hieroglyphs".
+         */
+        EGYPTIAN_HIEROGLYPHS,
+
+        /**
+         * Unicode script "Samaritan".
+         */
+        SAMARITAN,
+
+        /**
+         * Unicode script "Lisu".
+         */
+        LISU,
+
+        /**
+         * Unicode script "Bamum".
+         */
+        BAMUM,
+
+        /**
+         * Unicode script "Javanese".
+         */
+        JAVANESE,
+
+        /**
+         * Unicode script "Meetei_Mayek".
+         */
+        MEETEI_MAYEK,
+
+        /**
+         * Unicode script "Imperial_Aramaic".
+         */
+        IMPERIAL_ARAMAIC,
+
+        /**
+         * Unicode script "Old_South_Arabian".
+         */
+        OLD_SOUTH_ARABIAN,
+
+        /**
+         * Unicode script "Inscriptional_Parthian".
+         */
+        INSCRIPTIONAL_PARTHIAN,
+
+        /**
+         * Unicode script "Inscriptional_Pahlavi".
+         */
+        INSCRIPTIONAL_PAHLAVI,
+
+        /**
+         * Unicode script "Old_Turkic".
+         */
+        OLD_TURKIC,
+
+        /**
+         * Unicode script "Kaithi".
+         */
+        KAITHI,
+
+        /**
+         * Unicode script "Unknown".
+         */
+        UNKNOWN;
+
+        private static final int[] scriptStarts = {
+            0x0000,   // 0000..0040; COMMON
+            0x0041,   // 0041..005A; LATIN
+            0x005B,   // 005B..0060; COMMON
+            0x0061,   // 0061..007A; LATIN
+            0x007B,   // 007B..00A9; COMMON
+            0x00AA,   // 00AA..00AA; LATIN
+            0x00AB,   // 00AB..00B9; COMMON
+            0x00BA,   // 00BA..00BA; LATIN
+            0x00BB,   // 00BB..00BF; COMMON
+            0x00C0,   // 00C0..00D6; LATIN
+            0x00D7,   // 00D7..00D7; COMMON
+            0x00D8,   // 00D8..00F6; LATIN
+            0x00F7,   // 00F7..00F7; COMMON
+            0x00F8,   // 00F8..02B8; LATIN
+            0x02B9,   // 02B9..02DF; COMMON
+            0x02E0,   // 02E0..02E4; LATIN
+            0x02E5,   // 02E5..02FF; COMMON
+            0x0300,   // 0300..036F; INHERITED
+            0x0370,   // 0370..0373; GREEK
+            0x0374,   // 0374..0374; COMMON
+            0x0375,   // 0375..037D; GREEK
+            0x037E,   // 037E..0383; COMMON
+            0x0384,   // 0384..0384; GREEK
+            0x0385,   // 0385..0385; COMMON
+            0x0386,   // 0386..0386; GREEK
+            0x0387,   // 0387..0387; COMMON
+            0x0388,   // 0388..03E1; GREEK
+            0x03E2,   // 03E2..03EF; COPTIC
+            0x03F0,   // 03F0..03FF; GREEK
+            0x0400,   // 0400..0484; CYRILLIC
+            0x0485,   // 0485..0486; INHERITED
+            0x0487,   // 0487..0530; CYRILLIC
+            0x0531,   // 0531..0588; ARMENIAN
+            0x0589,   // 0589..0589; COMMON
+            0x058A,   // 058A..0590; ARMENIAN
+            0x0591,   // 0591..05FF; HEBREW
+            0x0600,   // 0600..0605; COMMON
+            0x0606,   // 0606..060B; ARABIC
+            0x060C,   // 060C..060C; COMMON
+            0x060D,   // 060D..061A; ARABIC
+            0x061B,   // 061B..061D; COMMON
+            0x061E,   // 061E..061E; ARABIC
+            0x061F,   // 061F..0620; COMMON
+            0x0621,   // 0621..063F; ARABIC
+            0x0640,   // 0640..0640; COMMON
+            0x0641,   // 0641..064A; ARABIC
+            0x064B,   // 064B..0655; INHERITED
+            0x0656,   // 0656..065F; ARABIC
+            0x0660,   // 0660..0669; COMMON
+            0x066A,   // 066A..066F; ARABIC
+            0x0670,   // 0670..0670; INHERITED
+            0x0671,   // 0671..06DC; ARABIC
+            0x06DD,   // 06DD..06DD; COMMON
+            0x06DE,   // 06DE..06FF; ARABIC
+            0x0700,   // 0700..074F; SYRIAC
+            0x0750,   // 0750..077F; ARABIC
+            0x0780,   // 0780..07BF; THAANA
+            0x07C0,   // 07C0..07FF; NKO
+            0x0800,   // 0800..08FF; SAMARITAN
+            0x0900,   // 0900..0950; DEVANAGARI
+            0x0951,   // 0951..0952; INHERITED
+            0x0953,   // 0953..0963; DEVANAGARI
+            0x0964,   // 0964..0965; COMMON
+            0x0966,   // 0966..096F; DEVANAGARI
+            0x0970,   // 0970..0970; COMMON
+            0x0971,   // 0971..0980; DEVANAGARI
+            0x0981,   // 0981..0A00; BENGALI
+            0x0A01,   // 0A01..0A80; GURMUKHI
+            0x0A81,   // 0A81..0B00; GUJARATI
+            0x0B01,   // 0B01..0B81; ORIYA
+            0x0B82,   // 0B82..0C00; TAMIL
+            0x0C01,   // 0C01..0C81; TELUGU
+            0x0C82,   // 0C82..0CF0; KANNADA
+            0x0CF1,   // 0CF1..0D01; COMMON
+            0x0D02,   // 0D02..0D81; MALAYALAM
+            0x0D82,   // 0D82..0E00; SINHALA
+            0x0E01,   // 0E01..0E3E; THAI
+            0x0E3F,   // 0E3F..0E3F; COMMON
+            0x0E40,   // 0E40..0E80; THAI
+            0x0E81,   // 0E81..0EFF; LAO
+            0x0F00,   // 0F00..0FD4; TIBETAN
+            0x0FD5,   // 0FD5..0FFF; COMMON
+            0x1000,   // 1000..109F; MYANMAR
+            0x10A0,   // 10A0..10FA; GEORGIAN
+            0x10FB,   // 10FB..10FB; COMMON
+            0x10FC,   // 10FC..10FF; GEORGIAN
+            0x1100,   // 1100..11FF; HANGUL
+            0x1200,   // 1200..139F; ETHIOPIC
+            0x13A0,   // 13A0..13FF; CHEROKEE
+            0x1400,   // 1400..167F; CANADIAN_ABORIGINAL
+            0x1680,   // 1680..169F; OGHAM
+            0x16A0,   // 16A0..16EA; RUNIC
+            0x16EB,   // 16EB..16ED; COMMON
+            0x16EE,   // 16EE..16FF; RUNIC
+            0x1700,   // 1700..171F; TAGALOG
+            0x1720,   // 1720..1734; HANUNOO
+            0x1735,   // 1735..173F; COMMON
+            0x1740,   // 1740..175F; BUHID
+            0x1760,   // 1760..177F; TAGBANWA
+            0x1780,   // 1780..17FF; KHMER
+            0x1800,   // 1800..1801; MONGOLIAN
+            0x1802,   // 1802..1803; COMMON
+            0x1804,   // 1804..1804; MONGOLIAN
+            0x1805,   // 1805..1805; COMMON
+            0x1806,   // 1806..18AF; MONGOLIAN
+            0x18B0,   // 18B0..18FF; CANADIAN_ABORIGINAL
+            0x1900,   // 1900..194F; LIMBU
+            0x1950,   // 1950..197F; TAI_LE
+            0x1980,   // 1980..19DF; NEW_TAI_LUE
+            0x19E0,   // 19E0..19FF; KHMER
+            0x1A00,   // 1A00..1A1F; BUGINESE
+            0x1A20,   // 1A20..1AFF; TAI_THAM
+            0x1B00,   // 1B00..1B7F; BALINESE
+            0x1B80,   // 1B80..1BFF; SUNDANESE
+            0x1C00,   // 1C00..1C4F; LEPCHA
+            0x1C50,   // 1C50..1CCF; OL_CHIKI
+            0x1CD0,   // 1CD0..1CD2; INHERITED
+            0x1CD3,   // 1CD3..1CD3; COMMON
+            0x1CD4,   // 1CD4..1CE0; INHERITED
+            0x1CE1,   // 1CE1..1CE1; COMMON
+            0x1CE2,   // 1CE2..1CE8; INHERITED
+            0x1CE9,   // 1CE9..1CEC; COMMON
+            0x1CED,   // 1CED..1CED; INHERITED
+            0x1CEE,   // 1CEE..1CFF; COMMON
+            0x1D00,   // 1D00..1D25; LATIN
+            0x1D26,   // 1D26..1D2A; GREEK
+            0x1D2B,   // 1D2B..1D2B; CYRILLIC
+            0x1D2C,   // 1D2C..1D5C; LATIN
+            0x1D5D,   // 1D5D..1D61; GREEK
+            0x1D62,   // 1D62..1D65; LATIN
+            0x1D66,   // 1D66..1D6A; GREEK
+            0x1D6B,   // 1D6B..1D77; LATIN
+            0x1D78,   // 1D78..1D78; CYRILLIC
+            0x1D79,   // 1D79..1DBE; LATIN
+            0x1DBF,   // 1DBF..1DBF; GREEK
+            0x1DC0,   // 1DC0..1DFF; INHERITED
+            0x1E00,   // 1E00..1EFF; LATIN
+            0x1F00,   // 1F00..1FFF; GREEK
+            0x2000,   // 2000..200B; COMMON
+            0x200C,   // 200C..200D; INHERITED
+            0x200E,   // 200E..2070; COMMON
+            0x2071,   // 2071..2073; LATIN
+            0x2074,   // 2074..207E; COMMON
+            0x207F,   // 207F..207F; LATIN
+            0x2080,   // 2080..208F; COMMON
+            0x2090,   // 2090..209F; LATIN
+            0x20A0,   // 20A0..20CF; COMMON
+            0x20D0,   // 20D0..20FF; INHERITED
+            0x2100,   // 2100..2125; COMMON
+            0x2126,   // 2126..2126; GREEK
+            0x2127,   // 2127..2129; COMMON
+            0x212A,   // 212A..212B; LATIN
+            0x212C,   // 212C..2131; COMMON
+            0x2132,   // 2132..2132; LATIN
+            0x2133,   // 2133..214D; COMMON
+            0x214E,   // 214E..214E; LATIN
+            0x214F,   // 214F..215F; COMMON
+            0x2160,   // 2160..2188; LATIN
+            0x2189,   // 2189..27FF; COMMON
+            0x2800,   // 2800..28FF; BRAILLE
+            0x2900,   // 2900..2BFF; COMMON
+            0x2C00,   // 2C00..2C5F; GLAGOLITIC
+            0x2C60,   // 2C60..2C7F; LATIN
+            0x2C80,   // 2C80..2CFF; COPTIC
+            0x2D00,   // 2D00..2D2F; GEORGIAN
+            0x2D30,   // 2D30..2D7F; TIFINAGH
+            0x2D80,   // 2D80..2DDF; ETHIOPIC
+            0x2DE0,   // 2DE0..2DFF; CYRILLIC
+            0x2E00,   // 2E00..2E7F; COMMON
+            0x2E80,   // 2E80..2FEF; HAN
+            0x2FF0,   // 2FF0..3004; COMMON
+            0x3005,   // 3005..3005; HAN
+            0x3006,   // 3006..3006; COMMON
+            0x3007,   // 3007..3007; HAN
+            0x3008,   // 3008..3020; COMMON
+            0x3021,   // 3021..3029; HAN
+            0x302A,   // 302A..302F; INHERITED
+            0x3030,   // 3030..3037; COMMON
+            0x3038,   // 3038..303B; HAN
+            0x303C,   // 303C..3040; COMMON
+            0x3041,   // 3041..3098; HIRAGANA
+            0x3099,   // 3099..309A; INHERITED
+            0x309B,   // 309B..309C; COMMON
+            0x309D,   // 309D..309F; HIRAGANA
+            0x30A0,   // 30A0..30A0; COMMON
+            0x30A1,   // 30A1..30FA; KATAKANA
+            0x30FB,   // 30FB..30FC; COMMON
+            0x30FD,   // 30FD..3104; KATAKANA
+            0x3105,   // 3105..3130; BOPOMOFO
+            0x3131,   // 3131..318F; HANGUL
+            0x3190,   // 3190..319F; COMMON
+            0x31A0,   // 31A0..31BF; BOPOMOFO
+            0x31C0,   // 31C0..31EF; COMMON
+            0x31F0,   // 31F0..31FF; KATAKANA
+            0x3200,   // 3200..321F; HANGUL
+            0x3220,   // 3220..325F; COMMON
+            0x3260,   // 3260..327E; HANGUL
+            0x327F,   // 327F..32CF; COMMON
+            0x32D0,   // 32D0..3357; KATAKANA
+            0x3358,   // 3358..33FF; COMMON
+            0x3400,   // 3400..4DBF; HAN
+            0x4DC0,   // 4DC0..4DFF; COMMON
+            0x4E00,   // 4E00..9FFF; HAN
+            0xA000,   // A000..A4CF; YI
+            0xA4D0,   // A4D0..A4FF; LISU
+            0xA500,   // A500..A63F; VAI
+            0xA640,   // A640..A69F; CYRILLIC
+            0xA6A0,   // A6A0..A6FF; BAMUM
+            0xA700,   // A700..A721; COMMON
+            0xA722,   // A722..A787; LATIN
+            0xA788,   // A788..A78A; COMMON
+            0xA78B,   // A78B..A7FF; LATIN
+            0xA800,   // A800..A82F; SYLOTI_NAGRI
+            0xA830,   // A830..A83F; COMMON
+            0xA840,   // A840..A87F; PHAGS_PA
+            0xA880,   // A880..A8DF; SAURASHTRA
+            0xA8E0,   // A8E0..A8FF; DEVANAGARI
+            0xA900,   // A900..A92F; KAYAH_LI
+            0xA930,   // A930..A95F; REJANG
+            0xA960,   // A960..A97F; HANGUL
+            0xA980,   // A980..A9FF; JAVANESE
+            0xAA00,   // AA00..AA5F; CHAM
+            0xAA60,   // AA60..AA7F; MYANMAR
+            0xAA80,   // AA80..ABBF; TAI_VIET
+            0xABC0,   // ABC0..ABFF; MEETEI_MAYEK
+            0xAC00,   // AC00..D7FB; HANGUL
+            0xD7FC,   // D7FC..F8FF; UNKNOWN
+            0xF900,   // F900..FAFF; HAN
+            0xFB00,   // FB00..FB12; LATIN
+            0xFB13,   // FB13..FB1C; ARMENIAN
+            0xFB1D,   // FB1D..FB4F; HEBREW
+            0xFB50,   // FB50..FD3D; ARABIC
+            0xFD3E,   // FD3E..FD4F; COMMON
+            0xFD50,   // FD50..FDFC; ARABIC
+            0xFDFD,   // FDFD..FDFF; COMMON
+            0xFE00,   // FE00..FE0F; INHERITED
+            0xFE10,   // FE10..FE1F; COMMON
+            0xFE20,   // FE20..FE2F; INHERITED
+            0xFE30,   // FE30..FE6F; COMMON
+            0xFE70,   // FE70..FEFE; ARABIC
+            0xFEFF,   // FEFF..FF20; COMMON
+            0xFF21,   // FF21..FF3A; LATIN
+            0xFF3B,   // FF3B..FF40; COMMON
+            0xFF41,   // FF41..FF5A; LATIN
+            0xFF5B,   // FF5B..FF65; COMMON
+            0xFF66,   // FF66..FF6F; KATAKANA
+            0xFF70,   // FF70..FF70; COMMON
+            0xFF71,   // FF71..FF9D; KATAKANA
+            0xFF9E,   // FF9E..FF9F; COMMON
+            0xFFA0,   // FFA0..FFDF; HANGUL
+            0xFFE0,   // FFE0..FFFF; COMMON
+            0x10000,  // 10000..100FF; LINEAR_B
+            0x10100,  // 10100..1013F; COMMON
+            0x10140,  // 10140..1018F; GREEK
+            0x10190,  // 10190..101FC; COMMON
+            0x101FD,  // 101FD..1027F; INHERITED
+            0x10280,  // 10280..1029F; LYCIAN
+            0x102A0,  // 102A0..102FF; CARIAN
+            0x10300,  // 10300..1032F; OLD_ITALIC
+            0x10330,  // 10330..1037F; GOTHIC
+            0x10380,  // 10380..1039F; UGARITIC
+            0x103A0,  // 103A0..103FF; OLD_PERSIAN
+            0x10400,  // 10400..1044F; DESERET
+            0x10450,  // 10450..1047F; SHAVIAN
+            0x10480,  // 10480..107FF; OSMANYA
+            0x10800,  // 10800..1083F; CYPRIOT
+            0x10840,  // 10840..108FF; IMPERIAL_ARAMAIC
+            0x10900,  // 10900..1091F; PHOENICIAN
+            0x10920,  // 10920..109FF; LYDIAN
+            0x10A00,  // 10A00..10A5F; KHAROSHTHI
+            0x10A60,  // 10A60..10AFF; OLD_SOUTH_ARABIAN
+            0x10B00,  // 10B00..10B3F; AVESTAN
+            0x10B40,  // 10B40..10B5F; INSCRIPTIONAL_PARTHIAN
+            0x10B60,  // 10B60..10BFF; INSCRIPTIONAL_PAHLAVI
+            0x10C00,  // 10C00..10E5F; OLD_TURKIC
+            0x10E60,  // 10E60..1107F; ARABIC
+            0x11080,  // 11080..11FFF; KAITHI
+            0x12000,  // 12000..12FFF; CUNEIFORM
+            0x13000,  // 13000..1CFFF; EGYPTIAN_HIEROGLYPHS
+            0x1D000,  // 1D000..1D166; COMMON
+            0x1D167,  // 1D167..1D169; INHERITED
+            0x1D16A,  // 1D16A..1D17A; COMMON
+            0x1D17B,  // 1D17B..1D182; INHERITED
+            0x1D183,  // 1D183..1D184; COMMON
+            0x1D185,  // 1D185..1D18B; INHERITED
+            0x1D18C,  // 1D18C..1D1A9; COMMON
+            0x1D1AA,  // 1D1AA..1D1AD; INHERITED
+            0x1D1AE,  // 1D1AE..1D1FF; COMMON
+            0x1D200,  // 1D200..1D2FF; GREEK
+            0x1D300,  // 1D300..1F1FF; COMMON
+            0x1F200,  // 1F200..1F20F; HIRAGANA
+            0x1F210,  // 1F210..1FFFF; COMMON
+            0x20000,  // 20000..E0000; HAN
+            0xE0001,  // E0001..E00FF; COMMON
+            0xE0100,  // E0100..E01EF; INHERITED
+            0xE01F0   // E01F0..10FFFF; UNKNOWN
+
+        };
+
+        private static final UnicodeScript[] scripts = {
+            COMMON,
+            LATIN,
+            COMMON,
+            LATIN,
+            COMMON,
+            LATIN,
+            COMMON,
+            LATIN,
+            COMMON,
+            LATIN,
+            COMMON,
+            LATIN,
+            COMMON,
+            LATIN,
+            COMMON,
+            LATIN,
+            COMMON,
+            INHERITED,
+            GREEK,
+            COMMON,
+            GREEK,
+            COMMON,
+            GREEK,
+            COMMON,
+            GREEK,
+            COMMON,
+            GREEK,
+            COPTIC,
+            GREEK,
+            CYRILLIC,
+            INHERITED,
+            CYRILLIC,
+            ARMENIAN,
+            COMMON,
+            ARMENIAN,
+            HEBREW,
+            COMMON,
+            ARABIC,
+            COMMON,
+            ARABIC,
+            COMMON,
+            ARABIC,
+            COMMON,
+            ARABIC,
+            COMMON,
+            ARABIC,
+            INHERITED,
+            ARABIC,
+            COMMON,
+            ARABIC,
+            INHERITED,
+            ARABIC,
+            COMMON,
+            ARABIC,
+            SYRIAC,
+            ARABIC,
+            THAANA,
+            NKO,
+            SAMARITAN,
+            DEVANAGARI,
+            INHERITED,
+            DEVANAGARI,
+            COMMON,
+            DEVANAGARI,
+            COMMON,
+            DEVANAGARI,
+            BENGALI,
+            GURMUKHI,
+            GUJARATI,
+            ORIYA,
+            TAMIL,
+            TELUGU,
+            KANNADA,
+            COMMON,
+            MALAYALAM,
+            SINHALA,
+            THAI,
+            COMMON,
+            THAI,
+            LAO,
+            TIBETAN,
+            COMMON,
+            MYANMAR,
+            GEORGIAN,
+            COMMON,
+            GEORGIAN,
+            HANGUL,
+            ETHIOPIC,
+            CHEROKEE,
+            CANADIAN_ABORIGINAL,
+            OGHAM,
+            RUNIC,
+            COMMON,
+            RUNIC,
+            TAGALOG,
+            HANUNOO,
+            COMMON,
+            BUHID,
+            TAGBANWA,
+            KHMER,
+            MONGOLIAN,
+            COMMON,
+            MONGOLIAN,
+            COMMON,
+            MONGOLIAN,
+            CANADIAN_ABORIGINAL,
+            LIMBU,
+            TAI_LE,
+            NEW_TAI_LUE,
+            KHMER,
+            BUGINESE,
+            TAI_THAM,
+            BALINESE,
+            SUNDANESE,
+            LEPCHA,
+            OL_CHIKI,
+            INHERITED,
+            COMMON,
+            INHERITED,
+            COMMON,
+            INHERITED,
+            COMMON,
+            INHERITED,
+            COMMON,
+            LATIN,
+            GREEK,
+            CYRILLIC,
+            LATIN,
+            GREEK,
+            LATIN,
+            GREEK,
+            LATIN,
+            CYRILLIC,
+            LATIN,
+            GREEK,
+            INHERITED,
+            LATIN,
+            GREEK,
+            COMMON,
+            INHERITED,
+            COMMON,
+            LATIN,
+            COMMON,
+            LATIN,
+            COMMON,
+            LATIN,
+            COMMON,
+            INHERITED,
+            COMMON,
+            GREEK,
+            COMMON,
+            LATIN,
+            COMMON,
+            LATIN,
+            COMMON,
+            LATIN,
+            COMMON,
+            LATIN,
+            COMMON,
+            BRAILLE,
+            COMMON,
+            GLAGOLITIC,
+            LATIN,
+            COPTIC,
+            GEORGIAN,
+            TIFINAGH,
+            ETHIOPIC,
+            CYRILLIC,
+            COMMON,
+            HAN,
+            COMMON,
+            HAN,
+            COMMON,
+            HAN,
+            COMMON,
+            HAN,
+            INHERITED,
+            COMMON,
+            HAN,
+            COMMON,
+            HIRAGANA,
+            INHERITED,
+            COMMON,
+            HIRAGANA,
+            COMMON,
+            KATAKANA,
+            COMMON,
+            KATAKANA,
+            BOPOMOFO,
+            HANGUL,
+            COMMON,
+            BOPOMOFO,
+            COMMON,
+            KATAKANA,
+            HANGUL,
+            COMMON,
+            HANGUL,
+            COMMON,
+            KATAKANA,
+            COMMON,
+            HAN,
+            COMMON,
+            HAN,
+            YI,
+            LISU,
+            VAI,
+            CYRILLIC,
+            BAMUM,
+            COMMON,
+            LATIN,
+            COMMON,
+            LATIN,
+            SYLOTI_NAGRI,
+            COMMON,
+            PHAGS_PA,
+            SAURASHTRA,
+            DEVANAGARI,
+            KAYAH_LI,
+            REJANG,
+            HANGUL,
+            JAVANESE,
+            CHAM,
+            MYANMAR,
+            TAI_VIET,
+            MEETEI_MAYEK,
+            HANGUL,
+            UNKNOWN,
+            HAN,
+            LATIN,
+            ARMENIAN,
+            HEBREW,
+            ARABIC,
+            COMMON,
+            ARABIC,
+            COMMON,
+            INHERITED,
+            COMMON,
+            INHERITED,
+            COMMON,
+            ARABIC,
+            COMMON,
+            LATIN,
+            COMMON,
+            LATIN,
+            COMMON,
+            KATAKANA,
+            COMMON,
+            KATAKANA,
+            COMMON,
+            HANGUL,
+            COMMON,
+            LINEAR_B,
+            COMMON,
+            GREEK,
+            COMMON,
+            INHERITED,
+            LYCIAN,
+            CARIAN,
+            OLD_ITALIC,
+            GOTHIC,
+            UGARITIC,
+            OLD_PERSIAN,
+            DESERET,
+            SHAVIAN,
+            OSMANYA,
+            CYPRIOT,
+            IMPERIAL_ARAMAIC,
+            PHOENICIAN,
+            LYDIAN,
+            KHAROSHTHI,
+            OLD_SOUTH_ARABIAN,
+            AVESTAN,
+            INSCRIPTIONAL_PARTHIAN,
+            INSCRIPTIONAL_PAHLAVI,
+            OLD_TURKIC,
+            ARABIC,
+            KAITHI,
+            CUNEIFORM,
+            EGYPTIAN_HIEROGLYPHS,
+            COMMON,
+            INHERITED,
+            COMMON,
+            INHERITED,
+            COMMON,
+            INHERITED,
+            COMMON,
+            INHERITED,
+            COMMON,
+            GREEK,
+            COMMON,
+            HIRAGANA,
+            COMMON,
+            HAN,
+            COMMON,
+            INHERITED,
+            UNKNOWN
+        };
+
+        private static HashMap<String, Character.UnicodeScript> aliases;
+        static {
+            aliases = new HashMap<String, UnicodeScript>(128);
+            aliases.put("ARAB", ARABIC);
+            aliases.put("ARMI", IMPERIAL_ARAMAIC);
+            aliases.put("ARMN", ARMENIAN);
+            aliases.put("AVST", AVESTAN);
+            aliases.put("BALI", BALINESE);
+            aliases.put("BAMU", BAMUM);
+            aliases.put("BENG", BENGALI);
+            aliases.put("BOPO", BOPOMOFO);
+            aliases.put("BRAI", BRAILLE);
+            aliases.put("BUGI", BUGINESE);
+            aliases.put("BUHD", BUHID);
+            aliases.put("CANS", CANADIAN_ABORIGINAL);
+            aliases.put("CARI", CARIAN);
+            aliases.put("CHAM", CHAM);
+            aliases.put("CHER", CHEROKEE);
+            aliases.put("COPT", COPTIC);
+            aliases.put("CPRT", CYPRIOT);
+            aliases.put("CYRL", CYRILLIC);
+            aliases.put("DEVA", DEVANAGARI);
+            aliases.put("DSRT", DESERET);
+            aliases.put("EGYP", EGYPTIAN_HIEROGLYPHS);
+            aliases.put("ETHI", ETHIOPIC);
+            aliases.put("GEOR", GEORGIAN);
+            aliases.put("GLAG", GLAGOLITIC);
+            aliases.put("GOTH", GOTHIC);
+            aliases.put("GREK", GREEK);
+            aliases.put("GUJR", GUJARATI);
+            aliases.put("GURU", GURMUKHI);
+            aliases.put("HANG", HANGUL);
+            aliases.put("HANI", HAN);
+            aliases.put("HANO", HANUNOO);
+            aliases.put("HEBR", HEBREW);
+            aliases.put("HIRA", HIRAGANA);
+            // it appears we don't have the KATAKANA_OR_HIRAGANA
+            //aliases.put("HRKT", KATAKANA_OR_HIRAGANA);
+            aliases.put("ITAL", OLD_ITALIC);
+            aliases.put("JAVA", JAVANESE);
+            aliases.put("KALI", KAYAH_LI);
+            aliases.put("KANA", KATAKANA);
+            aliases.put("KHAR", KHAROSHTHI);
+            aliases.put("KHMR", KHMER);
+            aliases.put("KNDA", KANNADA);
+            aliases.put("KTHI", KAITHI);
+            aliases.put("LANA", TAI_THAM);
+            aliases.put("LAOO", LAO);
+            aliases.put("LATN", LATIN);
+            aliases.put("LEPC", LEPCHA);
+            aliases.put("LIMB", LIMBU);
+            aliases.put("LINB", LINEAR_B);
+            aliases.put("LISU", LISU);
+            aliases.put("LYCI", LYCIAN);
+            aliases.put("LYDI", LYDIAN);
+            aliases.put("MLYM", MALAYALAM);
+            aliases.put("MONG", MONGOLIAN);
+            aliases.put("MTEI", MEETEI_MAYEK);
+            aliases.put("MYMR", MYANMAR);
+            aliases.put("NKOO", NKO);
+            aliases.put("OGAM", OGHAM);
+            aliases.put("OLCK", OL_CHIKI);
+            aliases.put("ORKH", OLD_TURKIC);
+            aliases.put("ORYA", ORIYA);
+            aliases.put("OSMA", OSMANYA);
+            aliases.put("PHAG", PHAGS_PA);
+            aliases.put("PHLI", INSCRIPTIONAL_PAHLAVI);
+            aliases.put("PHNX", PHOENICIAN);
+            aliases.put("PRTI", INSCRIPTIONAL_PARTHIAN);
+            aliases.put("RJNG", REJANG);
+            aliases.put("RUNR", RUNIC);
+            aliases.put("SAMR", SAMARITAN);
+            aliases.put("SARB", OLD_SOUTH_ARABIAN);
+            aliases.put("SAUR", SAURASHTRA);
+            aliases.put("SHAW", SHAVIAN);
+            aliases.put("SINH", SINHALA);
+            aliases.put("SUND", SUNDANESE);
+            aliases.put("SYLO", SYLOTI_NAGRI);
+            aliases.put("SYRC", SYRIAC);
+            aliases.put("TAGB", TAGBANWA);
+            aliases.put("TALE", TAI_LE);
+            aliases.put("TALU", NEW_TAI_LUE);
+            aliases.put("TAML", TAMIL);
+            aliases.put("TAVT", TAI_VIET);
+            aliases.put("TELU", TELUGU);
+            aliases.put("TFNG", TIFINAGH);
+            aliases.put("TGLG", TAGALOG);
+            aliases.put("THAA", THAANA);
+            aliases.put("THAI", THAI);
+            aliases.put("TIBT", TIBETAN);
+            aliases.put("UGAR", UGARITIC);
+            aliases.put("VAII", VAI);
+            aliases.put("XPEO", OLD_PERSIAN);
+            aliases.put("XSUX", CUNEIFORM);
+            aliases.put("YIII", YI);
+            aliases.put("ZINH", INHERITED);
+            aliases.put("ZYYY", COMMON);
+            aliases.put("ZZZZ", UNKNOWN);
+        }
+
+        /**
+         * Returns the enum constant representing the Unicode script of which
+         * the given character (Unicode code point) is assigned to.
+         *
+         * @param   codePoint the character (Unicode code point) in question.
+         * @return  The <code>UnicodeScript</code> constant representing the
+         *          Unicode script of which this character is assigned to.
+         *
+         * @exception IllegalArgumentException if the specified
+         * <code>codePoint</code> is an invalid Unicode code point.
+         * @see Character#isValidCodePoint(int)
+         *
+         */
+        public static UnicodeScript of(int codePoint) {
+            if (!isValidCodePoint(codePoint))
+                throw new IllegalArgumentException();
+            int type = getType(codePoint);
+            // leave SURROGATE and PRIVATE_USE for table lookup
+            if (type == UNASSIGNED)
+                return UNKNOWN;
+            int index = Arrays.binarySearch(scriptStarts, codePoint);
+            if (index < 0)
+                index = -index - 2;
+            return scripts[index];
+        }
+
+        /**
+         * Returns the UnicodeScript constant with the given Unicode script
+         * name or the script name alias. Script names and their aliases are
+         * determined by The Unicode Standard. The files Scripts&lt;version&gt;.txt
+         * and PropertyValueAliases&lt;version&gt;.txt define script names
+         * and the script name aliases for a particular version of the
+         * standard. The {@link Character} class specifies the version of
+         * the standard that it supports.
+         * <p>
+         * Character case is ignored for all of the valid script names.
+         * The en_US locale's case mapping rules are used to provide
+         * case-insensitive string comparisons for script name validation.
+         * <p>
+         *
+         * @param scriptName A <code>UnicodeScript</code> name.
+         * @return The <code>UnicodeScript</code> constant identified
+         *         by <code>scriptName</code>
+         * @throws IllegalArgumentException if <code>scriptName</code> is an
+         *         invalid name
+         * @throws NullPointerException if <code>scriptName</code> is null
+         */
+        public static final UnicodeScript forName(String scriptName) {
+            scriptName = scriptName.toUpperCase(Locale.ENGLISH);
+                                 //.replace(' ', '_'));
+            UnicodeScript sc = aliases.get(scriptName);
+            if (sc != null)
+                return sc;
+            return valueOf(scriptName);
+        }
+    }
+
+    /**
      * The value of the <code>Character</code>.
      *
      * @serial
@@ -2573,7 +3902,7 @@
         static final Character cache[] = new Character[127 + 1];
 
         static {
-            for(int i = 0; i < cache.length; i++)
+            for (int i = 0; i < cache.length; i++)
                 cache[i] = new Character((char)i);
         }
     }
@@ -2596,7 +3925,7 @@
      * @since  1.5
      */
     public static Character valueOf(char c) {
-        if(c <= 127) { // must cache
+        if (c <= 127) { // must cache
             return CharacterCache.cache[(int)c];
         }
         return new Character(c);
@@ -2678,7 +4007,29 @@
      * @since  1.5
      */
     public static boolean isValidCodePoint(int codePoint) {
-        return codePoint >= MIN_CODE_POINT && codePoint <= MAX_CODE_POINT;
+        // Optimized form of:
+        //     codePoint >= MIN_CODE_POINT && codePoint <= MAX_CODE_POINT
+        int plane = codePoint >>> 16;
+        return plane < ((MAX_CODE_POINT + 1) >>> 16);
+    }
+
+    /**
+     * Determines whether the specified character (Unicode code point)
+     * is in the <a href="#BMP">Basic Multilingual Plane (BMP)</a>.
+     * Such code points can be represented using a single {@code char}.
+     *
+     * @param  codePoint the character (Unicode code point) to be tested
+     * @return {@code true} if the specified code point is between
+     *         {@link #MIN_VALUE} and {@link #MAX_VALUE} inclusive;
+     *         {@code false} otherwise.
+     * @since  1.7
+     */
+    public static boolean isBmpCodePoint(int codePoint) {
+        return codePoint >>> 16 == 0;
+        // Optimized form of:
+        //     codePoint >= MIN_VALUE && codePoint <= MAX_VALUE
+        // We consistently use logical shift (>>>) to facilitate
+        // additional runtime optimizations.
     }
 
     /**
@@ -2694,7 +4045,7 @@
      */
     public static boolean isSupplementaryCodePoint(int codePoint) {
         return codePoint >= MIN_SUPPLEMENTARY_CODE_POINT
-            && codePoint <= MAX_CODE_POINT;
+            && codePoint <  MAX_CODE_POINT + 1;
     }
 
     /**
@@ -2713,12 +4064,13 @@
      *         {@link #MIN_HIGH_SURROGATE} and
      *         {@link #MAX_HIGH_SURROGATE} inclusive;
      *         {@code false} otherwise.
-     * @see    #isLowSurrogate(char)
+     * @see    Character#isLowSurrogate(char)
      * @see    Character.UnicodeBlock#of(int)
      * @since  1.5
      */
     public static boolean isHighSurrogate(char ch) {
-        return ch >= MIN_HIGH_SURROGATE && ch <= MAX_HIGH_SURROGATE;
+        // Help VM constant-fold; MAX_HIGH_SURROGATE + 1 == MIN_LOW_SURROGATE
+        return ch >= MIN_HIGH_SURROGATE && ch < (MAX_HIGH_SURROGATE + 1);
     }
 
     /**
@@ -2737,11 +4089,11 @@
      *         {@link #MIN_LOW_SURROGATE} and
      *         {@link #MAX_LOW_SURROGATE} inclusive;
      *         {@code false} otherwise.
-     * @see    #isHighSurrogate(char)
+     * @see    Character#isHighSurrogate(char)
      * @since  1.5
      */
     public static boolean isLowSurrogate(char ch) {
-        return ch >= MIN_LOW_SURROGATE && ch <= MAX_LOW_SURROGATE;
+        return ch >= MIN_LOW_SURROGATE && ch < (MAX_LOW_SURROGATE + 1);
     }
 
     /**
@@ -2765,7 +4117,7 @@
      * @since  1.7
      */
     public static boolean isSurrogate(char ch) {
-        return ch >= MIN_SURROGATE && ch <= MAX_SURROGATE;
+        return ch >= MIN_SURROGATE && ch < (MAX_SURROGATE + 1);
     }
 
     /**
@@ -2803,11 +4155,11 @@
      *
      * @param   codePoint the character (Unicode code point) to be tested.
      * @return  2 if the character is a valid supplementary character; 1 otherwise.
-     * @see     #isSupplementaryCodePoint(int)
+     * @see     Character#isSupplementaryCodePoint(int)
      * @since   1.5
      */
     public static int charCount(int codePoint) {
-        return codePoint >= MIN_SUPPLEMENTARY_CODE_POINT? 2 : 1;
+        return codePoint >= MIN_SUPPLEMENTARY_CODE_POINT ? 2 : 1;
     }
 
     /**
@@ -2924,6 +4276,7 @@
         return codePointAtImpl(a, index, limit);
     }
 
+    // throws ArrayIndexOutofBoundsException if index out of bounds
     static int codePointAtImpl(char[] a, int index, int limit) {
         char c1 = a[index++];
         if (isHighSurrogate(c1)) {
@@ -3030,6 +4383,7 @@
         return codePointBeforeImpl(a, index, start);
     }
 
+    // throws ArrayIndexOutofBoundsException if index-1 out of bounds
     static int codePointBeforeImpl(char[] a, int index, int start) {
         char c2 = a[--index];
         if (isLowSurrogate(c2)) {
@@ -3044,6 +4398,63 @@
     }
 
     /**
+     * Returns the leading surrogate (a
+     * <a href="http://www.unicode.org/glossary/#high_surrogate_code_unit">
+     * high surrogate code unit</a>) of the
+     * <a href="http://www.unicode.org/glossary/#surrogate_pair">
+     * surrogate pair</a>
+     * representing the specified supplementary character (Unicode
+     * code point) in the UTF-16 encoding.  If the specified character
+     * is not a
+     * <a href="Character.html#supplementary">supplementary character</a>,
+     * an unspecified {@code char} is returned.
+     *
+     * <p>If
+     * {@link #isSupplementaryCodePoint isSupplementaryCodePoint(x)}
+     * is {@code true}, then
+     * {@link #isHighSurrogate isHighSurrogate}{@code (highSurrogate(x))} and
+     * {@link #toCodePoint toCodePoint}{@code (highSurrogate(x), }{@link #lowSurrogate lowSurrogate}{@code (x)) == x}
+     * are also always {@code true}.
+     *
+     * @param   codePoint a supplementary character (Unicode code point)
+     * @return  the leading surrogate code unit used to represent the
+     *          character in the UTF-16 encoding
+     * @since   1.7
+     */
+    public static char highSurrogate(int codePoint) {
+        return (char) ((codePoint >>> 10)
+            + (MIN_HIGH_SURROGATE - (MIN_SUPPLEMENTARY_CODE_POINT >>> 10)));
+    }
+
+    /**
+     * Returns the trailing surrogate (a
+     * <a href="http://www.unicode.org/glossary/#low_surrogate_code_unit">
+     * low surrogate code unit</a>) of the
+     * <a href="http://www.unicode.org/glossary/#surrogate_pair">
+     * surrogate pair</a>
+     * representing the specified supplementary character (Unicode
+     * code point) in the UTF-16 encoding.  If the specified character
+     * is not a
+     * <a href="Character.html#supplementary">supplementary character</a>,
+     * an unspecified {@code char} is returned.
+     *
+     * <p>If
+     * {@link #isSupplementaryCodePoint isSupplementaryCodePoint(x)}
+     * is {@code true}, then
+     * {@link #isLowSurrogate isLowSurrogate}{@code (lowSurrogate(x))} and
+     * {@link #toCodePoint toCodePoint}{@code (}{@link #highSurrogate highSurrogate}{@code (x), lowSurrogate(x)) == x}
+     * are also always {@code true}.
+     *
+     * @param   codePoint a supplementary character (Unicode code point)
+     * @return  the trailing surrogate code unit used to represent the
+     *          character in the UTF-16 encoding
+     * @since   1.7
+     */
+    public static char lowSurrogate(int codePoint) {
+        return (char) ((codePoint & 0x3ff) + MIN_LOW_SURROGATE);
+    }
+
+    /**
      * Converts the specified character (Unicode code point) to its
      * UTF-16 representation. If the specified code point is a BMP
      * (Basic Multilingual Plane or Plane 0) value, the same value is
@@ -3075,15 +4486,15 @@
      * @since  1.5
      */
     public static int toChars(int codePoint, char[] dst, int dstIndex) {
-        if (codePoint < 0 || codePoint > MAX_CODE_POINT) {
+        if (isBmpCodePoint(codePoint)) {
+            dst[dstIndex] = (char) codePoint;
+            return 1;
+        } else if (isValidCodePoint(codePoint)) {
+            toSurrogates(codePoint, dst, dstIndex);
+            return 2;
+        } else {
             throw new IllegalArgumentException();
         }
-        if (codePoint < MIN_SUPPLEMENTARY_CODE_POINT) {
-            dst[dstIndex] = (char) codePoint;
-            return 1;
-        }
-        toSurrogates(codePoint, dst, dstIndex);
-        return 2;
     }
 
     /**
@@ -3103,22 +4514,21 @@
      * @since  1.5
      */
     public static char[] toChars(int codePoint) {
-        if (codePoint < 0 || codePoint > MAX_CODE_POINT) {
+        if (isBmpCodePoint(codePoint)) {
+            return new char[] { (char) codePoint };
+        } else if (isValidCodePoint(codePoint)) {
+            char[] result = new char[2];
+            toSurrogates(codePoint, result, 0);
+            return result;
+        } else {
             throw new IllegalArgumentException();
         }
-        if (codePoint < MIN_SUPPLEMENTARY_CODE_POINT) {
-                return new char[] { (char) codePoint };
-        }
-        char[] result = new char[2];
-        toSurrogates(codePoint, result, 0);
-        return result;
     }
 
     static void toSurrogates(int codePoint, char[] dst, int index) {
         // We write elements "backwards" to guarantee all-or-nothing
-        dst[index+1] = (char)((codePoint & 0x3ff) + MIN_LOW_SURROGATE);
-        dst[index] = (char)((codePoint >>> 10)
-            + (MIN_HIGH_SURROGATE - (MIN_SUPPLEMENTARY_CODE_POINT >>> 10)));
+        dst[index+1] = lowSurrogate(codePoint);
+        dst[index] = highSurrogate(codePoint);
     }
 
     /**
@@ -3149,13 +4559,12 @@
         if (beginIndex < 0 || endIndex > length || beginIndex > endIndex) {
             throw new IndexOutOfBoundsException();
         }
-        int n = 0;
+        int n = endIndex - beginIndex;
         for (int i = beginIndex; i < endIndex; ) {
-            n++;
-            if (isHighSurrogate(seq.charAt(i++))) {
-                if (i < endIndex && isLowSurrogate(seq.charAt(i))) {
-                    i++;
-                }
+            if (isHighSurrogate(seq.charAt(i++)) && i < endIndex &&
+                isLowSurrogate(seq.charAt(i))) {
+                n--;
+                i++;
             }
         }
         return n;
@@ -3189,13 +4598,12 @@
 
     static int codePointCountImpl(char[] a, int offset, int count) {
         int endIndex = offset + count;
-        int n = 0;
+        int n = count;
         for (int i = offset; i < endIndex; ) {
-            n++;
-            if (isHighSurrogate(a[i++])) {
-                if (i < endIndex && isLowSurrogate(a[i])) {
-                    i++;
-                }
+            if (isHighSurrogate(a[i++]) && i < endIndex &&
+                isLowSurrogate(a[i])) {
+                n--;
+                i++;
             }
         }
         return n;
@@ -3234,10 +4642,9 @@
         if (codePointOffset >= 0) {
             int i;
             for (i = 0; x < length && i < codePointOffset; i++) {
-                if (isHighSurrogate(seq.charAt(x++))) {
-                    if (x < length && isLowSurrogate(seq.charAt(x))) {
-                        x++;
-                    }
+                if (isHighSurrogate(seq.charAt(x++)) && x < length &&
+                    isLowSurrogate(seq.charAt(x))) {
+                    x++;
                 }
             }
             if (i < codePointOffset) {
@@ -3246,10 +4653,9 @@
         } else {
             int i;
             for (i = codePointOffset; x > 0 && i < 0; i++) {
-                if (isLowSurrogate(seq.charAt(--x))) {
-                    if (x > 0 && isHighSurrogate(seq.charAt(x-1))) {
-                        x--;
-                    }
+                if (isLowSurrogate(seq.charAt(--x)) && x > 0 &&
+                    isHighSurrogate(seq.charAt(x-1))) {
+                    x--;
                 }
             }
             if (i < 0) {
@@ -3308,10 +4714,9 @@
             int limit = start + count;
             int i;
             for (i = 0; x < limit && i < codePointOffset; i++) {
-                if (isHighSurrogate(a[x++])) {
-                    if (x < limit && isLowSurrogate(a[x])) {
-                        x++;
-                    }
+                if (isHighSurrogate(a[x++]) && x < limit &&
+                    isLowSurrogate(a[x])) {
+                    x++;
                 }
             }
             if (i < codePointOffset) {
@@ -3320,10 +4725,9 @@
         } else {
             int i;
             for (i = codePointOffset; x > start && i < 0; i++) {
-                if (isLowSurrogate(a[--x])) {
-                    if (x > start && isHighSurrogate(a[x-1])) {
-                        x--;
-                    }
+                if (isLowSurrogate(a[--x]) && x > start &&
+                    isHighSurrogate(a[x-1])) {
+                    x--;
                 }
             }
             if (i < 0) {
@@ -3333,7 +4737,7 @@
         return x;
     }
 
-   /**
+    /**
      * Determines if the specified character is a lowercase character.
      * <p>
      * A character is lowercase if its general category type, provided
@@ -3358,10 +4762,10 @@
      * @param   ch   the character to be tested.
      * @return  <code>true</code> if the character is lowercase;
      *          <code>false</code> otherwise.
-     * @see     java.lang.Character#isLowerCase(char)
-     * @see     java.lang.Character#isTitleCase(char)
-     * @see     java.lang.Character#toLowerCase(char)
-     * @see     java.lang.Character#getType(char)
+     * @see     Character#isLowerCase(char)
+     * @see     Character#isTitleCase(char)
+     * @see     Character#toLowerCase(char)
+     * @see     Character#getType(char)
      */
     public static boolean isLowerCase(char ch) {
         return isLowerCase((int)ch);
@@ -3388,17 +4792,17 @@
      * @param   codePoint the character (Unicode code point) to be tested.
      * @return  <code>true</code> if the character is lowercase;
      *          <code>false</code> otherwise.
-     * @see     java.lang.Character#isLowerCase(int)
-     * @see     java.lang.Character#isTitleCase(int)
-     * @see     java.lang.Character#toLowerCase(int)
-     * @see     java.lang.Character#getType(int)
+     * @see     Character#isLowerCase(int)
+     * @see     Character#isTitleCase(int)
+     * @see     Character#toLowerCase(int)
+     * @see     Character#getType(int)
      * @since   1.5
      */
     public static boolean isLowerCase(int codePoint) {
         return getType(codePoint) == Character.LOWERCASE_LETTER;
     }
 
-   /**
+    /**
      * Determines if the specified character is an uppercase character.
      * <p>
      * A character is uppercase if its general category type, provided by
@@ -3422,10 +4826,10 @@
      * @param   ch   the character to be tested.
      * @return  <code>true</code> if the character is uppercase;
      *          <code>false</code> otherwise.
-     * @see     java.lang.Character#isLowerCase(char)
-     * @see     java.lang.Character#isTitleCase(char)
-     * @see     java.lang.Character#toUpperCase(char)
-     * @see     java.lang.Character#getType(char)
+     * @see     Character#isLowerCase(char)
+     * @see     Character#isTitleCase(char)
+     * @see     Character#toUpperCase(char)
+     * @see     Character#getType(char)
      * @since   1.0
      */
     public static boolean isUpperCase(char ch) {
@@ -3451,10 +4855,10 @@
      * @param   codePoint the character (Unicode code point) to be tested.
      * @return  <code>true</code> if the character is uppercase;
      *          <code>false</code> otherwise.
-     * @see     java.lang.Character#isLowerCase(int)
-     * @see     java.lang.Character#isTitleCase(int)
-     * @see     java.lang.Character#toUpperCase(int)
-     * @see     java.lang.Character#getType(int)
+     * @see     Character#isLowerCase(int)
+     * @see     Character#isTitleCase(int)
+     * @see     Character#toUpperCase(int)
+     * @see     Character#getType(int)
      * @since   1.5
      */
     public static boolean isUpperCase(int codePoint) {
@@ -3492,10 +4896,10 @@
      * @param   ch   the character to be tested.
      * @return  <code>true</code> if the character is titlecase;
      *          <code>false</code> otherwise.
-     * @see     java.lang.Character#isLowerCase(char)
-     * @see     java.lang.Character#isUpperCase(char)
-     * @see     java.lang.Character#toTitleCase(char)
-     * @see     java.lang.Character#getType(char)
+     * @see     Character#isLowerCase(char)
+     * @see     Character#isUpperCase(char)
+     * @see     Character#toTitleCase(char)
+     * @see     Character#getType(char)
      * @since   1.0.2
      */
     public static boolean isTitleCase(char ch) {
@@ -3528,10 +4932,10 @@
      * @param   codePoint the character (Unicode code point) to be tested.
      * @return  <code>true</code> if the character is titlecase;
      *          <code>false</code> otherwise.
-     * @see     java.lang.Character#isLowerCase(int)
-     * @see     java.lang.Character#isUpperCase(int)
-     * @see     java.lang.Character#toTitleCase(int)
-     * @see     java.lang.Character#getType(int)
+     * @see     Character#isLowerCase(int)
+     * @see     Character#isUpperCase(int)
+     * @see     Character#toTitleCase(int)
+     * @see     Character#getType(int)
      * @since   1.5
      */
     public static boolean isTitleCase(int codePoint) {
@@ -3569,9 +4973,9 @@
      * @param   ch   the character to be tested.
      * @return  <code>true</code> if the character is a digit;
      *          <code>false</code> otherwise.
-     * @see     java.lang.Character#digit(char, int)
-     * @see     java.lang.Character#forDigit(int, int)
-     * @see     java.lang.Character#getType(char)
+     * @see     Character#digit(char, int)
+     * @see     Character#forDigit(int, int)
+     * @see     Character#getType(char)
      */
     public static boolean isDigit(char ch) {
         return isDigit((int)ch);
@@ -3603,8 +5007,8 @@
      * @param   codePoint the character (Unicode code point) to be tested.
      * @return  <code>true</code> if the character is a digit;
      *          <code>false</code> otherwise.
-     * @see     java.lang.Character#forDigit(int, int)
-     * @see     java.lang.Character#getType(int)
+     * @see     Character#forDigit(int, int)
+     * @see     Character#getType(int)
      * @since   1.5
      */
     public static boolean isDigit(int codePoint) {
@@ -3628,12 +5032,12 @@
      * @param   ch   the character to be tested
      * @return  <code>true</code> if the character has a defined meaning
      *          in Unicode; <code>false</code> otherwise.
-     * @see     java.lang.Character#isDigit(char)
-     * @see     java.lang.Character#isLetter(char)
-     * @see     java.lang.Character#isLetterOrDigit(char)
-     * @see     java.lang.Character#isLowerCase(char)
-     * @see     java.lang.Character#isTitleCase(char)
-     * @see     java.lang.Character#isUpperCase(char)
+     * @see     Character#isDigit(char)
+     * @see     Character#isLetter(char)
+     * @see     Character#isLetterOrDigit(char)
+     * @see     Character#isLowerCase(char)
+     * @see     Character#isTitleCase(char)
+     * @see     Character#isUpperCase(char)
      * @since   1.0.2
      */
     public static boolean isDefined(char ch) {
@@ -3652,12 +5056,12 @@
      * @param   codePoint the character (Unicode code point) to be tested.
      * @return  <code>true</code> if the character has a defined meaning
      *          in Unicode; <code>false</code> otherwise.
-     * @see     java.lang.Character#isDigit(int)
-     * @see     java.lang.Character#isLetter(int)
-     * @see     java.lang.Character#isLetterOrDigit(int)
-     * @see     java.lang.Character#isLowerCase(int)
-     * @see     java.lang.Character#isTitleCase(int)
-     * @see     java.lang.Character#isUpperCase(int)
+     * @see     Character#isDigit(int)
+     * @see     Character#isLetter(int)
+     * @see     Character#isLetterOrDigit(int)
+     * @see     Character#isLowerCase(int)
+     * @see     Character#isTitleCase(int)
+     * @see     Character#isUpperCase(int)
      * @since   1.5
      */
     public static boolean isDefined(int codePoint) {
@@ -3689,15 +5093,15 @@
      * @param   ch   the character to be tested.
      * @return  <code>true</code> if the character is a letter;
      *          <code>false</code> otherwise.
-     * @see     java.lang.Character#isDigit(char)
-     * @see     java.lang.Character#isJavaIdentifierStart(char)
-     * @see     java.lang.Character#isJavaLetter(char)
-     * @see     java.lang.Character#isJavaLetterOrDigit(char)
-     * @see     java.lang.Character#isLetterOrDigit(char)
-     * @see     java.lang.Character#isLowerCase(char)
-     * @see     java.lang.Character#isTitleCase(char)
-     * @see     java.lang.Character#isUnicodeIdentifierStart(char)
-     * @see     java.lang.Character#isUpperCase(char)
+     * @see     Character#isDigit(char)
+     * @see     Character#isJavaIdentifierStart(char)
+     * @see     Character#isJavaLetter(char)
+     * @see     Character#isJavaLetterOrDigit(char)
+     * @see     Character#isLetterOrDigit(char)
+     * @see     Character#isLowerCase(char)
+     * @see     Character#isTitleCase(char)
+     * @see     Character#isUnicodeIdentifierStart(char)
+     * @see     Character#isUpperCase(char)
      */
     public static boolean isLetter(char ch) {
         return isLetter((int)ch);
@@ -3723,13 +5127,13 @@
      * @param   codePoint the character (Unicode code point) to be tested.
      * @return  <code>true</code> if the character is a letter;
      *          <code>false</code> otherwise.
-     * @see     java.lang.Character#isDigit(int)
-     * @see     java.lang.Character#isJavaIdentifierStart(int)
-     * @see     java.lang.Character#isLetterOrDigit(int)
-     * @see     java.lang.Character#isLowerCase(int)
-     * @see     java.lang.Character#isTitleCase(int)
-     * @see     java.lang.Character#isUnicodeIdentifierStart(int)
-     * @see     java.lang.Character#isUpperCase(int)
+     * @see     Character#isDigit(int)
+     * @see     Character#isJavaIdentifierStart(int)
+     * @see     Character#isLetterOrDigit(int)
+     * @see     Character#isLowerCase(int)
+     * @see     Character#isTitleCase(int)
+     * @see     Character#isUnicodeIdentifierStart(int)
+     * @see     Character#isUpperCase(int)
      * @since   1.5
      */
     public static boolean isLetter(int codePoint) {
@@ -3757,12 +5161,12 @@
      * @param   ch   the character to be tested.
      * @return  <code>true</code> if the character is a letter or digit;
      *          <code>false</code> otherwise.
-     * @see     java.lang.Character#isDigit(char)
-     * @see     java.lang.Character#isJavaIdentifierPart(char)
-     * @see     java.lang.Character#isJavaLetter(char)
-     * @see     java.lang.Character#isJavaLetterOrDigit(char)
-     * @see     java.lang.Character#isLetter(char)
-     * @see     java.lang.Character#isUnicodeIdentifierPart(char)
+     * @see     Character#isDigit(char)
+     * @see     Character#isJavaIdentifierPart(char)
+     * @see     Character#isJavaLetter(char)
+     * @see     Character#isJavaLetterOrDigit(char)
+     * @see     Character#isLetter(char)
+     * @see     Character#isUnicodeIdentifierPart(char)
      * @since   1.0.2
      */
     public static boolean isLetterOrDigit(char ch) {
@@ -3780,10 +5184,10 @@
      * @param   codePoint the character (Unicode code point) to be tested.
      * @return  <code>true</code> if the character is a letter or digit;
      *          <code>false</code> otherwise.
-     * @see     java.lang.Character#isDigit(int)
-     * @see     java.lang.Character#isJavaIdentifierPart(int)
-     * @see     java.lang.Character#isLetter(int)
-     * @see     java.lang.Character#isUnicodeIdentifierPart(int)
+     * @see     Character#isDigit(int)
+     * @see     Character#isJavaIdentifierPart(int)
+     * @see     Character#isLetter(int)
+     * @see     Character#isUnicodeIdentifierPart(int)
      * @since   1.5
      */
     public static boolean isLetterOrDigit(int codePoint) {
@@ -3812,12 +5216,12 @@
      * @param   ch the character to be tested.
      * @return  <code>true</code> if the character may start a Java
      *          identifier; <code>false</code> otherwise.
-     * @see     java.lang.Character#isJavaLetterOrDigit(char)
-     * @see     java.lang.Character#isJavaIdentifierStart(char)
-     * @see     java.lang.Character#isJavaIdentifierPart(char)
-     * @see     java.lang.Character#isLetter(char)
-     * @see     java.lang.Character#isLetterOrDigit(char)
-     * @see     java.lang.Character#isUnicodeIdentifierStart(char)
+     * @see     Character#isJavaLetterOrDigit(char)
+     * @see     Character#isJavaIdentifierStart(char)
+     * @see     Character#isJavaIdentifierPart(char)
+     * @see     Character#isLetter(char)
+     * @see     Character#isLetterOrDigit(char)
+     * @see     Character#isUnicodeIdentifierStart(char)
      * @since   1.02
      * @deprecated Replaced by isJavaIdentifierStart(char).
      */
@@ -3847,13 +5251,13 @@
      * @param   ch the character to be tested.
      * @return  <code>true</code> if the character may be part of a
      *          Java identifier; <code>false</code> otherwise.
-     * @see     java.lang.Character#isJavaLetter(char)
-     * @see     java.lang.Character#isJavaIdentifierStart(char)
-     * @see     java.lang.Character#isJavaIdentifierPart(char)
-     * @see     java.lang.Character#isLetter(char)
-     * @see     java.lang.Character#isLetterOrDigit(char)
-     * @see     java.lang.Character#isUnicodeIdentifierPart(char)
-     * @see     java.lang.Character#isIdentifierIgnorable(char)
+     * @see     Character#isJavaLetter(char)
+     * @see     Character#isJavaIdentifierStart(char)
+     * @see     Character#isJavaIdentifierPart(char)
+     * @see     Character#isLetter(char)
+     * @see     Character#isLetterOrDigit(char)
+     * @see     Character#isUnicodeIdentifierPart(char)
+     * @see     Character#isIdentifierIgnorable(char)
      * @since   1.02
      * @deprecated Replaced by isJavaIdentifierPart(char).
      */
@@ -3883,9 +5287,9 @@
      * @param   ch the character to be tested.
      * @return  <code>true</code> if the character may start a Java identifier;
      *          <code>false</code> otherwise.
-     * @see     java.lang.Character#isJavaIdentifierPart(char)
-     * @see     java.lang.Character#isLetter(char)
-     * @see     java.lang.Character#isUnicodeIdentifierStart(char)
+     * @see     Character#isJavaIdentifierPart(char)
+     * @see     Character#isLetter(char)
+     * @see     Character#isUnicodeIdentifierStart(char)
      * @see     javax.lang.model.SourceVersion#isIdentifier(CharSequence)
      * @since   1.1
      */
@@ -3912,9 +5316,9 @@
      * @param   codePoint the character (Unicode code point) to be tested.
      * @return  <code>true</code> if the character may start a Java identifier;
      *          <code>false</code> otherwise.
-     * @see     java.lang.Character#isJavaIdentifierPart(int)
-     * @see     java.lang.Character#isLetter(int)
-     * @see     java.lang.Character#isUnicodeIdentifierStart(int)
+     * @see     Character#isJavaIdentifierPart(int)
+     * @see     Character#isLetter(int)
+     * @see     Character#isUnicodeIdentifierStart(int)
      * @see     javax.lang.model.SourceVersion#isIdentifier(CharSequence)
      * @since   1.5
      */
@@ -3948,10 +5352,10 @@
      * @param   ch      the character to be tested.
      * @return <code>true</code> if the character may be part of a
      *          Java identifier; <code>false</code> otherwise.
-     * @see     java.lang.Character#isIdentifierIgnorable(char)
-     * @see     java.lang.Character#isJavaIdentifierStart(char)
-     * @see     java.lang.Character#isLetterOrDigit(char)
-     * @see     java.lang.Character#isUnicodeIdentifierPart(char)
+     * @see     Character#isIdentifierIgnorable(char)
+     * @see     Character#isJavaIdentifierStart(char)
+     * @see     Character#isLetterOrDigit(char)
+     * @see     Character#isUnicodeIdentifierPart(char)
      * @see     javax.lang.model.SourceVersion#isIdentifier(CharSequence)
      * @since   1.1
      */
@@ -3981,10 +5385,10 @@
      * @param   codePoint the character (Unicode code point) to be tested.
      * @return <code>true</code> if the character may be part of a
      *          Java identifier; <code>false</code> otherwise.
-     * @see     java.lang.Character#isIdentifierIgnorable(int)
-     * @see     java.lang.Character#isJavaIdentifierStart(int)
-     * @see     java.lang.Character#isLetterOrDigit(int)
-     * @see     java.lang.Character#isUnicodeIdentifierPart(int)
+     * @see     Character#isIdentifierIgnorable(int)
+     * @see     Character#isJavaIdentifierStart(int)
+     * @see     Character#isLetterOrDigit(int)
+     * @see     Character#isUnicodeIdentifierPart(int)
      * @see     javax.lang.model.SourceVersion#isIdentifier(CharSequence)
      * @since   1.5
      */
@@ -4012,9 +5416,9 @@
      * @param   ch      the character to be tested.
      * @return  <code>true</code> if the character may start a Unicode
      *          identifier; <code>false</code> otherwise.
-     * @see     java.lang.Character#isJavaIdentifierStart(char)
-     * @see     java.lang.Character#isLetter(char)
-     * @see     java.lang.Character#isUnicodeIdentifierPart(char)
+     * @see     Character#isJavaIdentifierStart(char)
+     * @see     Character#isLetter(char)
+     * @see     Character#isUnicodeIdentifierPart(char)
      * @since   1.1
      */
     public static boolean isUnicodeIdentifierStart(char ch) {
@@ -4036,9 +5440,9 @@
      * @param   codePoint the character (Unicode code point) to be tested.
      * @return  <code>true</code> if the character may start a Unicode
      *          identifier; <code>false</code> otherwise.
-     * @see     java.lang.Character#isJavaIdentifierStart(int)
-     * @see     java.lang.Character#isLetter(int)
-     * @see     java.lang.Character#isUnicodeIdentifierPart(int)
+     * @see     Character#isJavaIdentifierStart(int)
+     * @see     Character#isLetter(int)
+     * @see     Character#isUnicodeIdentifierPart(int)
      * @since   1.5
      */
     public static boolean isUnicodeIdentifierStart(int codePoint) {
@@ -4070,10 +5474,10 @@
      * @param   ch      the character to be tested.
      * @return  <code>true</code> if the character may be part of a
      *          Unicode identifier; <code>false</code> otherwise.
-     * @see     java.lang.Character#isIdentifierIgnorable(char)
-     * @see     java.lang.Character#isJavaIdentifierPart(char)
-     * @see     java.lang.Character#isLetterOrDigit(char)
-     * @see     java.lang.Character#isUnicodeIdentifierStart(char)
+     * @see     Character#isIdentifierIgnorable(char)
+     * @see     Character#isJavaIdentifierPart(char)
+     * @see     Character#isLetterOrDigit(char)
+     * @see     Character#isUnicodeIdentifierStart(char)
      * @since   1.1
      */
     public static boolean isUnicodeIdentifierPart(char ch) {
@@ -4099,10 +5503,10 @@
      * @param   codePoint the character (Unicode code point) to be tested.
      * @return  <code>true</code> if the character may be part of a
      *          Unicode identifier; <code>false</code> otherwise.
-     * @see     java.lang.Character#isIdentifierIgnorable(int)
-     * @see     java.lang.Character#isJavaIdentifierPart(int)
-     * @see     java.lang.Character#isLetterOrDigit(int)
-     * @see     java.lang.Character#isUnicodeIdentifierStart(int)
+     * @see     Character#isIdentifierIgnorable(int)
+     * @see     Character#isJavaIdentifierPart(int)
+     * @see     Character#isLetterOrDigit(int)
+     * @see     Character#isUnicodeIdentifierStart(int)
      * @since   1.5
      */
     public static boolean isUnicodeIdentifierPart(int codePoint) {
@@ -4136,8 +5540,8 @@
      * @return  <code>true</code> if the character is an ignorable control
      *          character that may be part of a Java or Unicode identifier;
      *           <code>false</code> otherwise.
-     * @see     java.lang.Character#isJavaIdentifierPart(char)
-     * @see     java.lang.Character#isUnicodeIdentifierPart(char)
+     * @see     Character#isJavaIdentifierPart(char)
+     * @see     Character#isUnicodeIdentifierPart(char)
      * @since   1.1
      */
     public static boolean isIdentifierIgnorable(char ch) {
@@ -4166,8 +5570,8 @@
      * @return  <code>true</code> if the character is an ignorable control
      *          character that may be part of a Java or Unicode identifier;
      *          <code>false</code> otherwise.
-     * @see     java.lang.Character#isJavaIdentifierPart(int)
-     * @see     java.lang.Character#isUnicodeIdentifierPart(int)
+     * @see     Character#isJavaIdentifierPart(int)
+     * @see     Character#isUnicodeIdentifierPart(int)
      * @since   1.5
      */
     public static boolean isIdentifierIgnorable(int codePoint) {
@@ -4183,7 +5587,7 @@
      * does not always return <code>true</code> for some ranges of
      * characters, particularly those that are symbols or ideographs.
      *
-     * <p>In general, {@link java.lang.String#toLowerCase()} should be used to map
+     * <p>In general, {@link String#toLowerCase()} should be used to map
      * characters to lowercase. <code>String</code> case mapping methods
      * have several benefits over <code>Character</code> case mapping methods.
      * <code>String</code> case mapping methods can perform locale-sensitive
@@ -4198,8 +5602,8 @@
      * @param   ch   the character to be converted.
      * @return  the lowercase equivalent of the character, if any;
      *          otherwise, the character itself.
-     * @see     java.lang.Character#isLowerCase(char)
-     * @see     java.lang.String#toLowerCase()
+     * @see     Character#isLowerCase(char)
+     * @see     String#toLowerCase()
      */
     public static char toLowerCase(char ch) {
         return (char)toLowerCase((int)ch);
@@ -4215,7 +5619,7 @@
      * does not always return <code>true</code> for some ranges of
      * characters, particularly those that are symbols or ideographs.
      *
-     * <p>In general, {@link java.lang.String#toLowerCase()} should be used to map
+     * <p>In general, {@link String#toLowerCase()} should be used to map
      * characters to lowercase. <code>String</code> case mapping methods
      * have several benefits over <code>Character</code> case mapping methods.
      * <code>String</code> case mapping methods can perform locale-sensitive
@@ -4225,8 +5629,8 @@
      * @param   codePoint   the character (Unicode code point) to be converted.
      * @return  the lowercase equivalent of the character (Unicode code
      *          point), if any; otherwise, the character itself.
-     * @see     java.lang.Character#isLowerCase(int)
-     * @see     java.lang.String#toLowerCase()
+     * @see     Character#isLowerCase(int)
+     * @see     String#toLowerCase()
      *
      * @since   1.5
      */
@@ -4243,7 +5647,7 @@
      * does not always return <code>true</code> for some ranges of
      * characters, particularly those that are symbols or ideographs.
      *
-     * <p>In general, {@link java.lang.String#toUpperCase()} should be used to map
+     * <p>In general, {@link String#toUpperCase()} should be used to map
      * characters to uppercase. <code>String</code> case mapping methods
      * have several benefits over <code>Character</code> case mapping methods.
      * <code>String</code> case mapping methods can perform locale-sensitive
@@ -4258,8 +5662,8 @@
      * @param   ch   the character to be converted.
      * @return  the uppercase equivalent of the character, if any;
      *          otherwise, the character itself.
-     * @see     java.lang.Character#isUpperCase(char)
-     * @see     java.lang.String#toUpperCase()
+     * @see     Character#isUpperCase(char)
+     * @see     String#toUpperCase()
      */
     public static char toUpperCase(char ch) {
         return (char)toUpperCase((int)ch);
@@ -4275,7 +5679,7 @@
      * does not always return <code>true</code> for some ranges of
      * characters, particularly those that are symbols or ideographs.
      *
-     * <p>In general, {@link java.lang.String#toUpperCase()} should be used to map
+     * <p>In general, {@link String#toUpperCase()} should be used to map
      * characters to uppercase. <code>String</code> case mapping methods
      * have several benefits over <code>Character</code> case mapping methods.
      * <code>String</code> case mapping methods can perform locale-sensitive
@@ -4285,8 +5689,8 @@
      * @param   codePoint   the character (Unicode code point) to be converted.
      * @return  the uppercase equivalent of the character, if any;
      *          otherwise, the character itself.
-     * @see     java.lang.Character#isUpperCase(int)
-     * @see     java.lang.String#toUpperCase()
+     * @see     Character#isUpperCase(int)
+     * @see     String#toUpperCase()
      *
      * @since   1.5
      */
@@ -4317,9 +5721,9 @@
      * @param   ch   the character to be converted.
      * @return  the titlecase equivalent of the character, if any;
      *          otherwise, the character itself.
-     * @see     java.lang.Character#isTitleCase(char)
-     * @see     java.lang.Character#toLowerCase(char)
-     * @see     java.lang.Character#toUpperCase(char)
+     * @see     Character#isTitleCase(char)
+     * @see     Character#toLowerCase(char)
+     * @see     Character#toUpperCase(char)
      * @since   1.0.2
      */
     public static char toTitleCase(char ch) {
@@ -4344,9 +5748,9 @@
      * @param   codePoint   the character (Unicode code point) to be converted.
      * @return  the titlecase equivalent of the character, if any;
      *          otherwise, the character itself.
-     * @see     java.lang.Character#isTitleCase(int)
-     * @see     java.lang.Character#toLowerCase(int)
-     * @see     java.lang.Character#toUpperCase(int)
+     * @see     Character#isTitleCase(int)
+     * @see     Character#toLowerCase(int)
+     * @see     Character#toUpperCase(int)
      * @since   1.5
      */
     public static int toTitleCase(int codePoint) {
@@ -4388,8 +5792,8 @@
      * @param   radix   the radix.
      * @return  the numeric value represented by the character in the
      *          specified radix.
-     * @see     java.lang.Character#forDigit(int, int)
-     * @see     java.lang.Character#isDigit(char)
+     * @see     Character#forDigit(int, int)
+     * @see     Character#isDigit(char)
      */
     public static int digit(char ch, int radix) {
         return digit((int)ch, radix);
@@ -4425,8 +5829,8 @@
      * @param   radix   the radix.
      * @return  the numeric value represented by the character in the
      *          specified radix.
-     * @see     java.lang.Character#forDigit(int, int)
-     * @see     java.lang.Character#isDigit(int)
+     * @see     Character#forDigit(int, int)
+     * @see     Character#isDigit(int)
      * @since   1.5
      */
     public static int digit(int codePoint, int radix) {
@@ -4463,8 +5867,8 @@
      * @return  the numeric value of the character, as a nonnegative <code>int</code>
      *           value; -2 if the character has a numeric value that is not a
      *          nonnegative integer; -1 if the character has no numeric value.
-     * @see     java.lang.Character#forDigit(int, int)
-     * @see     java.lang.Character#isDigit(char)
+     * @see     Character#forDigit(int, int)
+     * @see     Character#isDigit(char)
      * @since   1.1
      */
     public static int getNumericValue(char ch) {
@@ -4496,8 +5900,8 @@
      * @return  the numeric value of the character, as a nonnegative <code>int</code>
      *          value; -2 if the character has a numeric value that is not a
      *          nonnegative integer; -1 if the character has no numeric value.
-     * @see     java.lang.Character#forDigit(int, int)
-     * @see     java.lang.Character#isDigit(int)
+     * @see     Character#forDigit(int, int)
+     * @see     Character#isDigit(int)
      * @since   1.5
      */
     public static int getNumericValue(int codePoint) {
@@ -4524,8 +5928,8 @@
      * @param      ch   the character to be tested.
      * @return     <code>true</code> if the character is ISO-LATIN-1 white
      *             space; <code>false</code> otherwise.
-     * @see        java.lang.Character#isSpaceChar(char)
-     * @see        java.lang.Character#isWhitespace(char)
+     * @see        Character#isSpaceChar(char)
+     * @see        Character#isWhitespace(char)
      * @deprecated Replaced by isWhitespace(char).
      */
     @Deprecated
@@ -4559,7 +5963,7 @@
      * @param   ch      the character to be tested.
      * @return  <code>true</code> if the character is a space character;
      *          <code>false</code> otherwise.
-     * @see     java.lang.Character#isWhitespace(char)
+     * @see     Character#isWhitespace(char)
      * @since   1.1
      */
     public static boolean isSpaceChar(char ch) {
@@ -4582,7 +5986,7 @@
      * @param   codePoint the character (Unicode code point) to be tested.
      * @return  <code>true</code> if the character is a space character;
      *          <code>false</code> otherwise.
-     * @see     java.lang.Character#isWhitespace(int)
+     * @see     Character#isWhitespace(int)
      * @since   1.5
      */
     public static boolean isSpaceChar(int codePoint) {
@@ -4620,7 +6024,7 @@
      * @param   ch the character to be tested.
      * @return  <code>true</code> if the character is a Java whitespace
      *          character; <code>false</code> otherwise.
-     * @see     java.lang.Character#isSpaceChar(char)
+     * @see     Character#isSpaceChar(char)
      * @since   1.1
      */
     public static boolean isWhitespace(char ch) {
@@ -4652,7 +6056,7 @@
      * @param   codePoint the character (Unicode code point) to be tested.
      * @return  <code>true</code> if the character is a Java whitespace
      *          character; <code>false</code> otherwise.
-     * @see     java.lang.Character#isSpaceChar(int)
+     * @see     Character#isSpaceChar(int)
      * @since   1.5
      */
     public static boolean isWhitespace(int codePoint) {
@@ -4675,8 +6079,8 @@
      * @return  <code>true</code> if the character is an ISO control character;
      *          <code>false</code> otherwise.
      *
-     * @see     java.lang.Character#isSpaceChar(char)
-     * @see     java.lang.Character#isWhitespace(char)
+     * @see     Character#isSpaceChar(char)
+     * @see     Character#isWhitespace(char)
      * @since   1.1
      */
     public static boolean isISOControl(char ch) {
@@ -4693,13 +6097,16 @@
      * @param   codePoint the character (Unicode code point) to be tested.
      * @return  <code>true</code> if the character is an ISO control character;
      *          <code>false</code> otherwise.
-     * @see     java.lang.Character#isSpaceChar(int)
-     * @see     java.lang.Character#isWhitespace(int)
+     * @see     Character#isSpaceChar(int)
+     * @see     Character#isWhitespace(int)
      * @since   1.5
      */
     public static boolean isISOControl(int codePoint) {
-        return (codePoint >= 0x0000 && codePoint <= 0x001F) ||
-            (codePoint >= 0x007F && codePoint <= 0x009F);
+        // Optimized form of:
+        //     (codePoint >= 0x00 && codePoint <= 0x1F) ||
+        //     (codePoint >= 0x7F && codePoint <= 0x9F);
+        return codePoint <= 0x9F &&
+            (codePoint >= 0x7F || (codePoint >>> 5 == 0));
     }
 
     /**
@@ -4713,36 +6120,36 @@
      * @param   ch      the character to be tested.
      * @return  a value of type <code>int</code> representing the
      *          character's general category.
-     * @see     java.lang.Character#COMBINING_SPACING_MARK
-     * @see     java.lang.Character#CONNECTOR_PUNCTUATION
-     * @see     java.lang.Character#CONTROL
-     * @see     java.lang.Character#CURRENCY_SYMBOL
-     * @see     java.lang.Character#DASH_PUNCTUATION
-     * @see     java.lang.Character#DECIMAL_DIGIT_NUMBER
-     * @see     java.lang.Character#ENCLOSING_MARK
-     * @see     java.lang.Character#END_PUNCTUATION
-     * @see     java.lang.Character#FINAL_QUOTE_PUNCTUATION
-     * @see     java.lang.Character#FORMAT
-     * @see     java.lang.Character#INITIAL_QUOTE_PUNCTUATION
-     * @see     java.lang.Character#LETTER_NUMBER
-     * @see     java.lang.Character#LINE_SEPARATOR
-     * @see     java.lang.Character#LOWERCASE_LETTER
-     * @see     java.lang.Character#MATH_SYMBOL
-     * @see     java.lang.Character#MODIFIER_LETTER
-     * @see     java.lang.Character#MODIFIER_SYMBOL
-     * @see     java.lang.Character#NON_SPACING_MARK
-     * @see     java.lang.Character#OTHER_LETTER
-     * @see     java.lang.Character#OTHER_NUMBER
-     * @see     java.lang.Character#OTHER_PUNCTUATION
-     * @see     java.lang.Character#OTHER_SYMBOL
-     * @see     java.lang.Character#PARAGRAPH_SEPARATOR
-     * @see     java.lang.Character#PRIVATE_USE
-     * @see     java.lang.Character#SPACE_SEPARATOR
-     * @see     java.lang.Character#START_PUNCTUATION
-     * @see     java.lang.Character#SURROGATE
-     * @see     java.lang.Character#TITLECASE_LETTER
-     * @see     java.lang.Character#UNASSIGNED
-     * @see     java.lang.Character#UPPERCASE_LETTER
+     * @see     Character#COMBINING_SPACING_MARK
+     * @see     Character#CONNECTOR_PUNCTUATION
+     * @see     Character#CONTROL
+     * @see     Character#CURRENCY_SYMBOL
+     * @see     Character#DASH_PUNCTUATION
+     * @see     Character#DECIMAL_DIGIT_NUMBER
+     * @see     Character#ENCLOSING_MARK
+     * @see     Character#END_PUNCTUATION
+     * @see     Character#FINAL_QUOTE_PUNCTUATION
+     * @see     Character#FORMAT
+     * @see     Character#INITIAL_QUOTE_PUNCTUATION
+     * @see     Character#LETTER_NUMBER
+     * @see     Character#LINE_SEPARATOR
+     * @see     Character#LOWERCASE_LETTER
+     * @see     Character#MATH_SYMBOL
+     * @see     Character#MODIFIER_LETTER
+     * @see     Character#MODIFIER_SYMBOL
+     * @see     Character#NON_SPACING_MARK
+     * @see     Character#OTHER_LETTER
+     * @see     Character#OTHER_NUMBER
+     * @see     Character#OTHER_PUNCTUATION
+     * @see     Character#OTHER_SYMBOL
+     * @see     Character#PARAGRAPH_SEPARATOR
+     * @see     Character#PRIVATE_USE
+     * @see     Character#SPACE_SEPARATOR
+     * @see     Character#START_PUNCTUATION
+     * @see     Character#SURROGATE
+     * @see     Character#TITLECASE_LETTER
+     * @see     Character#UNASSIGNED
+     * @see     Character#UPPERCASE_LETTER
      * @since   1.1
      */
     public static int getType(char ch) {
@@ -4811,9 +6218,9 @@
      * @param   radix   the radix.
      * @return  the <code>char</code> representation of the specified digit
      *          in the specified radix.
-     * @see     java.lang.Character#MIN_RADIX
-     * @see     java.lang.Character#MAX_RADIX
-     * @see     java.lang.Character#digit(char, int)
+     * @see     Character#MIN_RADIX
+     * @see     Character#MAX_RADIX
+     * @see     Character#digit(char, int)
      */
     public static char forDigit(int digit, int radix) {
         if ((digit >= radix) || (digit < 0)) {
@@ -4994,10 +6401,10 @@
      * @return  either the uppercase equivalent of the character, if
      *          any, or an error flag (<code>Character.ERROR</code>)
      *          that indicates that a 1:M <code>char</code> mapping exists.
-     * @see     java.lang.Character#isLowerCase(char)
-     * @see     java.lang.Character#isUpperCase(char)
-     * @see     java.lang.Character#toLowerCase(char)
-     * @see     java.lang.Character#toTitleCase(char)
+     * @see     Character#isLowerCase(char)
+     * @see     Character#isUpperCase(char)
+     * @see     Character#toLowerCase(char)
+     * @see     Character#toTitleCase(char)
      * @since 1.4
      */
     static int toUpperCaseEx(int codePoint) {
@@ -5018,8 +6425,7 @@
      */
     static char[] toUpperCaseCharArray(int codePoint) {
         // As of Unicode 4.0, 1:M uppercasings only happen in the BMP.
-        assert isValidCodePoint(codePoint) &&
-               !isSupplementaryCodePoint(codePoint);
+        assert isBmpCodePoint(codePoint);
         return CharacterData.of(codePoint).toUpperCaseCharArray(codePoint);
     }
 
@@ -5042,4 +6448,51 @@
     public static char reverseBytes(char ch) {
         return (char) (((ch & 0xFF00) >> 8) | (ch << 8));
     }
+
+    /**
+     * Returns the Unicode name of the specified character
+     * <code>codePoint</code>, or null if the code point is
+     * {@link #UNASSIGNED unassigned}.
+     * <p>
+     * Note: if the specified character is not assigned a name by
+     * the <i>UnicodeData</i> file (part of the Unicode Character
+     * Database maintained by the Unicode Consortium), the returned
+     * name is the same as the result of expression
+     *
+     * <blockquote><code>
+     *     Character.UnicodeBlock.of(codePoint)
+     *                           .toString()
+     *                           .replace('_', ' ')
+     *     + " "
+     *     + Integer.toHexString(codePoint).toUpperCase(Locale.ENGLISH);
+     *
+     * </code></blockquote>
+     *
+     * @param  codePoint the character (Unicode code point)
+     *
+     * @return the Unicode name of the specified character, or null if
+     *         the code point is unassigned.
+     *
+     * @exception IllegalArgumentException if the specified
+     *            <code>codePoint</code> is not a valid Unicode
+     *            code point.
+     *
+     * @since 1.7
+     */
+    public static String getName(int codePoint) {
+        if (!isValidCodePoint(codePoint)) {
+            throw new IllegalArgumentException();
+        }
+        String name = CharacterName.get(codePoint);
+        if (name != null)
+            return name;
+        if (getType(codePoint) == UNASSIGNED)
+            return null;
+        UnicodeBlock block = UnicodeBlock.of(codePoint);
+        if (block != null)
+            return block.toString().replace('_', ' ') + " "
+                   + Integer.toHexString(codePoint).toUpperCase(Locale.ENGLISH);
+        // should never come here
+        return Integer.toHexString(codePoint).toUpperCase(Locale.ENGLISH);
+    }
 }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/src/share/classes/java/lang/CharacterName.java	Wed Jul 21 09:57:21 2010 -0700
@@ -0,0 +1,106 @@
+/*
+ * Copyright 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 java.lang;
+
+import java.io.DataInputStream;
+import java.io.InputStream;
+import java.lang.ref.SoftReference;
+import java.util.Arrays;
+import java.util.zip.InflaterInputStream;
+import java.security.AccessController;
+import java.security.PrivilegedAction;
+
+class CharacterName {
+
+    private static SoftReference<byte[]> refStrPool;
+    private static int[][] lookup;
+
+    private static synchronized byte[] initNamePool() {
+        byte[] strPool = null;
+        if (refStrPool != null && (strPool = refStrPool.get()) != null)
+            return strPool;
+        DataInputStream dis = null;
+        try {
+            dis = new DataInputStream(new InflaterInputStream(
+                AccessController.doPrivileged(new PrivilegedAction<InputStream>()
+                {
+                    public InputStream run() {
+                        return getClass().getResourceAsStream("uniName.dat");
+                    }
+                })));
+
+            lookup = new int[(Character.MAX_CODE_POINT + 1) >> 8][];
+            int total = dis.readInt();
+            int cpEnd = dis.readInt();
+            byte ba[] = new byte[cpEnd];
+            dis.readFully(ba);
+
+            int nameOff = 0;
+            int cpOff = 0;
+            int cp = 0;
+            do {
+                int len = ba[cpOff++] & 0xff;
+                if (len == 0) {
+                    len = ba[cpOff++] & 0xff;
+                    // always big-endian
+                    cp = ((ba[cpOff++] & 0xff) << 16) |
+                         ((ba[cpOff++] & 0xff) <<  8) |
+                         ((ba[cpOff++] & 0xff));
+                }  else {
+                    cp++;
+                }
+                int hi = cp >> 8;
+                if (lookup[hi] == null) {
+                    lookup[hi] = new int[0x100];
+                }
+                lookup[hi][cp&0xff] = (nameOff << 8) | len;
+                nameOff += len;
+            } while (cpOff < cpEnd);
+            strPool = new byte[total - cpEnd];
+            dis.readFully(strPool);
+            refStrPool = new SoftReference<byte[]>(strPool);
+        } catch (Exception x) {
+            throw new InternalError(x.getMessage());
+        } finally {
+            try {
+                if (dis != null)
+                    dis.close();
+            } catch (Exception xx) {}
+        }
+        return strPool;
+    }
+
+    public static String get(int cp) {
+        byte[] strPool = null;
+        if (refStrPool == null || (strPool = refStrPool.get()) == null)
+            strPool = initNamePool();
+        int off = 0;
+        if (lookup[cp>>8] == null ||
+            (off = lookup[cp>>8][cp&0xff]) == 0)
+            return null;
+        return new String(strPool, 0, off >>> 8, off & 0xff);  // ASCII
+    }
+}
--- a/jdk/src/share/classes/java/lang/Math.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/share/classes/java/lang/Math.java	Wed Jul 21 09:57:21 2010 -0700
@@ -681,9 +681,9 @@
 
     private static Random randomNumberGenerator;
 
-    private static synchronized void initRNG() {
-        if (randomNumberGenerator == null)
-            randomNumberGenerator = new Random();
+    private static synchronized Random initRNG() {
+        Random rnd = randomNumberGenerator;
+        return (rnd == null) ? (randomNumberGenerator = new Random()) : rnd;
     }
 
     /**
@@ -694,9 +694,11 @@
      *
      * <p>When this method is first called, it creates a single new
      * pseudorandom-number generator, exactly as if by the expression
-     * <blockquote>{@code new java.util.Random}</blockquote> This
-     * new pseudorandom-number generator is used thereafter for all
-     * calls to this method and is used nowhere else.
+     *
+     * <blockquote>{@code new java.util.Random()}</blockquote>
+     *
+     * This new pseudorandom-number generator is used thereafter for
+     * all calls to this method and is used nowhere else.
      *
      * <p>This method is properly synchronized to allow correct use by
      * more than one thread. However, if many threads need to generate
@@ -705,11 +707,12 @@
      *
      * @return  a pseudorandom {@code double} greater than or equal
      * to {@code 0.0} and less than {@code 1.0}.
-     * @see     java.util.Random#nextDouble()
+     * @see Random#nextDouble()
      */
     public static double random() {
-        if (randomNumberGenerator == null) initRNG();
-        return randomNumberGenerator.nextDouble();
+        Random rnd = randomNumberGenerator;
+        if (rnd == null) rnd = initRNG();
+        return rnd.nextDouble();
     }
 
     /**
--- a/jdk/src/share/classes/java/lang/ProcessBuilder.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/share/classes/java/lang/ProcessBuilder.java	Wed Jul 21 09:57:21 2010 -0700
@@ -418,6 +418,8 @@
      * Implements a <a href="#redirect-output">null input stream</a>.
      */
     static class NullInputStream extends InputStream {
+        static final NullInputStream INSTANCE = new NullInputStream();
+        private NullInputStream() {}
         public int read()      { return -1; }
         public int available() { return 0; }
     }
@@ -426,6 +428,8 @@
      * Implements a <a href="#redirect-input">null output stream</a>.
      */
     static class NullOutputStream extends OutputStream {
+        static final NullOutputStream INSTANCE = new NullOutputStream();
+        private NullOutputStream() {}
         public void write(int b) throws IOException {
             throw new IOException("Stream closed");
         }
--- a/jdk/src/share/classes/java/lang/StrictMath.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/share/classes/java/lang/StrictMath.java	Wed Jul 21 09:57:21 2010 -0700
@@ -667,9 +667,9 @@
 
     private static Random randomNumberGenerator;
 
-    private static synchronized void initRNG() {
-        if (randomNumberGenerator == null)
-            randomNumberGenerator = new Random();
+    private static synchronized Random initRNG() {
+        Random rnd = randomNumberGenerator;
+        return (rnd == null) ? (randomNumberGenerator = new Random()) : rnd;
     }
 
     /**
@@ -680,9 +680,11 @@
      *
      * <p>When this method is first called, it creates a single new
      * pseudorandom-number generator, exactly as if by the expression
-     * <blockquote>{@code new java.util.Random}</blockquote> This
-     * new pseudorandom-number generator is used thereafter for all
-     * calls to this method and is used nowhere else.
+     *
+     * <blockquote>{@code new java.util.Random()}</blockquote>
+     *
+     * This new pseudorandom-number generator is used thereafter for
+     * all calls to this method and is used nowhere else.
      *
      * <p>This method is properly synchronized to allow correct use by
      * more than one thread. However, if many threads need to generate
@@ -691,11 +693,12 @@
      *
      * @return  a pseudorandom {@code double} greater than or equal
      * to {@code 0.0} and less than {@code 1.0}.
-     * @see     java.util.Random#nextDouble()
+     * @see Random#nextDouble()
      */
     public static double random() {
-        if (randomNumberGenerator == null) initRNG();
-        return randomNumberGenerator.nextDouble();
+        Random rnd = randomNumberGenerator;
+        if (rnd == null) rnd = initRNG();
+        return rnd.nextDouble();
     }
 
     /**
--- a/jdk/src/share/classes/java/lang/String.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/share/classes/java/lang/String.java	Wed Jul 21 09:57:21 2010 -0700
@@ -38,7 +38,6 @@
 import java.util.regex.Pattern;
 import java.util.regex.PatternSyntaxException;
 
-
 /**
  * The <code>String</code> class represents character strings. All
  * string literals in Java programs, such as <code>"abc"</code>, are
@@ -99,6 +98,8 @@
  *
  * @author  Lee Boynton
  * @author  Arthur van Hoff
+ * @author  Martin Buchholz
+ * @author  Ulf Zibis
  * @see     java.lang.Object#toString()
  * @see     java.lang.StringBuffer
  * @see     java.lang.StringBuilder
@@ -273,32 +274,32 @@
             throw new StringIndexOutOfBoundsException(offset + count);
         }
 
+        final int end = offset + count;
+
         // Pass 1: Compute precise size of char[]
-        int n = 0;
-        for (int i = offset; i < offset + count; i++) {
+        int n = count;
+        for (int i = offset; i < end; i++) {
             int c = codePoints[i];
-            if (c >= Character.MIN_CODE_POINT &&
-                c <  Character.MIN_SUPPLEMENTARY_CODE_POINT)
-                n += 1;
-            else if (Character.isSupplementaryCodePoint(c))
-                n += 2;
+            if (Character.isBmpCodePoint(c))
+                continue;
+            else if (Character.isValidCodePoint(c))
+                n++;
             else throw new IllegalArgumentException(Integer.toString(c));
         }
 
         // Pass 2: Allocate and fill in char[]
-        char[] v = new char[n];
-        for (int i = offset, j = 0; i < offset + count; i++) {
+        final char[] v = new char[n];
+
+        for (int i = offset, j = 0; i < end; i++, j++) {
             int c = codePoints[i];
-            if (c < Character.MIN_SUPPLEMENTARY_CODE_POINT) {
-                v[j++] = (char) c;
-            } else {
-                Character.toSurrogates(c, v, j);
-                j += 2;
-            }
+            if (Character.isBmpCodePoint(c))
+                v[j] = (char) c;
+            else
+                Character.toSurrogates(c, v, j++);
         }
 
         this.value  = v;
-        this.count  = v.length;
+        this.count  = n;
         this.offset = 0;
     }
 
@@ -1573,9 +1574,6 @@
      *          if the character does not occur.
      */
     public int indexOf(int ch, int fromIndex) {
-        int max = offset + count;
-        char v[] = value;
-
         if (fromIndex < 0) {
             fromIndex = 0;
         } else if (fromIndex >= count) {
@@ -1583,29 +1581,36 @@
             return -1;
         }
 
-        int i = offset + fromIndex;
         if (ch < Character.MIN_SUPPLEMENTARY_CODE_POINT) {
             // handle most cases here (ch is a BMP code point or a
             // negative value (invalid code point))
-            for (; i < max ; i++) {
-                if (v[i] == ch) {
+            final char[] value = this.value;
+            final int offset = this.offset;
+            final int max = offset + count;
+            for (int i = offset + fromIndex; i < max ; i++) {
+                if (value[i] == ch) {
                     return i - offset;
                 }
             }
             return -1;
+        } else {
+            return indexOfSupplementary(ch, fromIndex);
         }
+    }
 
-        if (ch <= Character.MAX_CODE_POINT) {
-            // handle supplementary characters here
-            char[] surrogates = Character.toChars(ch);
-            for (; i < max; i++) {
-                if (v[i] == surrogates[0]) {
-                    if (i + 1 == max) {
-                        break;
-                    }
-                    if (v[i+1] == surrogates[1]) {
-                        return i - offset;
-                    }
+    /**
+     * Handles (rare) calls of indexOf with a supplementary character.
+     */
+    private int indexOfSupplementary(int ch, int fromIndex) {
+        if (Character.isValidCodePoint(ch)) {
+            final char[] value = this.value;
+            final int offset = this.offset;
+            final char hi = Character.highSurrogate(ch);
+            final char lo = Character.lowSurrogate(ch);
+            final int max = offset + count - 1;
+            for (int i = offset + fromIndex; i < max; i++) {
+                if (value[i] == hi && value[i+1] == lo) {
+                    return i - offset;
                 }
             }
         }
@@ -1674,34 +1679,36 @@
      *          if the character does not occur before that point.
      */
     public int lastIndexOf(int ch, int fromIndex) {
-        int min = offset;
-        char v[] = value;
-
-        int i = offset + ((fromIndex >= count) ? count - 1 : fromIndex);
-
         if (ch < Character.MIN_SUPPLEMENTARY_CODE_POINT) {
             // handle most cases here (ch is a BMP code point or a
             // negative value (invalid code point))
-            for (; i >= min ; i--) {
-                if (v[i] == ch) {
+            final char[] value = this.value;
+            final int offset = this.offset;
+            int i = offset + Math.min(fromIndex, count - 1);
+            for (; i >= offset ; i--) {
+                if (value[i] == ch) {
                     return i - offset;
                 }
             }
             return -1;
+        } else {
+            return lastIndexOfSupplementary(ch, fromIndex);
         }
+    }
 
-        int max = offset + count;
-        if (ch <= Character.MAX_CODE_POINT) {
-            // handle supplementary characters here
-            char[] surrogates = Character.toChars(ch);
-            for (; i >= min; i--) {
-                if (v[i] == surrogates[0]) {
-                    if (i + 1 == max) {
-                        break;
-                    }
-                    if (v[i+1] == surrogates[1]) {
-                        return i - offset;
-                    }
+    /**
+     * Handles (rare) calls of lastIndexOf with a supplementary character.
+     */
+    private int lastIndexOfSupplementary(int ch, int fromIndex) {
+        if (Character.isValidCodePoint(ch)) {
+            final char[] value = this.value;
+            final int offset = this.offset;
+            char hi = Character.highSurrogate(ch);
+            char lo = Character.lowSurrogate(ch);
+            int i = offset + Math.min(fromIndex, count - 2);
+            for (; i >= offset; i--) {
+                if (value[i] == hi && value[i+1] == lo) {
+                    return i - offset;
                 }
             }
         }
@@ -1710,18 +1717,17 @@
 
     /**
      * Returns the index within this string of the first occurrence of the
-     * specified substring. The integer returned is the smallest value
-     * <i>k</i> such that:
+     * specified substring.
+     *
+     * <p>The returned index is the smallest value <i>k</i> for which:
      * <blockquote><pre>
      * this.startsWith(str, <i>k</i>)
      * </pre></blockquote>
-     * is <code>true</code>.
+     * If no such value of <i>k</i> exists, then {@code -1} is returned.
      *
-     * @param   str   any string.
-     * @return  if the string argument occurs as a substring within this
-     *          object, then the index of the first character of the first
-     *          such substring is returned; if it does not occur as a
-     *          substring, <code>-1</code> is returned.
+     * @param   str   the substring to search for.
+     * @return  the index of the first occurrence of the specified substring,
+     *          or {@code -1} if there is no such occurrence.
      */
     public int indexOf(String str) {
         return indexOf(str, 0);
@@ -1729,17 +1735,19 @@
 
     /**
      * Returns the index within this string of the first occurrence of the
-     * specified substring, starting at the specified index.  The integer
-     * returned is the smallest value <tt>k</tt> for which:
+     * specified substring, starting at the specified index.
+     *
+     * <p>The returned index is the smallest value <i>k</i> for which:
      * <blockquote><pre>
-     *     k &gt;= Math.min(fromIndex, this.length()) && this.startsWith(str, k)
+     * <i>k</i> &gt;= fromIndex && this.startsWith(str, <i>k</i>)
      * </pre></blockquote>
-     * If no such value of <i>k</i> exists, then -1 is returned.
+     * If no such value of <i>k</i> exists, then {@code -1} is returned.
      *
-     * @param   str         the substring for which to search.
+     * @param   str         the substring to search for.
      * @param   fromIndex   the index from which to start the search.
-     * @return  the index within this string of the first occurrence of the
-     *          specified substring, starting at the specified index.
+     * @return  the index of the first occurrence of the specified substring,
+     *          starting at the specified index,
+     *          or {@code -1} if there is no such occurrence.
      */
     public int indexOf(String str, int fromIndex) {
         return indexOf(value, offset, count,
@@ -1798,20 +1806,19 @@
     }
 
     /**
-     * Returns the index within this string of the rightmost occurrence
-     * of the specified substring.  The rightmost empty string "" is
-     * considered to occur at the index value <code>this.length()</code>.
-     * The returned index is the largest value <i>k</i> such that
+     * Returns the index within this string of the last occurrence of the
+     * specified substring.  The last occurrence of the empty string ""
+     * is considered to occur at the index value {@code this.length()}.
+     *
+     * <p>The returned index is the largest value <i>k</i> for which:
      * <blockquote><pre>
-     * this.startsWith(str, k)
+     * this.startsWith(str, <i>k</i>)
      * </pre></blockquote>
-     * is true.
+     * If no such value of <i>k</i> exists, then {@code -1} is returned.
      *
      * @param   str   the substring to search for.
-     * @return  if the string argument occurs one or more times as a substring
-     *          within this object, then the index of the first character of
-     *          the last such substring is returned. If it does not occur as
-     *          a substring, <code>-1</code> is returned.
+     * @return  the index of the last occurrence of the specified substring,
+     *          or {@code -1} if there is no such occurrence.
      */
     public int lastIndexOf(String str) {
         return lastIndexOf(str, count);
@@ -1820,16 +1827,18 @@
     /**
      * Returns the index within this string of the last occurrence of the
      * specified substring, searching backward starting at the specified index.
-     * The integer returned is the largest value <i>k</i> such that:
+     *
+     * <p>The returned index is the largest value <i>k</i> for which:
      * <blockquote><pre>
-     *     k &lt;= Math.min(fromIndex, this.length()) && this.startsWith(str, k)
+     * <i>k</i> &lt;= fromIndex && this.startsWith(str, <i>k</i>)
      * </pre></blockquote>
-     * If no such value of <i>k</i> exists, then -1 is returned.
+     * If no such value of <i>k</i> exists, then {@code -1} is returned.
      *
      * @param   str         the substring to search for.
      * @param   fromIndex   the index to start the search from.
-     * @return  the index within this string of the last occurrence of the
-     *          specified substring.
+     * @return  the index of the last occurrence of the specified substring,
+     *          searching backward from the specified index,
+     *          or {@code -1} if there is no such occurrence.
      */
     public int lastIndexOf(String str, int fromIndex) {
         return lastIndexOf(value, offset, count,
--- a/jdk/src/share/classes/java/lang/System.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/share/classes/java/lang/System.java	Wed Jul 21 09:57:21 2010 -0700
@@ -69,7 +69,7 @@
      * corresponds to keyboard input or another input source specified by
      * the host environment or user.
      */
-    public final static InputStream in = nullInputStream();
+    public final static InputStream in = null;
 
     /**
      * The "standard" output stream. This stream is already
@@ -96,7 +96,7 @@
      * @see     java.io.PrintStream#println(java.lang.Object)
      * @see     java.io.PrintStream#println(java.lang.String)
      */
-    public final static PrintStream out = nullPrintStream();
+    public final static PrintStream out = null;
 
     /**
      * The "standard" error output stream. This stream is already
@@ -110,7 +110,7 @@
      * variable <code>out</code>, has been redirected to a file or other
      * destination that is typically not continuously monitored.
      */
-    public final static PrintStream err = nullPrintStream();
+    public final static PrintStream err = null;
 
     /* The security manager for the system.
      */
@@ -1093,26 +1093,6 @@
     public static native String mapLibraryName(String libname);
 
     /**
-     * The following two methods exist because in, out, and err must be
-     * initialized to null.  The compiler, however, cannot be permitted to
-     * inline access to them, since they are later set to more sensible values
-     * by initializeSystemClass().
-     */
-    private static InputStream nullInputStream() throws NullPointerException {
-        if (currentTimeMillis() > 0) {
-            return null;
-        }
-        throw new NullPointerException();
-    }
-
-    private static PrintStream nullPrintStream() throws NullPointerException {
-        if (currentTimeMillis() > 0) {
-            return null;
-        }
-        throw new NullPointerException();
-    }
-
-    /**
      * Initialize the system class.  Called after thread initialization.
      */
     private static void initializeSystemClass() {
--- a/jdk/src/share/classes/java/lang/Throwable.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/share/classes/java/lang/Throwable.java	Wed Jul 21 09:57:21 2010 -0700
@@ -25,6 +25,7 @@
 
 package java.lang;
 import  java.io.*;
+import  java.util.*;
 
 /**
  * The <code>Throwable</code> class is the superclass of all errors and
@@ -102,7 +103,7 @@
  *         lowLevelOp();
  *     } catch (LowLevelException le) {
  *         throw (HighLevelException)
-                 new HighLevelException().initCause(le);  // Legacy constructor
+ *               new HighLevelException().initCause(le);  // Legacy constructor
  *     }
  * </pre>
  *
@@ -193,6 +194,24 @@
      */
 
     /**
+     * The list of suppressed exceptions, as returned by
+     * {@link #getSuppressedExceptions()}.
+     *
+     * @serial
+     * @since 1.7
+     */
+    private List<Throwable> suppressedExceptions = Collections.emptyList();
+
+    /** Message for trying to suppress a null exception. */
+    private static final String NULL_CAUSE_MESSAGE = "Cannot suppress a null exception.";
+
+    /** Caption  for labeling causative exception stack traces */
+    private static final String CAUSE_CAPTION = "Caused by: ";
+
+    /** Caption for labeling suppressed exception stack traces */
+    private static final String SUPPRESSED_CAPTION = "Suppressed: ";
+
+    /**
      * Constructs a new throwable with <code>null</code> as its detail message.
      * The cause is not initialized, and may subsequently be initialized by a
      * call to {@link #initCause}.
@@ -469,6 +488,52 @@
      * class LowLevelException extends Exception {
      * }
      * </pre>
+     * As of release 7, the platform supports the notion of
+     * <i>suppressed exceptions</i> (in conjunction with automatic
+     * resource management blocks). Any exceptions that were
+     * suppressed in order to deliver an exception are printed out
+     * beneath the stack trace.  The format of this information
+     * depends on the implementation, but the following example may be
+     * regarded as typical:
+     *
+     * <pre>
+     * Exception in thread "main" java.lang.Exception: Something happened
+     *  at Foo.bar(Foo.java:10)
+     *  at Foo.main(Foo.java:5)
+     *  Suppressed: Resource$CloseFailException: Resource ID = 0
+     *          at Resource.close(Resource.java:26)
+     *          at Foo.bar(Foo.java:9)
+     *          ... 1 more
+     * </pre>
+     * Note that the "... n more" notation is used on suppressed exceptions
+     * just at it is used on causes. Unlike causes, suppressed exceptions are
+     * indented beyond their "containing exceptions."
+     *
+     * <p>An exception can have both a cause and one or more suppressed
+     * exceptions:
+     * <pre>
+     * Exception in thread "main" java.lang.Exception: Main block
+     *  at Foo3.main(Foo3.java:7)
+     *  Suppressed: Resource$CloseFailException: Resource ID = 2
+     *          at Resource.close(Resource.java:26)
+     *          at Foo3.main(Foo3.java:5)
+     *  Suppressed: Resource$CloseFailException: Resource ID = 1
+     *          at Resource.close(Resource.java:26)
+     *          at Foo3.main(Foo3.java:5)
+     * Caused by: java.lang.Exception: I did it
+     *  at Foo3.main(Foo3.java:8)
+     * </pre>
+     * Likewise, a suppressed exception can have a cause:
+     * <pre>
+     * Exception in thread "main" java.lang.Exception: Main block
+     *  at Foo4.main(Foo4.java:6)
+     *  Suppressed: Resource2$CloseFailException: Resource ID = 1
+     *          at Resource2.close(Resource2.java:20)
+     *          at Foo4.main(Foo4.java:5)
+     *  Caused by: java.lang.Exception: Rats, you caught me
+     *          at Resource2$CloseFailException.<init>(Resource2.java:45)
+     *          ... 2 more
+     * </pre>
      */
     public void printStackTrace() {
         printStackTrace(System.err);
@@ -480,44 +545,71 @@
      * @param s <code>PrintStream</code> to use for output
      */
     public void printStackTrace(PrintStream s) {
-        synchronized (s) {
+        printStackTrace(new WrappedPrintStream(s));
+    }
+
+    private void printStackTrace(PrintStreamOrWriter s) {
+        Set<Throwable> dejaVu = new HashSet<Throwable>();
+        dejaVu.add(this);
+
+        synchronized (s.lock()) {
+            // Print our stack trace
             s.println(this);
             StackTraceElement[] trace = getOurStackTrace();
-            for (int i=0; i < trace.length; i++)
-                s.println("\tat " + trace[i]);
+            for (StackTraceElement traceElement : trace)
+                s.println("\tat " + traceElement);
 
+            // Print suppressed exceptions, if any
+            for (Throwable se : suppressedExceptions)
+                se.printEnclosedStackTrace(s, trace, SUPPRESSED_CAPTION, "\t", dejaVu);
+
+            // Print cause, if any
             Throwable ourCause = getCause();
             if (ourCause != null)
-                ourCause.printStackTraceAsCause(s, trace);
+                ourCause.printEnclosedStackTrace(s, trace, CAUSE_CAPTION, "", dejaVu);
         }
     }
 
     /**
-     * Print our stack trace as a cause for the specified stack trace.
+     * Print our stack trace as an enclosed exception for the specified
+     * stack trace.
      */
-    private void printStackTraceAsCause(PrintStream s,
-                                        StackTraceElement[] causedTrace)
-    {
-        // assert Thread.holdsLock(s);
+    private void printEnclosedStackTrace(PrintStreamOrWriter s,
+                                         StackTraceElement[] enclosingTrace,
+                                         String caption,
+                                         String prefix,
+                                         Set<Throwable> dejaVu) {
+        assert Thread.holdsLock(s.lock());
+        if (dejaVu.contains(this)) {
+            s.println("\t[CIRCULAR REFERENCE:" + this + "]");
+        } else {
+            dejaVu.add(this);
+            // Compute number of frames in common between this and enclosing trace
+            StackTraceElement[] trace = getOurStackTrace();
+            int m = trace.length - 1;
+            int n = enclosingTrace.length - 1;
+            while (m >= 0 && n >=0 && trace[m].equals(enclosingTrace[n])) {
+                m--; n--;
+            }
+            int framesInCommon = trace.length - 1 - m;
 
-        // Compute number of frames in common between this and caused
-        StackTraceElement[] trace = getOurStackTrace();
-        int m = trace.length-1, n = causedTrace.length-1;
-        while (m >= 0 && n >=0 && trace[m].equals(causedTrace[n])) {
-            m--; n--;
+            // Print our stack trace
+            s.println(prefix + caption + this);
+            for (int i = 0; i <= m; i++)
+                s.println(prefix + "\tat " + trace[i]);
+            if (framesInCommon != 0)
+                s.println(prefix + "\t... " + framesInCommon + " more");
+
+            // Print suppressed exceptions, if any
+            for (Throwable se : suppressedExceptions)
+                se.printEnclosedStackTrace(s, trace, SUPPRESSED_CAPTION,
+                                           prefix +"\t", dejaVu);
+
+            // Print cause, if any
+            Throwable ourCause = getCause();
+            if (ourCause != null)
+                ourCause.printEnclosedStackTrace(s, trace, CAUSE_CAPTION, prefix, dejaVu);
         }
-        int framesInCommon = trace.length - 1 - m;
-
-        s.println("Caused by: " + this);
-        for (int i=0; i <= m; i++)
-            s.println("\tat " + trace[i]);
-        if (framesInCommon != 0)
-            s.println("\t... " + framesInCommon + " more");
-
-        // Recurse if we have a cause
-        Throwable ourCause = getCause();
-        if (ourCause != null)
-            ourCause.printStackTraceAsCause(s, trace);
     }
 
     /**
@@ -528,44 +620,51 @@
      * @since   JDK1.1
      */
     public void printStackTrace(PrintWriter s) {
-        synchronized (s) {
-            s.println(this);
-            StackTraceElement[] trace = getOurStackTrace();
-            for (int i=0; i < trace.length; i++)
-                s.println("\tat " + trace[i]);
-
-            Throwable ourCause = getCause();
-            if (ourCause != null)
-                ourCause.printStackTraceAsCause(s, trace);
-        }
+        printStackTrace(new WrappedPrintWriter(s));
     }
 
     /**
-     * Print our stack trace as a cause for the specified stack trace.
+     * Wrapper class for PrintStream and PrintWriter to enable a single
+     * implementation of printStackTrace.
      */
-    private void printStackTraceAsCause(PrintWriter s,
-                                        StackTraceElement[] causedTrace)
-    {
-        // assert Thread.holdsLock(s);
+    private abstract static class PrintStreamOrWriter {
+        /** Returns the object to be locked when using this StreamOrWriter */
+        abstract Object lock();
+
+        /** Prints the specified string as a line on this StreamOrWriter */
+        abstract void println(Object o);
+    }
 
-        // Compute number of frames in common between this and caused
-        StackTraceElement[] trace = getOurStackTrace();
-        int m = trace.length-1, n = causedTrace.length-1;
-        while (m >= 0 && n >=0 && trace[m].equals(causedTrace[n])) {
-            m--; n--;
+    private static class WrappedPrintStream extends PrintStreamOrWriter {
+        private final PrintStream printStream;
+
+        WrappedPrintStream(PrintStream printStream) {
+            this.printStream = printStream;
+        }
+
+        Object lock() {
+            return printStream;
         }
-        int framesInCommon = trace.length - 1 - m;
+
+        void println(Object o) {
+            printStream.println(o);
+        }
+    }
+
+    private static class WrappedPrintWriter extends PrintStreamOrWriter {
+        private final PrintWriter printWriter;
 
-        s.println("Caused by: " + this);
-        for (int i=0; i <= m; i++)
-            s.println("\tat " + trace[i]);
-        if (framesInCommon != 0)
-            s.println("\t... " + framesInCommon + " more");
+        WrappedPrintWriter(PrintWriter printWriter) {
+            this.printWriter = printWriter;
+        }
 
-        // Recurse if we have a cause
-        Throwable ourCause = getCause();
-        if (ourCause != null)
-            ourCause.printStackTraceAsCause(s, trace);
+        Object lock() {
+            return printWriter;
+        }
+
+        void println(Object o) {
+            printWriter.println(o);
+        }
     }
 
     /**
@@ -667,10 +766,60 @@
      */
     native StackTraceElement getStackTraceElement(int index);
 
-    private synchronized void writeObject(java.io.ObjectOutputStream s)
+    private void readObject(ObjectInputStream s)
+        throws IOException, ClassNotFoundException {
+        s.defaultReadObject();     // read in all fields
+        List<Throwable> suppressed = Collections.emptyList();
+        if (suppressedExceptions != null &&
+            !suppressedExceptions.isEmpty()) { // Copy Throwables to new list
+            suppressed = new ArrayList<Throwable>();
+            for(Throwable t : suppressedExceptions) {
+                if (t == null)
+                    throw new NullPointerException(NULL_CAUSE_MESSAGE);
+                suppressed.add(t);
+            }
+        }
+        suppressedExceptions = suppressed;
+    }
+
+    private synchronized void writeObject(ObjectOutputStream s)
         throws IOException
     {
         getOurStackTrace();  // Ensure that stackTrace field is initialized.
         s.defaultWriteObject();
     }
+
+    /**
+     * Adds the specified exception to the list of exceptions that
+     * were suppressed, typically by the automatic resource management
+     * statement, in order to deliver this exception.
+     *
+     * @param exception the exception to be added to the list of
+     *        suppressed exceptions
+     * @throws NullPointerException if {@code exception} is null
+     * @since 1.7
+     */
+    public synchronized void addSuppressedException(Throwable exception) {
+        if (exception == null)
+            throw new NullPointerException(NULL_CAUSE_MESSAGE);
+
+        if (suppressedExceptions.size() == 0)
+            suppressedExceptions = new ArrayList<Throwable>();
+        suppressedExceptions.add(exception);
+    }
+
+    private static final Throwable[] EMPTY_THROWABLE_ARRAY = new Throwable[0];
+
+    /**
+     * Returns an array containing all of the exceptions that were
+     * suppressed, typically by the automatic resource management
+     * statement, in order to deliver this exception.
+     *
+     * @return an array containing all of the exceptions that were
+     *         suppressed to deliver this exception.
+     * @since 1.7
+     */
+    public Throwable[] getSuppressedExceptions() {
+        return suppressedExceptions.toArray(EMPTY_THROWABLE_ARRAY);
+    }
 }
--- a/jdk/src/share/classes/java/net/Inet6Address.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/share/classes/java/net/Inet6Address.java	Wed Jul 21 09:57:21 2010 -0700
@@ -427,8 +427,9 @@
                     try {
                         scope_id = deriveNumericScope (scope_ifname);
                     } catch (UnknownHostException e) {
-                        // should not happen
-                        assert false;
+                        // typically should not happen, but it may be that
+                        // the machine being used for deserialization has
+                        // the same interface name but without IPv6 configured.
                     }
                 }
             } catch (SocketException e) {}
--- a/jdk/src/share/classes/java/net/URI.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/share/classes/java/net/URI.java	Wed Jul 21 09:57:21 2010 -0700
@@ -457,7 +457,7 @@
  * @author Mark Reinhold
  * @since 1.4
  *
- * @see <a href="http://ietf.org/rfc/rfc2279.txt"><i>RFC&nbsp;2279: UTF-8, a
+ * @see <a href="http://www.ietf.org/rfc/rfc2279.txt"><i>RFC&nbsp;2279: UTF-8, a
  * transformation format of ISO 10646</i></a>, <br><a
  * href="http://www.ietf.org/rfc/rfc2373.txt"><i>RFC&nbsp;2373: IPv6 Addressing
  * Architecture</i></a>, <br><a
@@ -2491,6 +2491,8 @@
 
     // Tell whether the given character is permitted by the given mask pair
     private static boolean match(char c, long lowMask, long highMask) {
+        if (c == 0) // 0 doesn't have a slot in the mask. So, it never matches.
+            return false;
         if (c < 64)
             return ((1L << c) & lowMask) != 0;
         if (c < 128)
--- a/jdk/src/share/classes/java/nio/Bits.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/share/classes/java/nio/Bits.java	Wed Jul 21 09:57:21 2010 -0700
@@ -41,25 +41,19 @@
     // -- Swapping --
 
     static short swap(short x) {
-        return (short)((x << 8) |
-                       ((char)x >>> 8));
+        return Short.reverseBytes(x);
     }
 
     static char swap(char x) {
-        return (char)((x << 8) |
-                      (x >>> 8));
+        return Character.reverseBytes(x);
     }
 
     static int swap(int x) {
-        return ((x << 24) |
-                ((x & 0x0000ff00) <<  8) |
-                ((x & 0x00ff0000) >>> 8) |
-                (x >>> 24));
+        return Integer.reverseBytes(x);
     }
 
     static long swap(long x) {
-        return (((long)swap((int)x) << 32) |
-                ((long)swap((int)(x >>> 32)) & 0xffffffffL));
+        return Long.reverseBytes(x);
     }
 
 
@@ -71,52 +65,52 @@
 
     static char getCharL(ByteBuffer bb, int bi) {
         return makeChar(bb._get(bi + 1),
-                        bb._get(bi + 0));
+                        bb._get(bi    ));
     }
 
     static char getCharL(long a) {
         return makeChar(_get(a + 1),
-                        _get(a + 0));
+                        _get(a    ));
     }
 
     static char getCharB(ByteBuffer bb, int bi) {
-        return makeChar(bb._get(bi + 0),
+        return makeChar(bb._get(bi    ),
                         bb._get(bi + 1));
     }
 
     static char getCharB(long a) {
-        return makeChar(_get(a + 0),
+        return makeChar(_get(a    ),
                         _get(a + 1));
     }
 
     static char getChar(ByteBuffer bb, int bi, boolean bigEndian) {
-        return (bigEndian ? getCharB(bb, bi) : getCharL(bb, bi));
+        return bigEndian ? getCharB(bb, bi) : getCharL(bb, bi);
     }
 
     static char getChar(long a, boolean bigEndian) {
-        return (bigEndian ? getCharB(a) : getCharL(a));
+        return bigEndian ? getCharB(a) : getCharL(a);
     }
 
     private static byte char1(char x) { return (byte)(x >> 8); }
-    private static byte char0(char x) { return (byte)(x >> 0); }
+    private static byte char0(char x) { return (byte)(x     ); }
 
     static void putCharL(ByteBuffer bb, int bi, char x) {
-        bb._put(bi + 0, char0(x));
+        bb._put(bi    , char0(x));
         bb._put(bi + 1, char1(x));
     }
 
     static void putCharL(long a, char x) {
-        _put(a + 0, char0(x));
+        _put(a    , char0(x));
         _put(a + 1, char1(x));
     }
 
     static void putCharB(ByteBuffer bb, int bi, char x) {
-        bb._put(bi + 0, char1(x));
+        bb._put(bi    , char1(x));
         bb._put(bi + 1, char0(x));
     }
 
     static void putCharB(long a, char x) {
-        _put(a + 0, char1(x));
+        _put(a    , char1(x));
         _put(a + 1, char0(x));
     }
 
@@ -143,52 +137,52 @@
 
     static short getShortL(ByteBuffer bb, int bi) {
         return makeShort(bb._get(bi + 1),
-                         bb._get(bi + 0));
+                         bb._get(bi    ));
     }
 
     static short getShortL(long a) {
         return makeShort(_get(a + 1),
-                         _get(a));
+                         _get(a    ));
     }
 
     static short getShortB(ByteBuffer bb, int bi) {
-        return makeShort(bb._get(bi + 0),
+        return makeShort(bb._get(bi    ),
                          bb._get(bi + 1));
     }
 
     static short getShortB(long a) {
-        return makeShort(_get(a),
+        return makeShort(_get(a    ),
                          _get(a + 1));
     }
 
     static short getShort(ByteBuffer bb, int bi, boolean bigEndian) {
-        return (bigEndian ? getShortB(bb, bi) : getShortL(bb, bi));
+        return bigEndian ? getShortB(bb, bi) : getShortL(bb, bi);
     }
 
     static short getShort(long a, boolean bigEndian) {
-        return (bigEndian ? getShortB(a) : getShortL(a));
+        return bigEndian ? getShortB(a) : getShortL(a);
     }
 
     private static byte short1(short x) { return (byte)(x >> 8); }
-    private static byte short0(short x) { return (byte)(x >> 0); }
+    private static byte short0(short x) { return (byte)(x     ); }
 
     static void putShortL(ByteBuffer bb, int bi, short x) {
-        bb._put(bi + 0, short0(x));
+        bb._put(bi    , short0(x));
         bb._put(bi + 1, short1(x));
     }
 
     static void putShortL(long a, short x) {
-        _put(a, short0(x));
+        _put(a    , short0(x));
         _put(a + 1, short1(x));
     }
 
     static void putShortB(ByteBuffer bb, int bi, short x) {
-        bb._put(bi + 0, short1(x));
+        bb._put(bi    , short1(x));
         bb._put(bi + 1, short0(x));
     }
 
     static void putShortB(long a, short x) {
-        _put(a, short1(x));
+        _put(a    , short1(x));
         _put(a + 1, short0(x));
     }
 
@@ -210,76 +204,76 @@
     // -- get/put int --
 
     static private int makeInt(byte b3, byte b2, byte b1, byte b0) {
-        return (((b3 & 0xff) << 24) |
+        return (((b3       ) << 24) |
                 ((b2 & 0xff) << 16) |
                 ((b1 & 0xff) <<  8) |
-                ((b0 & 0xff) <<  0));
+                ((b0 & 0xff)      ));
     }
 
     static int getIntL(ByteBuffer bb, int bi) {
         return makeInt(bb._get(bi + 3),
                        bb._get(bi + 2),
                        bb._get(bi + 1),
-                       bb._get(bi + 0));
+                       bb._get(bi    ));
     }
 
     static int getIntL(long a) {
         return makeInt(_get(a + 3),
                        _get(a + 2),
                        _get(a + 1),
-                       _get(a + 0));
+                       _get(a    ));
     }
 
     static int getIntB(ByteBuffer bb, int bi) {
-        return makeInt(bb._get(bi + 0),
+        return makeInt(bb._get(bi    ),
                        bb._get(bi + 1),
                        bb._get(bi + 2),
                        bb._get(bi + 3));
     }
 
     static int getIntB(long a) {
-        return makeInt(_get(a + 0),
+        return makeInt(_get(a    ),
                        _get(a + 1),
                        _get(a + 2),
                        _get(a + 3));
     }
 
     static int getInt(ByteBuffer bb, int bi, boolean bigEndian) {
-        return (bigEndian ? getIntB(bb, bi) : getIntL(bb, bi));
+        return bigEndian ? getIntB(bb, bi) : getIntL(bb, bi) ;
     }
 
     static int getInt(long a, boolean bigEndian) {
-        return (bigEndian ? getIntB(a) : getIntL(a));
+        return bigEndian ? getIntB(a) : getIntL(a) ;
     }
 
     private static byte int3(int x) { return (byte)(x >> 24); }
     private static byte int2(int x) { return (byte)(x >> 16); }
     private static byte int1(int x) { return (byte)(x >>  8); }
-    private static byte int0(int x) { return (byte)(x >>  0); }
+    private static byte int0(int x) { return (byte)(x      ); }
 
     static void putIntL(ByteBuffer bb, int bi, int x) {
         bb._put(bi + 3, int3(x));
         bb._put(bi + 2, int2(x));
         bb._put(bi + 1, int1(x));
-        bb._put(bi + 0, int0(x));
+        bb._put(bi    , int0(x));
     }
 
     static void putIntL(long a, int x) {
         _put(a + 3, int3(x));
         _put(a + 2, int2(x));
         _put(a + 1, int1(x));
-        _put(a + 0, int0(x));
+        _put(a    , int0(x));
     }
 
     static void putIntB(ByteBuffer bb, int bi, int x) {
-        bb._put(bi + 0, int3(x));
+        bb._put(bi    , int3(x));
         bb._put(bi + 1, int2(x));
         bb._put(bi + 2, int1(x));
         bb._put(bi + 3, int0(x));
     }
 
     static void putIntB(long a, int x) {
-        _put(a + 0, int3(x));
+        _put(a    , int3(x));
         _put(a + 1, int2(x));
         _put(a + 2, int1(x));
         _put(a + 3, int0(x));
@@ -305,14 +299,14 @@
     static private long makeLong(byte b7, byte b6, byte b5, byte b4,
                                  byte b3, byte b2, byte b1, byte b0)
     {
-        return ((((long)b7 & 0xff) << 56) |
+        return ((((long)b7       ) << 56) |
                 (((long)b6 & 0xff) << 48) |
                 (((long)b5 & 0xff) << 40) |
                 (((long)b4 & 0xff) << 32) |
                 (((long)b3 & 0xff) << 24) |
                 (((long)b2 & 0xff) << 16) |
                 (((long)b1 & 0xff) <<  8) |
-                (((long)b0 & 0xff) <<  0));
+                (((long)b0 & 0xff)      ));
     }
 
     static long getLongL(ByteBuffer bb, int bi) {
@@ -323,7 +317,7 @@
                         bb._get(bi + 3),
                         bb._get(bi + 2),
                         bb._get(bi + 1),
-                        bb._get(bi + 0));
+                        bb._get(bi    ));
     }
 
     static long getLongL(long a) {
@@ -334,11 +328,11 @@
                         _get(a + 3),
                         _get(a + 2),
                         _get(a + 1),
-                        _get(a + 0));
+                        _get(a    ));
     }
 
     static long getLongB(ByteBuffer bb, int bi) {
-        return makeLong(bb._get(bi + 0),
+        return makeLong(bb._get(bi    ),
                         bb._get(bi + 1),
                         bb._get(bi + 2),
                         bb._get(bi + 3),
@@ -349,7 +343,7 @@
     }
 
     static long getLongB(long a) {
-        return makeLong(_get(a + 0),
+        return makeLong(_get(a    ),
                         _get(a + 1),
                         _get(a + 2),
                         _get(a + 3),
@@ -360,11 +354,11 @@
     }
 
     static long getLong(ByteBuffer bb, int bi, boolean bigEndian) {
-        return (bigEndian ? getLongB(bb, bi) : getLongL(bb, bi));
+        return bigEndian ? getLongB(bb, bi) : getLongL(bb, bi);
     }
 
     static long getLong(long a, boolean bigEndian) {
-        return (bigEndian ? getLongB(a) : getLongL(a));
+        return bigEndian ? getLongB(a) : getLongL(a);
     }
 
     private static byte long7(long x) { return (byte)(x >> 56); }
@@ -374,7 +368,7 @@
     private static byte long3(long x) { return (byte)(x >> 24); }
     private static byte long2(long x) { return (byte)(x >> 16); }
     private static byte long1(long x) { return (byte)(x >>  8); }
-    private static byte long0(long x) { return (byte)(x >>  0); }
+    private static byte long0(long x) { return (byte)(x      ); }
 
     static void putLongL(ByteBuffer bb, int bi, long x) {
         bb._put(bi + 7, long7(x));
@@ -384,7 +378,7 @@
         bb._put(bi + 3, long3(x));
         bb._put(bi + 2, long2(x));
         bb._put(bi + 1, long1(x));
-        bb._put(bi + 0, long0(x));
+        bb._put(bi    , long0(x));
     }
 
     static void putLongL(long a, long x) {
@@ -395,11 +389,11 @@
         _put(a + 3, long3(x));
         _put(a + 2, long2(x));
         _put(a + 1, long1(x));
-        _put(a + 0, long0(x));
+        _put(a    , long0(x));
     }
 
     static void putLongB(ByteBuffer bb, int bi, long x) {
-        bb._put(bi + 0, long7(x));
+        bb._put(bi    , long7(x));
         bb._put(bi + 1, long6(x));
         bb._put(bi + 2, long5(x));
         bb._put(bi + 3, long4(x));
@@ -410,7 +404,7 @@
     }
 
     static void putLongB(long a, long x) {
-        _put(a + 0, long7(x));
+        _put(a    , long7(x));
         _put(a + 1, long6(x));
         _put(a + 2, long5(x));
         _put(a + 3, long4(x));
@@ -454,11 +448,11 @@
     }
 
     static float getFloat(ByteBuffer bb, int bi, boolean bigEndian) {
-        return (bigEndian ? getFloatB(bb, bi) : getFloatL(bb, bi));
+        return bigEndian ? getFloatB(bb, bi) : getFloatL(bb, bi);
     }
 
     static float getFloat(long a, boolean bigEndian) {
-        return (bigEndian ? getFloatB(a) : getFloatL(a));
+        return bigEndian ? getFloatB(a) : getFloatL(a);
     }
 
     static void putFloatL(ByteBuffer bb, int bi, float x) {
@@ -511,11 +505,11 @@
     }
 
     static double getDouble(ByteBuffer bb, int bi, boolean bigEndian) {
-        return (bigEndian ? getDoubleB(bb, bi) : getDoubleL(bb, bi));
+        return bigEndian ? getDoubleB(bb, bi) : getDoubleL(bb, bi);
     }
 
     static double getDouble(long a, boolean bigEndian) {
-        return (bigEndian ? getDoubleB(a) : getDoubleL(a));
+        return bigEndian ? getDoubleB(a) : getDoubleL(a);
     }
 
     static void putDoubleL(ByteBuffer bb, int bi, double x) {
@@ -794,7 +788,7 @@
     static native void copyFromIntArray(Object src, long srcPos, long dstAddr,
                                         long length);
     static native void copyToIntArray(long srcAddr, Object dst, long dstPos,
-                                        long length);
+                                      long length);
 
     static native void copyFromLongArray(Object src, long srcPos, long dstAddr,
                                          long length);
--- a/jdk/src/share/classes/java/nio/channels/FileLock.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/share/classes/java/nio/channels/FileLock.java	Wed Jul 21 09:57:21 2010 -0700
@@ -116,7 +116,7 @@
  * @since 1.4
  */
 
-public abstract class FileLock {
+public abstract class FileLock implements AutoCloseable {
 
     private final Channel channel;
     private final long position;
@@ -299,6 +299,17 @@
     public abstract void release() throws IOException;
 
     /**
+     * This method invokes the {@link #release} method. It was added
+     * to the class so that it could be used in conjunction with the
+     * automatic resource management block construct.
+     *
+     * @since 1.7
+     */
+    public final void close() throws IOException {
+        release();
+    }
+
+    /**
      * Returns a string describing the range, type, and validity of this lock.
      *
      * @return  A descriptive string
--- a/jdk/src/share/classes/java/nio/charset/package.html	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/share/classes/java/nio/charset/package.html	Wed Jul 21 09:57:21 2010 -0700
@@ -48,7 +48,7 @@
 
 <p> A <i>charset</i> is named mapping between sequences of sixteen-bit Unicode
 characters and sequences of bytes, in the sense defined in <a
-href="http://ietf.org/rfc/rfc2278.txt"><i>RFC&nbsp;2278</i></a>.  A
+href="http://www.ietf.org/rfc/rfc2278.txt"><i>RFC&nbsp;2278</i></a>.  A
 <i>decoder</i> is an engine which transforms bytes in a specific charset into
 characters, and an <i>encoder</i> is an engine which transforms characters into
 bytes.  Encoders and decoders operate on byte and character buffers.  They are
--- a/jdk/src/share/classes/java/security/Security.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/share/classes/java/security/Security.java	Wed Jul 21 09:57:21 2010 -0700
@@ -678,7 +678,7 @@
             spiMap.put(type, clazz);
             return clazz;
         } catch (ClassNotFoundException e) {
-            throw (Error)new AssertionError("Spi class not found").initCause(e);
+            throw new AssertionError("Spi class not found", e);
         }
     }
 
--- a/jdk/src/share/classes/java/util/Collections.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/share/classes/java/util/Collections.java	Wed Jul 21 09:57:21 2010 -0700
@@ -463,10 +463,10 @@
      *         its list-iterator does not support the <tt>set</tt> operation.
      */
     public static void shuffle(List<?> list) {
-        if (r == null) {
-            r = new Random();
-        }
-        shuffle(list, r);
+        Random rnd = r;
+        if (rnd == null)
+            r = rnd = new Random();
+        shuffle(list, rnd);
     }
     private static Random r;
 
--- a/jdk/src/share/classes/java/util/DualPivotQuicksort.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/share/classes/java/util/DualPivotQuicksort.java	Wed Jul 21 09:57:21 2010 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2009, 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
@@ -27,7 +27,7 @@
 
 /**
  * This class implements the Dual-Pivot Quicksort algorithm by
- * Vladimir Yaroslavskiy, Jon Bentley, and Joshua Bloch. The algorithm
+ * Vladimir Yaroslavskiy, Jon Bentley, and Josh Bloch. The algorithm
  * offers O(n log(n)) performance on many data sets that cause other
  * quicksorts to degrade to quadratic performance, and is typically
  * faster than traditional (one-pivot) Quicksort implementations.
@@ -36,7 +36,8 @@
  * @author Jon Bentley
  * @author Josh Bloch
  *
- * @version 2009.11.29 m765.827.12i
+ * @version 2010.06.21 m765.827.12i:5\7
+ * @since 1.7
  */
 final class DualPivotQuicksort {
 
@@ -68,7 +69,7 @@
     private static final int COUNTING_SORT_THRESHOLD_FOR_SHORT_OR_CHAR = 32768;
 
     /*
-     * Sorting methods for 7 primitive types.
+     * Sorting methods for seven primitive types.
      */
 
     /**
@@ -77,7 +78,7 @@
      * @param a the array to be sorted
      */
     public static void sort(int[] a) {
-        doSort(a, 0, a.length - 1);
+        sort(a, 0, a.length - 1, true);
     }
 
     /**
@@ -95,98 +96,132 @@
      */
     public static void sort(int[] a, int fromIndex, int toIndex) {
         rangeCheck(a.length, fromIndex, toIndex);
-        doSort(a, fromIndex, toIndex - 1);
+        sort(a, fromIndex, toIndex - 1, true);
     }
 
     /**
-     * Sorts the specified range of the array into ascending order. This
-     * method differs from the public {@code sort} method in that the
-     * {@code right} index is inclusive, and it does no range checking
-     * on {@code left} or {@code right}.
+     * Sorts the specified range of the array into ascending order by the
+     * Dual-Pivot Quicksort algorithm. This method differs from the public
+     * {@code sort} method in that the {@code right} index is inclusive,
+     * it does no range checking on {@code left} or {@code right}, and has
+     * boolean flag whether insertion sort with sentinel is used or not.
      *
      * @param a the array to be sorted
      * @param left the index of the first element, inclusive, to be sorted
      * @param right the index of the last element, inclusive, to be sorted
+     * @param leftmost indicates if the part is the most left in the range
      */
-    private static void doSort(int[] a, int left, int right) {
-        // Use insertion sort on tiny arrays
-        if (right - left + 1 < INSERTION_SORT_THRESHOLD) {
-            for (int i = left + 1; i <= right; i++) {
-                int ai = a[i];
-                int j;
-                for (j = i - 1; j >= left && ai < a[j]; j--) {
-                    a[j + 1] = a[j];
-                }
-                a[j + 1] = ai;
-            }
-        } else { // Use Dual-Pivot Quicksort on large arrays
-            dualPivotQuicksort(a, left, right);
-        }
-    }
+    private static void sort(int[] a, int left, int right, boolean leftmost) {
+        int length = right - left + 1;
 
-    /**
-     * Sorts the specified range of the array into ascending order by the
-     * Dual-Pivot Quicksort algorithm.
-     *
-     * @param a the array to be sorted
-     * @param left the index of the first element, inclusive, to be sorted
-     * @param right the index of the last element, inclusive, to be sorted
-     */
-    private static void dualPivotQuicksort(int[] a, int left, int right) {
-        // Compute indices of five evenly spaced elements
-        int sixth = (right - left + 1) / 6;
-        int e1 = left  + sixth;
-        int e5 = right - sixth;
+        // Use insertion sort on tiny arrays
+        if (length < INSERTION_SORT_THRESHOLD) {
+            if (!leftmost) {
+                /*
+                 * Every element in adjoining part plays the role
+                 * of sentinel, therefore this allows us to avoid
+                 * the j >= left check on each iteration.
+                 */
+                for (int j, i = left + 1; i <= right; i++) {
+                    int ai = a[i];
+                    for (j = i - 1; ai < a[j]; j--) {
+                        // assert j >= left;
+                        a[j + 1] = a[j];
+                    }
+                    a[j + 1] = ai;
+                }
+            } else {
+                /*
+                 * For case of leftmost part traditional (without a sentinel)
+                 * insertion sort, optimized for server JVM, is used.
+                 */
+                for (int i = left, j = i; i < right; j = ++i) {
+                    int ai = a[i + 1];
+                    while (ai < a[j]) {
+                        a[j + 1] = a[j];
+                        if (j-- == left) {
+                            break;
+                        }
+                    }
+                    a[j + 1] = ai;
+                }
+            }
+            return;
+        }
+
+        // Inexpensive approximation of length / 7
+        int seventh = (length >>> 3) + (length >>> 6) + 1;
+
+        /*
+         * Sort five evenly spaced elements around (and including) the
+         * center element in the range. These elements will be used for
+         * pivot selection as described below. The choice for spacing
+         * these elements was empirically determined to work well on
+         * a wide variety of inputs.
+         */
         int e3 = (left + right) >>> 1; // The midpoint
-        int e4 = e3 + sixth;
-        int e2 = e3 - sixth;
+        int e2 = e3 - seventh;
+        int e1 = e2 - seventh;
+        int e4 = e3 + seventh;
+        int e5 = e4 + seventh;
 
-        // Sort these elements using a 5-element sorting network
-        int ae1 = a[e1], ae2 = a[e2], ae3 = a[e3], ae4 = a[e4], ae5 = a[e5];
+        // Sort these elements using insertion sort
+        if (a[e2] < a[e1]) { int t = a[e2]; a[e2] = a[e1]; a[e1] = t; }
 
-        if (ae1 > ae2) { int t = ae1; ae1 = ae2; ae2 = t; }
-        if (ae4 > ae5) { int t = ae4; ae4 = ae5; ae5 = t; }
-        if (ae1 > ae3) { int t = ae1; ae1 = ae3; ae3 = t; }
-        if (ae2 > ae3) { int t = ae2; ae2 = ae3; ae3 = t; }
-        if (ae1 > ae4) { int t = ae1; ae1 = ae4; ae4 = t; }
-        if (ae3 > ae4) { int t = ae3; ae3 = ae4; ae4 = t; }
-        if (ae2 > ae5) { int t = ae2; ae2 = ae5; ae5 = t; }
-        if (ae2 > ae3) { int t = ae2; ae2 = ae3; ae3 = t; }
-        if (ae4 > ae5) { int t = ae4; ae4 = ae5; ae5 = t; }
-
-        a[e1] = ae1; a[e3] = ae3; a[e5] = ae5;
+        if (a[e3] < a[e2]) { int t = a[e3]; a[e3] = a[e2]; a[e2] = t;
+            if (t < a[e1]) { a[e2] = a[e1]; a[e1] = t; }
+        }
+        if (a[e4] < a[e3]) { int t = a[e4]; a[e4] = a[e3]; a[e3] = t;
+            if (t < a[e2]) { a[e3] = a[e2]; a[e2] = t;
+                if (t < a[e1]) { a[e2] = a[e1]; a[e1] = t; }
+            }
+        }
+        if (a[e5] < a[e4]) { int t = a[e5]; a[e5] = a[e4]; a[e4] = t;
+            if (t < a[e3]) { a[e4] = a[e3]; a[e3] = t;
+                if (t < a[e2]) { a[e3] = a[e2]; a[e2] = t;
+                    if (t < a[e1]) { a[e2] = a[e1]; a[e1] = t; }
+                }
+            }
+        }
 
         /*
          * Use the second and fourth of the five sorted elements as pivots.
          * These values are inexpensive approximations of the first and
          * second terciles of the array. Note that pivot1 <= pivot2.
-         *
-         * The pivots are stored in local variables, and the first and
-         * the last of the elements to be sorted are moved to the locations
-         * formerly occupied by the pivots. When partitioning is complete,
-         * the pivots are swapped back into their final positions, and
-         * excluded from subsequent sorting.
          */
-        int pivot1 = ae2; a[e2] = a[left];
-        int pivot2 = ae4; a[e4] = a[right];
+        int pivot1 = a[e2];
+        int pivot2 = a[e4];
 
         // Pointers
-        int less  = left  + 1; // The index of first element of center part
-        int great = right - 1; // The index before first element of right part
+        int less  = left;  // The index of the first element of center part
+        int great = right; // The index before the first element of right part
 
-        boolean pivotsDiffer = (pivot1 != pivot2);
+        if (pivot1 != pivot2) {
+            /*
+             * The first and the last elements to be sorted are moved to the
+             * locations formerly occupied by the pivots. When partitioning
+             * is complete, the pivots are swapped back into their final
+             * positions, and excluded from subsequent sorting.
+             */
+            a[e2] = a[left];
+            a[e4] = a[right];
 
-        if (pivotsDiffer) {
+            /*
+             * Skip elements, which are less or greater than pivot values.
+             */
+            while (a[++less] < pivot1);
+            while (a[--great] > pivot2);
+
             /*
              * Partitioning:
              *
-             *   left part         center part                    right part
-             * +------------------------------------------------------------+
-             * | < pivot1  |  pivot1 <= && <= pivot2  |    ?    |  > pivot2 |
-             * +------------------------------------------------------------+
-             *              ^                          ^       ^
-             *              |                          |       |
-             *             less                        k     great
+             *   left part           center part                   right part
+             * +--------------------------------------------------------------+
+             * |  < pivot1  |  pivot1 <= && <= pivot2  |    ?    |  > pivot2  |
+             * +--------------------------------------------------------------+
+             *               ^                          ^       ^
+             *               |                          |       |
+             *              less                        k     great
              *
              * Invariants:
              *
@@ -194,16 +229,14 @@
              *    pivot1 <= all in [less, k)     <= pivot2
              *              all in (great, right) > pivot2
              *
-             * Pointer k is the first index of ?-part
+             * Pointer k is the first index of ?-part.
              */
             outer:
             for (int k = less; k <= great; k++) {
                 int ak = a[k];
                 if (ak < pivot1) { // Move a[k] to left part
-                    if (k != less) {
-                        a[k] = a[less];
-                        a[less] = ak;
-                    }
+                    a[k] = a[less];
+                    a[less] = ak;
                     less++;
                 } else if (ak > pivot2) { // Move a[k] to right part
                     while (a[great] > pivot2) {
@@ -213,26 +246,107 @@
                     }
                     if (a[great] < pivot1) {
                         a[k] = a[less];
-                        a[less++] = a[great];
-                        a[great--] = ak;
+                        a[less] = a[great];
+                        less++;
                     } else { // pivot1 <= a[great] <= pivot2
                         a[k] = a[great];
-                        a[great--] = ak;
+                    }
+                    a[great] = ak;
+                    great--;
+                }
+            }
+
+            // Swap pivots into their final positions
+            a[left]  = a[less  - 1]; a[less  - 1] = pivot1;
+            a[right] = a[great + 1]; a[great + 1] = pivot2;
+
+            // Sort left and right parts recursively, excluding known pivots
+            sort(a, left, less - 2, leftmost);
+            sort(a, great + 2, right, false);
+
+            /*
+             * If center part is too large (comprises > 5/7 of the array),
+             * swap internal pivot values to ends.
+             */
+            if (less < e1 && e5 < great) {
+                /*
+                 * Skip elements, which are equal to pivot values.
+                 */
+                while (a[less] == pivot1) {
+                    less++;
+                }
+                while (a[great] == pivot2) {
+                    great--;
+                }
+
+                /*
+                 * Partitioning:
+                 *
+                 *   left part         center part                  right part
+                 * +----------------------------------------------------------+
+                 * | == pivot1 |  pivot1 < && < pivot2  |    ?    | == pivot2 |
+                 * +----------------------------------------------------------+
+                 *              ^                        ^       ^
+                 *              |                        |       |
+                 *             less                      k     great
+                 *
+                 * Invariants:
+                 *
+                 *              all in (*,  less) == pivot1
+                 *     pivot1 < all in [less,  k)  < pivot2
+                 *              all in (great, *) == pivot2
+                 *
+                 * Pointer k is the first index of ?-part.
+                 */
+                outer:
+                for (int k = less; k <= great; k++) {
+                    int ak = a[k];
+                    if (ak == pivot1) { // Move a[k] to left part
+                        a[k] = a[less];
+                        a[less] = ak;
+                        less++;
+                    } else if (ak == pivot2) { // Move a[k] to right part
+                        while (a[great] == pivot2) {
+                            if (great-- == k) {
+                                break outer;
+                            }
+                        }
+                        if (a[great] == pivot1) {
+                            a[k] = a[less];
+                            /*
+                             * Even though a[great] equals to pivot1, the
+                             * assignment a[less] = pivot1 may be incorrect,
+                             * if a[great] and pivot1 are floating-point zeros
+                             * of different signs. Therefore in float and
+                             * double sorting methods we have to use more
+                             * accurate assignment a[less] = a[great].
+                             */
+                            a[less] = pivot1;
+                            less++;
+                        } else { // pivot1 < a[great] < pivot2
+                            a[k] = a[great];
+                        }
+                        a[great] = ak;
+                        great--;
                     }
                 }
             }
+
+            // Sort center part recursively
+            sort(a, less, great, false);
+
         } else { // Pivots are equal
             /*
-             * Partition degenerates to the traditional 3-way,
-             * or "Dutch National Flag", partition:
+             * Partition degenerates to the traditional 3-way
+             * (or "Dutch National Flag") schema:
              *
-             *   left part   center part            right part
-             * +----------------------------------------------+
-             * |  < pivot  |  == pivot  |    ?    |  > pivot  |
-             * +----------------------------------------------+
-             *              ^            ^       ^
-             *              |            |       |
-             *             less          k     great
+             *   left part    center part              right part
+             * +-------------------------------------------------+
+             * |  < pivot  |   == pivot   |     ?    |  > pivot  |
+             * +-------------------------------------------------+
+             *              ^              ^        ^
+             *              |              |        |
+             *             less            k      great
              *
              * Invariants:
              *
@@ -240,20 +354,19 @@
              *   all in [less, k)     == pivot
              *   all in (great, right) > pivot
              *
-             * Pointer k is the first index of ?-part
+             * Pointer k is the first index of ?-part.
              */
-            for (int k = less; k <= great; k++) {
-                int ak = a[k];
-                if (ak == pivot1) {
+            for (int k = left; k <= great; k++) {
+                if (a[k] == pivot1) {
                     continue;
                 }
+                int ak = a[k];
+
                 if (ak < pivot1) { // Move a[k] to left part
-                    if (k != less) {
-                        a[k] = a[less];
-                        a[less] = ak;
-                    }
+                    a[k] = a[less];
+                    a[less] = ak;
                     less++;
-                } else { // (a[k] > pivot1) - Move a[k] to right part
+                } else { // a[k] > pivot1 - Move a[k] to right part
                     /*
                      * We know that pivot1 == a[e3] == pivot2. Thus, we know
                      * that great will still be >= k when the following loop
@@ -261,92 +374,33 @@
                      * In other words, a[e3] acts as a sentinel for great.
                      */
                     while (a[great] > pivot1) {
+                        // assert great > k;
                         great--;
                     }
                     if (a[great] < pivot1) {
                         a[k] = a[less];
-                        a[less++] = a[great];
-                        a[great--] = ak;
+                        a[less] = a[great];
+                        less++;
                     } else { // a[great] == pivot1
+                        /*
+                         * Even though a[great] equals to pivot1, the
+                         * assignment a[k] = pivot1 may be incorrect,
+                         * if a[great] and pivot1 are floating-point
+                         * zeros of different signs. Therefore in float
+                         * and double sorting methods we have to use
+                         * more accurate assignment a[k] = a[great].
+                         */
                         a[k] = pivot1;
-                        a[great--] = ak;
                     }
+                    a[great] = ak;
+                    great--;
                 }
             }
-        }
-
-        // Swap pivots into their final positions
-        a[left]  = a[less  - 1]; a[less  - 1] = pivot1;
-        a[right] = a[great + 1]; a[great + 1] = pivot2;
-
-        // Sort left and right parts recursively, excluding known pivot values
-        doSort(a, left,   less - 2);
-        doSort(a, great + 2, right);
-
-        /*
-         * If pivot1 == pivot2, all elements from center
-         * part are equal and, therefore, already sorted
-         */
-        if (!pivotsDiffer) {
-            return;
-        }
-
-        /*
-         * If center part is too large (comprises > 2/3 of the array),
-         * swap internal pivot values to ends
-         */
-        if (less < e1 && great > e5) {
-            while (a[less] == pivot1) {
-                less++;
-            }
-            while (a[great] == pivot2) {
-                great--;
-            }
 
-            /*
-             * Partitioning:
-             *
-             *   left part       center part                   right part
-             * +----------------------------------------------------------+
-             * | == pivot1 |  pivot1 < && < pivot2  |    ?    | == pivot2 |
-             * +----------------------------------------------------------+
-             *              ^                        ^       ^
-             *              |                        |       |
-             *             less                      k     great
-             *
-             * Invariants:
-             *
-             *              all in (*, less)  == pivot1
-             *     pivot1 < all in [less, k)   < pivot2
-             *              all in (great, *) == pivot2
-             *
-             * Pointer k is the first index of ?-part
-             */
-            outer:
-            for (int k = less; k <= great; k++) {
-                int ak = a[k];
-                if (ak == pivot2) { // Move a[k] to right part
-                    while (a[great] == pivot2) {
-                        if (great-- == k) {
-                            break outer;
-                        }
-                    }
-                    if (a[great] == pivot1) {
-                        a[k] = a[less];
-                        a[less++] = pivot1;
-                    } else { // pivot1 < a[great] < pivot2
-                        a[k] = a[great];
-                    }
-                    a[great--] = pivot2;
-                } else if (ak == pivot1) { // Move a[k] to left part
-                    a[k] = a[less];
-                    a[less++] = pivot1;
-                }
-            }
+            // Sort left and right parts recursively
+            sort(a, left, less - 1, leftmost);
+            sort(a, great + 1, right, false);
         }
-
-        // Sort center part recursively, excluding known pivot values
-        doSort(a, less, great);
     }
 
     /**
@@ -355,7 +409,7 @@
      * @param a the array to be sorted
      */
     public static void sort(long[] a) {
-        doSort(a, 0, a.length - 1);
+        sort(a, 0, a.length - 1, true);
     }
 
     /**
@@ -373,98 +427,132 @@
      */
     public static void sort(long[] a, int fromIndex, int toIndex) {
         rangeCheck(a.length, fromIndex, toIndex);
-        doSort(a, fromIndex, toIndex - 1);
+        sort(a, fromIndex, toIndex - 1, true);
     }
 
     /**
-     * Sorts the specified range of the array into ascending order. This
-     * method differs from the public {@code sort} method in that the
-     * {@code right} index is inclusive, and it does no range checking on
-     * {@code left} or {@code right}.
+     * Sorts the specified range of the array into ascending order by the
+     * Dual-Pivot Quicksort algorithm. This method differs from the public
+     * {@code sort} method in that the {@code right} index is inclusive,
+     * it does no range checking on {@code left} or {@code right}, and has
+     * boolean flag whether insertion sort with sentinel is used or not.
      *
      * @param a the array to be sorted
      * @param left the index of the first element, inclusive, to be sorted
      * @param right the index of the last element, inclusive, to be sorted
+     * @param leftmost indicates if the part is the most left in the range
      */
-    private static void doSort(long[] a, int left, int right) {
-        // Use insertion sort on tiny arrays
-        if (right - left + 1 < INSERTION_SORT_THRESHOLD) {
-            for (int i = left + 1; i <= right; i++) {
-                long ai = a[i];
-                int j;
-                for (j = i - 1; j >= left && ai < a[j]; j--) {
-                    a[j + 1] = a[j];
-                }
-                a[j + 1] = ai;
-            }
-        } else { // Use Dual-Pivot Quicksort on large arrays
-            dualPivotQuicksort(a, left, right);
-        }
-    }
+    private static void sort(long[] a, int left, int right, boolean leftmost) {
+        int length = right - left + 1;
 
-    /**
-     * Sorts the specified range of the array into ascending order by the
-     * Dual-Pivot Quicksort algorithm.
-     *
-     * @param a the array to be sorted
-     * @param left the index of the first element, inclusive, to be sorted
-     * @param right the index of the last element, inclusive, to be sorted
-     */
-    private static void dualPivotQuicksort(long[] a, int left, int right) {
-        // Compute indices of five evenly spaced elements
-        int sixth = (right - left + 1) / 6;
-        int e1 = left  + sixth;
-        int e5 = right - sixth;
+        // Use insertion sort on tiny arrays
+        if (length < INSERTION_SORT_THRESHOLD) {
+            if (!leftmost) {
+                /*
+                 * Every element in adjoining part plays the role
+                 * of sentinel, therefore this allows us to avoid
+                 * the j >= left check on each iteration.
+                 */
+                for (int j, i = left + 1; i <= right; i++) {
+                    long ai = a[i];
+                    for (j = i - 1; ai < a[j]; j--) {
+                        // assert j >= left;
+                        a[j + 1] = a[j];
+                    }
+                    a[j + 1] = ai;
+                }
+            } else {
+                /*
+                 * For case of leftmost part traditional (without a sentinel)
+                 * insertion sort, optimized for server JVM, is used.
+                 */
+                for (int i = left, j = i; i < right; j = ++i) {
+                    long ai = a[i + 1];
+                    while (ai < a[j]) {
+                        a[j + 1] = a[j];
+                        if (j-- == left) {
+                            break;
+                        }
+                    }
+                    a[j + 1] = ai;
+                }
+            }
+            return;
+        }
+
+        // Inexpensive approximation of length / 7
+        int seventh = (length >>> 3) + (length >>> 6) + 1;
+
+        /*
+         * Sort five evenly spaced elements around (and including) the
+         * center element in the range. These elements will be used for
+         * pivot selection as described below. The choice for spacing
+         * these elements was empirically determined to work well on
+         * a wide variety of inputs.
+         */
         int e3 = (left + right) >>> 1; // The midpoint
-        int e4 = e3 + sixth;
-        int e2 = e3 - sixth;
+        int e2 = e3 - seventh;
+        int e1 = e2 - seventh;
+        int e4 = e3 + seventh;
+        int e5 = e4 + seventh;
 
-        // Sort these elements using a 5-element sorting network
-        long ae1 = a[e1], ae2 = a[e2], ae3 = a[e3], ae4 = a[e4], ae5 = a[e5];
+        // Sort these elements using insertion sort
+        if (a[e2] < a[e1]) { long t = a[e2]; a[e2] = a[e1]; a[e1] = t; }
 
-        if (ae1 > ae2) { long t = ae1; ae1 = ae2; ae2 = t; }
-        if (ae4 > ae5) { long t = ae4; ae4 = ae5; ae5 = t; }
-        if (ae1 > ae3) { long t = ae1; ae1 = ae3; ae3 = t; }
-        if (ae2 > ae3) { long t = ae2; ae2 = ae3; ae3 = t; }
-        if (ae1 > ae4) { long t = ae1; ae1 = ae4; ae4 = t; }
-        if (ae3 > ae4) { long t = ae3; ae3 = ae4; ae4 = t; }
-        if (ae2 > ae5) { long t = ae2; ae2 = ae5; ae5 = t; }
-        if (ae2 > ae3) { long t = ae2; ae2 = ae3; ae3 = t; }
-        if (ae4 > ae5) { long t = ae4; ae4 = ae5; ae5 = t; }
-
-        a[e1] = ae1; a[e3] = ae3; a[e5] = ae5;
+        if (a[e3] < a[e2]) { long t = a[e3]; a[e3] = a[e2]; a[e2] = t;
+            if (t < a[e1]) { a[e2] = a[e1]; a[e1] = t; }
+        }
+        if (a[e4] < a[e3]) { long t = a[e4]; a[e4] = a[e3]; a[e3] = t;
+            if (t < a[e2]) { a[e3] = a[e2]; a[e2] = t;
+                if (t < a[e1]) { a[e2] = a[e1]; a[e1] = t; }
+            }
+        }
+        if (a[e5] < a[e4]) { long t = a[e5]; a[e5] = a[e4]; a[e4] = t;
+            if (t < a[e3]) { a[e4] = a[e3]; a[e3] = t;
+                if (t < a[e2]) { a[e3] = a[e2]; a[e2] = t;
+                    if (t < a[e1]) { a[e2] = a[e1]; a[e1] = t; }
+                }
+            }
+        }
 
         /*
          * Use the second and fourth of the five sorted elements as pivots.
          * These values are inexpensive approximations of the first and
          * second terciles of the array. Note that pivot1 <= pivot2.
-         *
-         * The pivots are stored in local variables, and the first and
-         * the last of the elements to be sorted are moved to the locations
-         * formerly occupied by the pivots. When partitioning is complete,
-         * the pivots are swapped back into their final positions, and
-         * excluded from subsequent sorting.
          */
-        long pivot1 = ae2; a[e2] = a[left];
-        long pivot2 = ae4; a[e4] = a[right];
+        long pivot1 = a[e2];
+        long pivot2 = a[e4];
 
         // Pointers
-        int less  = left  + 1; // The index of first element of center part
-        int great = right - 1; // The index before first element of right part
+        int less  = left;  // The index of the first element of center part
+        int great = right; // The index before the first element of right part
 
-        boolean pivotsDiffer = (pivot1 != pivot2);
+        if (pivot1 != pivot2) {
+            /*
+             * The first and the last elements to be sorted are moved to the
+             * locations formerly occupied by the pivots. When partitioning
+             * is complete, the pivots are swapped back into their final
+             * positions, and excluded from subsequent sorting.
+             */
+            a[e2] = a[left];
+            a[e4] = a[right];
 
-        if (pivotsDiffer) {
+            /*
+             * Skip elements, which are less or greater than pivot values.
+             */
+            while (a[++less] < pivot1);
+            while (a[--great] > pivot2);
+
             /*
              * Partitioning:
              *
-             *   left part         center part                    right part
-             * +------------------------------------------------------------+
-             * | < pivot1  |  pivot1 <= && <= pivot2  |    ?    |  > pivot2 |
-             * +------------------------------------------------------------+
-             *              ^                          ^       ^
-             *              |                          |       |
-             *             less                        k     great
+             *   left part           center part                   right part
+             * +--------------------------------------------------------------+
+             * |  < pivot1  |  pivot1 <= && <= pivot2  |    ?    |  > pivot2  |
+             * +--------------------------------------------------------------+
+             *               ^                          ^       ^
+             *               |                          |       |
+             *              less                        k     great
              *
              * Invariants:
              *
@@ -472,16 +560,14 @@
              *    pivot1 <= all in [less, k)     <= pivot2
              *              all in (great, right) > pivot2
              *
-             * Pointer k is the first index of ?-part
+             * Pointer k is the first index of ?-part.
              */
             outer:
             for (int k = less; k <= great; k++) {
                 long ak = a[k];
                 if (ak < pivot1) { // Move a[k] to left part
-                    if (k != less) {
-                        a[k] = a[less];
-                        a[less] = ak;
-                    }
+                    a[k] = a[less];
+                    a[less] = ak;
                     less++;
                 } else if (ak > pivot2) { // Move a[k] to right part
                     while (a[great] > pivot2) {
@@ -491,26 +577,107 @@
                     }
                     if (a[great] < pivot1) {
                         a[k] = a[less];
-                        a[less++] = a[great];
-                        a[great--] = ak;
+                        a[less] = a[great];
+                        less++;
                     } else { // pivot1 <= a[great] <= pivot2
                         a[k] = a[great];
-                        a[great--] = ak;
+                    }
+                    a[great] = ak;
+                    great--;
+                }
+            }
+
+            // Swap pivots into their final positions
+            a[left]  = a[less  - 1]; a[less  - 1] = pivot1;
+            a[right] = a[great + 1]; a[great + 1] = pivot2;
+
+            // Sort left and right parts recursively, excluding known pivots
+            sort(a, left, less - 2, leftmost);
+            sort(a, great + 2, right, false);
+
+            /*
+             * If center part is too large (comprises > 5/7 of the array),
+             * swap internal pivot values to ends.
+             */
+            if (less < e1 && e5 < great) {
+                /*
+                 * Skip elements, which are equal to pivot values.
+                 */
+                while (a[less] == pivot1) {
+                    less++;
+                }
+                while (a[great] == pivot2) {
+                    great--;
+                }
+
+                /*
+                 * Partitioning:
+                 *
+                 *   left part         center part                  right part
+                 * +----------------------------------------------------------+
+                 * | == pivot1 |  pivot1 < && < pivot2  |    ?    | == pivot2 |
+                 * +----------------------------------------------------------+
+                 *              ^                        ^       ^
+                 *              |                        |       |
+                 *             less                      k     great
+                 *
+                 * Invariants:
+                 *
+                 *              all in (*,  less) == pivot1
+                 *     pivot1 < all in [less,  k)  < pivot2
+                 *              all in (great, *) == pivot2
+                 *
+                 * Pointer k is the first index of ?-part.
+                 */
+                outer:
+                for (int k = less; k <= great; k++) {
+                    long ak = a[k];
+                    if (ak == pivot1) { // Move a[k] to left part
+                        a[k] = a[less];
+                        a[less] = ak;
+                        less++;
+                    } else if (ak == pivot2) { // Move a[k] to right part
+                        while (a[great] == pivot2) {
+                            if (great-- == k) {
+                                break outer;
+                            }
+                        }
+                        if (a[great] == pivot1) {
+                            a[k] = a[less];
+                            /*
+                             * Even though a[great] equals to pivot1, the
+                             * assignment a[less] = pivot1 may be incorrect,
+                             * if a[great] and pivot1 are floating-point zeros
+                             * of different signs. Therefore in float and
+                             * double sorting methods we have to use more
+                             * accurate assignment a[less] = a[great].
+                             */
+                            a[less] = pivot1;
+                            less++;
+                        } else { // pivot1 < a[great] < pivot2
+                            a[k] = a[great];
+                        }
+                        a[great] = ak;
+                        great--;
                     }
                 }
             }
+
+            // Sort center part recursively
+            sort(a, less, great, false);
+
         } else { // Pivots are equal
             /*
-             * Partition degenerates to the traditional 3-way,
-             * or "Dutch National Flag", partition:
+             * Partition degenerates to the traditional 3-way
+             * (or "Dutch National Flag") schema:
              *
-             *   left part   center part            right part
-             * +----------------------------------------------+
-             * |  < pivot  |  == pivot  |    ?    |  > pivot  |
-             * +----------------------------------------------+
-             *              ^            ^       ^
-             *              |            |       |
-             *             less          k     great
+             *   left part    center part              right part
+             * +-------------------------------------------------+
+             * |  < pivot  |   == pivot   |     ?    |  > pivot  |
+             * +-------------------------------------------------+
+             *              ^              ^        ^
+             *              |              |        |
+             *             less            k      great
              *
              * Invariants:
              *
@@ -518,20 +685,19 @@
              *   all in [less, k)     == pivot
              *   all in (great, right) > pivot
              *
-             * Pointer k is the first index of ?-part
+             * Pointer k is the first index of ?-part.
              */
-            for (int k = less; k <= great; k++) {
-                long ak = a[k];
-                if (ak == pivot1) {
+            for (int k = left; k <= great; k++) {
+                if (a[k] == pivot1) {
                     continue;
                 }
+                long ak = a[k];
+
                 if (ak < pivot1) { // Move a[k] to left part
-                    if (k != less) {
-                        a[k] = a[less];
-                        a[less] = ak;
-                    }
+                    a[k] = a[less];
+                    a[less] = ak;
                     less++;
-                } else { // (a[k] > pivot1) - Move a[k] to right part
+                } else { // a[k] > pivot1 - Move a[k] to right part
                     /*
                      * We know that pivot1 == a[e3] == pivot2. Thus, we know
                      * that great will still be >= k when the following loop
@@ -539,92 +705,33 @@
                      * In other words, a[e3] acts as a sentinel for great.
                      */
                     while (a[great] > pivot1) {
+                        // assert great > k;
                         great--;
                     }
                     if (a[great] < pivot1) {
                         a[k] = a[less];
-                        a[less++] = a[great];
-                        a[great--] = ak;
+                        a[less] = a[great];
+                        less++;
                     } else { // a[great] == pivot1
+                        /*
+                         * Even though a[great] equals to pivot1, the
+                         * assignment a[k] = pivot1 may be incorrect,
+                         * if a[great] and pivot1 are floating-point
+                         * zeros of different signs. Therefore in float
+                         * and double sorting methods we have to use
+                         * more accurate assignment a[k] = a[great].
+                         */
                         a[k] = pivot1;
-                        a[great--] = ak;
                     }
+                    a[great] = ak;
+                    great--;
                 }
             }
-        }
-
-        // Swap pivots into their final positions
-        a[left]  = a[less  - 1]; a[less  - 1] = pivot1;
-        a[right] = a[great + 1]; a[great + 1] = pivot2;
-
-        // Sort left and right parts recursively, excluding known pivot values
-        doSort(a, left,   less - 2);
-        doSort(a, great + 2, right);
-
-        /*
-         * If pivot1 == pivot2, all elements from center
-         * part are equal and, therefore, already sorted
-         */
-        if (!pivotsDiffer) {
-            return;
-        }
-
-        /*
-         * If center part is too large (comprises > 2/3 of the array),
-         * swap internal pivot values to ends
-         */
-        if (less < e1 && great > e5) {
-            while (a[less] == pivot1) {
-                less++;
-            }
-            while (a[great] == pivot2) {
-                great--;
-            }
 
-            /*
-             * Partitioning:
-             *
-             *   left part       center part                   right part
-             * +----------------------------------------------------------+
-             * | == pivot1 |  pivot1 < && < pivot2  |    ?    | == pivot2 |
-             * +----------------------------------------------------------+
-             *              ^                        ^       ^
-             *              |                        |       |
-             *             less                      k     great
-             *
-             * Invariants:
-             *
-             *              all in (*, less)  == pivot1
-             *     pivot1 < all in [less, k)   < pivot2
-             *              all in (great, *) == pivot2
-             *
-             * Pointer k is the first index of ?-part
-             */
-            outer:
-            for (int k = less; k <= great; k++) {
-                long ak = a[k];
-                if (ak == pivot2) { // Move a[k] to right part
-                    while (a[great] == pivot2) {
-                        if (great-- == k) {
-                            break outer;
-                        }
-                    }
-                    if (a[great] == pivot1) {
-                        a[k] = a[less];
-                        a[less++] = pivot1;
-                    } else { // pivot1 < a[great] < pivot2
-                        a[k] = a[great];
-                    }
-                    a[great--] = pivot2;
-                } else if (ak == pivot1) { // Move a[k] to left part
-                    a[k] = a[less];
-                    a[less++] = pivot1;
-                }
-            }
+            // Sort left and right parts recursively
+            sort(a, left, less - 1, leftmost);
+            sort(a, great + 1, right, false);
         }
-
-        // Sort center part recursively, excluding known pivot values
-        doSort(a, less, great);
     }
 
     /**
@@ -633,7 +740,11 @@
      * @param a the array to be sorted
      */
     public static void sort(short[] a) {
-        doSort(a, 0, a.length - 1);
+        if (a.length > COUNTING_SORT_THRESHOLD_FOR_SHORT_OR_CHAR) {
+            countingSort(a, 0, a.length - 1);
+        } else {
+            sort(a, 0, a.length - 1, true);
+        }
     }
 
     /**
@@ -651,115 +762,166 @@
      */
     public static void sort(short[] a, int fromIndex, int toIndex) {
         rangeCheck(a.length, fromIndex, toIndex);
-        doSort(a, fromIndex, toIndex - 1);
+
+        if (toIndex - fromIndex > COUNTING_SORT_THRESHOLD_FOR_SHORT_OR_CHAR) {
+            countingSort(a, fromIndex, toIndex - 1);
+        } else {
+            sort(a, fromIndex, toIndex - 1, true);
+        }
     }
 
     /** The number of distinct short values. */
     private static final int NUM_SHORT_VALUES = 1 << 16;
 
     /**
-     * Sorts the specified range of the array into ascending order. This
-     * method differs from the public {@code sort} method in that the
-     * {@code right} index is inclusive, and it does no range checking on
-     * {@code left} or {@code right}.
-     *
-     * @param a the array to be sorted
-     * @param left the index of the first element, inclusive, to be sorted
-     * @param right the index of the last element, inclusive, to be sorted
-     */
-    private static void doSort(short[] a, int left, int right) {
-        // Use insertion sort on tiny arrays
-        if (right - left + 1 < INSERTION_SORT_THRESHOLD) {
-            for (int i = left + 1; i <= right; i++) {
-                short ai = a[i];
-                int j;
-                for (j = i - 1; j >= left && ai < a[j]; j--) {
-                    a[j + 1] = a[j];
-                }
-                a[j + 1] = ai;
-            }
-        } else if (right-left+1 > COUNTING_SORT_THRESHOLD_FOR_SHORT_OR_CHAR) {
-            // Use counting sort on huge arrays
-            int[] count = new int[NUM_SHORT_VALUES];
-
-            for (int i = left; i <= right; i++) {
-                count[a[i] - Short.MIN_VALUE]++;
-            }
-            for (int i = 0, k = left; i < count.length && k <= right; i++) {
-                short value = (short) (i + Short.MIN_VALUE);
-
-                for (int s = count[i]; s > 0; s--) {
-                    a[k++] = value;
-               }
-            }
-        } else { // Use Dual-Pivot Quicksort on large arrays
-            dualPivotQuicksort(a, left, right);
-        }
-    }
-
-    /**
-     * Sorts the specified range of the array into ascending order by the
-     * Dual-Pivot Quicksort algorithm.
+     * Sorts the specified range of the array by counting sort.
      *
      * @param a the array to be sorted
      * @param left the index of the first element, inclusive, to be sorted
      * @param right the index of the last element, inclusive, to be sorted
      */
-    private static void dualPivotQuicksort(short[] a, int left, int right) {
-        // Compute indices of five evenly spaced elements
-        int sixth = (right - left + 1) / 6;
-        int e1 = left  + sixth;
-        int e5 = right - sixth;
-        int e3 = (left + right) >>> 1; // The midpoint
-        int e4 = e3 + sixth;
-        int e2 = e3 - sixth;
+    private static void countingSort(short[] a, int left, int right) {
+        int[] count = new int[NUM_SHORT_VALUES];
+
+        for (int i = left; i <= right; i++) {
+            count[a[i] - Short.MIN_VALUE]++;
+        }
+        for (int i = NUM_SHORT_VALUES - 1, k = right; k >= left; i--) {
+            while (count[i] == 0) {
+                i--;
+            }
+            short value = (short) (i + Short.MIN_VALUE);
+            int s = count[i];
 
-        // Sort these elements using a 5-element sorting network
-        short ae1 = a[e1], ae2 = a[e2], ae3 = a[e3], ae4 = a[e4], ae5 = a[e5];
+            do {
+                a[k--] = value;
+            } while (--s > 0);
+        }
+    }
+
+    /**
+     * Sorts the specified range of the array into ascending order by the
+     * Dual-Pivot Quicksort algorithm. This method differs from the public
+     * {@code sort} method in that the {@code right} index is inclusive,
+     * it does no range checking on {@code left} or {@code right}, and has
+     * boolean flag whether insertion sort with sentinel is used or not.
+     *
+     * @param a the array to be sorted
+     * @param left the index of the first element, inclusive, to be sorted
+     * @param right the index of the last element, inclusive, to be sorted
+     * @param leftmost indicates if the part is the most left in the range
+     */
+    private static void sort(short[] a, int left, int right,boolean leftmost) {
+        int length = right - left + 1;
 
-        if (ae1 > ae2) { short t = ae1; ae1 = ae2; ae2 = t; }
-        if (ae4 > ae5) { short t = ae4; ae4 = ae5; ae5 = t; }
-        if (ae1 > ae3) { short t = ae1; ae1 = ae3; ae3 = t; }
-        if (ae2 > ae3) { short t = ae2; ae2 = ae3; ae3 = t; }
-        if (ae1 > ae4) { short t = ae1; ae1 = ae4; ae4 = t; }
-        if (ae3 > ae4) { short t = ae3; ae3 = ae4; ae4 = t; }
-        if (ae2 > ae5) { short t = ae2; ae2 = ae5; ae5 = t; }
-        if (ae2 > ae3) { short t = ae2; ae2 = ae3; ae3 = t; }
-        if (ae4 > ae5) { short t = ae4; ae4 = ae5; ae5 = t; }
+        // Use insertion sort on tiny arrays
+        if (length < INSERTION_SORT_THRESHOLD) {
+            if (!leftmost) {
+                /*
+                 * Every element in adjoining part plays the role
+                 * of sentinel, therefore this allows us to avoid
+                 * the j >= left check on each iteration.
+                 */
+                for (int j, i = left + 1; i <= right; i++) {
+                    short ai = a[i];
+                    for (j = i - 1; ai < a[j]; j--) {
+                        // assert j >= left;
+                        a[j + 1] = a[j];
+                    }
+                    a[j + 1] = ai;
+                }
+            } else {
+                /*
+                 * For case of leftmost part traditional (without a sentinel)
+                 * insertion sort, optimized for server JVM, is used.
+                 */
+                for (int i = left, j = i; i < right; j = ++i) {
+                    short ai = a[i + 1];
+                    while (ai < a[j]) {
+                        a[j + 1] = a[j];
+                        if (j-- == left) {
+                            break;
+                        }
+                    }
+                    a[j + 1] = ai;
+                }
+            }
+            return;
+        }
 
-        a[e1] = ae1; a[e3] = ae3; a[e5] = ae5;
+        // Inexpensive approximation of length / 7
+        int seventh = (length >>> 3) + (length >>> 6) + 1;
+
+        /*
+         * Sort five evenly spaced elements around (and including) the
+         * center element in the range. These elements will be used for
+         * pivot selection as described below. The choice for spacing
+         * these elements was empirically determined to work well on
+         * a wide variety of inputs.
+         */
+        int e3 = (left + right) >>> 1; // The midpoint
+        int e2 = e3 - seventh;
+        int e1 = e2 - seventh;
+        int e4 = e3 + seventh;
+        int e5 = e4 + seventh;
+
+        // Sort these elements using insertion sort
+        if (a[e2] < a[e1]) { short t = a[e2]; a[e2] = a[e1]; a[e1] = t; }
+
+        if (a[e3] < a[e2]) { short t = a[e3]; a[e3] = a[e2]; a[e2] = t;
+            if (t < a[e1]) { a[e2] = a[e1]; a[e1] = t; }
+        }
+        if (a[e4] < a[e3]) { short t = a[e4]; a[e4] = a[e3]; a[e3] = t;
+            if (t < a[e2]) { a[e3] = a[e2]; a[e2] = t;
+                if (t < a[e1]) { a[e2] = a[e1]; a[e1] = t; }
+            }
+        }
+        if (a[e5] < a[e4]) { short t = a[e5]; a[e5] = a[e4]; a[e4] = t;
+            if (t < a[e3]) { a[e4] = a[e3]; a[e3] = t;
+                if (t < a[e2]) { a[e3] = a[e2]; a[e2] = t;
+                    if (t < a[e1]) { a[e2] = a[e1]; a[e1] = t; }
+                }
+            }
+        }
 
         /*
          * Use the second and fourth of the five sorted elements as pivots.
          * These values are inexpensive approximations of the first and
          * second terciles of the array. Note that pivot1 <= pivot2.
-         *
-         * The pivots are stored in local variables, and the first and
-         * the last of the elements to be sorted are moved to the locations
-         * formerly occupied by the pivots. When partitioning is complete,
-         * the pivots are swapped back into their final positions, and
-         * excluded from subsequent sorting.
          */
-        short pivot1 = ae2; a[e2] = a[left];
-        short pivot2 = ae4; a[e4] = a[right];
+        short pivot1 = a[e2];
+        short pivot2 = a[e4];
 
         // Pointers
-        int less  = left  + 1; // The index of first element of center part
-        int great = right - 1; // The index before first element of right part
+        int less  = left;  // The index of the first element of center part
+        int great = right; // The index before the first element of right part
 
-        boolean pivotsDiffer = (pivot1 != pivot2);
+        if (pivot1 != pivot2) {
+            /*
+             * The first and the last elements to be sorted are moved to the
+             * locations formerly occupied by the pivots. When partitioning
+             * is complete, the pivots are swapped back into their final
+             * positions, and excluded from subsequent sorting.
+             */
+            a[e2] = a[left];
+            a[e4] = a[right];
 
-        if (pivotsDiffer) {
+            /*
+             * Skip elements, which are less or greater than pivot values.
+             */
+            while (a[++less] < pivot1);
+            while (a[--great] > pivot2);
+
             /*
              * Partitioning:
              *
-             *   left part         center part                    right part
-             * +------------------------------------------------------------+
-             * | < pivot1  |  pivot1 <= && <= pivot2  |    ?    |  > pivot2 |
-             * +------------------------------------------------------------+
-             *              ^                          ^       ^
-             *              |                          |       |
-             *             less                        k     great
+             *   left part           center part                   right part
+             * +--------------------------------------------------------------+
+             * |  < pivot1  |  pivot1 <= && <= pivot2  |    ?    |  > pivot2  |
+             * +--------------------------------------------------------------+
+             *               ^                          ^       ^
+             *               |                          |       |
+             *              less                        k     great
              *
              * Invariants:
              *
@@ -767,16 +929,14 @@
              *    pivot1 <= all in [less, k)     <= pivot2
              *              all in (great, right) > pivot2
              *
-             * Pointer k is the first index of ?-part
+             * Pointer k is the first index of ?-part.
              */
             outer:
             for (int k = less; k <= great; k++) {
                 short ak = a[k];
                 if (ak < pivot1) { // Move a[k] to left part
-                    if (k != less) {
-                        a[k] = a[less];
-                        a[less] = ak;
-                    }
+                    a[k] = a[less];
+                    a[less] = ak;
                     less++;
                 } else if (ak > pivot2) { // Move a[k] to right part
                     while (a[great] > pivot2) {
@@ -786,26 +946,107 @@
                     }
                     if (a[great] < pivot1) {
                         a[k] = a[less];
-                        a[less++] = a[great];
-                        a[great--] = ak;
+                        a[less] = a[great];
+                        less++;
                     } else { // pivot1 <= a[great] <= pivot2
                         a[k] = a[great];
-                        a[great--] = ak;
+                    }
+                    a[great] = ak;
+                    great--;
+                }
+            }
+
+            // Swap pivots into their final positions
+            a[left]  = a[less  - 1]; a[less  - 1] = pivot1;
+            a[right] = a[great + 1]; a[great + 1] = pivot2;
+
+            // Sort left and right parts recursively, excluding known pivots
+            sort(a, left, less - 2, leftmost);
+            sort(a, great + 2, right, false);
+
+            /*
+             * If center part is too large (comprises > 5/7 of the array),
+             * swap internal pivot values to ends.
+             */
+            if (less < e1 && e5 < great) {
+                /*
+                 * Skip elements, which are equal to pivot values.
+                 */
+                while (a[less] == pivot1) {
+                    less++;
+                }
+                while (a[great] == pivot2) {
+                    great--;
+                }
+
+                /*
+                 * Partitioning:
+                 *
+                 *   left part         center part                  right part
+                 * +----------------------------------------------------------+
+                 * | == pivot1 |  pivot1 < && < pivot2  |    ?    | == pivot2 |
+                 * +----------------------------------------------------------+
+                 *              ^                        ^       ^
+                 *              |                        |       |
+                 *             less                      k     great
+                 *
+                 * Invariants:
+                 *
+                 *              all in (*,  less) == pivot1
+                 *     pivot1 < all in [less,  k)  < pivot2
+                 *              all in (great, *) == pivot2
+                 *
+                 * Pointer k is the first index of ?-part.
+                 */
+                outer:
+                for (int k = less; k <= great; k++) {
+                    short ak = a[k];
+                    if (ak == pivot1) { // Move a[k] to left part
+                        a[k] = a[less];
+                        a[less] = ak;
+                        less++;
+                    } else if (ak == pivot2) { // Move a[k] to right part
+                        while (a[great] == pivot2) {
+                            if (great-- == k) {
+                                break outer;
+                            }
+                        }
+                        if (a[great] == pivot1) {
+                            a[k] = a[less];
+                            /*
+                             * Even though a[great] equals to pivot1, the
+                             * assignment a[less] = pivot1 may be incorrect,
+                             * if a[great] and pivot1 are floating-point zeros
+                             * of different signs. Therefore in float and
+                             * double sorting methods we have to use more
+                             * accurate assignment a[less] = a[great].
+                             */
+                            a[less] = pivot1;
+                            less++;
+                        } else { // pivot1 < a[great] < pivot2
+                            a[k] = a[great];
+                        }
+                        a[great] = ak;
+                        great--;
                     }
                 }
             }
+
+            // Sort center part recursively
+            sort(a, less, great, false);
+
         } else { // Pivots are equal
             /*
-             * Partition degenerates to the traditional 3-way,
-             * or "Dutch National Flag", partition:
+             * Partition degenerates to the traditional 3-way
+             * (or "Dutch National Flag") schema:
              *
-             *   left part   center part            right part
-             * +----------------------------------------------+
-             * |  < pivot  |  == pivot  |    ?    |  > pivot  |
-             * +----------------------------------------------+
-             *              ^            ^       ^
-             *              |            |       |
-             *             less          k     great
+             *   left part    center part              right part
+             * +-------------------------------------------------+
+             * |  < pivot  |   == pivot   |     ?    |  > pivot  |
+             * +-------------------------------------------------+
+             *              ^              ^        ^
+             *              |              |        |
+             *             less            k      great
              *
              * Invariants:
              *
@@ -813,20 +1054,19 @@
              *   all in [less, k)     == pivot
              *   all in (great, right) > pivot
              *
-             * Pointer k is the first index of ?-part
+             * Pointer k is the first index of ?-part.
              */
-            for (int k = less; k <= great; k++) {
-                short ak = a[k];
-                if (ak == pivot1) {
+            for (int k = left; k <= great; k++) {
+                if (a[k] == pivot1) {
                     continue;
                 }
+                short ak = a[k];
+
                 if (ak < pivot1) { // Move a[k] to left part
-                    if (k != less) {
-                        a[k] = a[less];
-                        a[less] = ak;
-                    }
+                    a[k] = a[less];
+                    a[less] = ak;
                     less++;
-                } else { // (a[k] > pivot1) - Move a[k] to right part
+                } else { // a[k] > pivot1 - Move a[k] to right part
                     /*
                      * We know that pivot1 == a[e3] == pivot2. Thus, we know
                      * that great will still be >= k when the following loop
@@ -834,92 +1074,33 @@
                      * In other words, a[e3] acts as a sentinel for great.
                      */
                     while (a[great] > pivot1) {
+                        // assert great > k;
                         great--;
                     }
                     if (a[great] < pivot1) {
                         a[k] = a[less];
-                        a[less++] = a[great];
-                        a[great--] = ak;
+                        a[less] = a[great];
+                        less++;
                     } else { // a[great] == pivot1
+                        /*
+                         * Even though a[great] equals to pivot1, the
+                         * assignment a[k] = pivot1 may be incorrect,
+                         * if a[great] and pivot1 are floating-point
+                         * zeros of different signs. Therefore in float
+                         * and double sorting methods we have to use
+                         * more accurate assignment a[k] = a[great].
+                         */
                         a[k] = pivot1;
-                        a[great--] = ak;
                     }
+                    a[great] = ak;
+                    great--;
                 }
             }
-        }
-
-        // Swap pivots into their final positions
-        a[left]  = a[less  - 1]; a[less  - 1] = pivot1;
-        a[right] = a[great + 1]; a[great + 1] = pivot2;
-
-        // Sort left and right parts recursively, excluding known pivot values
-        doSort(a, left,   less - 2);
-        doSort(a, great + 2, right);
-
-        /*
-         * If pivot1 == pivot2, all elements from center
-         * part are equal and, therefore, already sorted
-         */
-        if (!pivotsDiffer) {
-            return;
-        }
-
-        /*
-         * If center part is too large (comprises > 2/3 of the array),
-         * swap internal pivot values to ends
-         */
-        if (less < e1 && great > e5) {
-            while (a[less] == pivot1) {
-                less++;
-            }
-            while (a[great] == pivot2) {
-                great--;
-            }
 
-            /*
-             * Partitioning:
-             *
-             *   left part       center part                   right part
-             * +----------------------------------------------------------+
-             * | == pivot1 |  pivot1 < && < pivot2  |    ?    | == pivot2 |
-             * +----------------------------------------------------------+
-             *              ^                        ^       ^
-             *              |                        |       |
-             *             less                      k     great
-             *
-             * Invariants:
-             *
-             *              all in (*, less)  == pivot1
-             *     pivot1 < all in [less, k)   < pivot2
-             *              all in (great, *) == pivot2
-             *
-             * Pointer k is the first index of ?-part
-             */
-            outer:
-            for (int k = less; k <= great; k++) {
-                short ak = a[k];
-                if (ak == pivot2) { // Move a[k] to right part
-                    while (a[great] == pivot2) {
-                        if (great-- == k) {
-                            break outer;
-                        }
-                    }
-                    if (a[great] == pivot1) {
-                        a[k] = a[less];
-                        a[less++] = pivot1;
-                    } else { // pivot1 < a[great] < pivot2
-                        a[k] = a[great];
-                    }
-                    a[great--] = pivot2;
-                } else if (ak == pivot1) { // Move a[k] to left part
-                    a[k] = a[less];
-                    a[less++] = pivot1;
-                }
-            }
+            // Sort left and right parts recursively
+            sort(a, left, less - 1, leftmost);
+            sort(a, great + 1, right, false);
         }
-
-        // Sort center part recursively, excluding known pivot values
-        doSort(a, less, great);
     }
 
     /**
@@ -928,7 +1109,11 @@
      * @param a the array to be sorted
      */
     public static void sort(char[] a) {
-        doSort(a, 0, a.length - 1);
+        if (a.length > COUNTING_SORT_THRESHOLD_FOR_SHORT_OR_CHAR) {
+            countingSort(a, 0, a.length - 1);
+        } else {
+            sort(a, 0, a.length - 1, true);
+        }
     }
 
     /**
@@ -946,113 +1131,166 @@
      */
     public static void sort(char[] a, int fromIndex, int toIndex) {
         rangeCheck(a.length, fromIndex, toIndex);
-        doSort(a, fromIndex, toIndex - 1);
+
+        if (toIndex - fromIndex > COUNTING_SORT_THRESHOLD_FOR_SHORT_OR_CHAR) {
+            countingSort(a, fromIndex, toIndex - 1);
+        } else {
+            sort(a, fromIndex, toIndex - 1, true);
+        }
     }
 
     /** The number of distinct char values. */
     private static final int NUM_CHAR_VALUES = 1 << 16;
 
     /**
-     * Sorts the specified range of the array into ascending order. This
-     * method differs from the public {@code sort} method in that the
-     * {@code right} index is inclusive, and it does no range checking on
-     * {@code left} or {@code right}.
-     *
-     * @param a the array to be sorted
-     * @param left the index of the first element, inclusive, to be sorted
-     * @param right the index of the last element, inclusive, to be sorted
-     */
-    private static void doSort(char[] a, int left, int right) {
-        // Use insertion sort on tiny arrays
-        if (right - left + 1 < INSERTION_SORT_THRESHOLD) {
-            for (int i = left + 1; i <= right; i++) {
-                char ai = a[i];
-                int j;
-                for (j = i - 1; j >= left && ai < a[j]; j--) {
-                    a[j + 1] = a[j];
-                }
-                a[j + 1] = ai;
-            }
-        } else if (right-left+1 > COUNTING_SORT_THRESHOLD_FOR_SHORT_OR_CHAR) {
-            // Use counting sort on huge arrays
-            int[] count = new int[NUM_CHAR_VALUES];
-
-            for (int i = left; i <= right; i++) {
-                count[a[i]]++;
-            }
-            for (int i = 0, k = left; i < count.length && k <= right; i++) {
-                for (int s = count[i]; s > 0; s--) {
-                    a[k++] = (char) i;
-               }
-            }
-        } else { // Use Dual-Pivot Quicksort on large arrays
-            dualPivotQuicksort(a, left, right);
-        }
-    }
-
-    /**
-     * Sorts the specified range of the array into ascending order by the
-     * Dual-Pivot Quicksort algorithm.
+     * Sorts the specified range of the array by counting sort.
      *
      * @param a the array to be sorted
      * @param left the index of the first element, inclusive, to be sorted
      * @param right the index of the last element, inclusive, to be sorted
      */
-    private static void dualPivotQuicksort(char[] a, int left, int right) {
-        // Compute indices of five evenly spaced elements
-        int sixth = (right - left + 1) / 6;
-        int e1 = left  + sixth;
-        int e5 = right - sixth;
-        int e3 = (left + right) >>> 1; // The midpoint
-        int e4 = e3 + sixth;
-        int e2 = e3 - sixth;
+    private static void countingSort(char[] a, int left, int right) {
+        int[] count = new int[NUM_CHAR_VALUES];
+
+        for (int i = left; i <= right; i++) {
+            count[a[i]]++;
+        }
+        for (int i = 0, k = left; k <= right; i++) {
+            while (count[i] == 0) {
+                i++;
+            }
+            char value = (char) i;
+            int s = count[i];
 
-        // Sort these elements using a 5-element sorting network
-        char ae1 = a[e1], ae2 = a[e2], ae3 = a[e3], ae4 = a[e4], ae5 = a[e5];
+            do {
+                a[k++] = value;
+            } while (--s > 0);
+        }
+    }
+
+    /**
+     * Sorts the specified range of the array into ascending order by the
+     * Dual-Pivot Quicksort algorithm. This method differs from the public
+     * {@code sort} method in that the {@code right} index is inclusive,
+     * it does no range checking on {@code left} or {@code right}, and has
+     * boolean flag whether insertion sort with sentinel is used or not.
+     *
+     * @param a the array to be sorted
+     * @param left the index of the first element, inclusive, to be sorted
+     * @param right the index of the last element, inclusive, to be sorted
+     * @param leftmost indicates if the part is the most left in the range
+     */
+    private static void sort(char[] a, int left, int right, boolean leftmost) {
+        int length = right - left + 1;
 
-        if (ae1 > ae2) { char t = ae1; ae1 = ae2; ae2 = t; }
-        if (ae4 > ae5) { char t = ae4; ae4 = ae5; ae5 = t; }
-        if (ae1 > ae3) { char t = ae1; ae1 = ae3; ae3 = t; }
-        if (ae2 > ae3) { char t = ae2; ae2 = ae3; ae3 = t; }
-        if (ae1 > ae4) { char t = ae1; ae1 = ae4; ae4 = t; }
-        if (ae3 > ae4) { char t = ae3; ae3 = ae4; ae4 = t; }
-        if (ae2 > ae5) { char t = ae2; ae2 = ae5; ae5 = t; }
-        if (ae2 > ae3) { char t = ae2; ae2 = ae3; ae3 = t; }
-        if (ae4 > ae5) { char t = ae4; ae4 = ae5; ae5 = t; }
+        // Use insertion sort on tiny arrays
+        if (length < INSERTION_SORT_THRESHOLD) {
+            if (!leftmost) {
+                /*
+                 * Every element in adjoining part plays the role
+                 * of sentinel, therefore this allows us to avoid
+                 * the j >= left check on each iteration.
+                 */
+                for (int j, i = left + 1; i <= right; i++) {
+                    char ai = a[i];
+                    for (j = i - 1; ai < a[j]; j--) {
+                        // assert j >= left;
+                        a[j + 1] = a[j];
+                    }
+                    a[j + 1] = ai;
+                }
+            } else {
+                /*
+                 * For case of leftmost part traditional (without a sentinel)
+                 * insertion sort, optimized for server JVM, is used.
+                 */
+                for (int i = left, j = i; i < right; j = ++i) {
+                    char ai = a[i + 1];
+                    while (ai < a[j]) {
+                        a[j + 1] = a[j];
+                        if (j-- == left) {
+                            break;
+                        }
+                    }
+                    a[j + 1] = ai;
+                }
+            }
+            return;
+        }
 
-        a[e1] = ae1; a[e3] = ae3; a[e5] = ae5;
+        // Inexpensive approximation of length / 7
+        int seventh = (length >>> 3) + (length >>> 6) + 1;
+
+        /*
+         * Sort five evenly spaced elements around (and including) the
+         * center element in the range. These elements will be used for
+         * pivot selection as described below. The choice for spacing
+         * these elements was empirically determined to work well on
+         * a wide variety of inputs.
+         */
+        int e3 = (left + right) >>> 1; // The midpoint
+        int e2 = e3 - seventh;
+        int e1 = e2 - seventh;
+        int e4 = e3 + seventh;
+        int e5 = e4 + seventh;
+
+        // Sort these elements using insertion sort
+        if (a[e2] < a[e1]) { char t = a[e2]; a[e2] = a[e1]; a[e1] = t; }
+
+        if (a[e3] < a[e2]) { char t = a[e3]; a[e3] = a[e2]; a[e2] = t;
+            if (t < a[e1]) { a[e2] = a[e1]; a[e1] = t; }
+        }
+        if (a[e4] < a[e3]) { char t = a[e4]; a[e4] = a[e3]; a[e3] = t;
+            if (t < a[e2]) { a[e3] = a[e2]; a[e2] = t;
+                if (t < a[e1]) { a[e2] = a[e1]; a[e1] = t; }
+            }
+        }
+        if (a[e5] < a[e4]) { char t = a[e5]; a[e5] = a[e4]; a[e4] = t;
+            if (t < a[e3]) { a[e4] = a[e3]; a[e3] = t;
+                if (t < a[e2]) { a[e3] = a[e2]; a[e2] = t;
+                    if (t < a[e1]) { a[e2] = a[e1]; a[e1] = t; }
+                }
+            }
+        }
 
         /*
          * Use the second and fourth of the five sorted elements as pivots.
          * These values are inexpensive approximations of the first and
          * second terciles of the array. Note that pivot1 <= pivot2.
-         *
-         * The pivots are stored in local variables, and the first and
-         * the last of the elements to be sorted are moved to the locations
-         * formerly occupied by the pivots. When partitioning is complete,
-         * the pivots are swapped back into their final positions, and
-         * excluded from subsequent sorting.
          */
-        char pivot1 = ae2; a[e2] = a[left];
-        char pivot2 = ae4; a[e4] = a[right];
+        char pivot1 = a[e2];
+        char pivot2 = a[e4];
 
         // Pointers
-        int less  = left  + 1; // The index of first element of center part
-        int great = right - 1; // The index before first element of right part
+        int less  = left;  // The index of the first element of center part
+        int great = right; // The index before the first element of right part
 
-        boolean pivotsDiffer = (pivot1 != pivot2);
+        if (pivot1 != pivot2) {
+            /*
+             * The first and the last elements to be sorted are moved to the
+             * locations formerly occupied by the pivots. When partitioning
+             * is complete, the pivots are swapped back into their final
+             * positions, and excluded from subsequent sorting.
+             */
+            a[e2] = a[left];
+            a[e4] = a[right];
 
-        if (pivotsDiffer) {
+            /*
+             * Skip elements, which are less or greater than pivot values.
+             */
+            while (a[++less] < pivot1);
+            while (a[--great] > pivot2);
+
             /*
              * Partitioning:
              *
-             *   left part         center part                    right part
-             * +------------------------------------------------------------+
-             * | < pivot1  |  pivot1 <= && <= pivot2  |    ?    |  > pivot2 |
-             * +------------------------------------------------------------+
-             *              ^                          ^       ^
-             *              |                          |       |
-             *             less                        k     great
+             *   left part           center part                   right part
+             * +--------------------------------------------------------------+
+             * |  < pivot1  |  pivot1 <= && <= pivot2  |    ?    |  > pivot2  |
+             * +--------------------------------------------------------------+
+             *               ^                          ^       ^
+             *               |                          |       |
+             *              less                        k     great
              *
              * Invariants:
              *
@@ -1060,16 +1298,14 @@
              *    pivot1 <= all in [less, k)     <= pivot2
              *              all in (great, right) > pivot2
              *
-             * Pointer k is the first index of ?-part
+             * Pointer k is the first index of ?-part.
              */
             outer:
             for (int k = less; k <= great; k++) {
                 char ak = a[k];
                 if (ak < pivot1) { // Move a[k] to left part
-                    if (k != less) {
-                        a[k] = a[less];
-                        a[less] = ak;
-                    }
+                    a[k] = a[less];
+                    a[less] = ak;
                     less++;
                 } else if (ak > pivot2) { // Move a[k] to right part
                     while (a[great] > pivot2) {
@@ -1079,26 +1315,107 @@
                     }
                     if (a[great] < pivot1) {
                         a[k] = a[less];
-                        a[less++] = a[great];
-                        a[great--] = ak;
+                        a[less] = a[great];
+                        less++;
                     } else { // pivot1 <= a[great] <= pivot2
                         a[k] = a[great];
-                        a[great--] = ak;
+                    }
+                    a[great] = ak;
+                    great--;
+                }
+            }
+
+            // Swap pivots into their final positions
+            a[left]  = a[less  - 1]; a[less  - 1] = pivot1;
+            a[right] = a[great + 1]; a[great + 1] = pivot2;
+
+            // Sort left and right parts recursively, excluding known pivots
+            sort(a, left, less - 2, leftmost);
+            sort(a, great + 2, right, false);
+
+            /*
+             * If center part is too large (comprises > 5/7 of the array),
+             * swap internal pivot values to ends.
+             */
+            if (less < e1 && e5 < great) {
+                /*
+                 * Skip elements, which are equal to pivot values.
+                 */
+                while (a[less] == pivot1) {
+                    less++;
+                }
+                while (a[great] == pivot2) {
+                    great--;
+                }
+
+                /*
+                 * Partitioning:
+                 *
+                 *   left part         center part                  right part
+                 * +----------------------------------------------------------+
+                 * | == pivot1 |  pivot1 < && < pivot2  |    ?    | == pivot2 |
+                 * +----------------------------------------------------------+
+                 *              ^                        ^       ^
+                 *              |                        |       |
+                 *             less                      k     great
+                 *
+                 * Invariants:
+                 *
+                 *              all in (*,  less) == pivot1
+                 *     pivot1 < all in [less,  k)  < pivot2
+                 *              all in (great, *) == pivot2
+                 *
+                 * Pointer k is the first index of ?-part.
+                 */
+                outer:
+                for (int k = less; k <= great; k++) {
+                    char ak = a[k];
+                    if (ak == pivot1) { // Move a[k] to left part
+                        a[k] = a[less];
+                        a[less] = ak;
+                        less++;
+                    } else if (ak == pivot2) { // Move a[k] to right part
+                        while (a[great] == pivot2) {
+                            if (great-- == k) {
+                                break outer;
+                            }
+                        }
+                        if (a[great] == pivot1) {
+                            a[k] = a[less];
+                            /*
+                             * Even though a[great] equals to pivot1, the
+                             * assignment a[less] = pivot1 may be incorrect,
+                             * if a[great] and pivot1 are floating-point zeros
+                             * of different signs. Therefore in float and
+                             * double sorting methods we have to use more
+                             * accurate assignment a[less] = a[great].
+                             */
+                            a[less] = pivot1;
+                            less++;
+                        } else { // pivot1 < a[great] < pivot2
+                            a[k] = a[great];
+                        }
+                        a[great] = ak;
+                        great--;
                     }
                 }
             }
+
+            // Sort center part recursively
+            sort(a, less, great, false);
+
         } else { // Pivots are equal
             /*
-             * Partition degenerates to the traditional 3-way,
-             * or "Dutch National Flag", partition:
+             * Partition degenerates to the traditional 3-way
+             * (or "Dutch National Flag") schema:
              *
-             *   left part   center part            right part
-             * +----------------------------------------------+
-             * |  < pivot  |  == pivot  |    ?    |  > pivot  |
-             * +----------------------------------------------+
-             *              ^            ^       ^
-             *              |            |       |
-             *             less          k     great
+             *   left part    center part              right part
+             * +-------------------------------------------------+
+             * |  < pivot  |   == pivot   |     ?    |  > pivot  |
+             * +-------------------------------------------------+
+             *              ^              ^        ^
+             *              |              |        |
+             *             less            k      great
              *
              * Invariants:
              *
@@ -1106,20 +1423,19 @@
              *   all in [less, k)     == pivot
              *   all in (great, right) > pivot
              *
-             * Pointer k is the first index of ?-part
+             * Pointer k is the first index of ?-part.
              */
-            for (int k = less; k <= great; k++) {
-                char ak = a[k];
-                if (ak == pivot1) {
+            for (int k = left; k <= great; k++) {
+                if (a[k] == pivot1) {
                     continue;
                 }
+                char ak = a[k];
+
                 if (ak < pivot1) { // Move a[k] to left part
-                    if (k != less) {
-                        a[k] = a[less];
-                        a[less] = ak;
-                    }
+                    a[k] = a[less];
+                    a[less] = ak;
                     less++;
-                } else { // (a[k] > pivot1) - Move a[k] to right part
+                } else { // a[k] > pivot1 - Move a[k] to right part
                     /*
                      * We know that pivot1 == a[e3] == pivot2. Thus, we know
                      * that great will still be >= k when the following loop
@@ -1127,92 +1443,33 @@
                      * In other words, a[e3] acts as a sentinel for great.
                      */
                     while (a[great] > pivot1) {
+                        // assert great > k;
                         great--;
                     }
                     if (a[great] < pivot1) {
                         a[k] = a[less];
-                        a[less++] = a[great];
-                        a[great--] = ak;
+                        a[less] = a[great];
+                        less++;
                     } else { // a[great] == pivot1
+                        /*
+                         * Even though a[great] equals to pivot1, the
+                         * assignment a[k] = pivot1 may be incorrect,
+                         * if a[great] and pivot1 are floating-point
+                         * zeros of different signs. Therefore in float
+                         * and double sorting methods we have to use
+                         * more accurate assignment a[k] = a[great].
+                         */
                         a[k] = pivot1;
-                        a[great--] = ak;
                     }
+                    a[great] = ak;
+                    great--;
                 }
             }
-        }
-
-        // Swap pivots into their final positions
-        a[left]  = a[less  - 1]; a[less  - 1] = pivot1;
-        a[right] = a[great + 1]; a[great + 1] = pivot2;
-
-        // Sort left and right parts recursively, excluding known pivot values
-        doSort(a, left,   less - 2);
-        doSort(a, great + 2, right);
-
-        /*
-         * If pivot1 == pivot2, all elements from center
-         * part are equal and, therefore, already sorted
-         */
-        if (!pivotsDiffer) {
-            return;
-        }
-
-        /*
-         * If center part is too large (comprises > 2/3 of the array),
-         * swap internal pivot values to ends
-         */
-        if (less < e1 && great > e5) {
-            while (a[less] == pivot1) {
-                less++;
-            }
-            while (a[great] == pivot2) {
-                great--;
-            }
 
-            /*
-             * Partitioning:
-             *
-             *   left part       center part                   right part
-             * +----------------------------------------------------------+
-             * | == pivot1 |  pivot1 < && < pivot2  |    ?    | == pivot2 |
-             * +----------------------------------------------------------+
-             *              ^                        ^       ^
-             *              |                        |       |
-             *             less                      k     great
-             *
-             * Invariants:
-             *
-             *              all in (*, less)  == pivot1
-             *     pivot1 < all in [less, k)   < pivot2
-             *              all in (great, *) == pivot2
-             *
-             * Pointer k is the first index of ?-part
-             */
-            outer:
-            for (int k = less; k <= great; k++) {
-                char ak = a[k];
-                if (ak == pivot2) { // Move a[k] to right part
-                    while (a[great] == pivot2) {
-                        if (great-- == k) {
-                            break outer;
-                        }
-                    }
-                    if (a[great] == pivot1) {
-                        a[k] = a[less];
-                        a[less++] = pivot1;
-                    } else { // pivot1 < a[great] < pivot2
-                        a[k] = a[great];
-                    }
-                    a[great--] = pivot2;
-                } else if (ak == pivot1) { // Move a[k] to left part
-                    a[k] = a[less];
-                    a[less++] = pivot1;
-                }
-            }
+            // Sort left and right parts recursively
+            sort(a, left, less - 1, leftmost);
+            sort(a, great + 1, right, false);
         }
-
-        // Sort center part recursively, excluding known pivot values
-        doSort(a, less, great);
     }
 
     /**
@@ -1221,7 +1478,11 @@
      * @param a the array to be sorted
      */
     public static void sort(byte[] a) {
-        doSort(a, 0, a.length - 1);
+        if (a.length > COUNTING_SORT_THRESHOLD_FOR_BYTE) {
+            countingSort(a, 0, a.length - 1);
+        } else {
+            sort(a, 0, a.length - 1, true);
+        }
     }
 
     /**
@@ -1239,115 +1500,166 @@
      */
     public static void sort(byte[] a, int fromIndex, int toIndex) {
         rangeCheck(a.length, fromIndex, toIndex);
-        doSort(a, fromIndex, toIndex - 1);
+
+        if (toIndex - fromIndex > COUNTING_SORT_THRESHOLD_FOR_BYTE) {
+            countingSort(a, fromIndex, toIndex - 1);
+        } else {
+            sort(a, fromIndex, toIndex - 1, true);
+        }
     }
 
     /** The number of distinct byte values. */
     private static final int NUM_BYTE_VALUES = 1 << 8;
 
     /**
-     * Sorts the specified range of the array into ascending order. This
-     * method differs from the public {@code sort} method in that the
-     * {@code right} index is inclusive, and it does no range checking on
-     * {@code left} or {@code right}.
-     *
-     * @param a the array to be sorted
-     * @param left the index of the first element, inclusive, to be sorted
-     * @param right the index of the last element, inclusive, to be sorted
-     */
-    private static void doSort(byte[] a, int left, int right) {
-        // Use insertion sort on tiny arrays
-        if (right - left + 1 < INSERTION_SORT_THRESHOLD) {
-            for (int i = left + 1; i <= right; i++) {
-                byte ai = a[i];
-                int j;
-                for (j = i - 1; j >= left && ai < a[j]; j--) {
-                    a[j + 1] = a[j];
-                }
-                a[j + 1] = ai;
-            }
-        } else if (right - left + 1 > COUNTING_SORT_THRESHOLD_FOR_BYTE) {
-            // Use counting sort on huge arrays
-            int[] count = new int[NUM_BYTE_VALUES];
-
-            for (int i = left; i <= right; i++) {
-                count[a[i] - Byte.MIN_VALUE]++;
-            }
-            for (int i = 0, k = left; i < count.length && k <= right; i++) {
-                byte value = (byte) (i + Byte.MIN_VALUE);
-
-                for (int s = count[i]; s > 0; s--) {
-                    a[k++] = value;
-               }
-            }
-        } else { // Use Dual-Pivot Quicksort on large arrays
-            dualPivotQuicksort(a, left, right);
-        }
-    }
-
-    /**
-     * Sorts the specified range of the array into ascending order by the
-     * Dual-Pivot Quicksort algorithm.
+     * Sorts the specified range of the array by counting sort.
      *
      * @param a the array to be sorted
      * @param left the index of the first element, inclusive, to be sorted
      * @param right the index of the last element, inclusive, to be sorted
      */
-    private static void dualPivotQuicksort(byte[] a, int left, int right) {
-        // Compute indices of five evenly spaced elements
-        int sixth = (right - left + 1) / 6;
-        int e1 = left  + sixth;
-        int e5 = right - sixth;
-        int e3 = (left + right) >>> 1; // The midpoint
-        int e4 = e3 + sixth;
-        int e2 = e3 - sixth;
+    private static void countingSort(byte[] a, int left, int right) {
+        int[] count = new int[NUM_BYTE_VALUES];
+
+        for (int i = left; i <= right; i++) {
+            count[a[i] - Byte.MIN_VALUE]++;
+        }
+        for (int i = NUM_BYTE_VALUES - 1, k = right; k >= left; i--) {
+            while (count[i] == 0) {
+                i--;
+            }
+            byte value = (byte) (i + Byte.MIN_VALUE);
+            int s = count[i];
 
-        // Sort these elements using a 5-element sorting network
-        byte ae1 = a[e1], ae2 = a[e2], ae3 = a[e3], ae4 = a[e4], ae5 = a[e5];
+            do {
+                a[k--] = value;
+            } while (--s > 0);
+        }
+    }
+
+    /**
+     * Sorts the specified range of the array into ascending order by the
+     * Dual-Pivot Quicksort algorithm. This method differs from the public
+     * {@code sort} method in that the {@code right} index is inclusive,
+     * it does no range checking on {@code left} or {@code right}, and has
+     * boolean flag whether insertion sort with sentinel is used or not.
+     *
+     * @param a the array to be sorted
+     * @param left the index of the first element, inclusive, to be sorted
+     * @param right the index of the last element, inclusive, to be sorted
+     * @param leftmost indicates if the part is the most left in the range
+     */
+    private static void sort(byte[] a, int left, int right, boolean leftmost) {
+        int length = right - left + 1;
 
-        if (ae1 > ae2) { byte t = ae1; ae1 = ae2; ae2 = t; }
-        if (ae4 > ae5) { byte t = ae4; ae4 = ae5; ae5 = t; }
-        if (ae1 > ae3) { byte t = ae1; ae1 = ae3; ae3 = t; }
-        if (ae2 > ae3) { byte t = ae2; ae2 = ae3; ae3 = t; }
-        if (ae1 > ae4) { byte t = ae1; ae1 = ae4; ae4 = t; }
-        if (ae3 > ae4) { byte t = ae3; ae3 = ae4; ae4 = t; }
-        if (ae2 > ae5) { byte t = ae2; ae2 = ae5; ae5 = t; }
-        if (ae2 > ae3) { byte t = ae2; ae2 = ae3; ae3 = t; }
-        if (ae4 > ae5) { byte t = ae4; ae4 = ae5; ae5 = t; }
+        // Use insertion sort on tiny arrays
+        if (length < INSERTION_SORT_THRESHOLD) {
+            if (!leftmost) {
+                /*
+                 * Every element in adjoining part plays the role
+                 * of sentinel, therefore this allows us to avoid
+                 * the j >= left check on each iteration.
+                 */
+                for (int j, i = left + 1; i <= right; i++) {
+                    byte ai = a[i];
+                    for (j = i - 1; ai < a[j]; j--) {
+                        // assert j >= left;
+                        a[j + 1] = a[j];
+                    }
+                    a[j + 1] = ai;
+                }
+            } else {
+                /*
+                 * For case of leftmost part traditional (without a sentinel)
+                 * insertion sort, optimized for server JVM, is used.
+                 */
+                for (int i = left, j = i; i < right; j = ++i) {
+                    byte ai = a[i + 1];
+                    while (ai < a[j]) {
+                        a[j + 1] = a[j];
+                        if (j-- == left) {
+                            break;
+                        }
+                    }
+                    a[j + 1] = ai;
+                }
+            }
+            return;
+        }
 
-        a[e1] = ae1; a[e3] = ae3; a[e5] = ae5;
+        // Inexpensive approximation of length / 7
+        int seventh = (length >>> 3) + (length >>> 6) + 1;
+
+        /*
+         * Sort five evenly spaced elements around (and including) the
+         * center element in the range. These elements will be used for
+         * pivot selection as described below. The choice for spacing
+         * these elements was empirically determined to work well on
+         * a wide variety of inputs.
+         */
+        int e3 = (left + right) >>> 1; // The midpoint
+        int e2 = e3 - seventh;
+        int e1 = e2 - seventh;
+        int e4 = e3 + seventh;
+        int e5 = e4 + seventh;
+
+        // Sort these elements using insertion sort
+        if (a[e2] < a[e1]) { byte t = a[e2]; a[e2] = a[e1]; a[e1] = t; }
+
+        if (a[e3] < a[e2]) { byte t = a[e3]; a[e3] = a[e2]; a[e2] = t;
+            if (t < a[e1]) { a[e2] = a[e1]; a[e1] = t; }
+        }
+        if (a[e4] < a[e3]) { byte t = a[e4]; a[e4] = a[e3]; a[e3] = t;
+            if (t < a[e2]) { a[e3] = a[e2]; a[e2] = t;
+                if (t < a[e1]) { a[e2] = a[e1]; a[e1] = t; }
+            }
+        }
+        if (a[e5] < a[e4]) { byte t = a[e5]; a[e5] = a[e4]; a[e4] = t;
+            if (t < a[e3]) { a[e4] = a[e3]; a[e3] = t;
+                if (t < a[e2]) { a[e3] = a[e2]; a[e2] = t;
+                    if (t < a[e1]) { a[e2] = a[e1]; a[e1] = t; }
+                }
+            }
+        }
 
         /*
          * Use the second and fourth of the five sorted elements as pivots.
          * These values are inexpensive approximations of the first and
          * second terciles of the array. Note that pivot1 <= pivot2.
-         *
-         * The pivots are stored in local variables, and the first and
-         * the last of the elements to be sorted are moved to the locations
-         * formerly occupied by the pivots. When partitioning is complete,
-         * the pivots are swapped back into their final positions, and
-         * excluded from subsequent sorting.
          */
-        byte pivot1 = ae2; a[e2] = a[left];
-        byte pivot2 = ae4; a[e4] = a[right];
+        byte pivot1 = a[e2];
+        byte pivot2 = a[e4];
 
         // Pointers
-        int less  = left  + 1; // The index of first element of center part
-        int great = right - 1; // The index before first element of right part
+        int less  = left;  // The index of the first element of center part
+        int great = right; // The index before the first element of right part
 
-        boolean pivotsDiffer = (pivot1 != pivot2);
+        if (pivot1 != pivot2) {
+            /*
+             * The first and the last elements to be sorted are moved to the
+             * locations formerly occupied by the pivots. When partitioning
+             * is complete, the pivots are swapped back into their final
+             * positions, and excluded from subsequent sorting.
+             */
+            a[e2] = a[left];
+            a[e4] = a[right];
 
-        if (pivotsDiffer) {
+            /*
+             * Skip elements, which are less or greater than pivot values.
+             */
+            while (a[++less] < pivot1);
+            while (a[--great] > pivot2);
+
             /*
              * Partitioning:
              *
-             *   left part         center part                    right part
-             * +------------------------------------------------------------+
-             * | < pivot1  |  pivot1 <= && <= pivot2  |    ?    |  > pivot2 |
-             * +------------------------------------------------------------+
-             *              ^                          ^       ^
-             *              |                          |       |
-             *             less                        k     great
+             *   left part           center part                   right part
+             * +--------------------------------------------------------------+
+             * |  < pivot1  |  pivot1 <= && <= pivot2  |    ?    |  > pivot2  |
+             * +--------------------------------------------------------------+
+             *               ^                          ^       ^
+             *               |                          |       |
+             *              less                        k     great
              *
              * Invariants:
              *
@@ -1355,16 +1667,14 @@
              *    pivot1 <= all in [less, k)     <= pivot2
              *              all in (great, right) > pivot2
              *
-             * Pointer k is the first index of ?-part
+             * Pointer k is the first index of ?-part.
              */
             outer:
             for (int k = less; k <= great; k++) {
                 byte ak = a[k];
                 if (ak < pivot1) { // Move a[k] to left part
-                    if (k != less) {
-                        a[k] = a[less];
-                        a[less] = ak;
-                    }
+                    a[k] = a[less];
+                    a[less] = ak;
                     less++;
                 } else if (ak > pivot2) { // Move a[k] to right part
                     while (a[great] > pivot2) {
@@ -1374,26 +1684,107 @@
                     }
                     if (a[great] < pivot1) {
                         a[k] = a[less];
-                        a[less++] = a[great];
-                        a[great--] = ak;
+                        a[less] = a[great];
+                        less++;
                     } else { // pivot1 <= a[great] <= pivot2
                         a[k] = a[great];
-                        a[great--] = ak;
+                    }
+                    a[great] = ak;
+                    great--;
+                }
+            }
+
+            // Swap pivots into their final positions
+            a[left]  = a[less  - 1]; a[less  - 1] = pivot1;
+            a[right] = a[great + 1]; a[great + 1] = pivot2;
+
+            // Sort left and right parts recursively, excluding known pivots
+            sort(a, left, less - 2, leftmost);
+            sort(a, great + 2, right, false);
+
+            /*
+             * If center part is too large (comprises > 5/7 of the array),
+             * swap internal pivot values to ends.
+             */
+            if (less < e1 && e5 < great) {
+                /*
+                 * Skip elements, which are equal to pivot values.
+                 */
+                while (a[less] == pivot1) {
+                    less++;
+                }
+                while (a[great] == pivot2) {
+                    great--;
+                }
+
+                /*
+                 * Partitioning:
+                 *
+                 *   left part         center part                  right part
+                 * +----------------------------------------------------------+
+                 * | == pivot1 |  pivot1 < && < pivot2  |    ?    | == pivot2 |
+                 * +----------------------------------------------------------+
+                 *              ^                        ^       ^
+                 *              |                        |       |
+                 *             less                      k     great
+                 *
+                 * Invariants:
+                 *
+                 *              all in (*,  less) == pivot1
+                 *     pivot1 < all in [less,  k)  < pivot2
+                 *              all in (great, *) == pivot2
+                 *
+                 * Pointer k is the first index of ?-part.
+                 */
+                outer:
+                for (int k = less; k <= great; k++) {
+                    byte ak = a[k];
+                    if (ak == pivot1) { // Move a[k] to left part
+                        a[k] = a[less];
+                        a[less] = ak;
+                        less++;
+                    } else if (ak == pivot2) { // Move a[k] to right part
+                        while (a[great] == pivot2) {
+                            if (great-- == k) {
+                                break outer;
+                            }
+                        }
+                        if (a[great] == pivot1) {
+                            a[k] = a[less];
+                            /*
+                             * Even though a[great] equals to pivot1, the
+                             * assignment a[less] = pivot1 may be incorrect,
+                             * if a[great] and pivot1 are floating-point zeros
+                             * of different signs. Therefore in float and
+                             * double sorting methods we have to use more
+                             * accurate assignment a[less] = a[great].
+                             */
+                            a[less] = pivot1;
+                            less++;
+                        } else { // pivot1 < a[great] < pivot2
+                            a[k] = a[great];
+                        }
+                        a[great] = ak;
+                        great--;
                     }
                 }
             }
+
+            // Sort center part recursively
+            sort(a, less, great, false);
+
         } else { // Pivots are equal
             /*
-             * Partition degenerates to the traditional 3-way,
-             * or "Dutch National Flag", partition:
+             * Partition degenerates to the traditional 3-way
+             * (or "Dutch National Flag") schema:
              *
-             *   left part   center part            right part
-             * +----------------------------------------------+
-             * |  < pivot  |  == pivot  |    ?    |  > pivot  |
-             * +----------------------------------------------+
-             *              ^            ^       ^
-             *              |            |       |
-             *             less          k     great
+             *   left part    center part              right part
+             * +-------------------------------------------------+
+             * |  < pivot  |   == pivot   |     ?    |  > pivot  |
+             * +-------------------------------------------------+
+             *              ^              ^        ^
+             *              |              |        |
+             *             less            k      great
              *
              * Invariants:
              *
@@ -1401,20 +1792,19 @@
              *   all in [less, k)     == pivot
              *   all in (great, right) > pivot
              *
-             * Pointer k is the first index of ?-part
+             * Pointer k is the first index of ?-part.
              */
-            for (int k = less; k <= great; k++) {
-                byte ak = a[k];
-                if (ak == pivot1) {
+            for (int k = left; k <= great; k++) {
+                if (a[k] == pivot1) {
                     continue;
                 }
+                byte ak = a[k];
+
                 if (ak < pivot1) { // Move a[k] to left part
-                    if (k != less) {
-                        a[k] = a[less];
-                        a[less] = ak;
-                    }
+                    a[k] = a[less];
+                    a[less] = ak;
                     less++;
-                } else { // (a[k] > pivot1) - Move a[k] to right part
+                } else { // a[k] > pivot1 - Move a[k] to right part
                     /*
                      * We know that pivot1 == a[e3] == pivot2. Thus, we know
                      * that great will still be >= k when the following loop
@@ -1422,92 +1812,33 @@
                      * In other words, a[e3] acts as a sentinel for great.
                      */
                     while (a[great] > pivot1) {
+                        // assert great > k;
                         great--;
                     }
                     if (a[great] < pivot1) {
                         a[k] = a[less];
-                        a[less++] = a[great];
-                        a[great--] = ak;
+                        a[less] = a[great];
+                        less++;
                     } else { // a[great] == pivot1
+                        /*
+                         * Even though a[great] equals to pivot1, the
+                         * assignment a[k] = pivot1 may be incorrect,
+                         * if a[great] and pivot1 are floating-point
+                         * zeros of different signs. Therefore in float
+                         * and double sorting methods we have to use
+                         * more accurate assignment a[k] = a[great].
+                         */
                         a[k] = pivot1;
-                        a[great--] = ak;
                     }
+                    a[great] = ak;
+                    great--;
                 }
             }
-        }
-
-        // Swap pivots into their final positions
-        a[left]  = a[less  - 1]; a[less  - 1] = pivot1;
-        a[right] = a[great + 1]; a[great + 1] = pivot2;
-
-        // Sort left and right parts recursively, excluding known pivot values
-        doSort(a, left,   less - 2);
-        doSort(a, great + 2, right);
-
-        /*
-         * If pivot1 == pivot2, all elements from center
-         * part are equal and, therefore, already sorted
-         */
-        if (!pivotsDiffer) {
-            return;
-        }
-
-        /*
-         * If center part is too large (comprises > 2/3 of the array),
-         * swap internal pivot values to ends
-         */
-        if (less < e1 && great > e5) {
-            while (a[less] == pivot1) {
-                less++;
-            }
-            while (a[great] == pivot2) {
-                great--;
-            }
 
-            /*
-             * Partitioning:
-             *
-             *   left part       center part                   right part
-             * +----------------------------------------------------------+
-             * | == pivot1 |  pivot1 < && < pivot2  |    ?    | == pivot2 |
-             * +----------------------------------------------------------+
-             *              ^                        ^       ^
-             *              |                        |       |
-             *             less                      k     great
-             *
-             * Invariants:
-             *
-             *              all in (*, less)  == pivot1
-             *     pivot1 < all in [less, k)   < pivot2
-             *              all in (great, *) == pivot2
-             *
-             * Pointer k is the first index of ?-part
-             */
-            outer:
-            for (int k = less; k <= great; k++) {
-                byte ak = a[k];
-                if (ak == pivot2) { // Move a[k] to right part
-                    while (a[great] == pivot2) {
-                        if (great-- == k) {
-                            break outer;
-                        }
-                    }
-                    if (a[great] == pivot1) {
-                        a[k] = a[less];
-                        a[less++] = pivot1;
-                    } else { // pivot1 < a[great] < pivot2
-                        a[k] = a[great];
-                    }
-                    a[great--] = pivot2;
-                } else if (ak == pivot1) { // Move a[k] to left part
-                    a[k] = a[less];
-                    a[less++] = pivot1;
-                }
-            }
+            // Sort left and right parts recursively
+            sort(a, left, less - 1, leftmost);
+            sort(a, great + 1, right, false);
         }
-
-        // Sort center part recursively, excluding known pivot values
-        doSort(a, less, great);
     }
 
     /**
@@ -1531,7 +1862,7 @@
      * Sorts the specified range of the array into ascending order. The range
      * to be sorted extends from the index {@code fromIndex}, inclusive, to
      * the index {@code toIndex}, exclusive. If {@code fromIndex == toIndex},
-     * the range to be sorted is empty and the call is a no-op).
+     * the range to be sorted is empty (and the call is a no-op).
      *
      * <p>The {@code <} relation does not provide a total order on all float
      * values: {@code -0.0f == 0.0f} is {@code true} and a {@code Float.NaN}
@@ -1565,162 +1896,207 @@
      */
     private static void sortNegZeroAndNaN(float[] a, int left, int right) {
         /*
-         * Phase 1: Count negative zeros and move NaNs to end of array
+         * Phase 1: Move NaNs to the end of the array.
          */
-        final int NEGATIVE_ZERO = Float.floatToIntBits(-0.0f);
-        int numNegativeZeros = 0;
-        int n = right;
-
-        for (int k = left; k <= n; k++) {
+        while (left <= right && Float.isNaN(a[right])) {
+            right--;
+        }
+        for (int k = right - 1; k >= left; k--) {
             float ak = a[k];
-            if (ak == 0.0f && NEGATIVE_ZERO == Float.floatToIntBits(ak)) {
-                a[k] = 0.0f;
-                numNegativeZeros++;
-            } else if (ak != ak) { // i.e., ak is NaN
-                a[k--] = a[n];
-                a[n--] = Float.NaN;
+            if (ak != ak) { // a[k] is NaN
+                a[k] = a[right];
+                a[right] = ak;
+                right--;
             }
         }
 
         /*
-         * Phase 2: Sort everything except NaNs (which are already in place)
+         * Phase 2: Sort everything except NaNs (which are already in place).
          */
-        doSort(a, left, n);
+        sort(a, left, right, true);
 
         /*
-         * Phase 3: Turn positive zeros back into negative zeros as appropriate
+         * Phase 3: Place negative zeros before positive zeros.
          */
-        if (numNegativeZeros == 0) {
-            return;
-        }
-
-        // Find first zero element
-        int zeroIndex = findAnyZero(a, left, n);
-
-        for (int i = zeroIndex - 1; i >= left && a[i] == 0.0f; i--) {
-            zeroIndex = i;
-        }
+        int hi = right;
 
-        // Turn the right number of positive zeros back into negative zeros
-        for (int i = zeroIndex, m = zeroIndex + numNegativeZeros; i < m; i++) {
-            a[i] = -0.0f;
-        }
-    }
-
-    /**
-     * Returns the index of some zero element in the specified range via
-     * binary search. The range is assumed to be sorted, and must contain
-     * at least one zero.
-     *
-     * @param a the array to be searched
-     * @param low the index of the first element, inclusive, to be searched
-     * @param high the index of the last element, inclusive, to be searched
-     */
-    private static int findAnyZero(float[] a, int low, int high) {
-        while (true) {
-            int middle = (low + high) >>> 1;
+        /*
+         * Search first zero, or first positive, or last negative element.
+         */
+        while (left < hi) {
+            int middle = (left + hi) >>> 1;
             float middleValue = a[middle];
 
             if (middleValue < 0.0f) {
-                low = middle + 1;
-            } else if (middleValue > 0.0f) {
-                high = middle - 1;
-            } else { // middleValue == 0.0f
-                return middle;
+                left = middle + 1;
+            } else {
+                hi = middle;
+            }
+        }
+
+        /*
+         * Skip the last negative value (if any) or all leading negative zeros.
+         */
+        while (left <= right && Float.floatToRawIntBits(a[left]) < 0) {
+            left++;
+        }
+
+        /*
+         * Move negative zeros to the beginning of the sub-range.
+         *
+         * Partitioning:
+         *
+         * +---------------------------------------------------+
+         * |   < 0.0   |   -0.0   |    0.0    |  ?  ( >= 0.0 ) |
+         * +---------------------------------------------------+
+         *              ^          ^           ^
+         *              |          |           |
+         *             left        p           k
+         *
+         * Invariants:
+         *
+         *   all in (*,  left)  <  0.0
+         *   all in [left,  p) == -0.0
+         *   all in [p,     k) ==  0.0
+         *   all in [k, right] >=  0.0
+         *
+         * Pointer k is the first index of ?-part.
+         */
+        for (int k = left + 1, p = left; k <= right; k++) {
+            float ak = a[k];
+            if (ak != 0.0f) {
+                break;
+            }
+            if (Float.floatToRawIntBits(ak) < 0) { // ak is -0.0f
+                a[k] = 0.0f;
+                a[p++] = -0.0f;
             }
         }
     }
 
     /**
-     * Sorts the specified range of the array into ascending order. This
-     * method differs from the public {@code sort} method in three ways:
-     * {@code right} index is inclusive, it does no range checking on
-     * {@code left} or {@code right}, and it does not handle negative
-     * zeros or NaNs in the array.
-     *
-     * @param a the array to be sorted, which must not contain -0.0f or NaN
-     * @param left the index of the first element, inclusive, to be sorted
-     * @param right the index of the last element, inclusive, to be sorted
-     */
-    private static void doSort(float[] a, int left, int right) {
-        // Use insertion sort on tiny arrays
-        if (right - left + 1 < INSERTION_SORT_THRESHOLD) {
-            for (int i = left + 1; i <= right; i++) {
-                float ai = a[i];
-                int j;
-                for (j = i - 1; j >= left && ai < a[j]; j--) {
-                    a[j + 1] = a[j];
-                }
-                a[j + 1] = ai;
-            }
-        } else { // Use Dual-Pivot Quicksort on large arrays
-            dualPivotQuicksort(a, left, right);
-        }
-    }
-
-    /**
      * Sorts the specified range of the array into ascending order by the
-     * Dual-Pivot Quicksort algorithm.
+     * Dual-Pivot Quicksort algorithm. This method differs from the public
+     * {@code sort} method in that the {@code right} index is inclusive,
+     * it does no range checking on {@code left} or {@code right}, and has
+     * boolean flag whether insertion sort with sentinel is used or not.
      *
      * @param a the array to be sorted
      * @param left the index of the first element, inclusive, to be sorted
      * @param right the index of the last element, inclusive, to be sorted
+     * @param leftmost indicates if the part is the most left in the range
      */
-    private static void dualPivotQuicksort(float[] a, int left, int right) {
-        // Compute indices of five evenly spaced elements
-        int sixth = (right - left + 1) / 6;
-        int e1 = left  + sixth;
-        int e5 = right - sixth;
-        int e3 = (left + right) >>> 1; // The midpoint
-        int e4 = e3 + sixth;
-        int e2 = e3 - sixth;
+    private static void sort(float[] a, int left, int right,boolean leftmost) {
+        int length = right - left + 1;
 
-        // Sort these elements using a 5-element sorting network
-        float ae1 = a[e1], ae2 = a[e2], ae3 = a[e3], ae4 = a[e4], ae5 = a[e5];
+        // Use insertion sort on tiny arrays
+        if (length < INSERTION_SORT_THRESHOLD) {
+            if (!leftmost) {
+                /*
+                 * Every element in adjoining part plays the role
+                 * of sentinel, therefore this allows us to avoid
+                 * the j >= left check on each iteration.
+                 */
+                for (int j, i = left + 1; i <= right; i++) {
+                    float ai = a[i];
+                    for (j = i - 1; ai < a[j]; j--) {
+                        // assert j >= left;
+                        a[j + 1] = a[j];
+                    }
+                    a[j + 1] = ai;
+                }
+            } else {
+                /*
+                 * For case of leftmost part traditional (without a sentinel)
+                 * insertion sort, optimized for server JVM, is used.
+                 */
+                for (int i = left, j = i; i < right; j = ++i) {
+                    float ai = a[i + 1];
+                    while (ai < a[j]) {
+                        a[j + 1] = a[j];
+                        if (j-- == left) {
+                            break;
+                        }
+                    }
+                    a[j + 1] = ai;
+                }
+            }
+            return;
+        }
 
-        if (ae1 > ae2) { float t = ae1; ae1 = ae2; ae2 = t; }
-        if (ae4 > ae5) { float t = ae4; ae4 = ae5; ae5 = t; }
-        if (ae1 > ae3) { float t = ae1; ae1 = ae3; ae3 = t; }
-        if (ae2 > ae3) { float t = ae2; ae2 = ae3; ae3 = t; }
-        if (ae1 > ae4) { float t = ae1; ae1 = ae4; ae4 = t; }
-        if (ae3 > ae4) { float t = ae3; ae3 = ae4; ae4 = t; }
-        if (ae2 > ae5) { float t = ae2; ae2 = ae5; ae5 = t; }
-        if (ae2 > ae3) { float t = ae2; ae2 = ae3; ae3 = t; }
-        if (ae4 > ae5) { float t = ae4; ae4 = ae5; ae5 = t; }
+        // Inexpensive approximation of length / 7
+        int seventh = (length >>> 3) + (length >>> 6) + 1;
+
+        /*
+         * Sort five evenly spaced elements around (and including) the
+         * center element in the range. These elements will be used for
+         * pivot selection as described below. The choice for spacing
+         * these elements was empirically determined to work well on
+         * a wide variety of inputs.
+         */
+        int e3 = (left + right) >>> 1; // The midpoint
+        int e2 = e3 - seventh;
+        int e1 = e2 - seventh;
+        int e4 = e3 + seventh;
+        int e5 = e4 + seventh;
 
-        a[e1] = ae1; a[e3] = ae3; a[e5] = ae5;
+        // Sort these elements using insertion sort
+        if (a[e2] < a[e1]) { float t = a[e2]; a[e2] = a[e1]; a[e1] = t; }
+
+        if (a[e3] < a[e2]) { float t = a[e3]; a[e3] = a[e2]; a[e2] = t;
+            if (t < a[e1]) { a[e2] = a[e1]; a[e1] = t; }
+        }
+        if (a[e4] < a[e3]) { float t = a[e4]; a[e4] = a[e3]; a[e3] = t;
+            if (t < a[e2]) { a[e3] = a[e2]; a[e2] = t;
+                if (t < a[e1]) { a[e2] = a[e1]; a[e1] = t; }
+            }
+        }
+        if (a[e5] < a[e4]) { float t = a[e5]; a[e5] = a[e4]; a[e4] = t;
+            if (t < a[e3]) { a[e4] = a[e3]; a[e3] = t;
+                if (t < a[e2]) { a[e3] = a[e2]; a[e2] = t;
+                    if (t < a[e1]) { a[e2] = a[e1]; a[e1] = t; }
+                }
+            }
+        }
 
         /*
          * Use the second and fourth of the five sorted elements as pivots.
          * These values are inexpensive approximations of the first and
          * second terciles of the array. Note that pivot1 <= pivot2.
-         *
-         * The pivots are stored in local variables, and the first and
-         * the last of the elements to be sorted are moved to the locations
-         * formerly occupied by the pivots. When partitioning is complete,
-         * the pivots are swapped back into their final positions, and
-         * excluded from subsequent sorting.
          */
-        float pivot1 = ae2; a[e2] = a[left];
-        float pivot2 = ae4; a[e4] = a[right];
+        float pivot1 = a[e2];
+        float pivot2 = a[e4];
 
         // Pointers
-        int less  = left  + 1; // The index of first element of center part
-        int great = right - 1; // The index before first element of right part
+        int less  = left;  // The index of the first element of center part
+        int great = right; // The index before the first element of right part
 
-        boolean pivotsDiffer = (pivot1 != pivot2);
+        if (pivot1 != pivot2) {
+            /*
+             * The first and the last elements to be sorted are moved to the
+             * locations formerly occupied by the pivots. When partitioning
+             * is complete, the pivots are swapped back into their final
+             * positions, and excluded from subsequent sorting.
+             */
+            a[e2] = a[left];
+            a[e4] = a[right];
 
-        if (pivotsDiffer) {
+            /*
+             * Skip elements, which are less or greater than pivot values.
+             */
+            while (a[++less] < pivot1);
+            while (a[--great] > pivot2);
+
             /*
              * Partitioning:
              *
-             *   left part         center part                    right part
-             * +------------------------------------------------------------+
-             * | < pivot1  |  pivot1 <= && <= pivot2  |    ?    |  > pivot2 |
-             * +------------------------------------------------------------+
-             *              ^                          ^       ^
-             *              |                          |       |
-             *             less                        k     great
+             *   left part           center part                   right part
+             * +--------------------------------------------------------------+
+             * |  < pivot1  |  pivot1 <= && <= pivot2  |    ?    |  > pivot2  |
+             * +--------------------------------------------------------------+
+             *               ^                          ^       ^
+             *               |                          |       |
+             *              less                        k     great
              *
              * Invariants:
              *
@@ -1728,16 +2104,14 @@
              *    pivot1 <= all in [less, k)     <= pivot2
              *              all in (great, right) > pivot2
              *
-             * Pointer k is the first index of ?-part
+             * Pointer k is the first index of ?-part.
              */
             outer:
             for (int k = less; k <= great; k++) {
                 float ak = a[k];
                 if (ak < pivot1) { // Move a[k] to left part
-                    if (k != less) {
-                        a[k] = a[less];
-                        a[less] = ak;
-                    }
+                    a[k] = a[less];
+                    a[less] = ak;
                     less++;
                 } else if (ak > pivot2) { // Move a[k] to right part
                     while (a[great] > pivot2) {
@@ -1747,26 +2121,107 @@
                     }
                     if (a[great] < pivot1) {
                         a[k] = a[less];
-                        a[less++] = a[great];
-                        a[great--] = ak;
+                        a[less] = a[great];
+                        less++;
                     } else { // pivot1 <= a[great] <= pivot2
                         a[k] = a[great];
-                        a[great--] = ak;
+                    }
+                    a[great] = ak;
+                    great--;
+                }
+            }
+
+            // Swap pivots into their final positions
+            a[left]  = a[less  - 1]; a[less  - 1] = pivot1;
+            a[right] = a[great + 1]; a[great + 1] = pivot2;
+
+            // Sort left and right parts recursively, excluding known pivots
+            sort(a, left, less - 2, leftmost);
+            sort(a, great + 2, right, false);
+
+            /*
+             * If center part is too large (comprises > 5/7 of the array),
+             * swap internal pivot values to ends.
+             */
+            if (less < e1 && e5 < great) {
+                /*
+                 * Skip elements, which are equal to pivot values.
+                 */
+                while (a[less] == pivot1) {
+                    less++;
+                }
+                while (a[great] == pivot2) {
+                    great--;
+                }
+
+                /*
+                 * Partitioning:
+                 *
+                 *   left part         center part                  right part
+                 * +----------------------------------------------------------+
+                 * | == pivot1 |  pivot1 < && < pivot2  |    ?    | == pivot2 |
+                 * +----------------------------------------------------------+
+                 *              ^                        ^       ^
+                 *              |                        |       |
+                 *             less                      k     great
+                 *
+                 * Invariants:
+                 *
+                 *              all in (*,  less) == pivot1
+                 *     pivot1 < all in [less,  k)  < pivot2
+                 *              all in (great, *) == pivot2
+                 *
+                 * Pointer k is the first index of ?-part.
+                 */
+                outer:
+                for (int k = less; k <= great; k++) {
+                    float ak = a[k];
+                    if (ak == pivot1) { // Move a[k] to left part
+                        a[k] = a[less];
+                        a[less] = ak;
+                        less++;
+                    } else if (ak == pivot2) { // Move a[k] to right part
+                        while (a[great] == pivot2) {
+                            if (great-- == k) {
+                                break outer;
+                            }
+                        }
+                        if (a[great] == pivot1) {
+                            a[k] = a[less];
+                            /*
+                             * Even though a[great] equals to pivot1, the
+                             * assignment a[less] = pivot1 may be incorrect,
+                             * if a[great] and pivot1 are floating-point zeros
+                             * of different signs. Therefore in float and
+                             * double sorting methods we have to use more
+                             * accurate assignment a[less] = a[great].
+                             */
+                            a[less] = a[great];
+                            less++;
+                        } else { // pivot1 < a[great] < pivot2
+                            a[k] = a[great];
+                        }
+                        a[great] = ak;
+                        great--;
                     }
                 }
             }
+
+            // Sort center part recursively
+            sort(a, less, great, false);
+
         } else { // Pivots are equal
             /*
-             * Partition degenerates to the traditional 3-way,
-             * or "Dutch National Flag", partition:
+             * Partition degenerates to the traditional 3-way
+             * (or "Dutch National Flag") schema:
              *
-             *   left part   center part            right part
-             * +----------------------------------------------+
-             * |  < pivot  |  == pivot  |    ?    |  > pivot  |
-             * +----------------------------------------------+
-             *              ^            ^       ^
-             *              |            |       |
-             *             less          k     great
+             *   left part    center part              right part
+             * +-------------------------------------------------+
+             * |  < pivot  |   == pivot   |     ?    |  > pivot  |
+             * +-------------------------------------------------+
+             *              ^              ^        ^
+             *              |              |        |
+             *             less            k      great
              *
              * Invariants:
              *
@@ -1774,20 +2229,19 @@
              *   all in [less, k)     == pivot
              *   all in (great, right) > pivot
              *
-             * Pointer k is the first index of ?-part
+             * Pointer k is the first index of ?-part.
              */
-            for (int k = less; k <= great; k++) {
-                float ak = a[k];
-                if (ak == pivot1) {
+            for (int k = left; k <= great; k++) {
+                if (a[k] == pivot1) {
                     continue;
                 }
+                float ak = a[k];
+
                 if (ak < pivot1) { // Move a[k] to left part
-                    if (k != less) {
-                        a[k] = a[less];
-                        a[less] = ak;
-                    }
+                    a[k] = a[less];
+                    a[less] = ak;
                     less++;
-                } else { // (a[k] > pivot1) - Move a[k] to right part
+                } else { // a[k] > pivot1 - Move a[k] to right part
                     /*
                      * We know that pivot1 == a[e3] == pivot2. Thus, we know
                      * that great will still be >= k when the following loop
@@ -1795,92 +2249,33 @@
                      * In other words, a[e3] acts as a sentinel for great.
                      */
                     while (a[great] > pivot1) {
+                        // assert great > k;
                         great--;
                     }
                     if (a[great] < pivot1) {
                         a[k] = a[less];
-                        a[less++] = a[great];
-                        a[great--] = ak;
+                        a[less] = a[great];
+                        less++;
                     } else { // a[great] == pivot1
-                        a[k] = pivot1;
-                        a[great--] = ak;
+                        /*
+                         * Even though a[great] equals to pivot1, the
+                         * assignment a[k] = pivot1 may be incorrect,
+                         * if a[great] and pivot1 are floating-point
+                         * zeros of different signs. Therefore in float
+                         * and double sorting methods we have to use
+                         * more accurate assignment a[k] = a[great].
+                         */
+                        a[k] = a[great];
                     }
+                    a[great] = ak;
+                    great--;
                 }
             }
-        }
-
-        // Swap pivots into their final positions
-        a[left]  = a[less  - 1]; a[less  - 1] = pivot1;
-        a[right] = a[great + 1]; a[great + 1] = pivot2;
-
-        // Sort left and right parts recursively, excluding known pivot values
-        doSort(a, left,   less - 2);
-        doSort(a, great + 2, right);
-
-        /*
-         * If pivot1 == pivot2, all elements from center
-         * part are equal and, therefore, already sorted
-         */
-        if (!pivotsDiffer) {
-            return;
-        }
-
-        /*
-         * If center part is too large (comprises > 2/3 of the array),
-         * swap internal pivot values to ends
-         */
-        if (less < e1 && great > e5) {
-            while (a[less] == pivot1) {
-                less++;
-            }
-            while (a[great] == pivot2) {
-                great--;
-            }
 
-            /*
-             * Partitioning:
-             *
-             *   left part       center part                   right part
-             * +----------------------------------------------------------+
-             * | == pivot1 |  pivot1 < && < pivot2  |    ?    | == pivot2 |
-             * +----------------------------------------------------------+
-             *              ^                        ^       ^
-             *              |                        |       |
-             *             less                      k     great
-             *
-             * Invariants:
-             *
-             *              all in (*, less)  == pivot1
-             *     pivot1 < all in [less, k)   < pivot2
-             *              all in (great, *) == pivot2
-             *
-             * Pointer k is the first index of ?-part
-             */
-            outer:
-            for (int k = less; k <= great; k++) {
-                float ak = a[k];
-                if (ak == pivot2) { // Move a[k] to right part
-                    while (a[great] == pivot2) {
-                        if (great-- == k) {
-                            break outer;
-                        }
-                    }
-                    if (a[great] == pivot1) {
-                        a[k] = a[less];
-                        a[less++] = pivot1;
-                    } else { // pivot1 < a[great] < pivot2
-                        a[k] = a[great];
-                    }
-                    a[great--] = pivot2;
-                } else if (ak == pivot1) { // Move a[k] to left part
-                    a[k] = a[less];
-                    a[less++] = pivot1;
-                }
-            }
+            // Sort left and right parts recursively
+            sort(a, left, less - 1, leftmost);
+            sort(a, great + 1, right, false);
         }
-
-        // Sort center part recursively, excluding known pivot values
-        doSort(a, less, great);
     }
 
     /**
@@ -1938,162 +2333,207 @@
      */
     private static void sortNegZeroAndNaN(double[] a, int left, int right) {
         /*
-         * Phase 1: Count negative zeros and move NaNs to end of array
+         * Phase 1: Move NaNs to the end of the array.
          */
-        final long NEGATIVE_ZERO = Double.doubleToLongBits(-0.0d);
-        int numNegativeZeros = 0;
-        int n = right;
-
-        for (int k = left; k <= n; k++) {
+        while (left <= right && Double.isNaN(a[right])) {
+            right--;
+        }
+        for (int k = right - 1; k >= left; k--) {
             double ak = a[k];
-            if (ak == 0.0d && NEGATIVE_ZERO == Double.doubleToLongBits(ak)) {
-                a[k] = 0.0d;
-                numNegativeZeros++;
-            } else if (ak != ak) { // i.e., ak is NaN
-                a[k--] = a[n];
-                a[n--] = Double.NaN;
+            if (ak != ak) { // a[k] is NaN
+                a[k] = a[right];
+                a[right] = ak;
+                right--;
             }
         }
 
         /*
-         * Phase 2: Sort everything except NaNs (which are already in place)
+         * Phase 2: Sort everything except NaNs (which are already in place).
          */
-        doSort(a, left, n);
+        sort(a, left, right, true);
 
         /*
-         * Phase 3: Turn positive zeros back into negative zeros as appropriate
+         * Phase 3: Place negative zeros before positive zeros.
          */
-        if (numNegativeZeros == 0) {
-            return;
-        }
-
-        // Find first zero element
-        int zeroIndex = findAnyZero(a, left, n);
-
-        for (int i = zeroIndex - 1; i >= left && a[i] == 0.0d; i--) {
-            zeroIndex = i;
-        }
+        int hi = right;
 
-        // Turn the right number of positive zeros back into negative zeros
-        for (int i = zeroIndex, m = zeroIndex + numNegativeZeros; i < m; i++) {
-            a[i] = -0.0d;
-        }
-    }
-
-    /**
-     * Returns the index of some zero element in the specified range via
-     * binary search. The range is assumed to be sorted, and must contain
-     * at least one zero.
-     *
-     * @param a the array to be searched
-     * @param low the index of the first element, inclusive, to be searched
-     * @param high the index of the last element, inclusive, to be searched
-     */
-    private static int findAnyZero(double[] a, int low, int high) {
-        while (true) {
-            int middle = (low + high) >>> 1;
+        /*
+         * Search first zero, or first positive, or last negative element.
+         */
+        while (left < hi) {
+            int middle = (left + hi) >>> 1;
             double middleValue = a[middle];
 
             if (middleValue < 0.0d) {
-                low = middle + 1;
-            } else if (middleValue > 0.0d) {
-                high = middle - 1;
-            } else { // middleValue == 0.0d
-                return middle;
+                left = middle + 1;
+            } else {
+                hi = middle;
+            }
+        }
+
+        /*
+         * Skip the last negative value (if any) or all leading negative zeros.
+         */
+        while (left <= right && Double.doubleToRawLongBits(a[left]) < 0) {
+            left++;
+        }
+
+        /*
+         * Move negative zeros to the beginning of the sub-range.
+         *
+         * Partitioning:
+         *
+         * +---------------------------------------------------+
+         * |   < 0.0   |   -0.0   |    0.0    |  ?  ( >= 0.0 ) |
+         * +---------------------------------------------------+
+         *              ^          ^           ^
+         *              |          |           |
+         *             left        p           k
+         *
+         * Invariants:
+         *
+         *   all in (*,  left)  <  0.0
+         *   all in [left,  p) == -0.0
+         *   all in [p,     k) ==  0.0
+         *   all in [k, right] >=  0.0
+         *
+         * Pointer k is the first index of ?-part.
+         */
+        for (int k = left + 1, p = left; k <= right; k++) {
+            double ak = a[k];
+            if (ak != 0.0d) {
+                break;
+            }
+            if (Double.doubleToRawLongBits(ak) < 0) { // ak is -0.0d
+                a[k] = 0.0d;
+                a[p++] = -0.0d;
             }
         }
     }
 
     /**
-     * Sorts the specified range of the array into ascending order. This
-     * method differs from the public {@code sort} method in three ways:
-     * {@code right} index is inclusive, it does no range checking on
-     * {@code left} or {@code right}, and it does not handle negative
-     * zeros or NaNs in the array.
-     *
-     * @param a the array to be sorted, which must not contain -0.0d and NaN
-     * @param left the index of the first element, inclusive, to be sorted
-     * @param right the index of the last element, inclusive, to be sorted
-     */
-    private static void doSort(double[] a, int left, int right) {
-        // Use insertion sort on tiny arrays
-        if (right - left + 1 < INSERTION_SORT_THRESHOLD) {
-            for (int i = left + 1; i <= right; i++) {
-                double ai = a[i];
-                int j;
-                for (j = i - 1; j >= left && ai < a[j]; j--) {
-                    a[j + 1] = a[j];
-                }
-                a[j + 1] = ai;
-            }
-        } else { // Use Dual-Pivot Quicksort on large arrays
-            dualPivotQuicksort(a, left, right);
-        }
-    }
-
-    /**
      * Sorts the specified range of the array into ascending order by the
-     * Dual-Pivot Quicksort algorithm.
+     * Dual-Pivot Quicksort algorithm. This method differs from the public
+     * {@code sort} method in that the {@code right} index is inclusive,
+     * it does no range checking on {@code left} or {@code right}, and has
+     * boolean flag whether insertion sort with sentinel is used or not.
      *
      * @param a the array to be sorted
      * @param left the index of the first element, inclusive, to be sorted
      * @param right the index of the last element, inclusive, to be sorted
+     * @param leftmost indicates if the part is the most left in the range
      */
-    private static void dualPivotQuicksort(double[] a, int left, int right) {
-        // Compute indices of five evenly spaced elements
-        int sixth = (right - left + 1) / 6;
-        int e1 = left  + sixth;
-        int e5 = right - sixth;
-        int e3 = (left + right) >>> 1; // The midpoint
-        int e4 = e3 + sixth;
-        int e2 = e3 - sixth;
+    private static void sort(double[] a, int left,int right,boolean leftmost) {
+        int length = right - left + 1;
 
-        // Sort these elements using a 5-element sorting network
-        double ae1 = a[e1], ae2 = a[e2], ae3 = a[e3], ae4 = a[e4], ae5 = a[e5];
+        // Use insertion sort on tiny arrays
+        if (length < INSERTION_SORT_THRESHOLD) {
+            if (!leftmost) {
+                /*
+                 * Every element in adjoining part plays the role
+                 * of sentinel, therefore this allows us to avoid
+                 * the j >= left check on each iteration.
+                 */
+                for (int j, i = left + 1; i <= right; i++) {
+                    double ai = a[i];
+                    for (j = i - 1; ai < a[j]; j--) {
+                        // assert j >= left;
+                        a[j + 1] = a[j];
+                    }
+                    a[j + 1] = ai;
+                }
+            } else {
+                /*
+                 * For case of leftmost part traditional (without a sentinel)
+                 * insertion sort, optimized for server JVM, is used.
+                 */
+                for (int i = left, j = i; i < right; j = ++i) {
+                    double ai = a[i + 1];
+                    while (ai < a[j]) {
+                        a[j + 1] = a[j];
+                        if (j-- == left) {
+                            break;
+                        }
+                    }
+                    a[j + 1] = ai;
+                }
+            }
+            return;
+        }
 
-        if (ae1 > ae2) { double t = ae1; ae1 = ae2; ae2 = t; }
-        if (ae4 > ae5) { double t = ae4; ae4 = ae5; ae5 = t; }
-        if (ae1 > ae3) { double t = ae1; ae1 = ae3; ae3 = t; }
-        if (ae2 > ae3) { double t = ae2; ae2 = ae3; ae3 = t; }
-        if (ae1 > ae4) { double t = ae1; ae1 = ae4; ae4 = t; }
-        if (ae3 > ae4) { double t = ae3; ae3 = ae4; ae4 = t; }
-        if (ae2 > ae5) { double t = ae2; ae2 = ae5; ae5 = t; }
-        if (ae2 > ae3) { double t = ae2; ae2 = ae3; ae3 = t; }
-        if (ae4 > ae5) { double t = ae4; ae4 = ae5; ae5 = t; }
+        // Inexpensive approximation of length / 7
+        int seventh = (length >>> 3) + (length >>> 6) + 1;
+
+        /*
+         * Sort five evenly spaced elements around (and including) the
+         * center element in the range. These elements will be used for
+         * pivot selection as described below. The choice for spacing
+         * these elements was empirically determined to work well on
+         * a wide variety of inputs.
+         */
+        int e3 = (left + right) >>> 1; // The midpoint
+        int e2 = e3 - seventh;
+        int e1 = e2 - seventh;
+        int e4 = e3 + seventh;
+        int e5 = e4 + seventh;
 
-        a[e1] = ae1; a[e3] = ae3; a[e5] = ae5;
+        // Sort these elements using insertion sort
+        if (a[e2] < a[e1]) { double t = a[e2]; a[e2] = a[e1]; a[e1] = t; }
+
+        if (a[e3] < a[e2]) { double t = a[e3]; a[e3] = a[e2]; a[e2] = t;
+            if (t < a[e1]) { a[e2] = a[e1]; a[e1] = t; }
+        }
+        if (a[e4] < a[e3]) { double t = a[e4]; a[e4] = a[e3]; a[e3] = t;
+            if (t < a[e2]) { a[e3] = a[e2]; a[e2] = t;
+                if (t < a[e1]) { a[e2] = a[e1]; a[e1] = t; }
+            }
+        }
+        if (a[e5] < a[e4]) { double t = a[e5]; a[e5] = a[e4]; a[e4] = t;
+            if (t < a[e3]) { a[e4] = a[e3]; a[e3] = t;
+                if (t < a[e2]) { a[e3] = a[e2]; a[e2] = t;
+                    if (t < a[e1]) { a[e2] = a[e1]; a[e1] = t; }
+                }
+            }
+        }
 
         /*
          * Use the second and fourth of the five sorted elements as pivots.
          * These values are inexpensive approximations of the first and
          * second terciles of the array. Note that pivot1 <= pivot2.
-         *
-         * The pivots are stored in local variables, and the first and
-         * the last of the elements to be sorted are moved to the locations
-         * formerly occupied by the pivots. When partitioning is complete,
-         * the pivots are swapped back into their final positions, and
-         * excluded from subsequent sorting.
          */
-        double pivot1 = ae2; a[e2] = a[left];
-        double pivot2 = ae4; a[e4] = a[right];
+        double pivot1 = a[e2];
+        double pivot2 = a[e4];
 
         // Pointers
-        int less  = left  + 1; // The index of first element of center part
-        int great = right - 1; // The index before first element of right part
+        int less  = left;  // The index of the first element of center part
+        int great = right; // The index before the first element of right part
 
-        boolean pivotsDiffer = (pivot1 != pivot2);
+        if (pivot1 != pivot2) {
+            /*
+             * The first and the last elements to be sorted are moved to the
+             * locations formerly occupied by the pivots. When partitioning
+             * is complete, the pivots are swapped back into their final
+             * positions, and excluded from subsequent sorting.
+             */
+            a[e2] = a[left];
+            a[e4] = a[right];
 
-        if (pivotsDiffer) {
+            /*
+             * Skip elements, which are less or greater than pivot values.
+             */
+            while (a[++less] < pivot1);
+            while (a[--great] > pivot2);
+
             /*
              * Partitioning:
              *
-             *   left part         center part                    right part
-             * +------------------------------------------------------------+
-             * | < pivot1  |  pivot1 <= && <= pivot2  |    ?    |  > pivot2 |
-             * +------------------------------------------------------------+
-             *              ^                          ^       ^
-             *              |                          |       |
-             *             less                        k     great
+             *   left part           center part                   right part
+             * +--------------------------------------------------------------+
+             * |  < pivot1  |  pivot1 <= && <= pivot2  |    ?    |  > pivot2  |
+             * +--------------------------------------------------------------+
+             *               ^                          ^       ^
+             *               |                          |       |
+             *              less                        k     great
              *
              * Invariants:
              *
@@ -2101,16 +2541,14 @@
              *    pivot1 <= all in [less, k)     <= pivot2
              *              all in (great, right) > pivot2
              *
-             * Pointer k is the first index of ?-part
+             * Pointer k is the first index of ?-part.
              */
             outer:
             for (int k = less; k <= great; k++) {
                 double ak = a[k];
                 if (ak < pivot1) { // Move a[k] to left part
-                    if (k != less) {
-                        a[k] = a[less];
-                        a[less] = ak;
-                    }
+                    a[k] = a[less];
+                    a[less] = ak;
                     less++;
                 } else if (ak > pivot2) { // Move a[k] to right part
                     while (a[great] > pivot2) {
@@ -2120,26 +2558,107 @@
                     }
                     if (a[great] < pivot1) {
                         a[k] = a[less];
-                        a[less++] = a[great];
-                        a[great--] = ak;
+                        a[less] = a[great];
+                        less++;
                     } else { // pivot1 <= a[great] <= pivot2
                         a[k] = a[great];
-                        a[great--] = ak;
+                    }
+                    a[great] = ak;
+                    great--;
+                }
+            }
+
+            // Swap pivots into their final positions
+            a[left]  = a[less  - 1]; a[less  - 1] = pivot1;
+            a[right] = a[great + 1]; a[great + 1] = pivot2;
+
+            // Sort left and right parts recursively, excluding known pivots
+            sort(a, left, less - 2, leftmost);
+            sort(a, great + 2, right, false);
+
+            /*
+             * If center part is too large (comprises > 5/7 of the array),
+             * swap internal pivot values to ends.
+             */
+            if (less < e1 && e5 < great) {
+                /*
+                 * Skip elements, which are equal to pivot values.
+                 */
+                while (a[less] == pivot1) {
+                    less++;
+                }
+                while (a[great] == pivot2) {
+                    great--;
+                }
+
+                /*
+                 * Partitioning:
+                 *
+                 *   left part         center part                  right part
+                 * +----------------------------------------------------------+
+                 * | == pivot1 |  pivot1 < && < pivot2  |    ?    | == pivot2 |
+                 * +----------------------------------------------------------+
+                 *              ^                        ^       ^
+                 *              |                        |       |
+                 *             less                      k     great
+                 *
+                 * Invariants:
+                 *
+                 *              all in (*,  less) == pivot1
+                 *     pivot1 < all in [less,  k)  < pivot2
+                 *              all in (great, *) == pivot2
+                 *
+                 * Pointer k is the first index of ?-part.
+                 */
+                outer:
+                for (int k = less; k <= great; k++) {
+                    double ak = a[k];
+                    if (ak == pivot1) { // Move a[k] to left part
+                        a[k] = a[less];
+                        a[less] = ak;
+                        less++;
+                    } else if (ak == pivot2) { // Move a[k] to right part
+                        while (a[great] == pivot2) {
+                            if (great-- == k) {
+                                break outer;
+                            }
+                        }
+                        if (a[great] == pivot1) {
+                            a[k] = a[less];
+                            /*
+                             * Even though a[great] equals to pivot1, the
+                             * assignment a[less] = pivot1 may be incorrect,
+                             * if a[great] and pivot1 are floating-point zeros
+                             * of different signs. Therefore in float and
+                             * double sorting methods we have to use more
+                             * accurate assignment a[less] = a[great].
+                             */
+                            a[less] = a[great];
+                            less++;
+                        } else { // pivot1 < a[great] < pivot2
+                            a[k] = a[great];
+                        }
+                        a[great] = ak;
+                        great--;
                     }
                 }
             }
+
+            // Sort center part recursively
+            sort(a, less, great, false);
+
         } else { // Pivots are equal
             /*
-             * Partition degenerates to the traditional 3-way,
-             * or "Dutch National Flag", partition:
+             * Partition degenerates to the traditional 3-way
+             * (or "Dutch National Flag") schema:
              *
-             *   left part   center part            right part
-             * +----------------------------------------------+
-             * |  < pivot  |  == pivot  |    ?    |  > pivot  |
-             * +----------------------------------------------+
-             *              ^            ^       ^
-             *              |            |       |
-             *             less          k     great
+             *   left part    center part              right part
+             * +-------------------------------------------------+
+             * |  < pivot  |   == pivot   |     ?    |  > pivot  |
+             * +-------------------------------------------------+
+             *              ^              ^        ^
+             *              |              |        |
+             *             less            k      great
              *
              * Invariants:
              *
@@ -2147,20 +2666,19 @@
              *   all in [less, k)     == pivot
              *   all in (great, right) > pivot
              *
-             * Pointer k is the first index of ?-part
+             * Pointer k is the first index of ?-part.
              */
-            for (int k = less; k <= great; k++) {
-                double ak = a[k];
-                if (ak == pivot1) {
+            for (int k = left; k <= great; k++) {
+                if (a[k] == pivot1) {
                     continue;
                 }
+                double ak = a[k];
+
                 if (ak < pivot1) { // Move a[k] to left part
-                    if (k != less) {
-                        a[k] = a[less];
-                        a[less] = ak;
-                    }
+                    a[k] = a[less];
+                    a[less] = ak;
                     less++;
-                } else { // (a[k] > pivot1) - Move a[k] to right part
+                } else { // a[k] > pivot1 - Move a[k] to right part
                     /*
                      * We know that pivot1 == a[e3] == pivot2. Thus, we know
                      * that great will still be >= k when the following loop
@@ -2168,102 +2686,43 @@
                      * In other words, a[e3] acts as a sentinel for great.
                      */
                     while (a[great] > pivot1) {
+                        // assert great > k;
                         great--;
                     }
                     if (a[great] < pivot1) {
                         a[k] = a[less];
-                        a[less++] = a[great];
-                        a[great--] = ak;
+                        a[less] = a[great];
+                        less++;
                     } else { // a[great] == pivot1
-                        a[k] = pivot1;
-                        a[great--] = ak;
+                        /*
+                         * Even though a[great] equals to pivot1, the
+                         * assignment a[k] = pivot1 may be incorrect,
+                         * if a[great] and pivot1 are floating-point
+                         * zeros of different signs. Therefore in float
+                         * and double sorting methods we have to use
+                         * more accurate assignment a[k] = a[great].
+                         */
+                        a[k] = a[great];
                     }
+                    a[great] = ak;
+                    great--;
                 }
             }
-        }
-
-        // Swap pivots into their final positions
-        a[left]  = a[less  - 1]; a[less  - 1] = pivot1;
-        a[right] = a[great + 1]; a[great + 1] = pivot2;
-
-        // Sort left and right parts recursively, excluding known pivot values
-        doSort(a, left,   less - 2);
-        doSort(a, great + 2, right);
-
-        /*
-         * If pivot1 == pivot2, all elements from center
-         * part are equal and, therefore, already sorted
-         */
-        if (!pivotsDiffer) {
-            return;
-        }
-
-        /*
-         * If center part is too large (comprises > 2/3 of the array),
-         * swap internal pivot values to ends
-         */
-        if (less < e1 && great > e5) {
-            while (a[less] == pivot1) {
-                less++;
-            }
-            while (a[great] == pivot2) {
-                great--;
-            }
 
-            /*
-             * Partitioning:
-             *
-             *   left part       center part                   right part
-             * +----------------------------------------------------------+
-             * | == pivot1 |  pivot1 < && < pivot2  |    ?    | == pivot2 |
-             * +----------------------------------------------------------+
-             *              ^                        ^       ^
-             *              |                        |       |
-             *             less                      k     great
-             *
-             * Invariants:
-             *
-             *              all in (*, less)  == pivot1
-             *     pivot1 < all in [less, k)   < pivot2
-             *              all in (great, *) == pivot2
-             *
-             * Pointer k is the first index of ?-part
-             */
-            outer:
-            for (int k = less; k <= great; k++) {
-                double ak = a[k];
-                if (ak == pivot2) { // Move a[k] to right part
-                    while (a[great] == pivot2) {
-                        if (great-- == k) {
-                            break outer;
-                        }
-                    }
-                    if (a[great] == pivot1) {
-                        a[k] = a[less];
-                        a[less++] = pivot1;
-                    } else { // pivot1 < a[great] < pivot2
-                        a[k] = a[great];
-                    }
-                    a[great--] = pivot2;
-                } else if (ak == pivot1) { // Move a[k] to left part
-                    a[k] = a[less];
-                    a[less++] = pivot1;
-                }
-            }
+            // Sort left and right parts recursively
+            sort(a, left, less - 1, leftmost);
+            sort(a, great + 1, right, false);
         }
-
-        // Sort center part recursively, excluding known pivot values
-        doSort(a, less, great);
     }
 
     /**
-     * Checks that {@code fromIndex} and {@code toIndex} are in
-     * the range and throws an appropriate exception, if they aren't.
+     * Checks that {@code fromIndex} and {@code toIndex} are in the range,
+     * otherwise throws an appropriate exception.
      */
     private static void rangeCheck(int length, int fromIndex, int toIndex) {
         if (fromIndex > toIndex) {
             throw new IllegalArgumentException(
-                "fromIndex(" + fromIndex + ") > toIndex(" + toIndex + ")");
+                "fromIndex: " + fromIndex + " > toIndex: " + toIndex);
         }
         if (fromIndex < 0) {
             throw new ArrayIndexOutOfBoundsException(fromIndex);
--- a/jdk/src/share/classes/java/util/Scanner.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/share/classes/java/util/Scanner.java	Wed Jul 21 09:57:21 2010 -0700
@@ -343,7 +343,7 @@
  *
  * @since   1.5
  */
-public final class Scanner implements Iterator<String> {
+public final class Scanner implements Iterator<String>, Closeable {
 
     // Internal buffer used to hold input
     private CharBuffer buf;
--- a/jdk/src/share/classes/java/util/concurrent/ThreadLocalRandom.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/share/classes/java/util/concurrent/ThreadLocalRandom.java	Wed Jul 21 09:57:21 2010 -0700
@@ -73,10 +73,10 @@
     private long rnd;
 
     /**
-     * Initialization flag to permit the first and only allowed call
-     * to setSeed (inside Random constructor) to succeed.  We can't
-     * allow others since it would cause setting seed in one part of a
-     * program to unintentionally impact other usages by the thread.
+     * Initialization flag to permit calls to setSeed to succeed only
+     * while executing the Random constructor.  We can't allow others
+     * since it would cause setting seed in one part of a program to
+     * unintentionally impact other usages by the thread.
      */
     boolean initialized;
 
@@ -98,11 +98,10 @@
 
     /**
      * Constructor called only by localRandom.initialValue.
-     * We rely on the fact that the superclass no-arg constructor
-     * invokes setSeed exactly once to initialize.
      */
     ThreadLocalRandom() {
         super();
+        initialized = true;
     }
 
     /**
@@ -123,7 +122,6 @@
     public void setSeed(long seed) {
         if (initialized)
             throw new UnsupportedOperationException();
-        initialized = true;
         rnd = (seed ^ multiplier) & mask;
     }
 
--- a/jdk/src/share/classes/java/util/jar/JarVerifier.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/share/classes/java/util/jar/JarVerifier.java	Wed Jul 21 09:57:21 2010 -0700
@@ -76,7 +76,7 @@
     private ByteArrayOutputStream baos;
 
     /** The ManifestDigester object */
-    private ManifestDigester manDig;
+    private volatile ManifestDigester manDig;
 
     /** the bytes for the manDig object */
     byte manifestRawBytes[] = null;
--- a/jdk/src/share/classes/java/util/jar/Pack200.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/share/classes/java/util/jar/Pack200.java	Wed Jul 21 09:57:21 2010 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003,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
@@ -212,10 +212,18 @@
      * to produce a specific bytewise image for any given transmission
      * ordering of archive elements.)
      * <p>
-     * In order to maintain backward compatibility, if the input JAR-files are
-     * solely comprised of 1.5 (or  lesser) classfiles, a 1.5 compatible
-     * pack file is  produced.  Otherwise a 1.6 compatible pack200 file is
-     * produced.
+     * In order to maintain backward compatibility, the pack file's version is
+     * set to accommodate the class files present in the input JAR file. In
+     * other words, the pack file version will be the latest, if the class files
+     * are the latest and conversely the pack file version will be the oldest
+     * if the class file versions are also the oldest. For intermediate class
+     * file versions the corresponding pack file version will be used.
+     * For example:
+     *    If the input JAR-files are solely comprised of 1.5  (or  lesser)
+     * class files, a 1.5 compatible pack file is  produced. This will also be
+     * the case for archives that have no class files.
+     *    If the input JAR-files contains a 1.6 class file, then the pack file
+     * version will be set to 1.6.
      * <p>
      * @since 1.5
      */
@@ -236,9 +244,10 @@
          * input file to be transmitted in the segment, along with the size
          * of its name and other transmitted properties.
          * <p>
-         * The default is 1000000 (a million bytes).  This allows input JAR files
-         * of moderate size to be transmitted in one segment.  It also puts
-         * a limit on memory requirements for packers and unpackers.
+         * The default is -1, which means the packer will always create a single
+         * segment output file. In cases where extremely large output files are
+         * generated, users are strongly encouraged to use segmenting or break
+         * up the input file into smaller JARs.
          * <p>
          * A 10Mb JAR packed without this limit will
          * typically pack about 10% smaller, but the packer may require
--- a/jdk/src/share/classes/java/util/logging/LogManager.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/share/classes/java/util/logging/LogManager.java	Wed Jul 21 09:57:21 2010 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 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
@@ -29,6 +29,7 @@
 import java.io.*;
 import java.util.*;
 import java.security.*;
+import java.lang.ref.ReferenceQueue;
 import java.lang.ref.WeakReference;
 import java.beans.PropertyChangeListener;
 import java.beans.PropertyChangeSupport;
@@ -154,10 +155,10 @@
                          = new PropertyChangeSupport(LogManager.class);
     private final static Level defaultLevel = Level.INFO;
 
-    // Table of known loggers.  Maps names to Loggers.
-    private Hashtable<String,WeakReference<Logger>> loggers =
-        new Hashtable<String,WeakReference<Logger>>();
-    // Tree of known loggers
+    // Table of named Loggers that maps names to Loggers.
+    private Hashtable<String,LoggerWeakRef> namedLoggers =
+        new Hashtable<String,LoggerWeakRef>();
+    // Tree of named Loggers
     private LogNode root = new LogNode(null);
     private Logger rootLogger;
 
@@ -417,6 +418,121 @@
             }});
     }
 
+
+    // loggerRefQueue holds LoggerWeakRef objects for Logger objects
+    // that have been GC'ed.
+    private final ReferenceQueue<Logger> loggerRefQueue
+        = new ReferenceQueue<Logger>();
+
+    // Package-level inner class.
+    // Helper class for managing WeakReferences to Logger objects.
+    //
+    // LogManager.namedLoggers
+    //     - has weak references to all named Loggers
+    //     - namedLoggers keeps the LoggerWeakRef objects for the named
+    //       Loggers around until we can deal with the book keeping for
+    //       the named Logger that is being GC'ed.
+    // LogManager.LogNode.loggerRef
+    //     - has a weak reference to a named Logger
+    //     - the LogNode will also keep the LoggerWeakRef objects for
+    //       the named Loggers around; currently LogNodes never go away.
+    // Logger.kids
+    //     - has a weak reference to each direct child Logger; this
+    //       includes anonymous and named Loggers
+    //     - anonymous Loggers are always children of the rootLogger
+    //       which is a strong reference; rootLogger.kids keeps the
+    //       LoggerWeakRef objects for the anonymous Loggers around
+    //       until we can deal with the book keeping.
+    //
+    final class LoggerWeakRef extends WeakReference<Logger> {
+        private String                name;       // for namedLoggers cleanup
+        private LogNode               node;       // for loggerRef cleanup
+        private WeakReference<Logger> parentRef;  // for kids cleanup
+
+        LoggerWeakRef(Logger logger) {
+            super(logger, loggerRefQueue);
+
+            name = logger.getName();  // save for namedLoggers cleanup
+        }
+
+        // dispose of this LoggerWeakRef object
+        void dispose() {
+            if (node != null) {
+                // if we have a LogNode, then we were a named Logger
+                // so clear namedLoggers weak ref to us
+                manager.namedLoggers.remove(name);
+                name = null;  // clear our ref to the Logger's name
+
+                node.loggerRef = null;  // clear LogNode's weak ref to us
+                node = null;            // clear our ref to LogNode
+            }
+
+            if (parentRef != null) {
+                // this LoggerWeakRef has or had a parent Logger
+                Logger parent = parentRef.get();
+                if (parent != null) {
+                    // the parent Logger is still there so clear the
+                    // parent Logger's weak ref to us
+                    parent.removeChildLogger(this);
+                }
+                parentRef = null;  // clear our weak ref to the parent Logger
+            }
+        }
+
+        // set the node field to the specified value
+        void setNode(LogNode node) {
+            this.node = node;
+        }
+
+        // set the parentRef field to the specified value
+        void setParentRef(WeakReference<Logger> parentRef) {
+            this.parentRef = parentRef;
+        }
+    }
+
+    // Package-level method.
+    // Drain some Logger objects that have been GC'ed.
+    //
+    // drainLoggerRefQueueBounded() is called by addLogger() below
+    // and by Logger.getAnonymousLogger(String) so we'll drain up to
+    // MAX_ITERATIONS GC'ed Loggers for every Logger we add.
+    //
+    // On a WinXP VMware client, a MAX_ITERATIONS value of 400 gives
+    // us about a 50/50 mix in increased weak ref counts versus
+    // decreased weak ref counts in the AnonLoggerWeakRefLeak test.
+    // Here are stats for cleaning up sets of 400 anonymous Loggers:
+    //   - test duration 1 minute
+    //   - sample size of 125 sets of 400
+    //   - average: 1.99 ms
+    //   - minimum: 0.57 ms
+    //   - maximum: 25.3 ms
+    //
+    // The same config gives us a better decreased weak ref count
+    // than increased weak ref count in the LoggerWeakRefLeak test.
+    // Here are stats for cleaning up sets of 400 named Loggers:
+    //   - test duration 2 minutes
+    //   - sample size of 506 sets of 400
+    //   - average: 0.57 ms
+    //   - minimum: 0.02 ms
+    //   - maximum: 10.9 ms
+    //
+    private final static int MAX_ITERATIONS = 400;
+    final synchronized void drainLoggerRefQueueBounded() {
+        for (int i = 0; i < MAX_ITERATIONS; i++) {
+            if (loggerRefQueue == null) {
+                // haven't finished loading LogManager yet
+                break;
+            }
+
+            LoggerWeakRef ref = (LoggerWeakRef) loggerRefQueue.poll();
+            if (ref == null) {
+                break;
+            }
+            // a Logger object has been GC'ed so clean it up
+            ref.dispose();
+        }
+    }
+
     /**
      * Add a named logger.  This does nothing and returns false if a logger
      * with the same name is already registered.
@@ -439,13 +555,16 @@
             throw new NullPointerException();
         }
 
-        WeakReference<Logger> ref = loggers.get(name);
+        // cleanup some Loggers that have been GC'ed
+        drainLoggerRefQueueBounded();
+
+        LoggerWeakRef ref = namedLoggers.get(name);
         if (ref != null) {
             if (ref.get() == null) {
-                // Hashtable holds stale weak reference
-                // to a logger which has been GC-ed.
-                // Allow to register new one.
-                loggers.remove(name);
+                // It's possible that the Logger was GC'ed after the
+                // drainLoggerRefQueueBounded() call above so allow
+                // a new one to be registered.
+                namedLoggers.remove(name);
             } else {
                 // We already have a registered logger with the given name.
                 return false;
@@ -454,7 +573,8 @@
 
         // We're adding a new logger.
         // Note that we are creating a weak reference here.
-        loggers.put(name, new WeakReference<Logger>(logger));
+        ref = new LoggerWeakRef(logger);
+        namedLoggers.put(name, ref);
 
         // Apply any initial level defined for the new logger.
         Level level = getLevelProperty(name+".level", null);
@@ -469,11 +589,11 @@
 
         // Find the new node and its parent.
         LogNode node = findNode(name);
-        node.loggerRef = new WeakReference<Logger>(logger);
+        node.loggerRef = ref;
         Logger parent = null;
         LogNode nodep = node.parent;
         while (nodep != null) {
-            WeakReference<Logger> nodeRef = nodep.loggerRef;
+            LoggerWeakRef nodeRef = nodep.loggerRef;
             if (nodeRef != null) {
                 parent = nodeRef.get();
                 if (parent != null) {
@@ -489,6 +609,9 @@
         // Walk over the children and tell them we are their new parent.
         node.walkAndSetParent(logger);
 
+        // new LogNode is ready so tell the LoggerWeakRef about it
+        ref.setNode(node);
+
         return true;
     }
 
@@ -572,7 +695,7 @@
      * @return  matching logger or null if none is found
      */
     public synchronized Logger getLogger(String name) {
-        WeakReference<Logger> ref = loggers.get(name);
+        LoggerWeakRef ref = namedLoggers.get(name);
         if (ref == null) {
             return null;
         }
@@ -580,7 +703,7 @@
         if (logger == null) {
             // Hashtable holds stale weak reference
             // to a logger which has been GC-ed.
-            loggers.remove(name);
+            namedLoggers.remove(name);
         }
         return logger;
     }
@@ -594,7 +717,7 @@
      * @return  enumeration of logger name strings
      */
     public synchronized Enumeration<String> getLoggerNames() {
-        return loggers.keys();
+        return namedLoggers.keys();
     }
 
     /**
@@ -942,7 +1065,7 @@
     // Nested class to represent a node in our tree of named loggers.
     private static class LogNode {
         HashMap<String,LogNode> children;
-        WeakReference<Logger> loggerRef;
+        LoggerWeakRef loggerRef;
         LogNode parent;
 
         LogNode(LogNode parent) {
@@ -958,7 +1081,7 @@
             Iterator<LogNode> values = children.values().iterator();
             while (values.hasNext()) {
                 LogNode node = values.next();
-                WeakReference<Logger> ref = node.loggerRef;
+                LoggerWeakRef ref = node.loggerRef;
                 Logger logger = (ref == null) ? null : ref.get();
                 if (logger == null) {
                     node.walkAndSetParent(parent);
--- a/jdk/src/share/classes/java/util/logging/Logger.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/share/classes/java/util/logging/Logger.java	Wed Jul 21 09:57:21 2010 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 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
@@ -183,7 +183,7 @@
     // We keep weak references from parents to children, but strong
     // references from children to parents.
     private volatile Logger parent;    // our nearest parent.
-    private ArrayList<WeakReference<Logger>> kids;   // WeakReferences to loggers that have us as parent
+    private ArrayList<LogManager.LoggerWeakRef> kids;   // WeakReferences to loggers that have us as parent
     private volatile Level levelObject;
     private volatile int levelValue;  // current effective level value
 
@@ -366,13 +366,8 @@
      *
      * @return a newly created private Logger
      */
-    public static synchronized Logger getAnonymousLogger() {
-        LogManager manager = LogManager.getLogManager();
-        Logger result = new Logger(null, null);
-        result.anonymous = true;
-        Logger root = manager.getLogger("");
-        result.doSetParent(root);
-        return result;
+    public static Logger getAnonymousLogger() {
+        return getAnonymousLogger(null);
     }
 
     /**
@@ -401,6 +396,8 @@
      */
     public static synchronized Logger getAnonymousLogger(String resourceBundleName) {
         LogManager manager = LogManager.getLogManager();
+        // cleanup some Loggers that have been GC'ed
+        manager.drainLoggerRefQueueBounded();
         Logger result = new Logger(null, resourceBundleName);
         result.anonymous = true;
         Logger root = manager.getLogger("");
@@ -1380,14 +1377,18 @@
         synchronized (treeLock) {
 
             // Remove ourself from any previous parent.
+            LogManager.LoggerWeakRef ref = null;
             if (parent != null) {
                 // assert parent.kids != null;
-                for (Iterator<WeakReference<Logger>> iter = parent.kids.iterator(); iter.hasNext(); ) {
-                    WeakReference<Logger> ref =  iter.next();
+                for (Iterator<LogManager.LoggerWeakRef> iter = parent.kids.iterator(); iter.hasNext(); ) {
+                    ref = iter.next();
                     Logger kid =  ref.get();
                     if (kid == this) {
+                        // ref is used down below to complete the reparenting
                         iter.remove();
                         break;
+                    } else {
+                        ref = null;
                     }
                 }
                 // We have now removed ourself from our parents' kids.
@@ -1396,9 +1397,14 @@
             // Set our new parent.
             parent = newParent;
             if (parent.kids == null) {
-                parent.kids = new ArrayList<WeakReference<Logger>>(2);
+                parent.kids = new ArrayList<LogManager.LoggerWeakRef>(2);
             }
-            parent.kids.add(new WeakReference<Logger>(this));
+            if (ref == null) {
+                // we didn't have a previous parent
+                ref = manager.new LoggerWeakRef(this);
+            }
+            ref.setParentRef(new WeakReference<Logger>(parent));
+            parent.kids.add(ref);
 
             // As a result of the reparenting, the effective level
             // may have changed for us and our children.
@@ -1407,6 +1413,21 @@
         }
     }
 
+    // Package-level method.
+    // Remove the weak reference for the specified child Logger from the
+    // kid list. We should only be called from LoggerWeakRef.dispose().
+    final void removeChildLogger(LogManager.LoggerWeakRef child) {
+        synchronized (treeLock) {
+            for (Iterator<LogManager.LoggerWeakRef> iter = kids.iterator(); iter.hasNext(); ) {
+                LogManager.LoggerWeakRef ref = iter.next();
+                if (ref == child) {
+                    iter.remove();
+                    return;
+                }
+            }
+        }
+    }
+
     // Recalculate the effective level for this node and
     // recursively for our children.
 
@@ -1438,7 +1459,7 @@
         // Recursively update the level on each of our kids.
         if (kids != null) {
             for (int i = 0; i < kids.size(); i++) {
-                WeakReference<Logger> ref = kids.get(i);
+                LogManager.LoggerWeakRef ref = kids.get(i);
                 Logger kid =  ref.get();
                 if (kid != null) {
                     kid.updateEffectiveLevel();
--- a/jdk/src/share/classes/java/util/regex/Pattern.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/share/classes/java/util/regex/Pattern.java	Wed Jul 21 09:57:21 2010 -0700
@@ -29,6 +29,7 @@
 import java.security.PrivilegedAction;
 import java.text.CharacterIterator;
 import java.text.Normalizer;
+import java.util.Locale;
 import java.util.Map;
 import java.util.ArrayList;
 import java.util.HashMap;
@@ -200,8 +201,9 @@
  *     <td>Equivalent to java.lang.Character.isMirrored()</td></tr>
  *
  * <tr><th>&nbsp;</th></tr>
- * <tr align="left"><th colspan="2" id="unicode">Classes for Unicode blocks and categories</th></tr>
- *
+ * <tr align="left"><th colspan="2" id="unicode">Classes for Unicode scripts, blocks and categories</th></tr>
+ * * <tr><td valign="top" headers="construct unicode"><tt>\p{IsLatin}</tt></td>
+ *     <td headers="matches">A Latin&nbsp;script character (simple <a href="#ubc">script</a>)</td></tr>
  * <tr><td valign="top" headers="construct unicode"><tt>\p{InGreek}</tt></td>
  *     <td headers="matches">A character in the Greek&nbsp;block (simple <a href="#ubc">block</a>)</td></tr>
  * <tr><td valign="top" headers="construct unicode"><tt>\p{Lu}</tt></td>
@@ -527,25 +529,40 @@
  * while not equal, compile into the same pattern, which matches the character
  * with hexadecimal value <tt>0x2014</tt>.
  *
- * <a name="ubc"> <p>Unicode blocks and categories are written with the
- * <tt>\p</tt> and <tt>\P</tt> constructs as in
- * Perl. <tt>\p{</tt><i>prop</i><tt>}</tt> matches if the input has the
- * property <i>prop</i>, while <tt>\P{</tt><i>prop</i><tt>}</tt> does not match if
- * the input has that property.  Blocks are specified with the prefix
- * <tt>In</tt>, as in <tt>InMongolian</tt>.  Categories may be specified with
- * the optional prefix <tt>Is</tt>: Both <tt>\p{L}</tt> and <tt>\p{IsL}</tt>
- * denote the category of Unicode letters.  Blocks and categories can be used
- * both inside and outside of a character class.
- *
+ * <a name="ubc">
+ * <p>Unicode scripts, blocks and categories are written with the <tt>\p</tt> and
+ * <tt>\P</tt> constructs as in Perl. <tt>\p{</tt><i>prop</i><tt>}</tt> matches if
+ * the input has the property <i>prop</i>, while <tt>\P{</tt><i>prop</i><tt>}</tt>
+ * does not match if the input has that property.
+ * <p>
+ * Scripts are specified either with the prefix {@code Is}, as in
+ * {@code IsHiragana}, or by using  the {@code script} keyword (or its short
+ * form {@code sc})as in {@code script=Hiragana} or {@code sc=Hiragana}.
+ * <p>
+ * Blocks are specified with the prefix {@code In}, as in
+ * {@code InMongolian}, or by using the keyword {@code block} (or its short
+ * form {@code blk}) as in {@code block=Mongolian} or {@code blk=Mongolian}.
+ * <p>
+ * Categories may be specified with the optional prefix {@code Is}:
+ * Both {@code \p{L}} and {@code \p{IsL}} denote the category of Unicode
+ * letters. Same as scripts and blocks, categories can also be specified
+ * by using the keyword {@code general_category} (or its short form
+ * {@code gc}) as in {@code general_category=Lu} or {@code gc=Lu}.
+ * <p>
+ * Scripts, blocks and categories can be used both inside and outside of a
+ * character class.
  * <p> The supported categories are those of
  * <a href="http://www.unicode.org/unicode/standard/standard.html">
  * <i>The Unicode Standard</i></a> in the version specified by the
  * {@link java.lang.Character Character} class. The category names are those
  * defined in the Standard, both normative and informative.
+ * The script names supported by <code>Pattern</code> are the valid script names
+ * accepted and defined by
+ * {@link java.lang.Character.UnicodeScript#forName(String) UnicodeScript.forName}.
  * The block names supported by <code>Pattern</code> are the valid block names
  * accepted and defined by
  * {@link java.lang.Character.UnicodeBlock#forName(String) UnicodeBlock.forName}.
- *
+ * <p>
  * <a name="jcc"> <p>Categories that behave like the java.lang.Character
  * boolean is<i>methodname</i> methods (except for the deprecated ones) are
  * available through the same <tt>\p{</tt><i>prop</i><tt>}</tt> syntax where
@@ -2488,12 +2505,34 @@
             name = new String(temp, i, j-i-1);
         }
 
-        if (name.startsWith("In")) {
-            node = unicodeBlockPropertyFor(name.substring(2));
+        int i = name.indexOf('=');
+        if (i != -1) {
+            // property construct \p{name=value}
+            String value = name.substring(i + 1);
+            name = name.substring(0, i).toLowerCase(Locale.ENGLISH);
+            if ("sc".equals(name) || "script".equals(name)) {
+                node = unicodeScriptPropertyFor(value);
+            } else if ("blk".equals(name) || "block".equals(name)) {
+                node = unicodeBlockPropertyFor(value);
+            } else if ("gc".equals(name) || "general_category".equals(name)) {
+                node = charPropertyNodeFor(value);
+            } else {
+                throw error("Unknown Unicode property {name=<" + name + ">, "
+                             + "value=<" + value + ">}");
+            }
         } else {
-            if (name.startsWith("Is"))
+            if (name.startsWith("In")) {
+                // \p{inBlockName}
+                node = unicodeBlockPropertyFor(name.substring(2));
+            } else if (name.startsWith("Is")) {
+                // \p{isGeneralCategory} and \p{isScriptName}
                 name = name.substring(2);
-            node = charPropertyNodeFor(name);
+                node = CharPropertyNames.charPropertyFor(name);
+                if (node == null)
+                    node = unicodeScriptPropertyFor(name);
+            } else {
+                node = charPropertyNodeFor(name);
+            }
         }
         if (maybeComplement) {
             if (node instanceof Category || node instanceof Block)
@@ -2503,6 +2542,21 @@
         return node;
     }
 
+
+    /**
+     * Returns a CharProperty matching all characters belong to
+     * a UnicodeScript.
+     */
+    private CharProperty unicodeScriptPropertyFor(String name) {
+        final Character.UnicodeScript script;
+        try {
+            script = Character.UnicodeScript.forName(name);
+        } catch (IllegalArgumentException iae) {
+            throw error("Unknown character script name {" + name + "}");
+        }
+        return new Script(script);
+    }
+
     /**
      * Returns a CharProperty matching all characters in a UnicodeBlock.
      */
@@ -3567,6 +3621,19 @@
     }
 
     /**
+     * Node class that matches a Unicode script
+     */
+    static final class Script extends CharProperty {
+        final Character.UnicodeScript script;
+        Script(Character.UnicodeScript script) {
+            this.script = script;
+        }
+        boolean isSatisfiedBy(int ch) {
+            return script == Character.UnicodeScript.of(ch);
+        }
+    }
+
+    /**
      * Node class that matches a Unicode category.
      */
     static final class Category extends CharProperty {
--- a/jdk/src/share/classes/java/util/zip/GZIPInputStream.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/share/classes/java/util/zip/GZIPInputStream.java	Wed Jul 21 09:57:21 2010 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1996, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1996, 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
@@ -66,19 +66,24 @@
      * Creates a new input stream with the specified buffer size.
      * @param in the input stream
      * @param size the input buffer size
+     *
+     * @exception ZipException if a GZIP format error has occurred or the
+     *                         compression method used is unsupported
      * @exception IOException if an I/O error has occurred
      * @exception IllegalArgumentException if size is <= 0
      */
     public GZIPInputStream(InputStream in, int size) throws IOException {
         super(in, new Inflater(true), size);
         usesDefaultInflater = true;
-        readHeader();
-        crc.reset();
+        readHeader(in);
     }
 
     /**
      * Creates a new input stream with a default buffer size.
      * @param in the input stream
+     *
+     * @exception ZipException if a GZIP format error has occurred or the
+     *                         compression method used is unsupported
      * @exception IOException if an I/O error has occurred
      */
     public GZIPInputStream(InputStream in) throws IOException {
@@ -94,26 +99,30 @@
      * @param len the maximum number of bytes read
      * @return  the actual number of bytes read, or -1 if the end of the
      *          compressed input stream is reached
+     *
      * @exception  NullPointerException If <code>buf</code> is <code>null</code>.
      * @exception  IndexOutOfBoundsException If <code>off</code> is negative,
      * <code>len</code> is negative, or <code>len</code> is greater than
      * <code>buf.length - off</code>
-     * @exception IOException if an I/O error has occurred or the compressed
-     *                        input data is corrupt
+     * @exception ZipException if the compressed input data is corrupt.
+     * @exception IOException if an I/O error has occurred.
+     *
      */
     public int read(byte[] buf, int off, int len) throws IOException {
         ensureOpen();
         if (eos) {
             return -1;
         }
-        len = super.read(buf, off, len);
-        if (len == -1) {
-            readTrailer();
-            eos = true;
+        int n = super.read(buf, off, len);
+        if (n == -1) {
+            if (readTrailer())
+                eos = true;
+            else
+                return this.read(buf, off, len);
         } else {
-            crc.update(buf, off, len);
+            crc.update(buf, off, n);
         }
-        return len;
+        return n;
     }
 
     /**
@@ -144,48 +153,61 @@
     private final static int FCOMMENT   = 16;   // File comment
 
     /*
-     * Reads GZIP member header.
+     * Reads GZIP member header and returns the total byte number
+     * of this member header.
      */
-    private void readHeader() throws IOException {
-        CheckedInputStream in = new CheckedInputStream(this.in, crc);
+    private int readHeader(InputStream this_in) throws IOException {
+        CheckedInputStream in = new CheckedInputStream(this_in, crc);
         crc.reset();
         // Check header magic
         if (readUShort(in) != GZIP_MAGIC) {
-            throw new IOException("Not in GZIP format");
+            throw new ZipException("Not in GZIP format");
         }
         // Check compression method
         if (readUByte(in) != 8) {
-            throw new IOException("Unsupported compression method");
+            throw new ZipException("Unsupported compression method");
         }
         // Read flags
         int flg = readUByte(in);
         // Skip MTIME, XFL, and OS fields
         skipBytes(in, 6);
+        int n = 2 + 2 + 6;
         // Skip optional extra field
         if ((flg & FEXTRA) == FEXTRA) {
-            skipBytes(in, readUShort(in));
+            int m = readUShort(in);
+            skipBytes(in, m);
+            n += m + 2;
         }
         // Skip optional file name
         if ((flg & FNAME) == FNAME) {
-            while (readUByte(in) != 0) ;
+            do {
+                n++;
+            } while (readUByte(in) != 0);
         }
         // Skip optional file comment
         if ((flg & FCOMMENT) == FCOMMENT) {
-            while (readUByte(in) != 0) ;
+            do {
+                n++;
+            } while (readUByte(in) != 0);
         }
         // Check optional header CRC
         if ((flg & FHCRC) == FHCRC) {
             int v = (int)crc.getValue() & 0xffff;
             if (readUShort(in) != v) {
-                throw new IOException("Corrupt GZIP header");
+                throw new ZipException("Corrupt GZIP header");
             }
+            n += 2;
         }
+        crc.reset();
+        return n;
     }
 
     /*
-     * Reads GZIP member trailer.
+     * Reads GZIP member trailer and returns true if the eos
+     * reached, false if there are more (concatenated gzip
+     * data set)
      */
-    private void readTrailer() throws IOException {
+    private boolean readTrailer() throws IOException {
         InputStream in = this.in;
         int n = inf.getRemaining();
         if (n > 0) {
@@ -196,7 +218,25 @@
         if ((readUInt(in) != crc.getValue()) ||
             // rfc1952; ISIZE is the input size modulo 2^32
             (readUInt(in) != (inf.getBytesWritten() & 0xffffffffL)))
-            throw new IOException("Corrupt GZIP trailer");
+            throw new ZipException("Corrupt GZIP trailer");
+
+        // If there are more bytes available in "in" or
+        // the leftover in the "inf" is > 26 bytes:
+        // this.trailer(8) + next.header.min(10) + next.trailer(8)
+        // try concatenated case
+        if (this.in.available() > 0 || n > 26) {
+            int m = 8;                  // this.trailer
+            try {
+                m += readHeader(in);    // next.header
+            } catch (IOException ze) {
+                return true;  // ignore any malformed, do nothing
+            }
+            inf.reset();
+            if (n > m)
+                inf.setInput(buf, len - n + m, n - m);
+            return false;
+        }
+        return true;
     }
 
     /*
@@ -231,7 +271,6 @@
         return b;
     }
 
-
     private byte[] tmpbuf = new byte[128];
 
     /*
--- a/jdk/src/share/classes/java/util/zip/GZIPOutputStream.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/share/classes/java/util/zip/GZIPOutputStream.java	Wed Jul 21 09:57:21 2010 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1996, 2002, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1996, 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
@@ -54,25 +54,82 @@
 
     /**
      * Creates a new output stream with the specified buffer size.
+     *
+     * <p>The new output stream instance is created as if by invoking
+     * the 3-argument constructor GZIPOutputStream(out, size, false).
+     *
      * @param out the output stream
      * @param size the output buffer size
      * @exception IOException If an I/O error has occurred.
      * @exception IllegalArgumentException if size is <= 0
+
      */
     public GZIPOutputStream(OutputStream out, int size) throws IOException {
-        super(out, new Deflater(Deflater.DEFAULT_COMPRESSION, true), size);
+        this(out, size, false);
+    }
+
+    /**
+     * Creates a new output stream with the specified buffer size and
+     * flush mode.
+     *
+     * @param out the output stream
+     * @param size the output buffer size
+     * @param syncFlush
+     *        if {@code true} invocation of the inherited
+     *        {@link DeflaterOutputStream#flush() flush()} method of
+     *        this instance flushes the compressor with flush mode
+     *        {@link Deflater#SYNC_FLUSH} before flushing the output
+     *        stream, otherwise only flushes the output stream
+     * @exception IOException If an I/O error has occurred.
+     * @exception IllegalArgumentException if size is <= 0
+     *
+     * @since 1.7
+     */
+    public GZIPOutputStream(OutputStream out, int size, boolean syncFlush)
+        throws IOException
+    {
+        super(out, new Deflater(Deflater.DEFAULT_COMPRESSION, true),
+              size,
+              syncFlush);
         usesDefaultDeflater = true;
         writeHeader();
         crc.reset();
     }
 
+
     /**
      * Creates a new output stream with a default buffer size.
+     *
+     * <p>The new output stream instance is created as if by invoking
+     * the 2-argument constructor GZIPOutputStream(out, false).
+     *
      * @param out the output stream
      * @exception IOException If an I/O error has occurred.
      */
     public GZIPOutputStream(OutputStream out) throws IOException {
-        this(out, 512);
+        this(out, 512, false);
+    }
+
+    /**
+     * Creates a new output stream with a default buffer size and
+     * the specified flush mode.
+     *
+     * @param out the output stream
+     * @param syncFlush
+     *        if {@code true} invocation of the inherited
+     *        {@link DeflaterOutputStream#flush() flush()} method of
+     *        this instance flushes the compressor with flush mode
+     *        {@link Deflater#SYNC_FLUSH} before flushing the output
+     *        stream, otherwise only flushes the output stream
+     *
+     * @exception IOException If an I/O error has occurred.
+     *
+     * @since 1.7
+     */
+    public GZIPOutputStream(OutputStream out, boolean syncFlush)
+        throws IOException
+    {
+        this(out, 512, syncFlush);
     }
 
     /**
@@ -122,22 +179,19 @@
     /*
      * Writes GZIP member header.
      */
-
-    private final static byte[] header = {
-        (byte) GZIP_MAGIC,                // Magic number (short)
-        (byte)(GZIP_MAGIC >> 8),          // Magic number (short)
-        Deflater.DEFLATED,                // Compression method (CM)
-        0,                                // Flags (FLG)
-        0,                                // Modification time MTIME (int)
-        0,                                // Modification time MTIME (int)
-        0,                                // Modification time MTIME (int)
-        0,                                // Modification time MTIME (int)
-        0,                                // Extra flags (XFLG)
-        0                                 // Operating system (OS)
-    };
-
     private void writeHeader() throws IOException {
-        out.write(header);
+        out.write(new byte[] {
+                      (byte) GZIP_MAGIC,        // Magic number (short)
+                      (byte)(GZIP_MAGIC >> 8),  // Magic number (short)
+                      Deflater.DEFLATED,        // Compression method (CM)
+                      0,                        // Flags (FLG)
+                      0,                        // Modification time MTIME (int)
+                      0,                        // Modification time MTIME (int)
+                      0,                        // Modification time MTIME (int)
+                      0,                        // Modification time MTIME (int)
+                      0,                        // Extra flags (XFLG)
+                      0                         // Operating system (OS)
+                  });
     }
 
     /*
--- a/jdk/src/share/classes/java/util/zip/ZipException.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/share/classes/java/util/zip/ZipException.java	Wed Jul 21 09:57:21 2010 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1995, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1995, 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
@@ -40,7 +40,7 @@
     private static final long serialVersionUID = 8000196834066748623L;
 
     /**
-     * Constructs an <code>ZipException</code> with <code>null</code>
+     * Constructs a <code>ZipException</code> with <code>null</code>
      * as its error detail message.
      */
     public ZipException() {
@@ -48,7 +48,7 @@
     }
 
     /**
-     * Constructs an <code>ZipException</code> with the specified detail
+     * Constructs a <code>ZipException</code> with the specified detail
      * message.
      *
      * @param   s   the detail message.
--- a/jdk/src/share/classes/java/util/zip/package.html	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/share/classes/java/util/zip/package.html	Wed Jul 21 09:57:21 2010 -0700
@@ -58,25 +58,22 @@
       PKWARE ZIP File Format Specification</a> - Language Encoding Flag (EFS) to
       encode ZIP entry filename and comment fields using UTF-8.
 <p>
-  <li><a href="http://www.isi.edu/in-notes/rfc1950.txt">
+  <li><a href="http://www.ietf.org/rfc/rfc1950.txt">
       ZLIB Compressed Data Format Specification version 3.3</a>
       &nbsp;
-      <a href="http://www.isi.edu/in-notes/rfc1950.ps">
-      (PostScript)</a>
+      <a href="http://www.ietf.org/rfc/rfc1950.txt.pdf">(pdf)</a>
       (RFC 1950)
 <p>
-  <li><a href="http://www.isi.edu/in-notes/rfc1951.txt">
+  <li><a href="http://www.ietf.org/rfc/rfc1951.txt">
       DEFLATE Compressed Data Format Specification version 1.3</a>
       &nbsp;
-      <a href="http://www.isi.edu/in-notes/rfc1951.ps">
-      (PostScript)</a>
+      <a href="http://www.ietf.org/rfc/rfc1951.txt.pdf">(pdf)</a>
       (RFC 1951)
 <p>
-  <li><a href="http://www.isi.edu/in-notes/rfc1952.txt">
+  <li><a href="http://www.ietf.org/rfc/rfc1952.txt">
       GZIP file format specification version 4.3</a>
       &nbsp;
-      <a href="http://www.isi.edu/in-notes/rfc1952.ps">
-      (PostScript)</a>
+      <a href="http://www.ietf.org/rfc/rfc1952.txt.pdf">(pdf)</a>
       (RFC 1952)
 <p>
   <li>CRC-32 checksum is described in RFC 1952 (above)
--- a/jdk/src/share/classes/javax/imageio/stream/ImageInputStream.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/share/classes/javax/imageio/stream/ImageInputStream.java	Wed Jul 21 09:57:21 2010 -0700
@@ -25,6 +25,7 @@
 
 package javax.imageio.stream;
 
+import java.io.Closeable;
 import java.io.DataInput;
 import java.io.IOException;
 import java.nio.ByteOrder;
@@ -42,7 +43,7 @@
  * @see MemoryCacheImageInputStream
  *
  */
-public interface ImageInputStream extends DataInput {
+public interface ImageInputStream extends DataInput, Closeable {
 
     /**
      * Sets the desired byte order for future reads of data values
--- a/jdk/src/share/classes/javax/management/remote/JMXServiceURL.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/share/classes/javax/management/remote/JMXServiceURL.java	Wed Jul 21 09:57:21 2010 -0700
@@ -107,10 +107,10 @@
  * significant in the <code><em>url-path</em></code>.</p>
  *
  * @see <a
- * href="ftp://ftp.rfc-editor.org/in-notes/rfc2609.txt">RFC 2609,
+ * href="http://www.ietf.org/rfc/rfc2609.txt">RFC 2609,
  * "Service Templates and <code>Service:</code> Schemes"</a>
  * @see <a
- * href="ftp://ftp.rfc-editor.org/in-notes/rfc3111.txt">RFC 3111,
+ * href="http://www.ietf.org/rfc/rfc3111.txt">RFC 3111,
  * "Service Location Protocol Modifications for IPv6"</a>
  *
  * @since 1.5
--- a/jdk/src/share/classes/javax/naming/event/EventDirContext.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/share/classes/javax/naming/event/EventDirContext.java	Wed Jul 21 09:57:21 2010 -0700
@@ -34,7 +34,7 @@
  * of events fired when objects named in a directory context changes.
  *<p>
  * The methods in this interface support identification of objects by
- * <A HREF="ftp://ftp.isi.edu/in-notes/rfc2254.txt">RFC 2254</a>
+ * <A HREF="http://www.ietf.org/rfc/rfc2254.txt">RFC 2254</a>
  * search filters.
  *
  *<P>Using the search filter, it is possible to register interest in objects
--- a/jdk/src/share/classes/javax/naming/ldap/Control.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/share/classes/javax/naming/ldap/Control.java	Wed Jul 21 09:57:21 2010 -0700
@@ -27,7 +27,7 @@
 
 /**
   * This interface represents an LDAPv3 control as defined in
-  * <A HREF="ftp://ftp.isi.edu/in-notes/rfc2251.txt">RFC 2251</A>.
+  * <A HREF="http://www.ietf.org/rfc/rfc2251.txt">RFC 2251</A>.
   *<p>
   * The LDAPv3 protocol uses controls to send and receive additional data
   * to affect the behavior of predefined operations.
--- a/jdk/src/share/classes/javax/naming/ldap/ControlFactory.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/share/classes/javax/naming/ldap/ControlFactory.java	Wed Jul 21 09:57:21 2010 -0700
@@ -37,7 +37,7 @@
 /**
   * This abstract class represents a factory for creating LDAPv3 controls.
   * LDAPv3 controls are defined in
-  * <A HREF="ftp://ftp.isi.edu/in-notes/rfc2251.txt">RFC 2251</A>.
+  * <A HREF="http://www.ietf.org/rfc/rfc2251.txt">RFC 2251</A>.
   *<p>
   * When a service provider receives a response control, it uses control
   * factories to return the specific/appropriate control class implementation.
--- a/jdk/src/share/classes/javax/naming/ldap/ExtendedRequest.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/share/classes/javax/naming/ldap/ExtendedRequest.java	Wed Jul 21 09:57:21 2010 -0700
@@ -29,7 +29,7 @@
 
 /**
   * This interface represents an LDAPv3 extended operation request as defined in
-  * <A HREF="ftp://ftp.isi.edu/in-notes/rfc2251.txt">RFC 2251</A>.
+  * <A HREF="http://www.ietf.org/rfc/rfc2251.txt">RFC 2251</A>.
   * <pre>
   *     ExtendedRequest ::= [APPLICATION 23] SEQUENCE {
   *              requestName      [0] LDAPOID,
--- a/jdk/src/share/classes/javax/naming/ldap/ExtendedResponse.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/share/classes/javax/naming/ldap/ExtendedResponse.java	Wed Jul 21 09:57:21 2010 -0700
@@ -27,7 +27,7 @@
 
 /**
   * This interface represents an LDAP extended operation response as defined in
-  * <A HREF="ftp://ftp.isi.edu/in-notes/rfc2251.txt">RFC 2251</A>.
+  * <A HREF="http://www.ietf.org/rfc/rfc2251.txt">RFC 2251</A>.
   * <pre>
   *     ExtendedResponse ::= [APPLICATION 24] SEQUENCE {
   *          COMPONENTS OF LDAPResult,
--- a/jdk/src/share/classes/javax/naming/ldap/LdapName.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/share/classes/javax/naming/ldap/LdapName.java	Wed Jul 21 09:57:21 2010 -0700
@@ -42,7 +42,7 @@
 
 /**
  * This class represents a distinguished name as specified by
- * <a href="http://ietf.org//rfc/rfc2253.txt">RFC 2253</a>.
+ * <a href="http://www.ietf.org/rfc/rfc2253.txt">RFC 2253</a>.
  * A distinguished name, or DN, is composed of an ordered list of
  * components called <em>relative distinguished name</em>s, or RDNs.
  * Details of a DN's syntax are described in RFC 2253.
@@ -115,7 +115,7 @@
      *
      * @param name  This is a non-null distinguished name formatted
      * according to the rules defined in
-     * <a href="http://ietf.org/rfc/rfc2253.txt">RFC 2253</a>.
+     * <a href="http://www.ietf.org/rfc/rfc2253.txt">RFC 2253</a>.
      *
      * @throws InvalidNameException if a syntax violation is detected.
      * @see Rdn#escapeValue(Object value)
@@ -614,7 +614,7 @@
 
     /**
      * Returns a string representation of this LDAP name in a format
-     * defined by <a href="http://ietf.org/rfc/rfc2253.txt">RFC 2253</a>
+     * defined by <a href="http://www.ietf.org/rfc/rfc2253.txt">RFC 2253</a>
      * and described in the class description. If the name has zero
      * components an empty string is returned.
      *
--- a/jdk/src/share/classes/javax/naming/ldap/Rdn.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/share/classes/javax/naming/ldap/Rdn.java	Wed Jul 21 09:57:21 2010 -0700
@@ -45,7 +45,7 @@
 /**
  * This class represents a relative distinguished name, or RDN, which is a
  * component of a distinguished name as specified by
- * <a href="http://ietf.org/rfc/rfc2253.txt">RFC 2253</a>.
+ * <a href="http://www.ietf.org/rfc/rfc2253.txt">RFC 2253</a>.
  * An example of an RDN is "OU=Sales+CN=J.Smith". In this example,
  * the RDN consist of multiple attribute type/value pairs. The
  * RDN is parsed as described in the class description for
@@ -117,7 +117,7 @@
      * {@link javax.naming.directory.Attributes Attributes}.
      * <p>
      * The string attribute values are not interpretted as
-     * <a href="http://ietf.org/rfc/rfc2253.txt">RFC 2253</a>
+     * <a href="http://www.ietf.org/rfc/rfc2253.txt">RFC 2253</a>
      * formatted RDN strings. That is, the values are used
      * literally (not parsed) and assumed to be unescaped.
      *
@@ -152,7 +152,7 @@
     /**
      * Constructs an Rdn from the given string.
      * This constructor takes a string formatted according to the rules
-     * defined in <a href="http://ietf.org//rfc/rfc2253.txt">RFC 2253</a>
+     * defined in <a href="http://www.ietf.org/rfc/rfc2253.txt">RFC 2253</a>
      * and described in the class description for
      * {@link javax.naming.ldap.LdapName}.
      *
@@ -180,7 +180,7 @@
      * Constructs an Rdn from the given attribute type and
      * value.
      * The string attribute values are not interpretted as
-     * <a href="http://ietf.org/rfc/rfc2253.txt">RFC 2253</a>
+     * <a href="http://www.ietf.org/rfc/rfc2253.txt">RFC 2253</a>
      * formatted RDN strings. That is, the values are used
      * literally (not parsed) and assumed to be unescaped.
      *
@@ -216,7 +216,7 @@
     /*
      * Adds the given attribute type and value to this Rdn.
      * The string attribute values are not interpretted as
-     * <a href="http://ietf.org/rfc/rfc2253.txt">RFC 2253</a>
+     * <a href="http://www.ietf.org/rfc/rfc2253.txt">RFC 2253</a>
      * formatted RDN strings. That is the values are used
      * literally (not parsed) and assumed to be unescaped.
      *
@@ -280,7 +280,7 @@
 
     /**
      * Returns this Rdn as a string represented in a format defined by
-     * <a href="http://ietf.org//rfc/rfc2253.txt">RFC 2253</a> and described
+     * <a href="http://www.ietf.org/rfc/rfc2253.txt">RFC 2253</a> and described
      * in the class description for {@link javax.naming.ldap.LdapName LdapName}.
      *
      * @return The string representation of the Rdn.
@@ -503,7 +503,7 @@
     /**
      * Given the value of an attribute, returns a string escaped according
      * to the rules specified in
-     * <a href="http://ietf.org/rfc/rfc2253.txt">RFC 2253</a>.
+     * <a href="http://www.ietf.org/rfc/rfc2253.txt">RFC 2253</a>.
      * <p>
      * For example, if the val is "Sue, Grabbit and Runn", the escaped
      * value returned by this method is "Sue\, Grabbit and Runn".
@@ -582,7 +582,7 @@
     /**
      * Given an attribute value string formated according to the rules
      * specified in
-     * <a href="http://ietf.org//rfc/rfc2253.txt">RFC 2253</a>,
+     * <a href="http://www.ietf.org/rfc/rfc2253.txt">RFC 2253</a>,
      * returns the unformated value.  Escapes and quotes are
      * stripped away, and hex-encoded UTF-8 is converted to equivalent
      * UTF-16 characters. Returns a string value as a String, and a
--- a/jdk/src/share/classes/javax/naming/ldap/UnsolicitedNotification.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/share/classes/javax/naming/ldap/UnsolicitedNotification.java	Wed Jul 21 09:57:21 2010 -0700
@@ -29,7 +29,7 @@
 
 /**
  * This interface represents an unsolicited notification as defined in
- * <A HREF="ftp://ftp.isi.edu/in-notes/rfc2251.txt">RFC 2251</A>.
+ * <A HREF="http://www.ietf.org/rfc/rfc2251.txt">RFC 2251</A>.
  * An unsolicited notification is sent by the LDAP server to the LDAP
  * client without any provocation from the client.
  * Its format is that of an extended response (<tt>ExtendedResponse</tt>).
--- a/jdk/src/share/classes/javax/naming/ldap/UnsolicitedNotificationListener.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/share/classes/javax/naming/ldap/UnsolicitedNotificationListener.java	Wed Jul 21 09:57:21 2010 -0700
@@ -30,7 +30,7 @@
 /**
  * This interface is for handling <tt>UnsolicitedNotificationEvent</tt>.
  * "Unsolicited notification" is defined in
- * <A HREF="ftp://ftp.isi.edu/in-notes/rfc2251.txt">RFC 2251</A>.
+ * <A HREF="http://www.ietf.org/rfc/rfc2251.txt">RFC 2251</A>.
  * It allows the server to send unsolicited notifications to the client.
  * A <tt>UnsolicitedNotificationListener</tt> must:
  *<ol>
--- a/jdk/src/share/classes/javax/net/ssl/SSLContext.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/share/classes/javax/net/ssl/SSLContext.java	Wed Jul 21 09:57:21 2010 -0700
@@ -160,7 +160,7 @@
      *
      * @param protocol the standard name of the requested protocol.
      *          See Appendix A in the <a href=
-     *  "{@docRoot}/../technotes/guides//security/jsse/JSSERefGuide.html#AppA">
+     *  "{@docRoot}/../technotes/guides/security/jsse/JSSERefGuide.html#AppA">
      *          Java Secure Socket Extension Reference Guide </a>
      *          for information about standard protocol names.
      *
--- a/jdk/src/share/classes/javax/print/DocFlavor.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/share/classes/javax/print/DocFlavor.java	Wed Jul 21 09:57:21 2010 -0700
@@ -83,7 +83,7 @@
  * doc flavor's MIME type is one of the standard media types telling how to
  * interpret the sequence of characters or bytes. For a list of standard media
  * types, see the Internet Assigned Numbers Authority's (IANA's) <A
- * HREF="http://www.isi.edu/in-notes/iana/assignments/media-types/">Media Types
+ * HREF="http://www.iana.org/assignments/media-types/">Media Types
  * Directory</A>. Interface {@link Doc Doc} provides two utility operations,
  * {@link Doc#getReaderForText() getReaderForText} and
  * {@link Doc#getStreamForBytes() getStreamForBytes()}, to help a
@@ -450,7 +450,7 @@
     /**
      * A String representing the host operating system encoding.
      * This will follow the conventions documented in
-     * <a href="http://ietf.org/rfc/rfc2278.txt">
+     * <a href="http://www.ietf.org/rfc/rfc2278.txt">
      * <i>RFC&nbsp;2278:&nbsp;IANA Charset Registration Procedures</i></a>
      * except where historical names are returned for compatibility with
      * previous versions of the Java platform.
--- a/jdk/src/share/classes/javax/sound/midi/MidiDevice.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/share/classes/javax/sound/midi/MidiDevice.java	Wed Jul 21 09:57:21 2010 -0700
@@ -107,7 +107,7 @@
  * @author Florian Bomers
  */
 
-public interface MidiDevice {
+public interface MidiDevice extends AutoCloseable {
 
 
     /**
--- a/jdk/src/share/classes/javax/sound/midi/Receiver.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/share/classes/javax/sound/midi/Receiver.java	Wed Jul 21 09:57:21 2010 -0700
@@ -38,7 +38,7 @@
  *
  * @author Kara Kytle
  */
-public interface Receiver {
+public interface Receiver extends AutoCloseable {
 
 
     //$$fb 2002-04-12: fix for 4662090: Contradiction in Receiver specification
--- a/jdk/src/share/classes/javax/sound/midi/Transmitter.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/share/classes/javax/sound/midi/Transmitter.java	Wed Jul 21 09:57:21 2010 -0700
@@ -35,7 +35,7 @@
  *
  * @author Kara Kytle
  */
-public interface Transmitter {
+public interface Transmitter extends AutoCloseable {
 
 
     /**
--- a/jdk/src/share/classes/javax/sound/sampled/Line.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/share/classes/javax/sound/sampled/Line.java	Wed Jul 21 09:57:21 2010 -0700
@@ -70,7 +70,7 @@
  * @see LineEvent
  * @since 1.3
  */
-public interface Line {
+public interface Line extends AutoCloseable {
 
     /**
      * Obtains the <code>Line.Info</code> object describing this
--- a/jdk/src/share/classes/javax/swing/BorderFactory.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/share/classes/javax/swing/BorderFactory.java	Wed Jul 21 09:57:21 2010 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2005, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -26,7 +26,6 @@
 
 import java.awt.Color;
 import java.awt.Font;
-import javax.swing.JComponent;
 import javax.swing.border.*;
 
 /**
@@ -74,10 +73,20 @@
         return new LineBorder(color, thickness);
     }
 
-//    public static Border createLineBorder(Color color, int thickness,
-//                                      boolean drawRounded)  {
-//        return new JLineBorder(color, thickness, drawRounded);
-//    }
+    /**
+     * Creates a line border with the specified color, thickness, and corner shape.
+     *
+     * @param color      the color of the border
+     * @param thickness  the thickness of the border
+     * @param rounded    whether or not border corners should be round
+     * @return the {@code Border} object
+     *
+     * @see LineBorder#LineBorder(Color, int, boolean)
+     * @since 1.7
+     */
+    public static Border createLineBorder(Color color, int thickness, boolean rounded) {
+        return new LineBorder(color, thickness, rounded);
+    }
 
 //// BevelBorder /////////////////////////////////////////////////////////////
 ///////////////////////////////////////////////////////////////////////////////
@@ -180,7 +189,115 @@
         }
         return null;
     }
+
+//// SoftBevelBorder ///////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////
+
+    private static Border sharedSoftRaisedBevel;
+    private static Border sharedSoftLoweredBevel;
+
+    /**
+     * Creates a beveled border with a raised edge and softened corners,
+     * using brighter shades of the component's current background color
+     * for highlighting, and darker shading for shadows.
+     * In a raised border, highlights are on top and shadows are underneath.
+     *
+     * @return the {@code Border} object
+     *
+     * @since 1.7
+     */
+    public static Border createRaisedSoftBevelBorder() {
+        if (sharedSoftRaisedBevel == null) {
+            sharedSoftRaisedBevel = new SoftBevelBorder(BevelBorder.RAISED);
+        }
+        return sharedSoftRaisedBevel;
+    }
+
+    /**
+     * Creates a beveled border with a lowered edge and softened corners,
+     * using brighter shades of the component's current background color
+     * for highlighting, and darker shading for shadows.
+     * In a lowered border, shadows are on top and highlights are underneath.
+     *
+     * @return the {@code Border} object
+     *
+     * @since 1.7
+     */
+    public static Border createLoweredSoftBevelBorder() {
+        if (sharedSoftLoweredBevel == null) {
+            sharedSoftLoweredBevel = new SoftBevelBorder(BevelBorder.LOWERED);
+        }
+        return sharedSoftLoweredBevel;
+    }
+
+    /**
+     * Creates a beveled border of the specified type with softened corners,
+     * using brighter shades of the component's current background color
+     * for highlighting, and darker shading for shadows.
+     * The type is either {@link BevelBorder#RAISED} or {@link BevelBorder#LOWERED}.
+     *
+     * @param type  a type of a bevel
+     * @return the {@code Border} object or {@code null}
+     *         if the specified type is not valid
+     *
+     * @see BevelBorder#BevelBorder(int)
+     * @since 1.7
+     */
+    public static Border createSoftBevelBorder(int type) {
+        if (type == BevelBorder.RAISED) {
+            return createRaisedSoftBevelBorder();
+        }
+        if (type == BevelBorder.LOWERED) {
+            return createLoweredSoftBevelBorder();
+        }
+        return null;
+    }
+
+    /**
+     * Creates a beveled border of the specified type with softened corners,
+     * using the specified highlighting and shadowing.
+     * The type is either {@link BevelBorder#RAISED} or {@link BevelBorder#LOWERED}.
+     * The outer edge of the highlight area uses
+     * a brighter shade of the {@code highlight} color.
+     * The inner edge of the shadow area uses
+     * a brighter shade of the {@code shadow} color.
+     *
+     * @param type       a type of a bevel
+     * @param highlight  a basic color of the highlight area
+     * @param shadow     a basic color of the shadow area
+     * @return the {@code Border} object
+     *
+     * @see BevelBorder#BevelBorder(int, Color, Color)
+     * @since 1.7
+     */
+    public static Border createSoftBevelBorder(int type, Color highlight, Color shadow) {
+        return new BevelBorder(type, highlight, shadow);
+    }
+
+    /**
+     * Creates a beveled border of the specified type with softened corners,
+     * using the specified colors for the inner and outer edges
+     * of the highlight and the shadow areas.
+     * The type is either {@link BevelBorder#RAISED} or {@link BevelBorder#LOWERED}.
+     * Note: The shadow inner and outer colors are switched
+     * for a lowered bevel border.
+     *
+     * @param type            a type of a bevel
+     * @param highlightOuter  a color of the outer edge of the highlight area
+     * @param highlightInner  a color of the inner edge of the highlight area
+     * @param shadowOuter     a color of the outer edge of the shadow area
+     * @param shadowInner     a color of the inner edge of the shadow area
+     * @return the {@code Border} object
+     *
+     * @see BevelBorder#BevelBorder(int, Color, Color, Color, Color)
+     * @since 1.7
+     */
+    public static Border createSoftBevelBorder(int type, Color highlightOuter, Color highlightInner, Color shadowOuter, Color shadowInner) {
+        return new BevelBorder(type, highlightOuter, highlightInner, shadowOuter, shadowInner);
+    }
+
 //// EtchedBorder ///////////////////////////////////////////////////////////
+
     static final Border sharedEtchedBorder = new EtchedBorder();
     private static Border sharedRaisedEtchedBorder;
 
--- a/jdk/src/share/classes/javax/swing/DefaultDesktopManager.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/share/classes/javax/swing/DefaultDesktopManager.java	Wed Jul 21 09:57:21 2010 -0700
@@ -26,16 +26,12 @@
 
 package javax.swing;
 
+import com.sun.awt.AWTUtilities;
+import sun.awt.AWTAccessor;
+import sun.awt.SunToolkit;
+
 import java.awt.*;
 import java.beans.PropertyVetoException;
-import java.beans.PropertyChangeEvent;
-import javax.swing.border.Border;
-import java.awt.event.ComponentListener;
-import java.awt.event.ComponentAdapter;
-import java.awt.event.ComponentEvent;
-
-import sun.awt.AWTAccessor;
-import sun.awt.SunToolkit;
 
 /** This is an implementation of the <code>DesktopManager</code>.
   * It currently implements the basic behaviors for managing
@@ -318,7 +314,10 @@
         dragMode = DEFAULT_DRAG_MODE;
         if (p != null) {
             String mode = (String)p.getClientProperty("JDesktopPane.dragMode");
-            if (mode != null && mode.equals("outline")) {
+            Window window = SwingUtilities.getWindowAncestor(f);
+            if (window != null && !AWTUtilities.isWindowOpaque(window)) {
+                dragMode = DEFAULT_DRAG_MODE;
+            } else if (mode != null && mode.equals("outline")) {
                 dragMode = OUTLINE_DRAG_MODE;
             } else if (mode != null && mode.equals("faster")
                     && f instanceof JInternalFrame
--- a/jdk/src/share/classes/javax/swing/JSplitPane.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/share/classes/javax/swing/JSplitPane.java	Wed Jul 21 09:57:21 2010 -0700
@@ -242,19 +242,19 @@
 
     /**
      * Creates a new <code>JSplitPane</code> configured to arrange the child
-     * components side-by-side horizontally with no continuous
-     * layout, using two buttons for the components.
+     * components side-by-side horizontally, using two buttons for the components.
      */
     public JSplitPane() {
-        this(JSplitPane.HORIZONTAL_SPLIT, false,
-            new JButton(UIManager.getString("SplitPane.leftButtonText")),
-            new JButton(UIManager.getString("SplitPane.rightButtonText")));
+        this(JSplitPane.HORIZONTAL_SPLIT,
+                UIManager.getBoolean("SplitPane.continuousLayout"),
+                new JButton(UIManager.getString("SplitPane.leftButtonText")),
+                new JButton(UIManager.getString("SplitPane.rightButtonText")));
     }
 
 
     /**
      * Creates a new <code>JSplitPane</code> configured with the
-     * specified orientation and no continuous layout.
+     * specified orientation.
      *
      * @param newOrientation  <code>JSplitPane.HORIZONTAL_SPLIT</code> or
      *                        <code>JSplitPane.VERTICAL_SPLIT</code>
@@ -263,7 +263,8 @@
      */
     @ConstructorProperties({"orientation"})
     public JSplitPane(int newOrientation) {
-        this(newOrientation, false);
+        this(newOrientation,
+                UIManager.getBoolean("SplitPane.continuousLayout"));
     }
 
 
@@ -287,9 +288,7 @@
 
     /**
      * Creates a new <code>JSplitPane</code> with the specified
-     * orientation and
-     * with the specified components that do not do continuous
-     * redrawing.
+     * orientation and the specified components.
      *
      * @param newOrientation  <code>JSplitPane.HORIZONTAL_SPLIT</code> or
      *                        <code>JSplitPane.VERTICAL_SPLIT</code>
@@ -307,7 +306,9 @@
     public JSplitPane(int newOrientation,
                       Component newLeftComponent,
                       Component newRightComponent){
-        this(newOrientation, false, newLeftComponent, newRightComponent);
+        this(newOrientation,
+                UIManager.getBoolean("SplitPane.continuousLayout"),
+                newLeftComponent, newRightComponent);
     }
 
 
--- a/jdk/src/share/classes/javax/swing/JTable.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/share/classes/javax/swing/JTable.java	Wed Jul 21 09:57:21 2010 -0700
@@ -1048,7 +1048,7 @@
 
     /**
      * Returns the horizontal and vertical space between cells.
-     * The default spacing is (1, 1), which provides room to draw the grid.
+     * The default spacing is look and feel dependent.
      *
      * @return  the horizontal and vertical spacing between cells
      * @see     #setIntercellSpacing
@@ -1155,7 +1155,7 @@
 
     /**
      * Returns true if the table draws horizontal lines between cells, false if it
-     * doesn't. The default is true.
+     * doesn't. The default value is look and feel dependent.
      *
      * @return  true if the table draws horizontal lines between cells, false if it
      *          doesn't
@@ -1167,7 +1167,7 @@
 
     /**
      * Returns true if the table draws vertical lines between cells, false if it
-     * doesn't. The default is true.
+     * doesn't. The default value is look and feel dependent.
      *
      * @return  true if the table draws vertical lines between cells, false if it
      *          doesn't
@@ -2583,10 +2583,8 @@
      * @see #convertColumnIndexToView
      */
     public int convertColumnIndexToModel(int viewColumnIndex) {
-        if (viewColumnIndex < 0) {
-            return viewColumnIndex;
-        }
-        return getColumnModel().getColumn(viewColumnIndex).getModelIndex();
+        return SwingUtilities2.convertColumnIndexToModel(
+                getColumnModel(), viewColumnIndex);
     }
 
     /**
@@ -2603,16 +2601,8 @@
      * @see #convertColumnIndexToModel
      */
     public int convertColumnIndexToView(int modelColumnIndex) {
-        if (modelColumnIndex < 0) {
-            return modelColumnIndex;
-        }
-        TableColumnModel cm = getColumnModel();
-        for (int column = 0; column < getColumnCount(); column++) {
-            if (cm.getColumn(column).getModelIndex() == modelColumnIndex) {
-                return column;
-            }
-        }
-        return -1;
+        return SwingUtilities2.convertColumnIndexToView(
+                getColumnModel(), modelColumnIndex);
     }
 
     /**
--- a/jdk/src/share/classes/javax/swing/JTree.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/share/classes/javax/swing/JTree.java	Wed Jul 21 09:57:21 2010 -0700
@@ -1986,20 +1986,17 @@
      *               true if all nodes in the path are expanded
      */
     public boolean isExpanded(TreePath path) {
+
         if(path == null)
             return false;
-
-        // Is this node expanded?
-        Boolean value = expandedState.get(path);
-
-        if(value == null || !value.booleanValue())
-            return false;
-
-        // It is, make sure its parent is also expanded.
-        TreePath        parentPath = path.getParentPath();
-
-        if(parentPath != null)
-            return isExpanded(parentPath);
+        Object  value;
+
+        do{
+            value = expandedState.get(path);
+            if(value == null || !((Boolean)value).booleanValue())
+                return false;
+        } while( (path=path.getParentPath())!=null );
+
         return true;
     }
 
--- a/jdk/src/share/classes/javax/swing/border/MatteBorder.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/share/classes/javax/swing/border/MatteBorder.java	Wed Jul 21 09:57:21 2010 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -26,7 +26,6 @@
 
 import java.awt.Graphics;
 import java.awt.Insets;
-import java.awt.Rectangle;
 import java.awt.Component;
 import java.awt.Color;
 
@@ -133,63 +132,29 @@
             g.fillRect(width - insets.right, 0, insets.right, height - insets.bottom);
 
         } else if (tileIcon != null) {
-
             int tileW = tileIcon.getIconWidth();
             int tileH = tileIcon.getIconHeight();
-            int xpos, ypos, startx, starty;
-            Graphics cg;
-
-            // Paint top matte edge
-            cg = g.create();
-            cg.setClip(0, 0, width, insets.top);
-            for (ypos = 0; insets.top - ypos > 0; ypos += tileH) {
-                for (xpos = 0; width - xpos > 0; xpos += tileW) {
-                    tileIcon.paintIcon(c, cg, xpos, ypos);
-                }
-            }
-            cg.dispose();
-
-            // Paint left matte edge
-            cg = g.create();
-            cg.setClip(0, insets.top, insets.left, height - insets.top);
-            starty = insets.top - (insets.top%tileH);
-            startx = 0;
-            for (ypos = starty; height - ypos > 0; ypos += tileH) {
-                for (xpos = startx; insets.left - xpos > 0; xpos += tileW) {
-                    tileIcon.paintIcon(c, cg, xpos, ypos);
-                }
-            }
-            cg.dispose();
-
-            // Paint bottom matte edge
-            cg = g.create();
-            cg.setClip(insets.left, height - insets.bottom, width - insets.left, insets.bottom);
-            starty = (height - insets.bottom) - ((height - insets.bottom)%tileH);
-            startx = insets.left - (insets.left%tileW);
-            for (ypos = starty; height - ypos > 0; ypos += tileH) {
-                for (xpos = startx; width - xpos > 0; xpos += tileW) {
-                    tileIcon.paintIcon(c, cg, xpos, ypos);
-                }
-            }
-            cg.dispose();
-
-            // Paint right matte edge
-            cg = g.create();
-            cg.setClip(width - insets.right, insets.top, insets.right, height - insets.top - insets.bottom);
-            starty = insets.top - (insets.top%tileH);
-            startx = width - insets.right - ((width - insets.right)%tileW);
-            for (ypos = starty; height - ypos > 0; ypos += tileH) {
-                for (xpos = startx; width - xpos > 0; xpos += tileW) {
-                    tileIcon.paintIcon(c, cg, xpos, ypos);
-                }
-            }
-            cg.dispose();
+            paintEdge(c, g, 0, 0, width - insets.right, insets.top, tileW, tileH);
+            paintEdge(c, g, 0, insets.top, insets.left, height - insets.top, tileW, tileH);
+            paintEdge(c, g, insets.left, height - insets.bottom, width - insets.left, insets.bottom, tileW, tileH);
+            paintEdge(c, g, width - insets.right, 0, insets.right, height - insets.bottom, tileW, tileH);
         }
         g.translate(-x, -y);
         g.setColor(oldColor);
 
     }
 
+    private void paintEdge(Component c, Graphics g, int x, int y, int width, int height, int tileW, int tileH) {
+        g = g.create(x, y, width, height);
+        int sY = -(y % tileH);
+        for (x = -(x % tileW); x < width; x += tileW) {
+            for (y = sY; y < height; y += tileH) {
+                this.tileIcon.paintIcon(c, g, x, y);
+            }
+        }
+        g.dispose();
+    }
+
     /**
      * Reinitialize the insets parameter with this Border's current Insets.
      * @param c the component for which this border insets value applies
--- a/jdk/src/share/classes/javax/swing/border/TitledBorder.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/share/classes/javax/swing/border/TitledBorder.java	Wed Jul 21 09:57:21 2010 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -24,22 +24,20 @@
  */
 package javax.swing.border;
 
-import sun.swing.SwingUtilities2;
-
+import java.awt.Color;
+import java.awt.Component;
+import java.awt.Dimension;
+import java.awt.Font;
 import java.awt.Graphics;
+import java.awt.Graphics2D;
 import java.awt.Insets;
 import java.awt.Rectangle;
-import java.awt.Color;
-import java.awt.Font;
-import java.awt.FontMetrics;
-import java.awt.Point;
-import java.awt.Toolkit;
-import java.awt.Component;
-import java.awt.Dimension;
+import java.awt.geom.Path2D;
 import java.beans.ConstructorProperties;
-
 import javax.swing.JComponent;
+import javax.swing.JLabel;
 import javax.swing.UIManager;
+import javax.swing.plaf.basic.BasicHTML;
 
 /**
  * A class which implements an arbitrary border
@@ -73,40 +71,40 @@
 {
     protected String title;
     protected Border border;
-    protected int    titlePosition;
-    protected int    titleJustification;
-    protected Font   titleFont;
-    protected Color  titleColor;
+    protected int titlePosition;
+    protected int titleJustification;
+    protected Font titleFont;
+    protected Color titleColor;
 
-    private Point textLoc = new Point();
+    private final JLabel label;
 
     /**
      * Use the default vertical orientation for the title text.
      */
     static public final int     DEFAULT_POSITION        = 0;
     /** Position the title above the border's top line. */
-    static public final int     ABOVE_TOP       = 1;
+    static public final int     ABOVE_TOP               = 1;
     /** Position the title in the middle of the border's top line. */
-    static public final int     TOP             = 2;
+    static public final int     TOP                     = 2;
     /** Position the title below the border's top line. */
-    static public final int     BELOW_TOP       = 3;
+    static public final int     BELOW_TOP               = 3;
     /** Position the title above the border's bottom line. */
-    static public final int     ABOVE_BOTTOM    = 4;
+    static public final int     ABOVE_BOTTOM            = 4;
     /** Position the title in the middle of the border's bottom line. */
-    static public final int     BOTTOM          = 5;
+    static public final int     BOTTOM                  = 5;
     /** Position the title below the border's bottom line. */
-    static public final int     BELOW_BOTTOM    = 6;
+    static public final int     BELOW_BOTTOM            = 6;
 
     /**
      * Use the default justification for the title text.
      */
     static public final int     DEFAULT_JUSTIFICATION   = 0;
     /** Position title text at the left side of the border line. */
-    static public final int     LEFT    = 1;
+    static public final int     LEFT                    = 1;
     /** Position title text in the center of the border line. */
-    static public final int     CENTER  = 2;
+    static public final int     CENTER                  = 2;
     /** Position title text at the right side of the border line. */
-    static public final int     RIGHT   = 3;
+    static public final int     RIGHT                   = 3;
     /** Position title text at the left side of the border line
      *  for left to right orientation, at the right side of the
      *  border line for right to left orientation.
@@ -132,7 +130,7 @@
      *
      * @param title  the title the border should display
      */
-    public TitledBorder(String title)     {
+    public TitledBorder(String title) {
         this(null, title, LEADING, DEFAULT_POSITION, null, null);
     }
 
@@ -142,7 +140,7 @@
      *
      * @param border  the border
      */
-    public TitledBorder(Border border)       {
+    public TitledBorder(Border border) {
         this(border, "", LEADING, DEFAULT_POSITION, null, null);
     }
 
@@ -167,9 +165,9 @@
      * @param titlePosition the position for the title
      */
     public TitledBorder(Border border,
-                        String title,
-                        int titleJustification,
-                        int titlePosition)      {
+                         String title,
+                         int titleJustification,
+                         int titlePosition) {
         this(border, title, titleJustification,
                         titlePosition, null, null);
     }
@@ -185,10 +183,10 @@
      * @param titleFont the font for rendering the title
      */
     public TitledBorder(Border border,
-                        String title,
-                        int titleJustification,
-                        int titlePosition,
-                        Font titleFont) {
+                         String title,
+                         int titleJustification,
+                         int titlePosition,
+                         Font titleFont) {
         this(border, title, titleJustification,
                         titlePosition, titleFont, null);
     }
@@ -207,11 +205,11 @@
      */
     @ConstructorProperties({"border", "title", "titleJustification", "titlePosition", "titleFont", "titleColor"})
     public TitledBorder(Border border,
-                        String title,
-                        int titleJustification,
-                        int titlePosition,
-                        Font titleFont,
-                        Color titleColor)       {
+                         String title,
+                         int titleJustification,
+                         int titlePosition,
+                         Font titleFont,
+                         Color titleColor) {
         this.title = title;
         this.border = border;
         this.titleFont = titleFont;
@@ -219,6 +217,10 @@
 
         setTitleJustification(titleJustification);
         setTitlePosition(titlePosition);
+
+        this.label = new JLabel();
+        this.label.setOpaque(false);
+        this.label.putClientProperty(BasicHTML.propertyKey, null);
     }
 
     /**
@@ -232,178 +234,111 @@
      * @param height the height of the painted border
      */
     public void paintBorder(Component c, Graphics g, int x, int y, int width, int height) {
-
-        Border border = getBorder();
-
-        if (getTitle() == null || getTitle().equals("")) {
-            if (border != null) {
-                border.paintBorder(c, g, x, y, width, height);
-            }
-            return;
-        }
-
-        Rectangle grooveRect = new Rectangle(x + EDGE_SPACING, y + EDGE_SPACING,
-                                             width - (EDGE_SPACING * 2),
-                                             height - (EDGE_SPACING * 2));
-        Font font = g.getFont();
-        Color color = g.getColor();
+        Border border = getBorderUI();
+        String title = getTitle();
+        if ((title != null) && !title.isEmpty()) {
+            int edge = (border instanceof TitledBorder) ? 0 : EDGE_SPACING;
+            JLabel label = getLabel(c);
+            Dimension size = label.getPreferredSize();
+            Insets insets = (border != null)
+                    ? border.getBorderInsets(c)
+                    : new Insets(0, 0, 0, 0);
 
-        g.setFont(getFont(c));
-
-        JComponent jc = (c instanceof JComponent) ? (JComponent)c : null;
-        FontMetrics fm = SwingUtilities2.getFontMetrics(jc, g);
-        int         fontHeight = fm.getHeight();
-        int         descent = fm.getDescent();
-        int         ascent = fm.getAscent();
-        int         diff;
-        int         stringWidth = SwingUtilities2.stringWidth(jc, fm,
-                                                              getTitle());
-        Insets      insets;
-
-        if (border != null) {
-            insets = border.getBorderInsets(c);
-        } else {
-            insets = new Insets(0, 0, 0, 0);
-        }
+            int borderX = x + edge;
+            int borderY = y + edge;
+            int borderW = width - edge - edge;
+            int borderH = height - edge - edge;
 
-        int titlePos = getTitlePosition();
-        switch (titlePos) {
-            case ABOVE_TOP:
-                diff = ascent + descent + (Math.max(EDGE_SPACING,
-                                 TEXT_SPACING*2) - EDGE_SPACING);
-                grooveRect.y += diff;
-                grooveRect.height -= diff;
-                textLoc.y = grooveRect.y - (descent + TEXT_SPACING);
-                break;
-            case TOP:
-            case DEFAULT_POSITION:
-                diff = Math.max(0, ((ascent/2) + TEXT_SPACING) - EDGE_SPACING);
-                grooveRect.y += diff;
-                grooveRect.height -= diff;
-                textLoc.y = (grooveRect.y - descent) +
-                (insets.top + ascent + descent)/2;
-                break;
-            case BELOW_TOP:
-                textLoc.y = grooveRect.y + insets.top + ascent + TEXT_SPACING;
-                break;
-            case ABOVE_BOTTOM:
-                textLoc.y = (grooveRect.y + grooveRect.height) -
-                (insets.bottom + descent + TEXT_SPACING);
-                break;
-            case BOTTOM:
-                grooveRect.height -= fontHeight/2;
-                textLoc.y = ((grooveRect.y + grooveRect.height) - descent) +
-                        ((ascent + descent) - insets.bottom)/2;
-                break;
-            case BELOW_BOTTOM:
-                grooveRect.height -= fontHeight;
-                textLoc.y = grooveRect.y + grooveRect.height + ascent +
-                        TEXT_SPACING;
-                break;
-        }
-
-        int justification = getTitleJustification();
-        if(isLeftToRight(c)) {
-            if(justification==LEADING ||
-               justification==DEFAULT_JUSTIFICATION) {
-                justification = LEFT;
-            }
-            else if(justification==TRAILING) {
-                justification = RIGHT;
-            }
-        }
-        else {
-            if(justification==LEADING ||
-               justification==DEFAULT_JUSTIFICATION) {
-                justification = RIGHT;
+            int labelY = y;
+            int labelH = size.height;
+            int position = getPosition();
+            switch (position) {
+                case ABOVE_TOP:
+                    insets.left = 0;
+                    insets.right = 0;
+                    borderY += labelH - edge;
+                    borderH -= labelH - edge;
+                    break;
+                case TOP:
+                    insets.top = edge + insets.top/2 - labelH/2;
+                    if (insets.top < edge) {
+                        borderY -= insets.top;
+                        borderH += insets.top;
+                    }
+                    else {
+                        labelY += insets.top;
+                    }
+                    break;
+                case BELOW_TOP:
+                    labelY += insets.top + edge;
+                    break;
+                case ABOVE_BOTTOM:
+                    labelY += height - labelH - insets.bottom - edge;
+                    break;
+                case BOTTOM:
+                    labelY += height - labelH;
+                    insets.bottom = edge + (insets.bottom - labelH) / 2;
+                    if (insets.bottom < edge) {
+                        borderH += insets.bottom;
+                    }
+                    else {
+                        labelY -= insets.bottom;
+                    }
+                    break;
+                case BELOW_BOTTOM:
+                    insets.left = 0;
+                    insets.right = 0;
+                    labelY += height - labelH;
+                    borderH -= labelH - edge;
+                    break;
             }
-            else if(justification==TRAILING) {
-                justification = LEFT;
-            }
-        }
-
-        switch (justification) {
-            case LEFT:
-                textLoc.x = grooveRect.x + TEXT_INSET_H + insets.left;
-                break;
-            case RIGHT:
-                textLoc.x = (grooveRect.x + grooveRect.width) -
-                        (stringWidth + TEXT_INSET_H + insets.right);
-                break;
-            case CENTER:
-                textLoc.x = grooveRect.x +
-                        ((grooveRect.width - stringWidth) / 2);
-                break;
-        }
+            insets.left += edge + TEXT_INSET_H;
+            insets.right += edge + TEXT_INSET_H;
 
-        // If title is positioned in middle of border AND its fontsize
-        // is greater than the border's thickness, we'll need to paint
-        // the border in sections to leave space for the component's background
-        // to show through the title.
-        //
-        if (border != null) {
-            if (((titlePos == TOP || titlePos == DEFAULT_POSITION) &&
-                  (grooveRect.y > textLoc.y - ascent)) ||
-                 (titlePos == BOTTOM &&
-                  (grooveRect.y + grooveRect.height < textLoc.y + descent))) {
-
-                Rectangle clipRect = new Rectangle();
-
-                // save original clip
-                Rectangle saveClip = g.getClipBounds();
-
-                // paint strip left of text
-                clipRect.setBounds(saveClip);
-                if (computeIntersection(clipRect, x, y, textLoc.x-1-x, height)) {
-                    g.setClip(clipRect);
-                    border.paintBorder(c, g, grooveRect.x, grooveRect.y,
-                                  grooveRect.width, grooveRect.height);
-                }
+            int labelX = x;
+            int labelW = width - insets.left - insets.right;
+            if (labelW > size.width) {
+                labelW = size.width;
+            }
+            switch (getJustification(c)) {
+                case LEFT:
+                    labelX += insets.left;
+                    break;
+                case RIGHT:
+                    labelX += width - insets.right - labelW;
+                    break;
+                case CENTER:
+                    labelX += (width - labelW) / 2;
+                    break;
+            }
 
-                // paint strip right of text
-                clipRect.setBounds(saveClip);
-                if (computeIntersection(clipRect, textLoc.x+stringWidth+1, y,
-                               x+width-(textLoc.x+stringWidth+1), height)) {
-                    g.setClip(clipRect);
-                    border.paintBorder(c, g, grooveRect.x, grooveRect.y,
-                                  grooveRect.width, grooveRect.height);
+            if (border != null) {
+                if ((position != TOP) && (position != BOTTOM)) {
+                    border.paintBorder(c, g, borderX, borderY, borderW, borderH);
                 }
-
-                if (titlePos == TOP || titlePos == DEFAULT_POSITION) {
-                    // paint strip below text
-                    clipRect.setBounds(saveClip);
-                    if (computeIntersection(clipRect, textLoc.x-1, textLoc.y+descent,
-                                        stringWidth+2, y+height-textLoc.y-descent)) {
-                        g.setClip(clipRect);
-                        border.paintBorder(c, g, grooveRect.x, grooveRect.y,
-                                  grooveRect.width, grooveRect.height);
+                else {
+                    Graphics g2 = g.create();
+                    if (g2 instanceof Graphics2D) {
+                        Graphics2D g2d = (Graphics2D) g2;
+                        Path2D path = new Path2D.Float();
+                        path.append(new Rectangle(borderX, borderY, borderW, labelY - borderY), false);
+                        path.append(new Rectangle(borderX, labelY, labelX - borderX - TEXT_SPACING, labelH), false);
+                        path.append(new Rectangle(labelX + labelW + TEXT_SPACING, labelY, borderX - labelX + borderW - labelW - TEXT_SPACING, labelH), false);
+                        path.append(new Rectangle(borderX, labelY + labelH, borderW, borderY - labelY + borderH - labelH), false);
+                        g2d.clip(path);
                     }
-
-                } else { // titlePos == BOTTOM
-                  // paint strip above text
-                    clipRect.setBounds(saveClip);
-                    if (computeIntersection(clipRect, textLoc.x-1, y,
-                          stringWidth+2, textLoc.y - ascent - y)) {
-                        g.setClip(clipRect);
-                        border.paintBorder(c, g, grooveRect.x, grooveRect.y,
-                                  grooveRect.width, grooveRect.height);
-                    }
+                    border.paintBorder(c, g2, borderX, borderY, borderW, borderH);
+                    g2.dispose();
                 }
-
-                // restore clip
-                g.setClip(saveClip);
-
-            } else {
-                border.paintBorder(c, g, grooveRect.x, grooveRect.y,
-                                  grooveRect.width, grooveRect.height);
             }
+            g.translate(labelX, labelY);
+            label.setSize(labelW, labelH);
+            label.paint(g);
+            g.translate(-labelX, -labelY);
         }
-
-        g.setColor(getTitleColor());
-        SwingUtilities2.drawString(jc, g, getTitle(), textLoc.x, textLoc.y);
-
-        g.setFont(font);
-        g.setColor(color);
+        else if (border != null) {
+            border.paintBorder(c, g, x, y, width, height);
+        }
     }
 
     /**
@@ -412,69 +347,54 @@
      * @param insets the object to be reinitialized
      */
     public Insets getBorderInsets(Component c, Insets insets) {
-        FontMetrics fm;
-        int         descent = 0;
-        int         ascent = 16;
-        int         height = 16;
-
-        Border border = getBorder();
-        if (border != null) {
-            if (border instanceof AbstractBorder) {
-                ((AbstractBorder)border).getBorderInsets(c, insets);
-            } else {
-                // Can't reuse border insets because the Border interface
-                // can't be enhanced.
-                Insets i = border.getBorderInsets(c);
-                insets.top = i.top;
-                insets.right = i.right;
-                insets.bottom = i.bottom;
-                insets.left = i.left;
-            }
-        } else {
-            insets.left = insets.top = insets.right = insets.bottom = 0;
+        Border border = getBorderUI();
+        if (border == null) {
+            insets.set(0, 0, 0, 0);
+        }
+        else if (border instanceof AbstractBorder) {
+            AbstractBorder ab = (AbstractBorder) border;
+            insets = ab.getBorderInsets(c, insets);
         }
-
-        insets.left += EDGE_SPACING + TEXT_SPACING;
-        insets.right += EDGE_SPACING + TEXT_SPACING;
-        insets.top += EDGE_SPACING + TEXT_SPACING;
-        insets.bottom += EDGE_SPACING + TEXT_SPACING;
-
-        if(c == null || getTitle() == null || getTitle().equals(""))    {
-            return insets;
+        else {
+            Insets i = border.getBorderInsets(c);
+            insets.set(i.top, i.left, i.bottom, i.right);
         }
+        String title = getTitle();
+        if ((title != null) && !title.isEmpty()) {
+            int edge = (border instanceof TitledBorder) ? 0 : EDGE_SPACING;
+            JLabel label = getLabel(c);
+            Dimension size = label.getPreferredSize();
 
-        Font font = getFont(c);
-
-        fm = c.getFontMetrics(font);
-
-        if(fm != null) {
-           descent = fm.getDescent();
-           ascent = fm.getAscent();
-           height = fm.getHeight();
-        }
-
-        switch (getTitlePosition()) {
-          case ABOVE_TOP:
-              insets.top += ascent + descent
-                            + (Math.max(EDGE_SPACING, TEXT_SPACING*2)
-                            - EDGE_SPACING);
-              break;
-          case TOP:
-          case DEFAULT_POSITION:
-              insets.top += ascent + descent;
-              break;
-          case BELOW_TOP:
-              insets.top += ascent + descent + TEXT_SPACING;
-              break;
-          case ABOVE_BOTTOM:
-              insets.bottom += ascent + descent + TEXT_SPACING;
-              break;
-          case BOTTOM:
-              insets.bottom += ascent + descent;
-              break;
-          case BELOW_BOTTOM:
-              insets.bottom += height;
-              break;
+            switch (getPosition()) {
+                case ABOVE_TOP:
+                    insets.top += size.height - edge;
+                    break;
+                case TOP: {
+                    if (insets.top < size.height) {
+                        insets.top = size.height - edge;
+                    }
+                    break;
+                }
+                case BELOW_TOP:
+                    insets.top += size.height;
+                    break;
+                case ABOVE_BOTTOM:
+                    insets.bottom += size.height;
+                    break;
+                case BOTTOM: {
+                    if (insets.bottom < size.height) {
+                        insets.bottom = size.height - edge;
+                    }
+                    break;
+                }
+                case BELOW_BOTTOM:
+                    insets.bottom += size.height - edge;
+                    break;
+            }
+            insets.top += edge + TEXT_SPACING;
+            insets.left += edge + TEXT_SPACING;
+            insets.right += edge + TEXT_SPACING;
+            insets.bottom += edge + TEXT_SPACING;
         }
         return insets;
     }
@@ -492,41 +412,14 @@
     /**
      * Returns the border of the titled border.
      */
-    public Border getBorder()       {
-        Border b = border;
-        if (b == null)
-            b = UIManager.getBorder("TitledBorder.border");
-        return b;
+    public Border getBorder() {
+        return border;
     }
 
     /**
      * Returns the title-position of the titled border.
      */
     public int getTitlePosition() {
-        if (titlePosition == DEFAULT_POSITION) {
-            Object value = UIManager.get("TitledBorder.position");
-            if (value instanceof String) {
-                String s = (String)value;
-                if ("ABOVE_TOP".equalsIgnoreCase(s)) {
-                    return ABOVE_TOP;
-                } else if ("TOP".equalsIgnoreCase(s)) {
-                    return TOP;
-                } else if ("BELOW_TOP".equalsIgnoreCase(s)) {
-                    return BELOW_TOP;
-                } else if ("ABOVE_BOTTOM".equalsIgnoreCase(s)) {
-                    return ABOVE_BOTTOM;
-                } else if ("BOTTOM".equalsIgnoreCase(s)) {
-                    return BOTTOM;
-                } else if ("BELOW_BOTTOM".equalsIgnoreCase(s)) {
-                    return BELOW_BOTTOM;
-                }
-            } else if (value instanceof Integer) {
-                int i = (Integer)value;
-                if (i >= 0 && i <= 6) {
-                    return i;
-                }
-            }
-        }
         return titlePosition;
     }
 
@@ -539,20 +432,14 @@
      * Returns the title-font of the titled border.
      */
     public Font getTitleFont()      {
-        Font f = titleFont;
-        if (f == null)
-            f = UIManager.getFont("TitledBorder.font");
-        return f;
+        return titleFont;
     }
 
     /**
      * Returns the title-color of the titled border.
      */
     public Color getTitleColor()    {
-        Color c = titleColor;
-        if (c == null)
-            c = UIManager.getColor("TitledBorder.titleColor");
-        return c;
+        return titleColor;
     }
 
 
@@ -576,18 +463,18 @@
      */
     public void setTitlePosition(int titlePosition) {
         switch (titlePosition) {
-          case ABOVE_TOP:
-          case TOP:
-          case BELOW_TOP:
-          case ABOVE_BOTTOM:
-          case BOTTOM:
-          case BELOW_BOTTOM:
-          case DEFAULT_POSITION:
+            case ABOVE_TOP:
+            case TOP:
+            case BELOW_TOP:
+            case ABOVE_BOTTOM:
+            case BOTTOM:
+            case BELOW_BOTTOM:
+            case DEFAULT_POSITION:
                 this.titlePosition = titlePosition;
                 break;
-          default:
-            throw new IllegalArgumentException(titlePosition +
-                                        " is not a valid title position.");
+            default:
+                throw new IllegalArgumentException(titlePosition +
+                        " is not a valid title position.");
         }
     }
 
@@ -624,7 +511,7 @@
      * @param titleColor the color for the border title
      */
     public void setTitleColor(Color titleColor) {
-      this.titleColor = titleColor;
+        this.titleColor = titleColor;
     }
 
     /**
@@ -636,22 +523,18 @@
         Insets insets = getBorderInsets(c);
         Dimension minSize = new Dimension(insets.right+insets.left,
                                           insets.top+insets.bottom);
-        Font font = getFont(c);
-        FontMetrics fm = c.getFontMetrics(font);
-        JComponent jc = (c instanceof JComponent) ? (JComponent)c : null;
-        switch (getTitlePosition()) {
-          case ABOVE_TOP:
-          case BELOW_BOTTOM:
-              minSize.width = Math.max(SwingUtilities2.stringWidth(jc, fm,
-                                       getTitle()), minSize.width);
-              break;
-          case BELOW_TOP:
-          case ABOVE_BOTTOM:
-          case TOP:
-          case BOTTOM:
-          case DEFAULT_POSITION:
-          default:
-              minSize.width += SwingUtilities2.stringWidth(jc, fm, getTitle());
+        String title = getTitle();
+        if ((title != null) && !title.isEmpty()) {
+            JLabel label = getLabel(c);
+            Dimension size = label.getPreferredSize();
+
+            int position = getPosition();
+            if ((position != ABOVE_TOP) && (position != BELOW_BOTTOM)) {
+                minSize.width += size.width;
+            }
+            else if (minSize.width < size.width) {
+                minSize.width += size.width;
+            }
         }
         return minSize;
     }
@@ -674,48 +557,36 @@
         if (height < 0) {
             throw new IllegalArgumentException("Height must be >= 0");
         }
+        Border border = getBorderUI();
         String title = getTitle();
-        if (title != null && !"".equals(title)) {
-            Font font = getFont(c);
-            Border border2 = getBorder();
-            Insets borderInsets;
-            if (border2 != null) {
-                borderInsets = border2.getBorderInsets(c);
-            }
-            else {
-                borderInsets = new Insets(0, 0, 0, 0);
-            }
-            FontMetrics fm = c.getFontMetrics(font);
-            int fontHeight = fm.getHeight();
-            int descent = fm.getDescent();
-            int ascent = fm.getAscent();
-            int y = EDGE_SPACING;
-            int h = height - EDGE_SPACING * 2;
-            int diff;
-            switch (getTitlePosition()) {
-            case ABOVE_TOP:
-                diff = ascent + descent + (Math.max(EDGE_SPACING,
-                                                    TEXT_SPACING * 2) -
-                                           EDGE_SPACING);
-                return y + diff - (descent + TEXT_SPACING);
-            case TOP:
-            case DEFAULT_POSITION:
-                diff = Math.max(0, ((ascent/2) + TEXT_SPACING) -
-                                EDGE_SPACING);
-                return (y + diff - descent) +
-                    (borderInsets.top + ascent + descent)/2;
-            case BELOW_TOP:
-                return y + borderInsets.top + ascent + TEXT_SPACING;
-            case ABOVE_BOTTOM:
-                return (y + h) - (borderInsets.bottom + descent +
-                                  TEXT_SPACING);
-            case BOTTOM:
-                h -= fontHeight / 2;
-                return ((y + h) - descent) +
-                        ((ascent + descent) - borderInsets.bottom)/2;
-            case BELOW_BOTTOM:
-                h -= fontHeight;
-                return y + h + ascent + TEXT_SPACING;
+        if ((title != null) && !title.isEmpty()) {
+            int edge = (border instanceof TitledBorder) ? 0 : EDGE_SPACING;
+            JLabel label = getLabel(c);
+            Dimension size = label.getPreferredSize();
+            Insets insets = (border != null)
+                    ? border.getBorderInsets(c)
+                    : new Insets(0, 0, 0, 0);
+
+            int baseline = label.getBaseline(size.width, size.height);
+            switch (getPosition()) {
+                case ABOVE_TOP:
+                    return baseline;
+                case TOP:
+                    insets.top = edge + (insets.top - size.height) / 2;
+                    return (insets.top < edge)
+                            ? baseline
+                            : baseline + insets.top;
+                case BELOW_TOP:
+                    return baseline + insets.top + edge;
+                case ABOVE_BOTTOM:
+                    return baseline + height - size.height - insets.bottom - edge;
+                case BOTTOM:
+                    insets.bottom = edge + (insets.bottom - size.height) / 2;
+                    return (insets.bottom < edge)
+                            ? baseline + height - size.height
+                            : baseline + height - size.height + insets.bottom;
+                case BELOW_BOTTOM:
+                    return baseline + height - size.height;
             }
         }
         return -1;
@@ -732,44 +603,111 @@
     public Component.BaselineResizeBehavior getBaselineResizeBehavior(
             Component c) {
         super.getBaselineResizeBehavior(c);
-        switch(getTitlePosition()) {
-        case TitledBorder.ABOVE_TOP:
-        case TitledBorder.TOP:
-        case TitledBorder.DEFAULT_POSITION:
-        case TitledBorder.BELOW_TOP:
-            return Component.BaselineResizeBehavior.CONSTANT_ASCENT;
-        case TitledBorder.ABOVE_BOTTOM:
-        case TitledBorder.BOTTOM:
-        case TitledBorder.BELOW_BOTTOM:
-            return JComponent.BaselineResizeBehavior.CONSTANT_DESCENT;
+        switch (getPosition()) {
+            case TitledBorder.ABOVE_TOP:
+            case TitledBorder.TOP:
+            case TitledBorder.BELOW_TOP:
+                return Component.BaselineResizeBehavior.CONSTANT_ASCENT;
+            case TitledBorder.ABOVE_BOTTOM:
+            case TitledBorder.BOTTOM:
+            case TitledBorder.BELOW_BOTTOM:
+                return JComponent.BaselineResizeBehavior.CONSTANT_DESCENT;
         }
         return Component.BaselineResizeBehavior.OTHER;
     }
 
+    private Border getBorderUI() {
+        Border border = getBorder();
+        return border != null
+                ? border
+                : UIManager.getBorder("TitledBorder.border");
+    }
+
+    private int getPosition() {
+        int position = getTitlePosition();
+        if (position != DEFAULT_POSITION) {
+            return position;
+        }
+        Object value = UIManager.get("TitledBorder.position");
+        if (value instanceof Integer) {
+            int i = (Integer) value;
+            if ((0 < i) && (i <= 6)) {
+                return i;
+            }
+        }
+        else if (value instanceof String) {
+            String s = (String) value;
+            if (s.equalsIgnoreCase("ABOVE_TOP")) {
+                return ABOVE_TOP;
+            }
+            if (s.equalsIgnoreCase("TOP")) {
+                return TOP;
+            }
+            if (s.equalsIgnoreCase("BELOW_TOP")) {
+                return BELOW_TOP;
+            }
+            if (s.equalsIgnoreCase("ABOVE_BOTTOM")) {
+                return ABOVE_BOTTOM;
+            }
+            if (s.equalsIgnoreCase("BOTTOM")) {
+                return BOTTOM;
+            }
+            if (s.equalsIgnoreCase("BELOW_BOTTOM")) {
+                return BELOW_BOTTOM;
+            }
+        }
+        return TOP;
+    }
+
+    private int getJustification(Component c) {
+        int justification = getTitleJustification();
+        if ((justification == LEADING) || (justification == DEFAULT_JUSTIFICATION)) {
+            return c.getComponentOrientation().isLeftToRight() ? LEFT : RIGHT;
+        }
+        if (justification == TRAILING) {
+            return c.getComponentOrientation().isLeftToRight() ? RIGHT : LEFT;
+        }
+        return justification;
+    }
+
     protected Font getFont(Component c) {
-        Font font;
-        if ((font = getTitleFont()) != null) {
+        Font font = getTitleFont();
+        if (font != null) {
+            return font;
+        }
+        font = UIManager.getFont("TitledBorder.font");
+        if (font != null) {
             return font;
-        } else if (c != null && (font = c.getFont()) != null) {
-            return font;
+        }
+        if (c != null) {
+            font = c.getFont();
+            if (font != null) {
+                return font;
+            }
         }
         return new Font(Font.DIALOG, Font.PLAIN, 12);
     }
 
-    private static boolean computeIntersection(Rectangle dest,
-                                               int rx, int ry, int rw, int rh) {
-        int x1 = Math.max(rx, dest.x);
-        int x2 = Math.min(rx + rw, dest.x + dest.width);
-        int y1 = Math.max(ry, dest.y);
-        int y2 = Math.min(ry + rh, dest.y + dest.height);
-        dest.x = x1;
-        dest.y = y1;
-        dest.width = x2 - x1;
-        dest.height = y2 - y1;
+    private Color getColor(Component c) {
+        Color color = getTitleColor();
+        if (color != null) {
+            return color;
+        }
+        color = UIManager.getColor("TitledBorder.titleColor");
+        if (color != null) {
+            return color;
+        }
+        return (c != null)
+                ? c.getForeground()
+                : null;
+    }
 
-        if (dest.width <= 0 || dest.height <= 0) {
-            return false;
-        }
-        return true;
+    private JLabel getLabel(Component c) {
+        this.label.setText(getTitle());
+        this.label.setFont(getFont(c));
+        this.label.setForeground(getColor(c));
+        this.label.setComponentOrientation(c.getComponentOrientation());
+        this.label.setEnabled(c.isEnabled());
+        return this.label;
     }
 }
--- a/jdk/src/share/classes/javax/swing/plaf/basic/BasicButtonListener.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicButtonListener.java	Wed Jul 21 09:57:21 2010 -0700
@@ -195,9 +195,8 @@
         }
 
         ButtonModel model = b.getModel();
+        model.setPressed(false);
         model.setArmed(false);
-        model.setPressed(false);
-
         b.repaint();
     }
 
--- a/jdk/src/share/classes/javax/swing/plaf/basic/BasicTabbedPaneUI.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicTabbedPaneUI.java	Wed Jul 21 09:57:21 2010 -0700
@@ -3524,7 +3524,13 @@
             }
             else if (name =="indexForTitle") {
                 calculatedBaseline = false;
-                updateHtmlViews((Integer)e.getNewValue());
+                Integer index = (Integer) e.getNewValue();
+                // remove the current index
+                // to let updateHtmlViews() insert the correct one
+                if (htmlViews != null) {
+                    htmlViews.removeElementAt(index);
+                }
+                updateHtmlViews(index);
             } else if (name == "tabLayoutPolicy") {
                 BasicTabbedPaneUI.this.uninstallUI(pane);
                 BasicTabbedPaneUI.this.installUI(pane);
--- a/jdk/src/share/classes/javax/swing/plaf/basic/BasicTableHeaderUI.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicTableHeaderUI.java	Wed Jul 21 09:57:21 2010 -0700
@@ -98,15 +98,18 @@
         private Cursor otherCursor = resizeCursor;
 
         public void mouseClicked(MouseEvent e) {
+            if (!header.isEnabled()) {
+                return;
+            }
             if (e.getClickCount() % 2 == 1 &&
-                    SwingUtilities.isLeftMouseButton(e)){
+                    SwingUtilities.isLeftMouseButton(e)) {
                 JTable table = header.getTable();
                 RowSorter sorter;
                 if (table != null && (sorter = table.getRowSorter()) != null) {
                     int columnIndex = header.columnAtPoint(e.getPoint());
                     if (columnIndex != -1) {
                         columnIndex = table.convertColumnIndexToModel(
-                                            columnIndex);
+                                columnIndex);
                         sorter.toggleSortOrder(columnIndex);
                     }
                 }
@@ -140,6 +143,9 @@
         }
 
         public void mousePressed(MouseEvent e) {
+            if (!header.isEnabled()) {
+                return;
+            }
             header.setDraggedColumn(null);
             header.setResizingColumn(null);
             header.setDraggedDistance(0);
@@ -182,6 +188,9 @@
         }
 
         public void mouseMoved(MouseEvent e) {
+            if (!header.isEnabled()) {
+                return;
+            }
             if (canResize(getResizingColumn(e.getPoint()), header) !=
                 (header.getCursor() == resizeCursor)) {
                 swapCursor();
@@ -190,6 +199,9 @@
        }
 
         public void mouseDragged(MouseEvent e) {
+            if (!header.isEnabled()) {
+                return;
+            }
             int mouseX = e.getX();
 
             TableColumn resizingColumn  = header.getResizingColumn();
@@ -217,21 +229,23 @@
                 if (0 <= newColumnIndex && newColumnIndex < cm.getColumnCount()) {
                     int width = cm.getColumn(newColumnIndex).getWidth();
                     if (Math.abs(draggedDistance) > (width / 2)) {
-                        JTable table = header.getTable();
 
                         mouseXOffset = mouseXOffset + direction * width;
                         header.setDraggedDistance(draggedDistance - direction * width);
 
                         //Cache the selected column.
-                        int selectedIndex = table.convertColumnIndexToModel(
-                                                        getSelectedColumnIndex());
+                        int selectedIndex =
+                                SwingUtilities2.convertColumnIndexToModel(
+                                        header.getColumnModel(),
+                                        getSelectedColumnIndex());
 
                         //Now do the move.
                         cm.moveColumn(columnIndex, newColumnIndex);
 
                         //Update the selected index.
                         selectColumn(
-                            table.convertColumnIndexToView(selectedIndex),
+                            SwingUtilities2.convertColumnIndexToView(
+                                    header.getColumnModel(), selectedIndex),
                             false);
 
                         return;
@@ -244,6 +258,9 @@
         }
 
         public void mouseReleased(MouseEvent e) {
+            if (!header.isEnabled()) {
+                return;
+            }
             setDraggedDistance(0, viewIndexForColumn(header.getDraggedColumn()));
 
             header.setResizingColumn(null);
@@ -253,10 +270,16 @@
         }
 
         public void mouseEntered(MouseEvent e) {
+            if (!header.isEnabled()) {
+                return;
+            }
             updateRolloverColumn(e);
         }
 
         public void mouseExited(MouseEvent e) {
+            if (!header.isEnabled()) {
+                return;
+            }
             int oldRolloverColumn = rolloverColumn;
             rolloverColumn = -1;
             rolloverColumnUpdated(oldRolloverColumn, rolloverColumn);
@@ -853,7 +876,7 @@
             String name = getName();
             if (TOGGLE_SORT_ORDER == name) {
                 JTable table = th.getTable();
-                RowSorter sorter = table.getRowSorter();
+                RowSorter sorter = table == null ? null : table.getRowSorter();
                 if (sorter != null) {
                     int columnIndex = ui.getSelectedColumnIndex();
                     columnIndex = table.convertColumnIndexToModel(
--- a/jdk/src/share/classes/javax/swing/plaf/basic/BasicTextUI.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicTextUI.java	Wed Jul 21 09:57:21 2010 -0700
@@ -779,20 +779,16 @@
         if (c instanceof JTextComponent) {
             editor = (JTextComponent) c;
 
+            // common case is background painted... this can
+            // easily be changed by subclasses or from outside
+            // of the component.
+            LookAndFeel.installProperty(editor, "opaque", Boolean.TRUE);
+            LookAndFeel.installProperty(editor, "autoscrolls", Boolean.TRUE);
+
             // install defaults
             installDefaults();
             installDefaults2();
 
-            // This is a workaround as these should not override what synth has
-            // set them to
-            if (! (this instanceof SynthUI)) {
-                // common case is background painted... this can
-                // easily be changed by subclasses or from outside
-                // of the component.
-                LookAndFeel.installProperty(editor, "opaque", Boolean.TRUE);
-                LookAndFeel.installProperty(editor, "autoscrolls", Boolean.TRUE);
-            }
-
             // attach to the model and editor
             editor.addPropertyChangeListener(updateHandler);
             Document doc = editor.getDocument();
--- a/jdk/src/share/classes/javax/swing/plaf/basic/BasicViewportUI.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicViewportUI.java	Wed Jul 21 09:57:21 2010 -0700
@@ -56,8 +56,8 @@
     }
 
     public void uninstallUI(JComponent c) {
+        uninstallDefaults(c);
         super.uninstallUI(c);
-
     }
 
     protected void installDefaults(JComponent c) {
--- a/jdk/src/share/classes/javax/swing/plaf/nimbus/skin.laf	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/share/classes/javax/swing/plaf/nimbus/skin.laf	Wed Jul 21 09:57:21 2010 -0700
@@ -21276,6 +21276,7 @@
                <uiProperty name="centerOneTouchButtons" type="BOOLEAN" value="true"/>
                <uiProperty name="oneTouchButtonOffset" type="INT" value="30"/>
                <uiProperty name="oneTouchExpandable" type="BOOLEAN" value="false"/>
+               <uiProperty name="continuousLayout" type="BOOLEAN" value="true"/>
             </uiproperties>
          </style>
          <backgroundStates>
--- a/jdk/src/share/classes/javax/swing/plaf/synth/SynthParser.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/share/classes/javax/swing/plaf/synth/SynthParser.java	Wed Jul 21 09:57:21 2010 -0700
@@ -658,8 +658,7 @@
                     }
                     try {
                         _colorTypes.add((ColorType)checkCast(typeClass.
-                              getField(typeName.substring(classIndex,
-                              typeName.length() - classIndex)).
+                              getField(typeName.substring(classIndex)).
                               get(typeClass), ColorType.class));
                     } catch (NoSuchFieldException nsfe) {
                         throw new SAXException("Unable to find color type: " +
--- a/jdk/src/share/classes/javax/swing/plaf/synth/SynthTableUI.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/share/classes/javax/swing/plaf/synth/SynthTableUI.java	Wed Jul 21 09:57:21 2010 -0700
@@ -361,12 +361,14 @@
             cMax = table.getColumnCount()-1;
         }
 
-        // Paint the grid.
-        paintGrid(context, g, rMin, rMax, cMin, cMax);
-
         // Paint the cells.
         paintCells(context, g, rMin, rMax, cMin, cMax);
 
+        // Paint the grid.
+        // it is important to paint the grid after the cells, otherwise the grid will be overpainted
+        // because in Synth cell renderers are likely to be opaque
+        paintGrid(context, g, rMin, rMax, cMin, cMax);
+
         paintDropLines(context, g);
     }
 
--- a/jdk/src/share/classes/javax/swing/plaf/synth/SynthTextPaneUI.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/share/classes/javax/swing/plaf/synth/SynthTextPaneUI.java	Wed Jul 21 09:57:21 2010 -0700
@@ -72,7 +72,28 @@
     }
 
     /**
-     * @inheritDoc
+     * Installs the UI for a component.  This does the following
+     * things.
+     * <ol>
+     * <li>
+     * Sets opaqueness of the associated component according to its style,
+     * if the opaque property has not already been set by the client program.
+     * <li>
+     * Installs the default caret and highlighter into the
+     * associated component. These properties are only set if their
+     * current value is either {@code null} or an instance of
+     * {@link UIResource}.
+     * <li>
+     * Attaches to the editor and model.  If there is no
+     * model, a default one is created.
+     * <li>
+     * Creates the view factory and the view hierarchy used
+     * to represent the model.
+     * </ol>
+     *
+     * @param c the editor component
+     * @see BasicTextUI#installUI
+     * @see ComponentUI#installUI
      */
     @Override
     public void installUI(JComponent c) {
--- a/jdk/src/share/classes/javax/swing/plaf/synth/SynthToolBarUI.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/share/classes/javax/swing/plaf/synth/SynthToolBarUI.java	Wed Jul 21 09:57:21 2010 -0700
@@ -363,18 +363,24 @@
                     SynthIcon.getIconWidth(handleIcon, context) : 0;
                 Dimension compDim;
                 for (int i = 0; i < tb.getComponentCount(); i++) {
-                    compDim = tb.getComponent(i).getMinimumSize();
-                    dim.width += compDim.width;
-                    dim.height = Math.max(dim.height, compDim.height);
+                    Component component = tb.getComponent(i);
+                    if (component.isVisible()) {
+                        compDim = component.getMinimumSize();
+                        dim.width += compDim.width;
+                        dim.height = Math.max(dim.height, compDim.height);
+                    }
                 }
             } else {
                 dim.height = tb.isFloatable() ?
                     SynthIcon.getIconHeight(handleIcon, context) : 0;
                 Dimension compDim;
                 for (int i = 0; i < tb.getComponentCount(); i++) {
-                    compDim = tb.getComponent(i).getMinimumSize();
-                    dim.width = Math.max(dim.width, compDim.width);
-                    dim.height += compDim.height;
+                    Component component = tb.getComponent(i);
+                    if (component.isVisible()) {
+                        compDim = component.getMinimumSize();
+                        dim.width = Math.max(dim.width, compDim.width);
+                        dim.height += compDim.height;
+                    }
                 }
             }
             dim.width += insets.left + insets.right;
@@ -395,18 +401,24 @@
                     SynthIcon.getIconWidth(handleIcon, context) : 0;
                 Dimension compDim;
                 for (int i = 0; i < tb.getComponentCount(); i++) {
-                    compDim = tb.getComponent(i).getPreferredSize();
-                    dim.width += compDim.width;
-                    dim.height = Math.max(dim.height, compDim.height);
+                    Component component = tb.getComponent(i);
+                    if (component.isVisible()) {
+                        compDim = component.getPreferredSize();
+                        dim.width += compDim.width;
+                        dim.height = Math.max(dim.height, compDim.height);
+                    }
                 }
             } else {
                 dim.height = tb.isFloatable() ?
                     SynthIcon.getIconHeight(handleIcon, context) : 0;
                 Dimension compDim;
                 for (int i = 0; i < tb.getComponentCount(); i++) {
-                    compDim = tb.getComponent(i).getPreferredSize();
-                    dim.width = Math.max(dim.width, compDim.width);
-                    dim.height += compDim.height;
+                    Component component = tb.getComponent(i);
+                    if (component.isVisible()) {
+                        compDim = component.getPreferredSize();
+                        dim.width = Math.max(dim.width, compDim.width);
+                        dim.height += compDim.height;
+                    }
                 }
             }
             dim.width += insets.left + insets.right;
@@ -469,22 +481,24 @@
 
                 for (int i = 0; i < tb.getComponentCount(); i++) {
                     c = tb.getComponent(i);
-                    d = c.getPreferredSize();
-                    int y, h;
-                    if (d.height >= baseH || c instanceof JSeparator) {
-                        // Fill available height
-                        y = baseY;
-                        h = baseH;
-                    } else {
-                        // Center component vertically in the available space
-                        y = baseY + (baseH / 2) - (d.height / 2);
-                        h = d.height;
+                    if (c.isVisible()) {
+                        d = c.getPreferredSize();
+                        int y, h;
+                        if (d.height >= baseH || c instanceof JSeparator) {
+                            // Fill available height
+                            y = baseY;
+                            h = baseH;
+                        } else {
+                            // Center component vertically in the available space
+                            y = baseY + (baseH / 2) - (d.height / 2);
+                            h = d.height;
+                        }
+                        //if the component is a "glue" component then add to its
+                        //width the extraSpacePerGlue it is due
+                        if (isGlue(c)) d.width += extraSpacePerGlue;
+                        c.setBounds(ltr ? x : x - d.width, y, d.width, h);
+                        x = ltr ? x + d.width : x - d.width;
                     }
-                    //if the component is a "glue" component then add to its
-                    //width the extraSpacePerGlue it is due
-                    if (isGlue(c)) d.width += extraSpacePerGlue;
-                    c.setBounds(ltr ? x : x - d.width, y, d.width, h);
-                    x = ltr ? x + d.width : x - d.width;
                 }
             } else {
                 int handleHeight = tb.isFloatable() ?
@@ -512,29 +526,31 @@
 
                 for (int i = 0; i < tb.getComponentCount(); i++) {
                     c = tb.getComponent(i);
-                    d = c.getPreferredSize();
-                    int x, w;
-                    if (d.width >= baseW || c instanceof JSeparator) {
-                        // Fill available width
-                        x = baseX;
-                        w = baseW;
-                    } else {
-                        // Center component horizontally in the available space
-                        x = baseX + (baseW / 2) - (d.width / 2);
-                        w = d.width;
+                    if (c.isVisible()) {
+                        d = c.getPreferredSize();
+                        int x, w;
+                        if (d.width >= baseW || c instanceof JSeparator) {
+                            // Fill available width
+                            x = baseX;
+                            w = baseW;
+                        } else {
+                            // Center component horizontally in the available space
+                            x = baseX + (baseW / 2) - (d.width / 2);
+                            w = d.width;
+                        }
+                        //if the component is a "glue" component then add to its
+                        //height the extraSpacePerGlue it is due
+                        if (isGlue(c)) d.height += extraSpacePerGlue;
+                        c.setBounds(x, y, w, d.height);
+                        y += d.height;
                     }
-                    //if the component is a "glue" component then add to its
-                    //height the extraSpacePerGlue it is due
-                    if (isGlue(c)) d.height += extraSpacePerGlue;
-                    c.setBounds(x, y, w, d.height);
-                    y += d.height;
                 }
             }
             context.dispose();
         }
 
         private boolean isGlue(Component c) {
-            if (c instanceof Box.Filler) {
+            if (c.isVisible() && c instanceof Box.Filler) {
                 Box.Filler f = (Box.Filler)c;
                 Dimension min = f.getMinimumSize();
                 Dimension pref = f.getPreferredSize();
--- a/jdk/src/share/classes/javax/swing/text/DefaultStyledDocument.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/share/classes/javax/swing/text/DefaultStyledDocument.java	Wed Jul 21 09:57:21 2010 -0700
@@ -25,15 +25,12 @@
 package javax.swing.text;
 
 import java.awt.Color;
-import java.awt.Component;
 import java.awt.Font;
-import java.awt.FontMetrics;
 import java.awt.font.TextAttribute;
 import java.lang.ref.ReferenceQueue;
 import java.lang.ref.WeakReference;
 import java.util.Enumeration;
 import java.util.HashMap;
-import java.util.Hashtable;
 import java.util.List;
 import java.util.Map;
 import java.util.Stack;
@@ -41,15 +38,14 @@
 import java.util.ArrayList;
 import java.io.IOException;
 import java.io.ObjectInputStream;
-import java.io.ObjectOutputStream;
 import java.io.Serializable;
-import javax.swing.Icon;
 import javax.swing.event.*;
 import javax.swing.undo.AbstractUndoableEdit;
 import javax.swing.undo.CannotRedoException;
 import javax.swing.undo.CannotUndoException;
 import javax.swing.undo.UndoableEdit;
 import javax.swing.SwingUtilities;
+import static sun.swing.SwingUtilities2.IMPLIED_CR;
 
 /**
  * A document that can be marked up with character and paragraph
@@ -782,9 +778,18 @@
             // Check for the composed text element. If it is, merge the character attributes
             // into this element as well.
             if (Utilities.isComposedTextAttributeDefined(attr)) {
-                ((MutableAttributeSet)attr).addAttributes(cattr);
-                ((MutableAttributeSet)attr).addAttribute(AbstractDocument.ElementNameAttribute,
-                                                         AbstractDocument.ContentElementName);
+                MutableAttributeSet mattr = (MutableAttributeSet) attr;
+                mattr.addAttributes(cattr);
+                mattr.addAttribute(AbstractDocument.ElementNameAttribute,
+                        AbstractDocument.ContentElementName);
+
+                // Assure that the composed text element is named properly
+                // and doesn't have the CR attribute defined.
+                mattr.addAttribute(StyleConstants.NameAttribute,
+                        AbstractDocument.ContentElementName);
+                if (mattr.isDefined(IMPLIED_CR)) {
+                    mattr.removeAttribute(IMPLIED_CR);
+                }
             }
 
             ElementSpec[] spec = new ElementSpec[parseBuffer.size()];
--- a/jdk/src/share/classes/javax/swing/text/GlyphView.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/share/classes/javax/swing/text/GlyphView.java	Wed Jul 21 09:57:21 2010 -0700
@@ -32,6 +32,7 @@
 
 import javax.swing.UIManager;
 import sun.swing.SwingUtilities2;
+import static sun.swing.SwingUtilities2.IMPLIED_CR;
 
 /**
  * A GlyphView is a styled chunk of text that represents a view
@@ -1061,7 +1062,6 @@
     int length;
     // if it is an implied newline character
     boolean impliedCR;
-    private static final String IMPLIED_CR = "CR";
     boolean skipWidth;
 
     /**
--- a/jdk/src/share/classes/javax/swing/text/Utilities.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/share/classes/javax/swing/text/Utilities.java	Wed Jul 21 09:57:21 2010 -0700
@@ -404,6 +404,24 @@
     }
 
     /**
+     * Adjust text offset so that the length of a resulting string as a whole
+     * fits into the specified width.
+     */
+    static int adjustOffsetForFractionalMetrics(
+            Segment s, FontMetrics fm, int offset, int width) {
+        // Sometimes the offset returned by getTabbedTextOffset is beyond the
+        // available area, when fractional metrics are enabled. We should
+        // guard against this.
+        if (offset < s.count) {
+            while (offset > 0 &&
+                    fm.charsWidth(s.array, s.offset, offset + 1) > width) {
+                offset--;
+            }
+        }
+        return offset;
+    }
+
+    /**
      * Determine where to break the given text to fit
      * within the given span. This tries to find a word boundary.
      * @param s  the source of the text
@@ -425,7 +443,7 @@
         int txtCount = s.count;
         int index = Utilities.getTabbedTextOffset(s, metrics, x0, x,
                                                   e, startOffset, false);
-
+        index = adjustOffsetForFractionalMetrics(s, metrics, index, x - x0);
 
         if (index >= txtCount - 1) {
             return txtCount;
--- a/jdk/src/share/classes/javax/swing/text/WrappedPlainView.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/share/classes/javax/swing/text/WrappedPlainView.java	Wed Jul 21 09:57:21 2010 -0700
@@ -24,8 +24,6 @@
  */
 package javax.swing.text;
 
-import java.util.Vector;
-import java.util.Properties;
 import java.awt.*;
 import java.lang.ref.SoftReference;
 import javax.swing.event.*;
@@ -110,7 +108,7 @@
 
         try {
             if (line.isLeaf()) {
-                drawText(line, p0, p1, g, x, y);
+                 drawText(line, p0, p1, g, x, y);
             } else {
                 // this line contains the composed text.
                 int idx = line.getElementIndex(p0);
@@ -236,17 +234,16 @@
         Segment segment = SegmentCache.getSharedSegment();
         loadText(segment, p0, p1);
         int currentWidth = getWidth();
-        if (currentWidth == Integer.MAX_VALUE) {
-            currentWidth = (int) getDefaultSpan(View.X_AXIS);
-        }
         if (wordWrap) {
             p = p0 + Utilities.getBreakLocation(segment, metrics,
                                                 tabBase, tabBase + currentWidth,
                                                 this, p0);
         } else {
-            p = p0 + Utilities.getTabbedTextOffset(segment, metrics,
-                                                   tabBase, tabBase + currentWidth,
-                                                   this, p0, false);
+            int offset = Utilities.getTabbedTextOffset(segment, metrics,
+                    tabBase, tabBase + currentWidth, this, p0, false);
+            offset = Utilities.adjustOffsetForFractionalMetrics(
+                    segment, metrics, offset, currentWidth);
+            p = p0 + offset;
         }
         SegmentCache.releaseSharedSegment(segment);
         return p;
@@ -324,53 +321,6 @@
         tabSize = getTabSize() * metrics.charWidth('m');
     }
 
-    /**
-     * Return reasonable default values for the view dimensions.  The standard
-     * text terminal size 80x24 is pretty suitable for the wrapped plain view.
-     *
-     * The size should not be larger than the component housing the view's
-     * container.
-     */
-    private float getDefaultSpan(int axis) {
-         Container host = getContainer();
-         Component parent = null;
-
-         if (host != null) {
-            parent = host.getParent();
-         }
-
-         switch (axis) {
-            case View.X_AXIS:
-               int defaultWidth = 80 * metrics.getWidths()['M'];
-               int parentWidth = 0;
-
-               if (parent != null) {
-                  parentWidth = parent.getWidth();
-               }
-
-               if (defaultWidth > parentWidth) {
-                 return parentWidth;
-               }
-               return defaultWidth;
-
-            case View.Y_AXIS:
-               int defaultHeight = 24 * metrics.getHeight();
-               int parentHeight = 0;
-
-               if (parent != null) {
-                  parentHeight = parent.getHeight();
-               }
-
-               if (defaultHeight > parentHeight) {
-                 return parentHeight;
-               }
-               return defaultHeight;
-
-            default:
-                throw new IllegalArgumentException("Invalid axis: " + axis);
-        }
-    }
-
     // --- TabExpander methods ------------------------------------------
 
     /**
@@ -605,18 +555,14 @@
                 if (width == Integer.MAX_VALUE) {
                     // We have been initially set to MAX_VALUE, but we don't
                     // want this as our preferred.
-                    width = getDefaultSpan(axis);
+                    return 100f;
                 }
                 return width;
             case View.Y_AXIS:
-                if (getDocument().getLength() > 0) {
-                    if ((lineCount < 0) || widthChanging) {
-                        breakLines(getStartOffset());
-                    }
-                    return lineCount * metrics.getHeight();
-                } else {
-                    return getDefaultSpan(axis);
+                if (lineCount < 0 || widthChanging) {
+                    breakLines(getStartOffset());
                 }
+                return lineCount * metrics.getHeight();
             default:
                 throw new IllegalArgumentException("Invalid axis: " + axis);
             }
--- a/jdk/src/share/classes/javax/swing/text/html/HTMLDocument.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/share/classes/javax/swing/text/html/HTMLDocument.java	Wed Jul 21 09:57:21 2010 -0700
@@ -24,20 +24,17 @@
  */
 package javax.swing.text.html;
 
-import java.awt.Color;
-import java.awt.Component;
 import java.awt.font.TextAttribute;
 import java.util.*;
 import java.net.URL;
-import java.net.URLEncoder;
 import java.net.MalformedURLException;
 import java.io.*;
 import javax.swing.*;
 import javax.swing.event.*;
 import javax.swing.text.*;
 import javax.swing.undo.*;
-import java.text.Bidi;
 import sun.swing.SwingUtilities2;
+import static sun.swing.SwingUtilities2.IMPLIED_CR;
 
 /**
  * A document that models HTML.  The purpose of this model is to
@@ -1819,7 +1816,6 @@
     static String MAP_PROPERTY = "__MAP__";
 
     private static char[] NEWLINE;
-    private static final String IMPLIED_CR = "CR";
 
     /**
      * I18N property key.
Binary file jdk/src/share/classes/javax/swing/text/html/parser/html32.bdtd has changed
--- a/jdk/src/share/classes/sun/awt/PlatformFont.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/share/classes/sun/awt/PlatformFont.java	Wed Jul 21 09:57:21 2010 -0700
@@ -25,10 +25,10 @@
 
 package sun.awt;
 
-import java.awt.GraphicsEnvironment;
 import java.awt.peer.FontPeer;
 import java.util.Locale;
 import java.util.Vector;
+import sun.font.SunFontManager;
 import sun.java2d.FontSupport;
 import java.nio.CharBuffer;
 import java.nio.ByteBuffer;
@@ -57,9 +57,9 @@
     protected static String osVersion;
 
     public PlatformFont(String name, int style){
-        GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
-        if (ge instanceof FontSupport) {
-            fontConfig = ((FontSupport)ge).getFontConfiguration();
+        SunFontManager sfm = SunFontManager.getInstance();
+        if (sfm instanceof FontSupport) {
+            fontConfig = ((FontSupport)sfm).getFontConfiguration();
         }
         if (fontConfig == null) {
             return;
--- a/jdk/src/share/classes/sun/awt/SunToolkit.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/share/classes/sun/awt/SunToolkit.java	Wed Jul 21 09:57:21 2010 -0700
@@ -39,6 +39,7 @@
 import java.util.*;
 import java.util.concurrent.TimeUnit;
 import java.util.concurrent.locks.Condition;
+import java.util.concurrent.locks.Lock;
 import java.util.concurrent.locks.ReentrantLock;
 import sun.util.logging.PlatformLogger;
 import sun.misc.SoftCache;
@@ -592,7 +593,7 @@
         }
         PostEventQueue postEventQueue =
             (PostEventQueue)appContext.get(POST_EVENT_QUEUE_KEY);
-        if(postEventQueue != null) {
+        if (postEventQueue != null) {
             postEventQueue.postEvent(event);
         }
     }
@@ -610,16 +611,29 @@
         postEvent(targetToAppContext(e.getSource()), pe);
     }
 
+    private static final Lock flushLock = new ReentrantLock();
+    private static boolean isFlushingPendingEvents = false;
+
     /*
      * Flush any pending events which haven't been posted to the AWT
      * EventQueue yet.
      */
     public static void flushPendingEvents()  {
-        AppContext appContext = AppContext.getAppContext();
-        PostEventQueue postEventQueue =
-            (PostEventQueue)appContext.get(POST_EVENT_QUEUE_KEY);
-        if(postEventQueue != null) {
-            postEventQueue.flush();
+        flushLock.lock();
+        try {
+            // Don't call flushPendingEvents() recursively
+            if (!isFlushingPendingEvents) {
+                isFlushingPendingEvents = true;
+                AppContext appContext = AppContext.getAppContext();
+                PostEventQueue postEventQueue =
+                    (PostEventQueue)appContext.get(POST_EVENT_QUEUE_KEY);
+                if (postEventQueue != null) {
+                    postEventQueue.flush();
+                }
+            }
+        } finally {
+            isFlushingPendingEvents = false;
+            flushLock.unlock();
         }
     }
 
@@ -1930,6 +1944,25 @@
         return (Window)comp;
     }
 
+    /**
+     * Returns the value of the system property indicated by the specified key.
+     */
+    public static String getSystemProperty(final String key) {
+        return (String)AccessController.doPrivileged(new PrivilegedAction() {
+                public Object run() {
+                    return System.getProperty(key);
+                }
+            });
+    }
+
+    /**
+     * Returns the boolean value of the system property indicated by the specified key.
+     */
+    protected static Boolean getBooleanSystemProperty(String key) {
+        return Boolean.valueOf(AccessController.
+                   doPrivileged(new GetBooleanAction(key)));
+    }
+
     private static Boolean sunAwtDisableMixing = null;
 
     /**
@@ -1938,9 +1971,7 @@
      */
     public synchronized static boolean getSunAwtDisableMixing() {
         if (sunAwtDisableMixing == null) {
-            sunAwtDisableMixing = Boolean.valueOf(
-                    AccessController.doPrivileged(
-                        new GetBooleanAction("sun.awt.disableMixing")));
+            sunAwtDisableMixing = getBooleanSystemProperty("sun.awt.disableMixing");
         }
         return sunAwtDisableMixing.booleanValue();
     }
@@ -2079,12 +2110,14 @@
         eventQueue = eq;
     }
 
-    public boolean noEvents() {
+    public synchronized boolean noEvents() {
         return queueHead == null;
     }
 
     /*
-     * Continually post pending AWTEvents to the Java EventQueue.
+     * Continually post pending AWTEvents to the Java EventQueue. The method
+     * is synchronized to ensure the flush is completed before a new event
+     * can be posted to this queue.
      */
     public synchronized void flush() {
         EventQueueItem tempQueue = queueHead;
--- a/jdk/src/share/classes/sun/awt/image/PNGImageDecoder.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/share/classes/sun/awt/image/PNGImageDecoder.java	Wed Jul 21 09:57:21 2010 -0700
@@ -32,7 +32,7 @@
 import java.awt.Color;
 
 /** PNG - Portable Network Graphics - image file reader.
-    See <a href=ftp://ds.internic.net/rfc/rfc2083.txt>RFC2083</a> for details. */
+    See <a href=http://www.ietf.org/rfc/rfc2083.txt>RFC2083</a> for details. */
 
 /* this is changed
 public class PNGImageDecoder extends FilterInputStream implements Runnable
--- a/jdk/src/share/classes/sun/dyn/AdapterMethodHandle.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/share/classes/sun/dyn/AdapterMethodHandle.java	Wed Jul 21 09:57:21 2010 -0700
@@ -366,7 +366,7 @@
     }
     private static boolean convOpSupported(int convOp) {
         assert(convOp >= 0 && convOp <= CONV_OP_LIMIT);
-        return ((1<<convOp) & CONV_OP_IMPLEMENTED_MASK) != 0;
+        return ((1<<convOp) & MethodHandleNatives.CONV_OP_IMPLEMENTED_MASK) != 0;
     }
 
     /** One of OP_RETYPE_ONLY, etc. */
--- a/jdk/src/share/classes/sun/dyn/BoundMethodHandle.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/share/classes/sun/dyn/BoundMethodHandle.java	Wed Jul 21 09:57:21 2010 -0700
@@ -146,6 +146,8 @@
         MethodType foundType = null;
         MemberName foundMethod = null;
         for (MemberName method : methods) {
+            if (method.getDeclaringClass() == MethodHandle.class)
+                continue;  // ignore methods inherited from MH class itself
             MethodType mtype = method.getMethodType();
             if (type != null && type.parameterCount() != mtype.parameterCount())
                 continue;
--- a/jdk/src/share/classes/sun/dyn/CallSiteImpl.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/share/classes/sun/dyn/CallSiteImpl.java	Wed Jul 21 09:57:21 2010 -0700
@@ -26,77 +26,65 @@
 package sun.dyn;
 
 import java.dyn.*;
-import java.util.logging.Level;
-import java.util.logging.Logger;
 
 /**
  * Parts of CallSite known to the JVM.
- * FIXME: Merge all this into CallSite proper.
  * @author jrose
  */
 public class CallSiteImpl {
-    // Field used only by the JVM.  Do not use or change.
-    private Object vmmethod;
-
-    // Values supplied by the JVM:
-    protected int callerMID, callerBCI;
-
-    private MethodHandle target;
-    protected final Object caller;  // usually a class
-    protected final String name;
-    protected final MethodType type;
-
-    /** called only directly from CallSite() */
-    protected CallSiteImpl(Access token, Object caller, String name, MethodType type) {
-        Access.check(token);
-        this.caller = caller;
-        this.name = name;
-        this.type = type;
-    }
-
-    /** native version of setTarget */
-    protected void setTarget(MethodHandle mh) {
-        //System.out.println("setTarget "+this+" := "+mh);
-        // XXX I don't know how to fix this properly.
-//         if (false && MethodHandleNatives.JVM_SUPPORT) // FIXME: enable this
-//             MethodHandleNatives.linkCallSite(this, mh);
-//         else
-            this.target = mh;
-    }
-
-    protected MethodHandle getTarget() {
-        return target;
-    }
-
-    private static final MethodHandle PRIVATE_INITIALIZE_CALL_SITE =
-            MethodHandleImpl.IMPL_LOOKUP.findStatic(CallSite.class, "privateInitializeCallSite",
-                MethodType.methodType(void.class, CallSite.class, int.class, int.class));
-
-    // this is the up-call from the JVM:
-    static CallSite makeSite(Class<?> caller, String name, MethodType type,
-                             int callerMID, int callerBCI) {
-        MethodHandle bsm = Linkage.getBootstrapMethod(caller);
-        if (bsm == null)
-            throw new InvokeDynamicBootstrapError("class has no bootstrap method: "+caller);
+    // this implements the upcall from the JVM, MethodHandleNatives.makeDynamicCallSite:
+    static CallSite makeSite(MethodHandle bootstrapMethod,
+                             // Callee information:
+                             String name, MethodType type,
+                             // Call-site attributes, if any:
+                             Object info,
+                             // Caller information:
+                             MemberName callerMethod, int callerBCI) {
+        Class<?> caller = callerMethod.getDeclaringClass();
+        if (bootstrapMethod == null) {
+            // If there is no bootstrap method, throw IncompatibleClassChangeError.
+            // This is a valid generic error type for resolution (JLS 12.3.3).
+            throw new IncompatibleClassChangeError
+                ("Class "+caller.getName()+" has not declared a bootstrap method for invokedynamic");
+        }
         CallSite site;
         try {
-            site = bsm.<CallSite>invoke(caller, name, type);
+            if (bootstrapMethod.type().parameterCount() == 3)
+                site = bootstrapMethod.<CallSite>invokeExact(caller, name, type);
+            else if (bootstrapMethod.type().parameterCount() == 4)
+                site = bootstrapMethod.<CallSite>invokeExact(caller, name, type,
+                                                             !(info instanceof java.lang.annotation.Annotation[]) ? null
+                                                             : (java.lang.annotation.Annotation[]) info);
+            else
+                throw new InternalError("bad BSM: "+bootstrapMethod);
+            if (!(site instanceof CallSite))
+                throw new InvokeDynamicBootstrapError("class bootstrap method failed to create a call site: "+caller);
+            PRIVATE_INITIALIZE_CALL_SITE.<void>invokeExact(site,
+                                                           name, type,
+                                                           callerMethod, callerBCI);
+            assert(site.getTarget() != null);
+            assert(site.getTarget().type().equals(type));
         } catch (Throwable ex) {
-            throw new InvokeDynamicBootstrapError("exception thrown while linking", ex);
-        }
-        if (site == null)
-            throw new InvokeDynamicBootstrapError("class bootstrap method failed to create a call site: "+caller);
-        if (site.type() != type)
-            throw new InvokeDynamicBootstrapError("call site type not initialized correctly: "+site);
-        if (site.callerClass() != caller)
-            throw new InvokeDynamicBootstrapError("call site caller not initialized correctly: "+site);
-        if ((Object)site.name() != name)
-            throw new InvokeDynamicBootstrapError("call site name not initialized correctly: "+site);
-        try {
-            PRIVATE_INITIALIZE_CALL_SITE.<void>invoke(site, callerMID, callerBCI);
-        } catch (Throwable ex) {
-            throw new InvokeDynamicBootstrapError("call site initialization exception", ex);
+            InvokeDynamicBootstrapError bex;
+            if (ex instanceof InvokeDynamicBootstrapError)
+                bex = (InvokeDynamicBootstrapError) ex;
+            else
+                bex = new InvokeDynamicBootstrapError("call site initialization exception", ex);
+            throw bex;
         }
         return site;
     }
+
+    // This method is private in CallSite because it touches private fields in CallSite.
+    // These private fields (vmmethod, vmindex) are specific to the JVM.
+    private static final MethodHandle PRIVATE_INITIALIZE_CALL_SITE =
+            MethodHandleImpl.IMPL_LOOKUP.findVirtual(CallSite.class, "initializeFromJVM",
+                MethodType.methodType(void.class,
+                                      String.class, MethodType.class,
+                                      MemberName.class, int.class));
+
+    public static void setCallSiteTarget(Access token, CallSite site, MethodHandle target) {
+        Access.check(token);
+        MethodHandleNatives.setCallSiteTarget(site, target);
+    }
 }
--- a/jdk/src/share/classes/sun/dyn/FilterGeneric.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/share/classes/sun/dyn/FilterGeneric.java	Wed Jul 21 09:57:21 2010 -0700
@@ -301,13 +301,13 @@
                         { 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.invoke(filter.invoke(a0)); }
-        protected Object invoke_F0(Object a0) { return target.invoke(filter.invoke(), a0); }
-        protected Object invoke_F1(Object a0) { return target.invoke(filter.invoke(a0), a0); }
-        protected Object invoke_C0(Object a0) { return target.invoke(filter.invoke(a0)); }
-        protected Object invoke_C1(Object a0) { return target.invoke(a0, filter.invoke()); }
+        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.<void>invoke(av); return target.invoke(av[0]); }
+                       filter.<void>invokeExact(av); return target.invokeExact(av[0]); }
     }
     static class F2X extends Adapter {
         protected F2X(MethodHandle entryPoint) { super(entryPoint); }  // to build prototype
@@ -315,16 +315,16 @@
                         { 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.invoke(filter.invoke(a0), a1); }
-        protected Object invoke_V1(Object a0, Object a1) { return target.invoke(a0, filter.invoke(a1)); }
-        protected Object invoke_F0(Object a0, Object a1) { return target.invoke(filter.invoke(), a0, a1); }
-        protected Object invoke_F1(Object a0, Object a1) { return target.invoke(filter.invoke(a0), a0, a1); }
-        protected Object invoke_F2(Object a0, Object a1) { return target.invoke(filter.invoke(a0, a1), a0, a1); }
-        protected Object invoke_C0(Object a0, Object a1) { return target.invoke(filter.invoke(a0, a1)); }
-        protected Object invoke_C1(Object a0, Object a1) { return target.invoke(a0, filter.invoke(a1)); }
-        protected Object invoke_C2(Object a0, Object a1) { return target.invoke(a0, a1, filter.invoke()); }
+        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.<void>invoke(av); return target.invoke(av[0], av[1]); }
+                       filter.<void>invokeExact(av); return target.invokeExact(av[0], av[1]); }
     }
     // */
 
@@ -336,13 +336,13 @@
         protected F0 makeInstance(MethodHandle e, MethodHandle f, MethodHandle t) {
             return new F0(e, f, t); }
         protected Object invoke_F0() throws Throwable {
-            return target.invoke(filter.invoke()); }
+            return target.invokeExact(filter.invokeExact()); }
         protected Object invoke_C0() throws Throwable {
-            return target.invoke(filter.invoke()); }
+            return target.invokeExact(filter.invokeExact()); }
         static final Object[] NO_ARGS = { };
         protected Object invoke_Y0() throws Throwable {
-            filter.<void>invoke(NO_ARGS); // make the flyby
-            return target.invoke(); }
+            filter.<void>invokeExact(NO_ARGS); // make the flyby
+            return target.invokeExact(); }
     }
 
 /*
@@ -361,26 +361,26 @@
         "            return new @cat@(e, f, t); }",
         "        //@each-P@",
         "        protected Object invoke_V@P@(@Tvav@) throws Throwable {",
-        "            return target.invoke(@a0_@@Psp@filter.invoke(a@P@)@_aN@); }",
+        "            return target.invokeExact(@a0_@@Psp@filter.invokeExact(a@P@)@_aN@); }",
         "        //@end-P@",
         "        //@each-P@",
         "        protected Object invoke_F@P@(@Tvav@) throws Throwable {",
-        "            return target.invoke(filter.invoke(@a0@),",
+        "            return target.invokeExact(filter.invokeExact(@a0@),",
         "                                 @av@); }",
         "        //@end-P@",
         "        protected Object invoke_F@N@(@Tvav@) throws Throwable {",
-        "            return target.invoke(filter.invoke(@av@),",
+        "            return target.invokeExact(filter.invokeExact(@av@),",
         "                                 @av@); }",
         "        //@each-P@",
         "        protected Object invoke_C@P@(@Tvav@) throws Throwable {",
-        "            return target.invoke(@a0_@filter.invoke(a@P@@_aN@)); }",
+        "            return target.invokeExact(@a0_@filter.invokeExact(a@P@@_aN@)); }",
         "        //@end-P@",
         "        protected Object invoke_C@N@(@Tvav@) throws Throwable {",
-        "            return target.invoke(@av@, filter.invoke()); }",
+        "            return target.invokeExact(@av@, filter.invokeExact()); }",
         "        protected Object invoke_Y0(@Tvav@) throws Throwable {",
         "            Object[] av = { @av@ };",
-        "            filter.<void>invoke(av); // make the flyby",
-        "            return target.invoke(@av[i]@); }",
+        "            filter.<void>invokeExact(av); // make the flyby",
+        "            return target.invokeExact(@av[i]@); }",
         "    }",
     } };
     static final String NEWLINE_INDENT = " //\n                                 ";
@@ -509,21 +509,21 @@
         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.invoke(filter.invoke(a0)); }
+            return target.invokeExact(filter.invokeExact(a0)); }
         protected Object invoke_F0(Object a0) throws Throwable {
-            return target.invoke(filter.invoke(),
+            return target.invokeExact(filter.invokeExact(),
                                  a0); }
         protected Object invoke_F1(Object a0) throws Throwable {
-            return target.invoke(filter.invoke(a0),
+            return target.invokeExact(filter.invokeExact(a0),
                                  a0); }
         protected Object invoke_C0(Object a0) throws Throwable {
-            return target.invoke(filter.invoke(a0)); }
+            return target.invokeExact(filter.invokeExact(a0)); }
         protected Object invoke_C1(Object a0) throws Throwable {
-            return target.invoke(a0, filter.invoke()); }
+            return target.invokeExact(a0, filter.invokeExact()); }
         protected Object invoke_Y0(Object a0) throws Throwable {
             Object[] av = { a0 };
-            filter.<void>invoke(av); // make the flyby
-            return target.invoke(av[0]); }
+            filter.<void>invokeExact(av); // make the flyby
+            return target.invokeExact(av[0]); }
     }
     static class F2 extends Adapter {
         protected F2(MethodHandle entryPoint) { super(entryPoint); }  // to build prototype
@@ -532,28 +532,28 @@
         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.invoke(filter.invoke(a0), a1); }
+            return target.invokeExact(filter.invokeExact(a0), a1); }
         protected Object invoke_V1(Object a0, Object a1) throws Throwable {
-            return target.invoke(a0, filter.invoke(a1)); }
+            return target.invokeExact(a0, filter.invokeExact(a1)); }
         protected Object invoke_F0(Object a0, Object a1) throws Throwable {
-            return target.invoke(filter.invoke(),
+            return target.invokeExact(filter.invokeExact(),
                                  a0, a1); }
         protected Object invoke_F1(Object a0, Object a1) throws Throwable {
-            return target.invoke(filter.invoke(a0),
+            return target.invokeExact(filter.invokeExact(a0),
                                  a0, a1); }
         protected Object invoke_F2(Object a0, Object a1) throws Throwable {
-            return target.invoke(filter.invoke(a0, a1),
+            return target.invokeExact(filter.invokeExact(a0, a1),
                                  a0, a1); }
         protected Object invoke_C0(Object a0, Object a1) throws Throwable {
-            return target.invoke(filter.invoke(a0, a1)); }
+            return target.invokeExact(filter.invokeExact(a0, a1)); }
         protected Object invoke_C1(Object a0, Object a1) throws Throwable {
-            return target.invoke(a0, filter.invoke(a1)); }
+            return target.invokeExact(a0, filter.invokeExact(a1)); }
         protected Object invoke_C2(Object a0, Object a1) throws Throwable {
-            return target.invoke(a0, a1, filter.invoke()); }
+            return target.invokeExact(a0, a1, filter.invokeExact()); }
         protected Object invoke_Y0(Object a0, Object a1) throws Throwable {
             Object[] av = { a0, a1 };
-            filter.<void>invoke(av); // make the flyby
-            return target.invoke(av[0], av[1]); }
+            filter.<void>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
@@ -562,35 +562,35 @@
         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.invoke(filter.invoke(a0), a1, a2); }
+            return target.invokeExact(filter.invokeExact(a0), a1, a2); }
         protected Object invoke_V1(Object a0, Object a1, Object a2) throws Throwable {
-            return target.invoke(a0, filter.invoke(a1), a2); }
+            return target.invokeExact(a0, filter.invokeExact(a1), a2); }
         protected Object invoke_V2(Object a0, Object a1, Object a2) throws Throwable {
-            return target.invoke(a0, a1, filter.invoke(a2)); }
+            return target.invokeExact(a0, a1, filter.invokeExact(a2)); }
         protected Object invoke_F0(Object a0, Object a1, Object a2) throws Throwable {
-            return target.invoke(filter.invoke(),
+            return target.invokeExact(filter.invokeExact(),
                                  a0, a1, a2); }
         protected Object invoke_F1(Object a0, Object a1, Object a2) throws Throwable {
-            return target.invoke(filter.invoke(a0),
+            return target.invokeExact(filter.invokeExact(a0),
                                  a0, a1, a2); }
         protected Object invoke_F2(Object a0, Object a1, Object a2) throws Throwable {
-            return target.invoke(filter.invoke(a0, a1),
+            return target.invokeExact(filter.invokeExact(a0, a1),
                                  a0, a1, a2); }
         protected Object invoke_F3(Object a0, Object a1, Object a2) throws Throwable {
-            return target.invoke(filter.invoke(a0, a1, a2),
+            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.invoke(filter.invoke(a0, a1, a2)); }
+            return target.invokeExact(filter.invokeExact(a0, a1, a2)); }
         protected Object invoke_C1(Object a0, Object a1, Object a2) throws Throwable {
-            return target.invoke(a0, filter.invoke(a1, a2)); }
+            return target.invokeExact(a0, filter.invokeExact(a1, a2)); }
         protected Object invoke_C2(Object a0, Object a1, Object a2) throws Throwable {
-            return target.invoke(a0, a1, filter.invoke(a2)); }
+            return target.invokeExact(a0, a1, filter.invokeExact(a2)); }
         protected Object invoke_C3(Object a0, Object a1, Object a2) throws Throwable {
-            return target.invoke(a0, a1, a2, filter.invoke()); }
+            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.<void>invoke(av); // make the flyby
-            return target.invoke(av[0], av[1], av[2]); }
+            filter.<void>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
@@ -599,42 +599,42 @@
         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.invoke(filter.invoke(a0), a1, a2, a3); }
+            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.invoke(a0, filter.invoke(a1), a2, a3); }
+            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.invoke(a0, a1, filter.invoke(a2), a3); }
+            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.invoke(a0, a1, a2, filter.invoke(a3)); }
+            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.invoke(filter.invoke(),
+            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.invoke(filter.invoke(a0),
+            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.invoke(filter.invoke(a0, a1),
+            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.invoke(filter.invoke(a0, a1, a2),
+            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.invoke(filter.invoke(a0, a1, a2, a3),
+            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.invoke(filter.invoke(a0, a1, a2, a3)); }
+            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.invoke(a0, filter.invoke(a1, a2, a3)); }
+            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.invoke(a0, a1, filter.invoke(a2, a3)); }
+            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.invoke(a0, a1, a2, filter.invoke(a3)); }
+            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.invoke(a0, a1, a2, a3, filter.invoke()); }
+            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.<void>invoke(av); // make the flyby
-            return target.invoke(av[0], av[1], av[2], av[3]); }
+            filter.<void>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
@@ -644,66 +644,66 @@
             return new F5(e, f, t); }
         protected Object invoke_V0(Object a0, Object a1, Object a2, Object a3,
                                    Object a4) throws Throwable {
-            return target.invoke(filter.invoke(a0), a1, a2, a3, a4); }
+            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.invoke(a0, filter.invoke(a1), a2, a3, a4); }
+            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.invoke(a0, a1, filter.invoke(a2), a3, a4); }
+            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.invoke(a0, a1, a2, filter.invoke(a3), a4); }
+            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.invoke(a0, a1, a2, a3, filter.invoke(a4)); }
+            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.invoke(filter.invoke(),
+            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.invoke(filter.invoke(a0),
+            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.invoke(filter.invoke(a0, a1),
+            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.invoke(filter.invoke(a0, a1, a2),
+            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.invoke(filter.invoke(a0, a1, a2, a3),
+            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.invoke(filter.invoke(a0, a1, a2, a3, a4),
+            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.invoke(filter.invoke(a0, a1, a2, a3, a4)); }
+            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.invoke(a0, filter.invoke(a1, a2, a3, a4)); }
+            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.invoke(a0, a1, filter.invoke(a2, a3, a4)); }
+            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.invoke(a0, a1, a2, filter.invoke(a3, a4)); }
+            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.invoke(a0, a1, a2, a3, filter.invoke(a4)); }
+            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.invoke(a0, a1, a2, a3, a4, filter.invoke()); }
+            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.<void>invoke(av); // make the flyby
-            return target.invoke(av[0], av[1], av[2], av[3], av[4]); }
+            filter.<void>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
@@ -713,76 +713,76 @@
             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.invoke(filter.invoke(a0), a1, a2, a3, a4, a5); }
+            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.invoke(a0, filter.invoke(a1), a2, a3, a4, a5); }
+            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.invoke(a0, a1, filter.invoke(a2), a3, a4, a5); }
+            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.invoke(a0, a1, a2, filter.invoke(a3), a4, a5); }
+            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.invoke(a0, a1, a2, a3, filter.invoke(a4), a5); }
+            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.invoke(a0, a1, a2, a3, a4, filter.invoke(a5)); }
+            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.invoke(filter.invoke(),
+            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.invoke(filter.invoke(a0),
+            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.invoke(filter.invoke(a0, a1),
+            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.invoke(filter.invoke(a0, a1, a2),
+            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.invoke(filter.invoke(a0, a1, a2, a3),
+            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.invoke(filter.invoke(a0, a1, a2, a3, a4),
+            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.invoke(filter.invoke(a0, a1, a2, a3, a4, a5),
+            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.invoke(filter.invoke(a0, a1, a2, a3, a4, a5)); }
+            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.invoke(a0, filter.invoke(a1, a2, a3, a4, a5)); }
+            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.invoke(a0, a1, filter.invoke(a2, a3, a4, a5)); }
+            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.invoke(a0, a1, a2, filter.invoke(a3, a4, a5)); }
+            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.invoke(a0, a1, a2, a3, filter.invoke(a4, a5)); }
+            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.invoke(a0, a1, a2, a3, a4, filter.invoke(a5)); }
+            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.invoke(a0, a1, a2, a3, a4, a5, filter.invoke()); }
+            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.<void>invoke(av); // make the flyby
-            return target.invoke(av[0], av[1], av[2], av[3], av[4], av[5]); }
+            filter.<void>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
@@ -792,86 +792,86 @@
             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.invoke(filter.invoke(a0), a1, a2, a3, a4, a5, a6); }
+            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.invoke(a0, filter.invoke(a1), a2, a3, a4, a5, a6); }
+            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.invoke(a0, a1, filter.invoke(a2), a3, a4, a5, a6); }
+            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.invoke(a0, a1, a2, filter.invoke(a3), a4, a5, a6); }
+            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.invoke(a0, a1, a2, a3, filter.invoke(a4), a5, a6); }
+            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.invoke(a0, a1, a2, a3, a4, filter.invoke(a5), a6); }
+            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.invoke(a0, a1, a2, a3, a4, a5, filter.invoke(a6)); }
+            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.invoke(filter.invoke(),
+            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.invoke(filter.invoke(a0),
+            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.invoke(filter.invoke(a0, a1),
+            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.invoke(filter.invoke(a0, a1, a2),
+            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.invoke(filter.invoke(a0, a1, a2, a3),
+            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.invoke(filter.invoke(a0, a1, a2, a3, a4),
+            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.invoke(filter.invoke(a0, a1, a2, a3, a4, a5),
+            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.invoke(filter.invoke(a0, a1, a2, a3, a4, a5, a6),
+            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.invoke(filter.invoke(a0, a1, a2, a3, a4, a5, a6)); }
+            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.invoke(a0, filter.invoke(a1, a2, a3, a4, a5, a6)); }
+            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.invoke(a0, a1, filter.invoke(a2, a3, a4, a5, a6)); }
+            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.invoke(a0, a1, a2, filter.invoke(a3, a4, a5, a6)); }
+            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.invoke(a0, a1, a2, a3, filter.invoke(a4, a5, a6)); }
+            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.invoke(a0, a1, a2, a3, a4, filter.invoke(a5, a6)); }
+            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.invoke(a0, a1, a2, a3, a4, a5, filter.invoke(a6)); }
+            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.invoke(a0, a1, a2, a3, a4, a5, a6, filter.invoke()); }
+            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.<void>invoke(av); // make the flyby
-            return target.invoke(av[0], av[1], av[2], av[3], av[4], av[5], av[6]); }
+            filter.<void>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
@@ -881,96 +881,96 @@
             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.invoke(filter.invoke(a0), a1, a2, a3, a4, a5, a6, a7); }
+            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.invoke(a0, filter.invoke(a1), a2, a3, a4, a5, a6, a7); }
+            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.invoke(a0, a1, filter.invoke(a2), a3, a4, a5, a6, a7); }
+            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.invoke(a0, a1, a2, filter.invoke(a3), a4, a5, a6, a7); }
+            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.invoke(a0, a1, a2, a3, filter.invoke(a4), a5, a6, a7); }
+            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.invoke(a0, a1, a2, a3, a4, filter.invoke(a5), a6, a7); }
+            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.invoke(a0, a1, a2, a3, a4, a5, filter.invoke(a6), a7); }
+            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.invoke(a0, a1, a2, a3, a4, a5, a6, filter.invoke(a7)); }
+            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.invoke(filter.invoke(),
+            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.invoke(filter.invoke(a0),
+            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.invoke(filter.invoke(a0, a1),
+            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.invoke(filter.invoke(a0, a1, a2),
+            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.invoke(filter.invoke(a0, a1, a2, a3),
+            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.invoke(filter.invoke(a0, a1, a2, a3, a4),
+            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.invoke(filter.invoke(a0, a1, a2, a3, a4, a5),
+            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.invoke(filter.invoke(a0, a1, a2, a3, a4, a5, a6),
+            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.invoke(filter.invoke(a0, a1, a2, a3, a4, a5, a6, a7),
+            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.invoke(filter.invoke(a0, a1, a2, a3, a4, a5, a6, a7)); }
+            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.invoke(a0, filter.invoke(a1, a2, a3, a4, a5, a6, a7)); }
+            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.invoke(a0, a1, filter.invoke(a2, a3, a4, a5, a6, a7)); }
+            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.invoke(a0, a1, a2, filter.invoke(a3, a4, a5, a6, a7)); }
+            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.invoke(a0, a1, a2, a3, filter.invoke(a4, a5, a6, a7)); }
+            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.invoke(a0, a1, a2, a3, a4, filter.invoke(a5, a6, a7)); }
+            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.invoke(a0, a1, a2, a3, a4, a5, filter.invoke(a6, a7)); }
+            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.invoke(a0, a1, a2, a3, a4, a5, a6, filter.invoke(a7)); }
+            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.invoke(a0, a1, a2, a3, a4, a5, a6, a7, filter.invoke()); }
+            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.<void>invoke(av); // make the flyby
-            return target.invoke(av[0], av[1], av[2], av[3], av[4], av[5], av[6], av[7]); }
+            filter.<void>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
@@ -981,135 +981,135 @@
         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.invoke(filter.invoke(a0), a1, a2, a3, a4, a5, a6, a7, a8); }
+            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.invoke(a0, filter.invoke(a1), a2, a3, a4, a5, a6, a7, a8); }
+            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.invoke(a0, a1, filter.invoke(a2), a3, a4, a5, a6, a7, a8); }
+            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.invoke(a0, a1, a2, filter.invoke(a3), a4, a5, a6, a7, a8); }
+            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.invoke(a0, a1, a2, a3, filter.invoke(a4), a5, a6, a7, a8); }
+            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.invoke(a0, a1, a2, a3, a4, filter.invoke(a5), a6, a7, a8); }
+            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.invoke(a0, a1, a2, a3, a4, a5, filter.invoke(a6), a7, a8); }
+            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.invoke(a0, a1, a2, a3, a4, a5, a6, filter.invoke(a7), a8); }
+            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.invoke(a0, a1, a2, a3, a4, a5, a6, a7, filter.invoke(a8)); }
+            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.invoke(filter.invoke(),
+            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.invoke(filter.invoke(a0),
+            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.invoke(filter.invoke(a0, a1),
+            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.invoke(filter.invoke(a0, a1, a2),
+            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.invoke(filter.invoke(a0, a1, a2, a3),
+            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.invoke(filter.invoke(a0, a1, a2, a3, a4),
+            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.invoke(filter.invoke(a0, a1, a2, a3, a4, a5),
+            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.invoke(filter.invoke(a0, a1, a2, a3, a4, a5, a6),
+            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.invoke(filter.invoke(a0, a1, a2, a3, a4, a5, a6, a7),
+            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.invoke(filter.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8),
+            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.invoke(filter.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8)); }
+            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.invoke(a0, filter.invoke(a1, a2, a3, a4, a5, a6, a7, a8)); }
+            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.invoke(a0, a1, filter.invoke(a2, a3, a4, a5, a6, a7, a8)); }
+            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.invoke(a0, a1, a2, filter.invoke(a3, a4, a5, a6, a7, a8)); }
+            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.invoke(a0, a1, a2, a3, filter.invoke(a4, a5, a6, a7, a8)); }
+            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.invoke(a0, a1, a2, a3, a4, filter.invoke(a5, a6, a7, a8)); }
+            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.invoke(a0, a1, a2, a3, a4, a5, filter.invoke(a6, a7, a8)); }
+            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.invoke(a0, a1, a2, a3, a4, a5, a6, filter.invoke(a7, a8)); }
+            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.invoke(a0, a1, a2, a3, a4, a5, a6, a7, filter.invoke(a8)); }
+            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.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, filter.invoke()); }
+            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.<void>invoke(av); // make the flyby
-            return target.invoke(av[0], av[1], av[2], av[3], av[4], av[5], av[6], av[7], av[8]); }
+            filter.<void>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
@@ -1120,148 +1120,148 @@
         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.invoke(filter.invoke(a0), a1, a2, a3, a4, a5, a6, a7, a8, a9); }
+            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.invoke(a0, filter.invoke(a1), a2, a3, a4, a5, a6, a7, a8, a9); }
+            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.invoke(a0, a1, filter.invoke(a2), a3, a4, a5, a6, a7, a8, a9); }
+            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.invoke(a0, a1, a2, filter.invoke(a3), a4, a5, a6, a7, a8, a9); }
+            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.invoke(a0, a1, a2, a3, filter.invoke(a4), a5, a6, a7, a8, a9); }
+            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.invoke(a0, a1, a2, a3, a4, filter.invoke(a5), a6, a7, a8, a9); }
+            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.invoke(a0, a1, a2, a3, a4, a5, filter.invoke(a6), a7, a8, a9); }
+            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.invoke(a0, a1, a2, a3, a4, a5, a6, filter.invoke(a7), a8, a9); }
+            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.invoke(a0, a1, a2, a3, a4, a5, a6, a7, filter.invoke(a8), a9); }
+            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.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, filter.invoke(a9)); }
+            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.invoke(filter.invoke(),
+            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.invoke(filter.invoke(a0),
+            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.invoke(filter.invoke(a0, a1),
+            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.invoke(filter.invoke(a0, a1, a2),
+            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.invoke(filter.invoke(a0, a1, a2, a3),
+            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.invoke(filter.invoke(a0, a1, a2, a3, a4),
+            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.invoke(filter.invoke(a0, a1, a2, a3, a4, a5),
+            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.invoke(filter.invoke(a0, a1, a2, a3, a4, a5, a6),
+            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.invoke(filter.invoke(a0, a1, a2, a3, a4, a5, a6, a7),
+            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.invoke(filter.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8),
+            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.invoke(filter.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9),
+            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.invoke(filter.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9)); }
+            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.invoke(a0, filter.invoke(a1, a2, a3, a4, a5, a6, a7, a8, a9)); }
+            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.invoke(a0, a1, filter.invoke(a2, a3, a4, a5, a6, a7, a8, a9)); }
+            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.invoke(a0, a1, a2, filter.invoke(a3, a4, a5, a6, a7, a8, a9)); }
+            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.invoke(a0, a1, a2, a3, filter.invoke(a4, a5, a6, a7, a8, a9)); }
+            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.invoke(a0, a1, a2, a3, a4, filter.invoke(a5, a6, a7, a8, a9)); }
+            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.invoke(a0, a1, a2, a3, a4, a5, filter.invoke(a6, a7, a8, a9)); }
+            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.invoke(a0, a1, a2, a3, a4, a5, a6, filter.invoke(a7, a8, a9)); }
+            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.invoke(a0, a1, a2, a3, a4, a5, a6, a7, filter.invoke(a8, a9)); }
+            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.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, filter.invoke(a9)); }
+            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.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, filter.invoke()); }
+            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.<void>invoke(av); // make the flyby
-            return target.invoke(av[0], av[1], av[2], av[3], av[4], av[5], av[6], av[7], av[8], av[9]); }
+            filter.<void>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
@@ -1272,182 +1272,182 @@
         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.invoke(filter.invoke(a0), a1, a2, a3, a4, a5, a6, a7, a8, a9,
+            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.invoke(a0, filter.invoke(a1), a2, a3, a4, a5, a6, a7, a8, a9,
+            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.invoke(a0, a1, filter.invoke(a2), a3, a4, a5, a6, a7, a8, a9,
+            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.invoke(a0, a1, a2, filter.invoke(a3), a4, a5, a6, a7, a8, a9,
+            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.invoke(a0, a1, a2, a3, filter.invoke(a4), a5, a6, a7, a8, a9,
+            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.invoke(a0, a1, a2, a3, a4, filter.invoke(a5), a6, a7, a8, a9,
+            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.invoke(a0, a1, a2, a3, a4, a5, filter.invoke(a6), a7, a8, a9,
+            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.invoke(a0, a1, a2, a3, a4, a5, a6, filter.invoke(a7), a8, a9,
+            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.invoke(a0, a1, a2, a3, a4, a5, a6, a7, filter.invoke(a8), a9,
+            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.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, filter.invoke(a9),
+            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.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
-                                 filter.invoke(a10)); }
+            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.invoke(filter.invoke(),
+            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.invoke(filter.invoke(a0),
+            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.invoke(filter.invoke(a0, a1),
+            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.invoke(filter.invoke(a0, a1, a2),
+            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.invoke(filter.invoke(a0, a1, a2, a3),
+            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.invoke(filter.invoke(a0, a1, a2, a3, a4),
+            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.invoke(filter.invoke(a0, a1, a2, a3, a4, a5),
+            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.invoke(filter.invoke(a0, a1, a2, a3, a4, a5, a6),
+            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.invoke(filter.invoke(a0, a1, a2, a3, a4, a5, a6, a7),
+            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.invoke(filter.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8),
+            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.invoke(filter.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9),
+            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.invoke(filter.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10),
+            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.invoke(filter.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
+            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.invoke(a0, filter.invoke(a1, a2, a3, a4, a5, a6, a7, a8, a9,
+            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.invoke(a0, a1, filter.invoke(a2, a3, a4, a5, a6, a7, a8, a9,
+            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.invoke(a0, a1, a2, filter.invoke(a3, a4, a5, a6, a7, a8, a9,
+            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.invoke(a0, a1, a2, a3, filter.invoke(a4, a5, a6, a7, a8, a9,
+            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.invoke(a0, a1, a2, a3, a4, filter.invoke(a5, a6, a7, a8, a9,
+            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.invoke(a0, a1, a2, a3, a4, a5, filter.invoke(a6, a7, a8, a9,
+            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.invoke(a0, a1, a2, a3, a4, a5, a6, filter.invoke(a7, a8, a9,
+            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.invoke(a0, a1, a2, a3, a4, a5, a6, a7, filter.invoke(a8, a9,
+            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.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, filter.invoke(a9,
+            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.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, filter.invoke(a10)); }
+            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.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, filter.invoke()); }
+            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.<void>invoke(av); // make the flyby
-            return target.invoke(av[0], av[1], av[2], av[3], av[4], av[5], av[6], av[7], av[8], av[9], av[10]); }
+            filter.<void>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
@@ -1458,198 +1458,198 @@
         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.invoke(filter.invoke(a0), a1, a2, a3, a4, a5, a6, a7, a8, a9,
+            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.invoke(a0, filter.invoke(a1), a2, a3, a4, a5, a6, a7, a8, a9,
+            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.invoke(a0, a1, filter.invoke(a2), a3, a4, a5, a6, a7, a8, a9,
+            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.invoke(a0, a1, a2, filter.invoke(a3), a4, a5, a6, a7, a8, a9,
+            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.invoke(a0, a1, a2, a3, filter.invoke(a4), a5, a6, a7, a8, a9,
+            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.invoke(a0, a1, a2, a3, a4, filter.invoke(a5), a6, a7, a8, a9,
+            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.invoke(a0, a1, a2, a3, a4, a5, filter.invoke(a6), a7, a8, a9,
+            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.invoke(a0, a1, a2, a3, a4, a5, a6, filter.invoke(a7), a8, a9,
+            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.invoke(a0, a1, a2, a3, a4, a5, a6, a7, filter.invoke(a8), a9,
+            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.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, filter.invoke(a9),
+            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.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
-                                 filter.invoke(a10), a11); }
+            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.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
-                                 a10, filter.invoke(a11)); }
+            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.invoke(filter.invoke(),
+            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.invoke(filter.invoke(a0),
+            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.invoke(filter.invoke(a0, a1),
+            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.invoke(filter.invoke(a0, a1, a2),
+            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.invoke(filter.invoke(a0, a1, a2, a3),
+            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.invoke(filter.invoke(a0, a1, a2, a3, a4),
+            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.invoke(filter.invoke(a0, a1, a2, a3, a4, a5),
+            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.invoke(filter.invoke(a0, a1, a2, a3, a4, a5, a6),
+            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.invoke(filter.invoke(a0, a1, a2, a3, a4, a5, a6, a7),
+            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.invoke(filter.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8),
+            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.invoke(filter.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9),
+            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.invoke(filter.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
+            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.invoke(filter.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11),
+            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.invoke(filter.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
+            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.invoke(a0, filter.invoke(a1, a2, a3, a4, a5, a6, a7, a8, a9,
+            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.invoke(a0, a1, filter.invoke(a2, a3, a4, a5, a6, a7, a8, a9,
+            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.invoke(a0, a1, a2, filter.invoke(a3, a4, a5, a6, a7, a8, a9,
+            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.invoke(a0, a1, a2, a3, filter.invoke(a4, a5, a6, a7, a8, a9,
+            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.invoke(a0, a1, a2, a3, a4, filter.invoke(a5, a6, a7, a8, a9,
+            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.invoke(a0, a1, a2, a3, a4, a5, filter.invoke(a6, a7, a8, a9,
+            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.invoke(a0, a1, a2, a3, a4, a5, a6, filter.invoke(a7, a8, a9,
+            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.invoke(a0, a1, a2, a3, a4, a5, a6, a7, filter.invoke(a8, a9,
+            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.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, filter.invoke(a9,
+            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.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, filter.invoke(a10, a11)); }
+            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.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
-                                 a10, filter.invoke(a11)); }
+            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.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, filter.invoke()); }
+            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.<void>invoke(av); // make the flyby
-            return target.invoke(av[0], av[1], av[2], av[3], av[4], av[5], av[6], av[7], av[8], av[9], av[10], av[11]); }
+            filter.<void>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
@@ -1661,255 +1661,255 @@
                                    Object a4, Object a5, Object a6, Object a7,
                                    Object a8, Object a9, Object a10, Object a11,
                                    Object a12) throws Throwable {
-            return target.invoke(filter.invoke(a0), a1, a2, a3, a4, a5, a6, a7, a8, a9,
+            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.invoke(a0, filter.invoke(a1), a2, a3, a4, a5, a6, a7, a8, a9,
+            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.invoke(a0, a1, filter.invoke(a2), a3, a4, a5, a6, a7, a8, a9,
+            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.invoke(a0, a1, a2, filter.invoke(a3), a4, a5, a6, a7, a8, a9,
+            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.invoke(a0, a1, a2, a3, filter.invoke(a4), a5, a6, a7, a8, a9,
+            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.invoke(a0, a1, a2, a3, a4, filter.invoke(a5), a6, a7, a8, a9,
+            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.invoke(a0, a1, a2, a3, a4, a5, filter.invoke(a6), a7, a8, a9,
+            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.invoke(a0, a1, a2, a3, a4, a5, a6, filter.invoke(a7), a8, a9,
+            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.invoke(a0, a1, a2, a3, a4, a5, a6, a7, filter.invoke(a8), a9,
+            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.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, filter.invoke(a9),
+            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.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
-                                 filter.invoke(a10), a11, a12); }
+            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.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
-                                 a10, filter.invoke(a11), a12); }
+            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.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
-                                 a10, a11, filter.invoke(a12)); }
+            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.invoke(filter.invoke(),
+            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.invoke(filter.invoke(a0),
+            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.invoke(filter.invoke(a0, a1),
+            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.invoke(filter.invoke(a0, a1, a2),
+            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.invoke(filter.invoke(a0, a1, a2, a3),
+            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.invoke(filter.invoke(a0, a1, a2, a3, a4),
+            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.invoke(filter.invoke(a0, a1, a2, a3, a4, a5),
+            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.invoke(filter.invoke(a0, a1, a2, a3, a4, a5, a6),
+            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.invoke(filter.invoke(a0, a1, a2, a3, a4, a5, a6, a7),
+            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.invoke(filter.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8),
+            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.invoke(filter.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9),
+            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.invoke(filter.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
+            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.invoke(filter.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
+            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.invoke(filter.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12),
+            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.invoke(filter.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
+            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.invoke(a0, filter.invoke(a1, a2, a3, a4, a5, a6, a7, a8, a9,
+            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.invoke(a0, a1, filter.invoke(a2, a3, a4, a5, a6, a7, a8, a9,
+            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.invoke(a0, a1, a2, filter.invoke(a3, a4, a5, a6, a7, a8, a9,
+            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.invoke(a0, a1, a2, a3, filter.invoke(a4, a5, a6, a7, a8, a9,
+            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.invoke(a0, a1, a2, a3, a4, filter.invoke(a5, a6, a7, a8, a9,
+            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.invoke(a0, a1, a2, a3, a4, a5, filter.invoke(a6, a7, a8, a9,
+            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.invoke(a0, a1, a2, a3, a4, a5, a6, filter.invoke(a7, a8, a9,
+            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.invoke(a0, a1, a2, a3, a4, a5, a6, a7, filter.invoke(a8, a9,
+            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.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, filter.invoke(a9,
+            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.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, filter.invoke(a10, a11, a12)); }
+            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.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
-                                 a10, filter.invoke(a11, a12)); }
+            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.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
-                                 a10, a11, filter.invoke(a12)); }
+            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.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, filter.invoke()); }
+            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.<void>invoke(av); // make the flyby
-            return target.invoke(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]); }
+            filter.<void>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
@@ -1921,274 +1921,274 @@
                                    Object a4, Object a5, Object a6, Object a7,
                                    Object a8, Object a9, Object a10, Object a11,
                                    Object a12, Object a13) throws Throwable {
-            return target.invoke(filter.invoke(a0), a1, a2, a3, a4, a5, a6, a7, a8, a9,
+            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.invoke(a0, filter.invoke(a1), a2, a3, a4, a5, a6, a7, a8, a9,
+            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.invoke(a0, a1, filter.invoke(a2), a3, a4, a5, a6, a7, a8, a9,
+            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.invoke(a0, a1, a2, filter.invoke(a3), a4, a5, a6, a7, a8, a9,
+            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.invoke(a0, a1, a2, a3, filter.invoke(a4), a5, a6, a7, a8, a9,
+            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.invoke(a0, a1, a2, a3, a4, filter.invoke(a5), a6, a7, a8, a9,
+            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.invoke(a0, a1, a2, a3, a4, a5, filter.invoke(a6), a7, a8, a9,
+            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.invoke(a0, a1, a2, a3, a4, a5, a6, filter.invoke(a7), a8, a9,
+            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.invoke(a0, a1, a2, a3, a4, a5, a6, a7, filter.invoke(a8), a9,
+            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.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, filter.invoke(a9),
+            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.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
-                                 filter.invoke(a10), a11, a12, a13); }
+            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.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
-                                 a10, filter.invoke(a11), a12, a13); }
+            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.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
-                                 a10, a11, filter.invoke(a12), a13); }
+            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.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
-                                 a10, a11, a12, filter.invoke(a13)); }
+            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.invoke(filter.invoke(),
+            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.invoke(filter.invoke(a0),
+            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.invoke(filter.invoke(a0, a1),
+            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.invoke(filter.invoke(a0, a1, a2),
+            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.invoke(filter.invoke(a0, a1, a2, a3),
+            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.invoke(filter.invoke(a0, a1, a2, a3, a4),
+            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.invoke(filter.invoke(a0, a1, a2, a3, a4, a5),
+            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.invoke(filter.invoke(a0, a1, a2, a3, a4, a5, a6),
+            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.invoke(filter.invoke(a0, a1, a2, a3, a4, a5, a6, a7),
+            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.invoke(filter.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8),
+            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.invoke(filter.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9),
+            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.invoke(filter.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
+            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.invoke(filter.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
+            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.invoke(filter.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
+            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.invoke(filter.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13),
+            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.invoke(filter.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
+            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.invoke(a0, filter.invoke(a1, a2, a3, a4, a5, a6, a7, a8, a9,
+            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.invoke(a0, a1, filter.invoke(a2, a3, a4, a5, a6, a7, a8, a9,
+            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.invoke(a0, a1, a2, filter.invoke(a3, a4, a5, a6, a7, a8, a9,
+            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.invoke(a0, a1, a2, a3, filter.invoke(a4, a5, a6, a7, a8, a9,
+            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.invoke(a0, a1, a2, a3, a4, filter.invoke(a5, a6, a7, a8, a9,
+            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.invoke(a0, a1, a2, a3, a4, a5, filter.invoke(a6, a7, a8, a9,
+            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.invoke(a0, a1, a2, a3, a4, a5, a6, filter.invoke(a7, a8, a9,
+            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.invoke(a0, a1, a2, a3, a4, a5, a6, a7, filter.invoke(a8, a9,
+            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.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, filter.invoke(a9,
+            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.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, filter.invoke(a10, a11, a12, a13)); }
+            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.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
-                                 a10, filter.invoke(a11, a12, a13)); }
+            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.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
-                                 a10, a11, filter.invoke(a12, a13)); }
+            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.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
-                                 a10, a11, a12, filter.invoke(a13)); }
+            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.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, filter.invoke()); }
+            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.<void>invoke(av); // make the flyby
-            return target.invoke(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]); }
+            filter.<void>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
@@ -2200,293 +2200,293 @@
                                    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.invoke(filter.invoke(a0), a1, a2, a3, a4, a5, a6, a7, a8, a9,
+            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.invoke(a0, filter.invoke(a1), a2, a3, a4, a5, a6, a7, a8, a9,
+            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.invoke(a0, a1, filter.invoke(a2), a3, a4, a5, a6, a7, a8, a9,
+            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.invoke(a0, a1, a2, filter.invoke(a3), a4, a5, a6, a7, a8, a9,
+            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.invoke(a0, a1, a2, a3, filter.invoke(a4), a5, a6, a7, a8, a9,
+            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.invoke(a0, a1, a2, a3, a4, filter.invoke(a5), a6, a7, a8, a9,
+            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.invoke(a0, a1, a2, a3, a4, a5, filter.invoke(a6), a7, a8, a9,
+            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.invoke(a0, a1, a2, a3, a4, a5, a6, filter.invoke(a7), a8, a9,
+            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.invoke(a0, a1, a2, a3, a4, a5, a6, a7, filter.invoke(a8), a9,
+            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.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, filter.invoke(a9),
+            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.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
-                                 filter.invoke(a10), a11, a12, a13, a14); }
+            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.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
-                                 a10, filter.invoke(a11), a12, a13, a14); }
+            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.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
-                                 a10, a11, filter.invoke(a12), a13, a14); }
+            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.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
-                                 a10, a11, a12, filter.invoke(a13), a14); }
+            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.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
-                                 a10, a11, a12, a13, filter.invoke(a14)); }
+            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.invoke(filter.invoke(),
+            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.invoke(filter.invoke(a0),
+            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.invoke(filter.invoke(a0, a1),
+            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.invoke(filter.invoke(a0, a1, a2),
+            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.invoke(filter.invoke(a0, a1, a2, a3),
+            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.invoke(filter.invoke(a0, a1, a2, a3, a4),
+            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.invoke(filter.invoke(a0, a1, a2, a3, a4, a5),
+            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.invoke(filter.invoke(a0, a1, a2, a3, a4, a5, a6),
+            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.invoke(filter.invoke(a0, a1, a2, a3, a4, a5, a6, a7),
+            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.invoke(filter.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8),
+            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.invoke(filter.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9),
+            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.invoke(filter.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
+            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.invoke(filter.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
+            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.invoke(filter.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
+            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.invoke(filter.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
+            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.invoke(filter.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14),
+            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.invoke(filter.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
+            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.invoke(a0, filter.invoke(a1, a2, a3, a4, a5, a6, a7, a8, a9,
+            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.invoke(a0, a1, filter.invoke(a2, a3, a4, a5, a6, a7, a8, a9,
+            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.invoke(a0, a1, a2, filter.invoke(a3, a4, a5, a6, a7, a8, a9,
+            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.invoke(a0, a1, a2, a3, filter.invoke(a4, a5, a6, a7, a8, a9,
+            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.invoke(a0, a1, a2, a3, a4, filter.invoke(a5, a6, a7, a8, a9,
+            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.invoke(a0, a1, a2, a3, a4, a5, filter.invoke(a6, a7, a8, a9,
+            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.invoke(a0, a1, a2, a3, a4, a5, a6, filter.invoke(a7, a8, a9,
+            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.invoke(a0, a1, a2, a3, a4, a5, a6, a7, filter.invoke(a8, a9,
+            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.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, filter.invoke(a9,
+            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.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, filter.invoke(a10, a11, a12, a13, a14)); }
+            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.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
-                                 a10, filter.invoke(a11, a12, a13, a14)); }
+            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.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
-                                 a10, a11, filter.invoke(a12, a13, a14)); }
+            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.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
-                                 a10, a11, a12, filter.invoke(a13, a14)); }
+            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.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
-                                 a10, a11, a12, a13, filter.invoke(a14)); }
+            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.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, filter.invoke()); }
+            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.<void>invoke(av); // make the flyby
-            return target.invoke(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]); }
+            filter.<void>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
@@ -2498,312 +2498,312 @@
                                    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.invoke(filter.invoke(a0), a1, a2, a3, a4, a5, a6, a7, a8, a9,
+            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.invoke(a0, filter.invoke(a1), a2, a3, a4, a5, a6, a7, a8, a9,
+            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.invoke(a0, a1, filter.invoke(a2), a3, a4, a5, a6, a7, a8, a9,
+            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.invoke(a0, a1, a2, filter.invoke(a3), a4, a5, a6, a7, a8, a9,
+            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.invoke(a0, a1, a2, a3, filter.invoke(a4), a5, a6, a7, a8, a9,
+            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.invoke(a0, a1, a2, a3, a4, filter.invoke(a5), a6, a7, a8, a9,
+            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.invoke(a0, a1, a2, a3, a4, a5, filter.invoke(a6), a7, a8, a9,
+            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.invoke(a0, a1, a2, a3, a4, a5, a6, filter.invoke(a7), a8, a9,
+            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.invoke(a0, a1, a2, a3, a4, a5, a6, a7, filter.invoke(a8), a9,
+            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.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, filter.invoke(a9),
+            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.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
-                                 filter.invoke(a10), a11, a12, a13, a14, a15); }
+            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.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
-                                 a10, filter.invoke(a11), a12, a13, a14, a15); }
+            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.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
-                                 a10, a11, filter.invoke(a12), a13, a14, a15); }
+            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.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
-                                 a10, a11, a12, filter.invoke(a13), a14, a15); }
+            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.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
-                                 a10, a11, a12, a13, filter.invoke(a14), a15); }
+            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.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
-                                 a10, a11, a12, a13, a14, filter.invoke(a15)); }
+            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.invoke(filter.invoke(),
+            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.invoke(filter.invoke(a0),
+            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.invoke(filter.invoke(a0, a1),
+            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.invoke(filter.invoke(a0, a1, a2),
+            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.invoke(filter.invoke(a0, a1, a2, a3),
+            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.invoke(filter.invoke(a0, a1, a2, a3, a4),
+            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.invoke(filter.invoke(a0, a1, a2, a3, a4, a5),
+            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.invoke(filter.invoke(a0, a1, a2, a3, a4, a5, a6),
+            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.invoke(filter.invoke(a0, a1, a2, a3, a4, a5, a6, a7),
+            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.invoke(filter.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8),
+            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.invoke(filter.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9),
+            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.invoke(filter.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
+            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.invoke(filter.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
+            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.invoke(filter.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
+            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.invoke(filter.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
+            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.invoke(filter.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
+            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.invoke(filter.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15),
+            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.invoke(filter.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
+            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.invoke(a0, filter.invoke(a1, a2, a3, a4, a5, a6, a7, a8, a9,
+            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.invoke(a0, a1, filter.invoke(a2, a3, a4, a5, a6, a7, a8, a9,
+            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.invoke(a0, a1, a2, filter.invoke(a3, a4, a5, a6, a7, a8, a9,
+            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.invoke(a0, a1, a2, a3, filter.invoke(a4, a5, a6, a7, a8, a9,
+            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.invoke(a0, a1, a2, a3, a4, filter.invoke(a5, a6, a7, a8, a9,
+            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.invoke(a0, a1, a2, a3, a4, a5, filter.invoke(a6, a7, a8, a9,
+            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.invoke(a0, a1, a2, a3, a4, a5, a6, filter.invoke(a7, a8, a9,
+            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.invoke(a0, a1, a2, a3, a4, a5, a6, a7, filter.invoke(a8, a9,
+            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.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, filter.invoke(a9,
+            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.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, filter.invoke(a10, a11, a12, a13, a14, a15)); }
+            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.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
-                                 a10, filter.invoke(a11, a12, a13, a14, a15)); }
+            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.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
-                                 a10, a11, filter.invoke(a12, a13, a14, a15)); }
+            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.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
-                                 a10, a11, a12, filter.invoke(a13, a14, a15)); }
+            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.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
-                                 a10, a11, a12, a13, filter.invoke(a14, a15)); }
+            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.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
-                                 a10, a11, a12, a13, a14, filter.invoke(a15)); }
+            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.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, filter.invoke()); }
+            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.<void>invoke(av); // make the flyby
-            return target.invoke(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]); }
+            filter.<void>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
@@ -2816,203 +2816,203 @@
                                    Object a8, Object a9, Object a10, Object a11,
                                    Object a12, Object a13, Object a14, Object a15,
                                    Object a16) throws Throwable {
-            return target.invoke(filter.invoke(a0), a1, a2, a3, a4, a5, a6, a7, a8, a9,
+            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.invoke(a0, filter.invoke(a1), a2, a3, a4, a5, a6, a7, a8, a9,
+            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.invoke(a0, a1, filter.invoke(a2), a3, a4, a5, a6, a7, a8, a9,
+            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.invoke(a0, a1, a2, filter.invoke(a3), a4, a5, a6, a7, a8, a9,
+            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.invoke(a0, a1, a2, a3, filter.invoke(a4), a5, a6, a7, a8, a9,
+            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.invoke(a0, a1, a2, a3, a4, filter.invoke(a5), a6, a7, a8, a9,
+            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.invoke(a0, a1, a2, a3, a4, a5, filter.invoke(a6), a7, a8, a9,
+            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.invoke(a0, a1, a2, a3, a4, a5, a6, filter.invoke(a7), a8, a9,
+            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.invoke(a0, a1, a2, a3, a4, a5, a6, a7, filter.invoke(a8), a9,
+            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.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, filter.invoke(a9),
+            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.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
-                                 filter.invoke(a10), a11, a12, a13, a14, a15, a16); }
+            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.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
-                                 a10, filter.invoke(a11), a12, a13, a14, a15, a16); }
+            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.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
-                                 a10, a11, filter.invoke(a12), a13, a14, a15, a16); }
+            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.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
-                                 a10, a11, a12, filter.invoke(a13), a14, a15, a16); }
+            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.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
-                                 a10, a11, a12, a13, filter.invoke(a14), a15, a16); }
+            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.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
-                                 a10, a11, a12, a13, a14, filter.invoke(a15), a16); }
+            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.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
-                                 a10, a11, a12, a13, a14, a15, filter.invoke(a16)); }
+            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.invoke(filter.invoke(),
+            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.invoke(filter.invoke(a0),
+            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.invoke(filter.invoke(a0, a1),
+            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.invoke(filter.invoke(a0, a1, a2),
+            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.invoke(filter.invoke(a0, a1, a2, a3),
+            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.invoke(filter.invoke(a0, a1, a2, a3, a4),
+            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.invoke(filter.invoke(a0, a1, a2, a3, a4, a5),
+            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.invoke(filter.invoke(a0, a1, a2, a3, a4, a5, a6),
+            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.invoke(filter.invoke(a0, a1, a2, a3, a4, a5, a6, a7),
+            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.invoke(filter.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8),
+            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.invoke(filter.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9),
+            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.invoke(filter.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
+            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,
@@ -3020,7 +3020,7 @@
                                     Object a8, Object a9, Object a10, Object a11,
                                     Object a12, Object a13, Object a14, Object a15,
                                     Object a16) throws Throwable {
-            return target.invoke(filter.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
+            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,
@@ -3028,7 +3028,7 @@
                                     Object a8, Object a9, Object a10, Object a11,
                                     Object a12, Object a13, Object a14, Object a15,
                                     Object a16) throws Throwable {
-            return target.invoke(filter.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
+            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,
@@ -3036,7 +3036,7 @@
                                     Object a8, Object a9, Object a10, Object a11,
                                     Object a12, Object a13, Object a14, Object a15,
                                     Object a16) throws Throwable {
-            return target.invoke(filter.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
+            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,
@@ -3044,7 +3044,7 @@
                                     Object a8, Object a9, Object a10, Object a11,
                                     Object a12, Object a13, Object a14, Object a15,
                                     Object a16) throws Throwable {
-            return target.invoke(filter.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
+            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,
@@ -3052,7 +3052,7 @@
                                     Object a8, Object a9, Object a10, Object a11,
                                     Object a12, Object a13, Object a14, Object a15,
                                     Object a16) throws Throwable {
-            return target.invoke(filter.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
+            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,
@@ -3060,140 +3060,140 @@
                                    Object a8, Object a9, Object a10, Object a11,
                                    Object a12, Object a13, Object a14, Object a15,
                                    Object a16) throws Throwable {
-            return target.invoke(filter.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16),
+            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.invoke(filter.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
+            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.invoke(a0, filter.invoke(a1, a2, a3, a4, a5, a6, a7, a8, a9,
+            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.invoke(a0, a1, filter.invoke(a2, a3, a4, a5, a6, a7, a8, a9,
+            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.invoke(a0, a1, a2, filter.invoke(a3, a4, a5, a6, a7, a8, a9,
+            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.invoke(a0, a1, a2, a3, filter.invoke(a4, a5, a6, a7, a8, a9,
+            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.invoke(a0, a1, a2, a3, a4, filter.invoke(a5, a6, a7, a8, a9,
+            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.invoke(a0, a1, a2, a3, a4, a5, filter.invoke(a6, a7, a8, a9,
+            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.invoke(a0, a1, a2, a3, a4, a5, a6, filter.invoke(a7, a8, a9,
+            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.invoke(a0, a1, a2, a3, a4, a5, a6, a7, filter.invoke(a8, a9,
+            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.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, filter.invoke(a9,
+            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.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, filter.invoke(a10, a11, a12, a13, a14, a15, a16)); }
+            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.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
-                                 a10, filter.invoke(a11, a12, a13, a14, a15, a16)); }
+            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.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
-                                 a10, a11, filter.invoke(a12, a13, a14, a15, a16)); }
+            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.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
-                                 a10, a11, a12, filter.invoke(a13, a14, a15, a16)); }
+            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.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
-                                 a10, a11, a12, a13, filter.invoke(a14, a15, a16)); }
+            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.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
-                                 a10, a11, a12, a13, a14, filter.invoke(a15, a16)); }
+            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.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
-                                 a10, a11, a12, a13, a14, a15, filter.invoke(a16)); }
+            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.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, filter.invoke()); }
+            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.<void>invoke(av); // make the flyby
-            return target.invoke(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]); }
+            filter.<void>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
@@ -3206,210 +3206,210 @@
                                    Object a8, Object a9, Object a10, Object a11,
                                    Object a12, Object a13, Object a14, Object a15,
                                    Object a16, Object a17) throws Throwable {
-            return target.invoke(filter.invoke(a0), a1, a2, a3, a4, a5, a6, a7, a8, a9,
+            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.invoke(a0, filter.invoke(a1), a2, a3, a4, a5, a6, a7, a8, a9,
+            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.invoke(a0, a1, filter.invoke(a2), a3, a4, a5, a6, a7, a8, a9,
+            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.invoke(a0, a1, a2, filter.invoke(a3), a4, a5, a6, a7, a8, a9,
+            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.invoke(a0, a1, a2, a3, filter.invoke(a4), a5, a6, a7, a8, a9,
+            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.invoke(a0, a1, a2, a3, a4, filter.invoke(a5), a6, a7, a8, a9,
+            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.invoke(a0, a1, a2, a3, a4, a5, filter.invoke(a6), a7, a8, a9,
+            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.invoke(a0, a1, a2, a3, a4, a5, a6, filter.invoke(a7), a8, a9,
+            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.invoke(a0, a1, a2, a3, a4, a5, a6, a7, filter.invoke(a8), a9,
+            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.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, filter.invoke(a9),
+            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.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
-                                 filter.invoke(a10), a11, a12, a13, a14, a15, a16, a17); }
+            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.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
-                                 a10, filter.invoke(a11), a12, a13, a14, a15, a16, a17); }
+            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.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
-                                 a10, a11, filter.invoke(a12), a13, a14, a15, a16, a17); }
+            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.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
-                                 a10, a11, a12, filter.invoke(a13), a14, a15, a16, a17); }
+            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.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
-                                 a10, a11, a12, a13, filter.invoke(a14), a15, a16, a17); }
+            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.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
-                                 a10, a11, a12, a13, a14, filter.invoke(a15), a16, a17); }
+            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.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
-                                 a10, a11, a12, a13, a14, a15, filter.invoke(a16), a17); }
+            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.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
-                                 a10, a11, a12, a13, a14, a15, a16, filter.invoke(a17)); }
+            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.invoke(filter.invoke(),
+            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.invoke(filter.invoke(a0),
+            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.invoke(filter.invoke(a0, a1),
+            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.invoke(filter.invoke(a0, a1, a2),
+            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.invoke(filter.invoke(a0, a1, a2, a3),
+            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.invoke(filter.invoke(a0, a1, a2, a3, a4),
+            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.invoke(filter.invoke(a0, a1, a2, a3, a4, a5),
+            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.invoke(filter.invoke(a0, a1, a2, a3, a4, a5, a6),
+            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.invoke(filter.invoke(a0, a1, a2, a3, a4, a5, a6, a7),
+            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.invoke(filter.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8),
+            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.invoke(filter.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9),
+            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.invoke(filter.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
+            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,
@@ -3417,7 +3417,7 @@
                                     Object a8, Object a9, Object a10, Object a11,
                                     Object a12, Object a13, Object a14, Object a15,
                                     Object a16, Object a17) throws Throwable {
-            return target.invoke(filter.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
+            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,
@@ -3425,7 +3425,7 @@
                                     Object a8, Object a9, Object a10, Object a11,
                                     Object a12, Object a13, Object a14, Object a15,
                                     Object a16, Object a17) throws Throwable {
-            return target.invoke(filter.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
+            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,
@@ -3433,7 +3433,7 @@
                                     Object a8, Object a9, Object a10, Object a11,
                                     Object a12, Object a13, Object a14, Object a15,
                                     Object a16, Object a17) throws Throwable {
-            return target.invoke(filter.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
+            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,
@@ -3441,7 +3441,7 @@
                                     Object a8, Object a9, Object a10, Object a11,
                                     Object a12, Object a13, Object a14, Object a15,
                                     Object a16, Object a17) throws Throwable {
-            return target.invoke(filter.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
+            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,
@@ -3449,7 +3449,7 @@
                                     Object a8, Object a9, Object a10, Object a11,
                                     Object a12, Object a13, Object a14, Object a15,
                                     Object a16, Object a17) throws Throwable {
-            return target.invoke(filter.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
+            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,
@@ -3457,7 +3457,7 @@
                                     Object a8, Object a9, Object a10, Object a11,
                                     Object a12, Object a13, Object a14, Object a15,
                                     Object a16, Object a17) throws Throwable {
-            return target.invoke(filter.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
+            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,
@@ -3465,147 +3465,147 @@
                                    Object a8, Object a9, Object a10, Object a11,
                                    Object a12, Object a13, Object a14, Object a15,
                                    Object a16, Object a17) throws Throwable {
-            return target.invoke(filter.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17),
+            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.invoke(filter.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
+            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.invoke(a0, filter.invoke(a1, a2, a3, a4, a5, a6, a7, a8, a9,
+            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.invoke(a0, a1, filter.invoke(a2, a3, a4, a5, a6, a7, a8, a9,
+            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.invoke(a0, a1, a2, filter.invoke(a3, a4, a5, a6, a7, a8, a9,
+            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.invoke(a0, a1, a2, a3, filter.invoke(a4, a5, a6, a7, a8, a9,
+            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.invoke(a0, a1, a2, a3, a4, filter.invoke(a5, a6, a7, a8, a9,
+            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.invoke(a0, a1, a2, a3, a4, a5, filter.invoke(a6, a7, a8, a9,
+            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.invoke(a0, a1, a2, a3, a4, a5, a6, filter.invoke(a7, a8, a9,
+            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.invoke(a0, a1, a2, a3, a4, a5, a6, a7, filter.invoke(a8, a9,
+            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.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, filter.invoke(a9,
+            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.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, filter.invoke(a10, a11, a12, a13, a14, a15, a16, a17)); }
+            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.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
-                                 a10, filter.invoke(a11, a12, a13, a14, a15, a16, a17)); }
+            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.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
-                                 a10, a11, filter.invoke(a12, a13, a14, a15, a16, a17)); }
+            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.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
-                                 a10, a11, a12, filter.invoke(a13, a14, a15, a16, a17)); }
+            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.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
-                                 a10, a11, a12, a13, filter.invoke(a14, a15, a16, a17)); }
+            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.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
-                                 a10, a11, a12, a13, a14, filter.invoke(a15, a16, a17)); }
+            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.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
-                                 a10, a11, a12, a13, a14, a15, filter.invoke(a16, a17)); }
+            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.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
-                                 a10, a11, a12, a13, a14, a15, a16, filter.invoke(a17)); }
+            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.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, filter.invoke()); }
+            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.<void>invoke(av); // make the flyby
-            return target.invoke(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]); }
+            filter.<void>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
@@ -3618,217 +3618,217 @@
                                    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.invoke(filter.invoke(a0), a1, a2, a3, a4, a5, a6, a7, a8, a9,
+            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.invoke(a0, filter.invoke(a1), a2, a3, a4, a5, a6, a7, a8, a9,
+            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.invoke(a0, a1, filter.invoke(a2), a3, a4, a5, a6, a7, a8, a9,
+            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.invoke(a0, a1, a2, filter.invoke(a3), a4, a5, a6, a7, a8, a9,
+            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.invoke(a0, a1, a2, a3, filter.invoke(a4), a5, a6, a7, a8, a9,
+            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.invoke(a0, a1, a2, a3, a4, filter.invoke(a5), a6, a7, a8, a9,
+            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.invoke(a0, a1, a2, a3, a4, a5, filter.invoke(a6), a7, a8, a9,
+            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.invoke(a0, a1, a2, a3, a4, a5, a6, filter.invoke(a7), a8, a9,
+            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.invoke(a0, a1, a2, a3, a4, a5, a6, a7, filter.invoke(a8), a9,
+            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.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, filter.invoke(a9),
+            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.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
-                                 filter.invoke(a10), a11, a12, a13, a14, a15, a16, a17, a18); }
+            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.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
-                                 a10, filter.invoke(a11), a12, a13, a14, a15, a16, a17, a18); }
+            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.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
-                                 a10, a11, filter.invoke(a12), a13, a14, a15, a16, a17, a18); }
+            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.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
-                                 a10, a11, a12, filter.invoke(a13), a14, a15, a16, a17, a18); }
+            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.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
-                                 a10, a11, a12, a13, filter.invoke(a14), a15, a16, a17, a18); }
+            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.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
-                                 a10, a11, a12, a13, a14, filter.invoke(a15), a16, a17, a18); }
+            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.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
-                                 a10, a11, a12, a13, a14, a15, filter.invoke(a16), a17, a18); }
+            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.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
-                                 a10, a11, a12, a13, a14, a15, a16, filter.invoke(a17), a18); }
+            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.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
-                                 a10, a11, a12, a13, a14, a15, a16, a17, filter.invoke(a18)); }
+            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.invoke(filter.invoke(),
+            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.invoke(filter.invoke(a0),
+            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.invoke(filter.invoke(a0, a1),
+            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.invoke(filter.invoke(a0, a1, a2),
+            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.invoke(filter.invoke(a0, a1, a2, a3),
+            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.invoke(filter.invoke(a0, a1, a2, a3, a4),
+            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.invoke(filter.invoke(a0, a1, a2, a3, a4, a5),
+            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.invoke(filter.invoke(a0, a1, a2, a3, a4, a5, a6),
+            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.invoke(filter.invoke(a0, a1, a2, a3, a4, a5, a6, a7),
+            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.invoke(filter.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8),
+            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.invoke(filter.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9),
+            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.invoke(filter.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
+            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,
@@ -3836,7 +3836,7 @@
                                     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.invoke(filter.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
+            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,
@@ -3844,7 +3844,7 @@
                                     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.invoke(filter.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
+            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,
@@ -3852,7 +3852,7 @@
                                     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.invoke(filter.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
+            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,
@@ -3860,7 +3860,7 @@
                                     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.invoke(filter.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
+            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,
@@ -3868,7 +3868,7 @@
                                     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.invoke(filter.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
+            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,
@@ -3876,7 +3876,7 @@
                                     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.invoke(filter.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
+            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,
@@ -3884,7 +3884,7 @@
                                     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.invoke(filter.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
+            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,
@@ -3892,154 +3892,154 @@
                                    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.invoke(filter.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18),
+            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.invoke(filter.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
+            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.invoke(a0, filter.invoke(a1, a2, a3, a4, a5, a6, a7, a8, a9,
+            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.invoke(a0, a1, filter.invoke(a2, a3, a4, a5, a6, a7, a8, a9,
+            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.invoke(a0, a1, a2, filter.invoke(a3, a4, a5, a6, a7, a8, a9,
+            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.invoke(a0, a1, a2, a3, filter.invoke(a4, a5, a6, a7, a8, a9,
+            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.invoke(a0, a1, a2, a3, a4, filter.invoke(a5, a6, a7, a8, a9,
+            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.invoke(a0, a1, a2, a3, a4, a5, filter.invoke(a6, a7, a8, a9,
+            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.invoke(a0, a1, a2, a3, a4, a5, a6, filter.invoke(a7, a8, a9,
+            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.invoke(a0, a1, a2, a3, a4, a5, a6, a7, filter.invoke(a8, a9,
+            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.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, filter.invoke(a9,
+            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.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, filter.invoke(a10, a11, a12, a13, a14, a15, a16, a17, a18)); }
+            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.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
-                                 a10, filter.invoke(a11, a12, a13, a14, a15, a16, a17, a18)); }
+            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.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
-                                 a10, a11, filter.invoke(a12, a13, a14, a15, a16, a17, a18)); }
+            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.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
-                                 a10, a11, a12, filter.invoke(a13, a14, a15, a16, a17, a18)); }
+            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.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
-                                 a10, a11, a12, a13, filter.invoke(a14, a15, a16, a17, a18)); }
+            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.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
-                                 a10, a11, a12, a13, a14, filter.invoke(a15, a16, a17, a18)); }
+            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.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
-                                 a10, a11, a12, a13, a14, a15, filter.invoke(a16, a17, a18)); }
+            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.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
-                                 a10, a11, a12, a13, a14, a15, a16, filter.invoke(a17, a18)); }
+            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.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
-                                 a10, a11, a12, a13, a14, a15, a16, a17, filter.invoke(a18)); }
+            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.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, filter.invoke()); }
+            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.<void>invoke(av); // make the flyby
-            return target.invoke(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]); }
+            filter.<void>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
@@ -4052,224 +4052,224 @@
                                    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.invoke(filter.invoke(a0), a1, a2, a3, a4, a5, a6, a7, a8, a9,
+            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.invoke(a0, filter.invoke(a1), a2, a3, a4, a5, a6, a7, a8, a9,
+            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.invoke(a0, a1, filter.invoke(a2), a3, a4, a5, a6, a7, a8, a9,
+            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.invoke(a0, a1, a2, filter.invoke(a3), a4, a5, a6, a7, a8, a9,
+            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.invoke(a0, a1, a2, a3, filter.invoke(a4), a5, a6, a7, a8, a9,
+            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.invoke(a0, a1, a2, a3, a4, filter.invoke(a5), a6, a7, a8, a9,
+            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.invoke(a0, a1, a2, a3, a4, a5, filter.invoke(a6), a7, a8, a9,
+            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.invoke(a0, a1, a2, a3, a4, a5, a6, filter.invoke(a7), a8, a9,
+            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.invoke(a0, a1, a2, a3, a4, a5, a6, a7, filter.invoke(a8), a9,
+            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.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, filter.invoke(a9),
+            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.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
-                                 filter.invoke(a10), a11, a12, a13, a14, a15, a16, a17, a18, a19); }
+            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.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
-                                 a10, filter.invoke(a11), a12, a13, a14, a15, a16, a17, a18, a19); }
+            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.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
-                                 a10, a11, filter.invoke(a12), a13, a14, a15, a16, a17, a18, a19); }
+            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.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
-                                 a10, a11, a12, filter.invoke(a13), a14, a15, a16, a17, a18, a19); }
+            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.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
-                                 a10, a11, a12, a13, filter.invoke(a14), a15, a16, a17, a18, a19); }
+            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.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
-                                 a10, a11, a12, a13, a14, filter.invoke(a15), a16, a17, a18, a19); }
+            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.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
-                                 a10, a11, a12, a13, a14, a15, filter.invoke(a16), a17, a18, a19); }
+            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.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
-                                 a10, a11, a12, a13, a14, a15, a16, filter.invoke(a17), a18, a19); }
+            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.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
-                                 a10, a11, a12, a13, a14, a15, a16, a17, filter.invoke(a18), a19); }
+            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.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
-                                 a10, a11, a12, a13, a14, a15, a16, a17, a18, filter.invoke(a19)); }
+            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.invoke(filter.invoke(),
+            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.invoke(filter.invoke(a0),
+            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.invoke(filter.invoke(a0, a1),
+            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.invoke(filter.invoke(a0, a1, a2),
+            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.invoke(filter.invoke(a0, a1, a2, a3),
+            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.invoke(filter.invoke(a0, a1, a2, a3, a4),
+            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.invoke(filter.invoke(a0, a1, a2, a3, a4, a5),
+            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.invoke(filter.invoke(a0, a1, a2, a3, a4, a5, a6),
+            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.invoke(filter.invoke(a0, a1, a2, a3, a4, a5, a6, a7),
+            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.invoke(filter.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8),
+            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.invoke(filter.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9),
+            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.invoke(filter.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
+            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,
@@ -4277,7 +4277,7 @@
                                     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.invoke(filter.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
+            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,
@@ -4285,7 +4285,7 @@
                                     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.invoke(filter.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
+            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,
@@ -4293,7 +4293,7 @@
                                     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.invoke(filter.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
+            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,
@@ -4301,7 +4301,7 @@
                                     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.invoke(filter.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
+            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,
@@ -4309,7 +4309,7 @@
                                     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.invoke(filter.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
+            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,
@@ -4317,7 +4317,7 @@
                                     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.invoke(filter.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
+            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,
@@ -4325,7 +4325,7 @@
                                     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.invoke(filter.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
+            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,
@@ -4333,7 +4333,7 @@
                                     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.invoke(filter.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
+            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,
@@ -4341,160 +4341,160 @@
                                    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.invoke(filter.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19),
+            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.invoke(filter.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
+            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.invoke(a0, filter.invoke(a1, a2, a3, a4, a5, a6, a7, a8, a9,
+            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.invoke(a0, a1, filter.invoke(a2, a3, a4, a5, a6, a7, a8, a9,
+            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.invoke(a0, a1, a2, filter.invoke(a3, a4, a5, a6, a7, a8, a9,
+            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.invoke(a0, a1, a2, a3, filter.invoke(a4, a5, a6, a7, a8, a9,
+            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.invoke(a0, a1, a2, a3, a4, filter.invoke(a5, a6, a7, a8, a9,
+            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.invoke(a0, a1, a2, a3, a4, a5, filter.invoke(a6, a7, a8, a9,
+            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.invoke(a0, a1, a2, a3, a4, a5, a6, filter.invoke(a7, a8, a9,
+            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.invoke(a0, a1, a2, a3, a4, a5, a6, a7, filter.invoke(a8, a9,
+            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.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, filter.invoke(a9,
+            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.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, filter.invoke(a10, a11, a12, a13, a14, a15, a16, a17, a18, a19)); }
+            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.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
-                                 a10, filter.invoke(a11, a12, a13, a14, a15, a16, a17, a18, a19)); }
+            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.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
-                                 a10, a11, filter.invoke(a12, a13, a14, a15, a16, a17, a18, a19)); }
+            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.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
-                                 a10, a11, a12, filter.invoke(a13, a14, a15, a16, a17, a18, a19)); }
+            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.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
-                                 a10, a11, a12, a13, filter.invoke(a14, a15, a16, a17, a18, a19)); }
+            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.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
-                                 a10, a11, a12, a13, a14, filter.invoke(a15, a16, a17, a18, a19)); }
+            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.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
-                                 a10, a11, a12, a13, a14, a15, filter.invoke(a16, a17, a18, a19)); }
+            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.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
-                                 a10, a11, a12, a13, a14, a15, a16, filter.invoke(a17, a18, a19)); }
+            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.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
-                                 a10, a11, a12, a13, a14, a15, a16, a17, filter.invoke(a18, a19)); }
+            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.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
-                                 a10, a11, a12, a13, a14, a15, a16, a17, a18, filter.invoke(a19)); }
+            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.invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19, filter.invoke()); }
+            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.<void>invoke(av); // make the flyby
-            return target.invoke(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]); }
+            filter.<void>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/jdk/src/share/classes/sun/dyn/FilterOneArgument.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/share/classes/sun/dyn/FilterOneArgument.java	Wed Jul 21 09:57:21 2010 -0700
@@ -47,8 +47,8 @@
     }
 
     protected Object invoke(Object argument) throws Throwable {
-        Object filteredArgument = filter.invoke(argument);
-        return target.invoke(filteredArgument);
+        Object filteredArgument = filter.invokeExact(argument);
+        return target.invokeExact(filteredArgument);
     }
 
     private static final MethodHandle INVOKE =
--- a/jdk/src/share/classes/sun/dyn/FromGeneric.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/share/classes/sun/dyn/FromGeneric.java	Wed Jul 21 09:57:21 2010 -0700
@@ -289,11 +289,11 @@
         // { return new ThisType(entryPoint, convert, target); }
 
         /// Conversions on the value returned from the target.
-        protected Object convert_L(Object result) throws Throwable { return convert.<Object>invoke(result); }
-        protected Object convert_I(int    result) throws Throwable { return convert.<Object>invoke(result); }
-        protected Object convert_J(long   result) throws Throwable { return convert.<Object>invoke(result); }
-        protected Object convert_F(float  result) throws Throwable { return convert.<Object>invoke(result); }
-        protected Object convert_D(double result) throws Throwable { return convert.<Object>invoke(result); }
+        protected Object convert_L(Object result) throws Throwable { return convert.<Object>invokeExact(result); }
+        protected Object convert_I(int    result) throws Throwable { return convert.<Object>invokeExact(result); }
+        protected Object convert_J(long   result) throws Throwable { return convert.<Object>invokeExact(result); }
+        protected Object convert_F(float  result) throws Throwable { return convert.<Object>invokeExact(result); }
+        protected Object convert_D(double result) throws Throwable { return convert.<Object>invokeExact(result); }
 
         static private final String CLASS_PREFIX; // "sun.dyn.FromGeneric$"
         static {
@@ -322,11 +322,11 @@
                         { 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(invoker.<Object>invoke(target, a0, a1)); }
-        protected Object invoke_I2(Object a0, Object a1) throws Throwable { return convert_I(invoker.<int   >invoke(target, a0, a1)); }
-        protected Object invoke_J2(Object a0, Object a1) throws Throwable { return convert_J(invoker.<long  >invoke(target, a0, a1)); }
-        protected Object invoke_F2(Object a0, Object a1) throws Throwable { return convert_F(invoker.<float >invoke(target, a0, a1)); }
-        protected Object invoke_D2(Object a0, Object a1) throws Throwable { return convert_D(invoker.<double>invoke(target, a0, a1)); }
+        protected Object invoke_L2(Object a0, Object a1) throws Throwable { return convert_L(invoker.<Object>invokeExact(target, a0, a1)); }
+        protected Object invoke_I2(Object a0, Object a1) throws Throwable { return convert_I(invoker.<int   >invokeExact(target, a0, a1)); }
+        protected Object invoke_J2(Object a0, Object a1) throws Throwable { return convert_J(invoker.<long  >invokeExact(target, a0, a1)); }
+        protected Object invoke_F2(Object a0, Object a1) throws Throwable { return convert_F(invoker.<float >invokeExact(target, a0, a1)); }
+        protected Object invoke_D2(Object a0, Object a1) throws Throwable { return convert_D(invoker.<double>invokeExact(target, a0, a1)); }
     }
     // */
 
@@ -347,7 +347,7 @@
         "        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@(invoker.<@R@>invoke(target@av@)); }",
+        "        protected Object invoke_@catN@(@Tvav@) throws Throwable { return convert_@Rc@(invoker.<@R@>invokeExact(target@av@)); }",
         "        //@end-R@",
         "    }",
     } };
@@ -503,11 +503,11 @@
                         { 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(invoker.<Object>invoke(target)); }
-        protected Object invoke_I0() throws Throwable { return convert_I(invoker.<int   >invoke(target)); }
-        protected Object invoke_J0() throws Throwable { return convert_J(invoker.<long  >invoke(target)); }
-        protected Object invoke_F0() throws Throwable { return convert_F(invoker.<float >invoke(target)); }
-        protected Object invoke_D0() throws Throwable { return convert_D(invoker.<double>invoke(target)); }
+        protected Object invoke_L0() throws Throwable { return convert_L(invoker.<Object>invokeExact(target)); }
+        protected Object invoke_I0() throws Throwable { return convert_I(invoker.<int   >invokeExact(target)); }
+        protected Object invoke_J0() throws Throwable { return convert_J(invoker.<long  >invokeExact(target)); }
+        protected Object invoke_F0() throws Throwable { return convert_F(invoker.<float >invokeExact(target)); }
+        protected Object invoke_D0() throws Throwable { return convert_D(invoker.<double>invokeExact(target)); }
     }
     static class A1 extends Adapter {
         protected A1(MethodHandle entryPoint) { super(entryPoint); }  // to build prototype
@@ -515,11 +515,11 @@
                         { 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(invoker.<Object>invoke(target, a0)); }
-        protected Object invoke_I1(Object a0) throws Throwable { return convert_I(invoker.<int   >invoke(target, a0)); }
-        protected Object invoke_J1(Object a0) throws Throwable { return convert_J(invoker.<long  >invoke(target, a0)); }
-        protected Object invoke_F1(Object a0) throws Throwable { return convert_F(invoker.<float >invoke(target, a0)); }
-        protected Object invoke_D1(Object a0) throws Throwable { return convert_D(invoker.<double>invoke(target, a0)); }
+        protected Object invoke_L1(Object a0) throws Throwable { return convert_L(invoker.<Object>invokeExact(target, a0)); }
+        protected Object invoke_I1(Object a0) throws Throwable { return convert_I(invoker.<int   >invokeExact(target, a0)); }
+        protected Object invoke_J1(Object a0) throws Throwable { return convert_J(invoker.<long  >invokeExact(target, a0)); }
+        protected Object invoke_F1(Object a0) throws Throwable { return convert_F(invoker.<float >invokeExact(target, a0)); }
+        protected Object invoke_D1(Object a0) throws Throwable { return convert_D(invoker.<double>invokeExact(target, a0)); }
     }
     static class A2 extends Adapter {
         protected A2(MethodHandle entryPoint) { super(entryPoint); }  // to build prototype
@@ -527,11 +527,11 @@
                         { 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(invoker.<Object>invoke(target, a0, a1)); }
-        protected Object invoke_I2(Object a0, Object a1) throws Throwable { return convert_I(invoker.<int   >invoke(target, a0, a1)); }
-        protected Object invoke_J2(Object a0, Object a1) throws Throwable { return convert_J(invoker.<long  >invoke(target, a0, a1)); }
-        protected Object invoke_F2(Object a0, Object a1) throws Throwable { return convert_F(invoker.<float >invoke(target, a0, a1)); }
-        protected Object invoke_D2(Object a0, Object a1) throws Throwable { return convert_D(invoker.<double>invoke(target, a0, a1)); }
+        protected Object invoke_L2(Object a0, Object a1) throws Throwable { return convert_L(invoker.<Object>invokeExact(target, a0, a1)); }
+        protected Object invoke_I2(Object a0, Object a1) throws Throwable { return convert_I(invoker.<int   >invokeExact(target, a0, a1)); }
+        protected Object invoke_J2(Object a0, Object a1) throws Throwable { return convert_J(invoker.<long  >invokeExact(target, a0, a1)); }
+        protected Object invoke_F2(Object a0, Object a1) throws Throwable { return convert_F(invoker.<float >invokeExact(target, a0, a1)); }
+        protected Object invoke_D2(Object a0, Object a1) throws Throwable { return convert_D(invoker.<double>invokeExact(target, a0, a1)); }
     }
     static class A3 extends Adapter {
         protected A3(MethodHandle entryPoint) { super(entryPoint); }  // to build prototype
@@ -539,11 +539,11 @@
                         { 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(invoker.<Object>invoke(target, a0, a1, a2)); }
-        protected Object invoke_I3(Object a0, Object a1, Object a2) throws Throwable { return convert_I(invoker.<int   >invoke(target, a0, a1, a2)); }
-        protected Object invoke_J3(Object a0, Object a1, Object a2) throws Throwable { return convert_J(invoker.<long  >invoke(target, a0, a1, a2)); }
-        protected Object invoke_F3(Object a0, Object a1, Object a2) throws Throwable { return convert_F(invoker.<float >invoke(target, a0, a1, a2)); }
-        protected Object invoke_D3(Object a0, Object a1, Object a2) throws Throwable { return convert_D(invoker.<double>invoke(target, a0, a1, a2)); }
+        protected Object invoke_L3(Object a0, Object a1, Object a2) throws Throwable { return convert_L(invoker.<Object>invokeExact(target, a0, a1, a2)); }
+        protected Object invoke_I3(Object a0, Object a1, Object a2) throws Throwable { return convert_I(invoker.<int   >invokeExact(target, a0, a1, a2)); }
+        protected Object invoke_J3(Object a0, Object a1, Object a2) throws Throwable { return convert_J(invoker.<long  >invokeExact(target, a0, a1, a2)); }
+        protected Object invoke_F3(Object a0, Object a1, Object a2) throws Throwable { return convert_F(invoker.<float >invokeExact(target, a0, a1, a2)); }
+        protected Object invoke_D3(Object a0, Object a1, Object a2) throws Throwable { return convert_D(invoker.<double>invokeExact(target, a0, a1, a2)); }
     }
     static class A4 extends Adapter {
         protected A4(MethodHandle entryPoint) { super(entryPoint); }  // to build prototype
@@ -551,11 +551,11 @@
                         { 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(invoker.<Object>invoke(target, a0, a1, a2, a3)); }
-        protected Object invoke_I4(Object a0, Object a1, Object a2, Object a3) throws Throwable { return convert_I(invoker.<int   >invoke(target, a0, a1, a2, a3)); }
-        protected Object invoke_J4(Object a0, Object a1, Object a2, Object a3) throws Throwable { return convert_J(invoker.<long  >invoke(target, a0, a1, a2, a3)); }
-        protected Object invoke_F4(Object a0, Object a1, Object a2, Object a3) throws Throwable { return convert_F(invoker.<float >invoke(target, a0, a1, a2, a3)); }
-        protected Object invoke_D4(Object a0, Object a1, Object a2, Object a3) throws Throwable { return convert_D(invoker.<double>invoke(target, a0, a1, a2, a3)); }
+        protected Object invoke_L4(Object a0, Object a1, Object a2, Object a3) throws Throwable { return convert_L(invoker.<Object>invokeExact(target, a0, a1, a2, a3)); }
+        protected Object invoke_I4(Object a0, Object a1, Object a2, Object a3) throws Throwable { return convert_I(invoker.<int   >invokeExact(target, a0, a1, a2, a3)); }
+        protected Object invoke_J4(Object a0, Object a1, Object a2, Object a3) throws Throwable { return convert_J(invoker.<long  >invokeExact(target, a0, a1, a2, a3)); }
+        protected Object invoke_F4(Object a0, Object a1, Object a2, Object a3) throws Throwable { return convert_F(invoker.<float >invokeExact(target, a0, a1, a2, a3)); }
+        protected Object invoke_D4(Object a0, Object a1, Object a2, Object a3) throws Throwable { return convert_D(invoker.<double>invokeExact(target, a0, a1, a2, a3)); }
     }
     static class A5 extends Adapter {
         protected A5(MethodHandle entryPoint) { super(entryPoint); }  // to build prototype
@@ -563,11 +563,11 @@
                         { 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(invoker.<Object>invoke(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(invoker.<int   >invoke(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(invoker.<long  >invoke(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(invoker.<float >invoke(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(invoker.<double>invoke(target, a0, a1, a2, a3, a4)); }
+        protected Object invoke_L5(Object a0, Object a1, Object a2, Object a3, Object a4) throws Throwable { return convert_L(invoker.<Object>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(invoker.<int   >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(invoker.<long  >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(invoker.<float >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(invoker.<double>invokeExact(target, a0, a1, a2, a3, a4)); }
     }
     static class A6 extends Adapter {
         protected A6(MethodHandle entryPoint) { super(entryPoint); }  // to build prototype
@@ -575,11 +575,11 @@
                         { 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(invoker.<Object>invoke(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(invoker.<int   >invoke(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(invoker.<long  >invoke(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(invoker.<float >invoke(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(invoker.<double>invoke(target, a0, a1, a2, a3, a4, a5)); }
+        protected Object invoke_L6(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5) throws Throwable { return convert_L(invoker.<Object>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(invoker.<int   >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(invoker.<long  >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(invoker.<float >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(invoker.<double>invokeExact(target, a0, a1, a2, a3, a4, a5)); }
     }
     static class A7 extends Adapter {
         protected A7(MethodHandle entryPoint) { super(entryPoint); }  // to build prototype
@@ -587,11 +587,11 @@
                         { 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(invoker.<Object>invoke(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(invoker.<int   >invoke(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(invoker.<long  >invoke(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(invoker.<float >invoke(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(invoker.<double>invoke(target, a0, a1, a2, a3, a4, a5, a6)); }
+        protected Object invoke_L7(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6) throws Throwable { return convert_L(invoker.<Object>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(invoker.<int   >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(invoker.<long  >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(invoker.<float >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(invoker.<double>invokeExact(target, a0, a1, a2, a3, a4, a5, a6)); }
     }
     static class A8 extends Adapter {
         protected A8(MethodHandle entryPoint) { super(entryPoint); }  // to build prototype
@@ -599,11 +599,11 @@
                         { 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(invoker.<Object>invoke(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(invoker.<int   >invoke(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(invoker.<long  >invoke(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(invoker.<float >invoke(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(invoker.<double>invoke(target, a0, a1, a2, a3, a4, a5, a6, a7)); }
+        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(invoker.<Object>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(invoker.<int   >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(invoker.<long  >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(invoker.<float >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(invoker.<double>invokeExact(target, a0, a1, a2, a3, a4, a5, a6, a7)); }
     }
     static class A9 extends Adapter {
         protected A9(MethodHandle entryPoint) { super(entryPoint); }  // to build prototype
@@ -611,11 +611,11 @@
                         { 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(invoker.<Object>invoke(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(invoker.<int   >invoke(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(invoker.<long  >invoke(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(invoker.<float >invoke(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(invoker.<double>invoke(target, a0, a1, a2, a3, a4, a5, a6, a7, a8)); }
+        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(invoker.<Object>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(invoker.<int   >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(invoker.<long  >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(invoker.<float >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(invoker.<double>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
@@ -623,10 +623,10 @@
                         { 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(invoker.<Object>invoke(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(invoker.<int   >invoke(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(invoker.<long  >invoke(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(invoker.<float >invoke(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(invoker.<double>invoke(target, a0, a1, a2, a3, a4, a5, a6, a7, a8, a9)); }
+        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(invoker.<Object>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(invoker.<int   >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(invoker.<long  >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(invoker.<float >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(invoker.<double>invokeExact(target, a0, a1, a2, a3, a4, a5, a6, a7, a8, a9)); }
     }
 }
--- a/jdk/src/share/classes/sun/dyn/MemberName.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/share/classes/sun/dyn/MemberName.java	Wed Jul 21 09:57:21 2010 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2008, 2009, Oracle and/or its affiliates. All rights reserved.
+ * 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
@@ -40,15 +40,29 @@
 import static sun.dyn.MethodHandleNatives.Constants.*;
 
 /**
- * Compact information which fully characterizes a method or field reference.
- * When resolved, it includes a direct pointer to JVM metadata.
+ * A {@code MemberName} is a compact symbolic datum which fully characterizes
+ * a method or field reference.
+ * A member name refers to a field, method, constructor, or member type.
+ * Every member name has a simple name (a string) and a type (either a Class or MethodType).
+ * A member name may also have a non-null declaring class, or it may be simply
+ * a naked name/type pair.
+ * A member name may also have non-zero modifier flags.
+ * Finally, a member name may be either resolved or unresolved.
+ * If it is resolved, the existence of the named
+ * <p>
+ * Whether resolved or not, a member name provides no access rights or
+ * invocation capability to its possessor.  It is merely a compact
+ * representation of all symbolic information necessary to link to
+ * and properly use the named member.
+ * <p>
+ * When resolved, a member name's internal implementation may include references to JVM metadata.
  * This representation is stateless and only decriptive.
  * It provides no private information and no capability to use the member.
  * <p>
- * By contrast, a java.lang.reflect.Method contains fuller information
+ * By contrast, a {@linkplain java.lang.reflect.Method} contains fuller information
  * about the internals of a method (except its bytecodes) and also
- * allows invocation.  A MemberName is much lighter than a reflect.Method,
- * since it contains about 7 fields to Method's 16 (plus its sub-arrays),
+ * allows invocation.  A MemberName is much lighter than a Method,
+ * since it contains about 7 fields to the 16 of Method (plus its sub-arrays),
  * and those seven fields omit much of the information in Method.
  * @author jrose
  */
@@ -63,6 +77,9 @@
 
     { vmindex = VM_INDEX_UNINITIALIZED; }
 
+    /** 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();
@@ -70,10 +87,16 @@
         return clazz;
     }
 
+    /** Utility method producing the class loader of the declaring class. */
     public ClassLoader getClassLoader() {
         return clazz.getClassLoader();
     }
 
+    /** Return the simple name of this member.
+     *  For a type, it is the same as {@link Class#getSimpleName}.
+     *  For a method or field, it is the simple name of the member.
+     *  For a constructor, it is always {@code "&lt;init&gt;"}.
+     */
     public String getName() {
         if (name == null) {
             expandFromVM();
@@ -82,6 +105,9 @@
         return name;
     }
 
+    /** Return the declared type of this member, which
+     *  must be a method or constructor.
+     */
     public MethodType getMethodType() {
         if (type == null) {
             expandFromVM();
@@ -109,6 +135,10 @@
         throw new InternalError("bad method type "+type);
     }
 
+    /** Return the actual type under which this method or constructor must be invoked.
+     *  For non-static methods or constructors, this is the type with a leading parameter,
+     *  a reference to declaring class.  For static methods, it is the same as the declared type.
+     */
     public MethodType getInvocationType() {
         MethodType itype = getMethodType();
         if (!isStatic())
@@ -116,14 +146,20 @@
         return itype;
     }
 
+    /** Utility method producing the parameter types of the method type. */
     public Class<?>[] getParameterTypes() {
         return getMethodType().parameterArray();
     }
 
+    /** Utility method producing the return type of the method type. */
     public Class<?> getReturnType() {
         return getMethodType().returnType();
     }
 
+    /** Return the declared type of this member, which
+     *  must be a field or type.
+     *  If it is a type member, that type itself is returned.
+     */
     public Class<?> getFieldType() {
         if (type == null) {
             expandFromVM();
@@ -144,10 +180,14 @@
         throw new InternalError("bad field type "+type);
     }
 
+    /** Utility method to produce either the method type or field type of this member. */
     public Object getType() {
         return (isInvocable() ? getMethodType() : getFieldType());
     }
 
+    /** Utility method to produce the signature of this member,
+     *  used within the class file format to describe its type.
+     */
     public String getSignature() {
         if (type == null) {
             expandFromVM();
@@ -161,6 +201,9 @@
             return BytecodeDescriptor.unparse(getFieldType());
     }
 
+    /** Return the modifier flags of this member.
+     *  @see java.lang.reflect.Modifier
+     */
     public int getModifiers() {
         return (flags & RECOGNIZED_MODIFIERS);
     }
@@ -180,21 +223,27 @@
         return !testFlags(mask, 0);
     }
 
+    /** Utility method to query the modifier flags of this member. */
     public boolean isStatic() {
         return Modifier.isStatic(flags);
     }
+    /** Utility method to query the modifier flags of this member. */
     public boolean isPublic() {
         return Modifier.isPublic(flags);
     }
+    /** Utility method to query the modifier flags of this member. */
     public boolean isPrivate() {
         return Modifier.isPrivate(flags);
     }
+    /** Utility method to query the modifier flags of this member. */
     public boolean isProtected() {
         return Modifier.isProtected(flags);
     }
+    /** Utility method to query the modifier flags of this member. */
     public boolean isFinal() {
         return Modifier.isFinal(flags);
     }
+    /** Utility method to query the modifier flags of this member. */
     public boolean isAbstract() {
         return Modifier.isAbstract(flags);
     }
@@ -206,12 +255,15 @@
     static final int SYNTHETIC = 0x00001000;
     static final int ANNOTATION= 0x00002000;
     static final int ENUM      = 0x00004000;
+    /** Utility method to query the modifier flags of this member; returns false if the member is not a method. */
     public boolean isBridge() {
         return testAllFlags(IS_METHOD | BRIDGE);
     }
+    /** Utility method to query the modifier flags of this member; returns false if the member is not a method. */
     public boolean isVarargs() {
         return testAllFlags(VARARGS) && isInvocable();
     }
+    /** Utility method to query the modifier flags of this member; returns false if the member is not a method. */
     public boolean isSynthetic() {
         return testAllFlags(SYNTHETIC);
     }
@@ -237,24 +289,31 @@
     static final int IS_FIELD_OR_METHOD = IS_METHOD | IS_FIELD;
     static final int SEARCH_ALL_SUPERS = SEARCH_SUPERCLASSES | SEARCH_INTERFACES;
 
+    /** Utility method to query whether this member is a method or constructor. */
     public boolean isInvocable() {
         return testAnyFlags(IS_INVOCABLE);
     }
+    /** Utility method to query whether this member is a method, constructor, or field. */
     public boolean isFieldOrMethod() {
         return testAnyFlags(IS_FIELD_OR_METHOD);
     }
+    /** Query whether this member is a method. */
     public boolean isMethod() {
         return testAllFlags(IS_METHOD);
     }
+    /** Query whether this member is a constructor. */
     public boolean isConstructor() {
         return testAllFlags(IS_CONSTRUCTOR);
     }
+    /** Query whether this member is a field. */
     public boolean isField() {
         return testAllFlags(IS_FIELD);
     }
+    /** Query whether this member is a type. */
     public boolean isType() {
         return testAllFlags(IS_TYPE);
     }
+    /** Utility method to query whether this member is neither public, private, nor protected. */
     public boolean isPackage() {
         return !testAnyFlags(ALL_ACCESS);
     }
@@ -262,8 +321,8 @@
     /** 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)
-        name.toString();  // null check
-        type.equals(type);  // null check
+        //name.toString();  // null check
+        //type.equals(type);  // null check
         // fill in fields:
         this.clazz = defClass;
         this.name = name;
@@ -285,6 +344,7 @@
         assert((mods & ~RECOGNIZED_MODIFIERS) == 0);
         return flags | mods;
     }
+    /** 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()));
@@ -292,6 +352,7 @@
         MethodHandleNatives.init(this, m);
         assert(isResolved());
     }
+    /** 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()));
@@ -299,12 +360,14 @@
         MethodHandleNatives.init(this, ctor);
         assert(isResolved());
     }
+    /** 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()));
         // fill in vmtarget, vmindex while we have fld in hand:
         MethodHandleNatives.init(this, fld);
         assert(isResolved());
     }
+    /** 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
@@ -326,28 +389,62 @@
     // %%% define equals/hashcode?
 
     // Construction from symbolic parts, for queries:
+    /** Create a field or type name from the given components:  Declaring class, name, type, modifiers.
+     *  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));
     }
+    /** 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);
     }
+    /** 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 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));
     }
+    /** 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) {
         this(defClass, name, type, 0);
     }
 
-    boolean isResolved() {
+    /** Query whether this member name is resolved.
+     *  A resolved member name is one for which the JVM has found
+     *  a method, constructor, field, or type binding corresponding exactly to the name.
+     *  (Document?)
+     */
+    public boolean isResolved() {
         return (vmindex != VM_INDEX_UNINITIALIZED);
     }
 
+    /** Query whether this member name is resolved to a non-static, non-final method.
+     */
     public boolean hasReceiverTypeDispatch() {
         return (isMethod() && getVMIndex(Access.TOKEN) >= 0);
     }
 
+    /** 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"}.
+     *  For methods and constructors, it is {@code "DeclaringClass.name(ptype...)rtype"}.
+     *  If the declaring class is null, the prefix {@code "DeclaringClass."} is omitted.
+     *  If the member is unresolved, a prefix {@code "*."} is prepended.
+     */
     @Override
     public String toString() {
         if (isType())
@@ -360,9 +457,15 @@
             buf.append(getName(clazz));
             buf.append('.');
         }
-        buf.append(getName());
-        if (!isInvocable())  buf.append('/');
-        buf.append(getName(getType()));
+        String name = getName();
+        buf.append(name == null ? "*" : name);
+        Object type = getType();
+        if (!isInvocable()) {
+            buf.append('/');
+            buf.append(type == null ? "*" : getName(type));
+        } else {
+            buf.append(type == null ? "(*)*" : getName(type));
+        }
         /*
         buf.append('/');
         // key: Public, private, pRotected, sTatic, Final, sYnchronized,
@@ -374,7 +477,7 @@
         for (int i = 0; i < modChars.length(); i++) {
             if ((flags & (1 << i)) != 0) {
                 char mc = modChars.charAt(i);
-                if (mc != '.')
+                if (mc != '?')
                     buf.append(mc);
             }
         }
@@ -388,6 +491,7 @@
     }
 
     // Queries to the JVM:
+    /** Document? */
     public int getVMIndex(Access token) {
         Access.check(token);
         if (!isResolved())
@@ -411,9 +515,6 @@
     public static NoAccessException newNoAccessException(MemberName name, Class<?> lookupClass) {
         return newNoAccessException("cannot access", name, lookupClass);
     }
-    public static NoAccessException newNoAccessException(MemberName name, MethodHandles.Lookup lookup) {
-        return newNoAccessException(name, lookup.lookupClass());
-    }
     public static NoAccessException newNoAccessException(String message,
             MemberName name, Class<?> lookupClass) {
         message += ": " + name;
@@ -429,6 +530,9 @@
     public static Factory getFactory() {
         return getFactory(Access.getToken());
     }
+    /** A factory type for resolving member names with the help of the VM.
+     *  TBD: Define access-safe public constructors for this factory.
+     */
     public static class Factory {
         private Factory() { } // singleton pattern
         static Factory INSTANCE = new Factory();
@@ -494,6 +598,21 @@
             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);
@@ -504,39 +623,82 @@
             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;
         }
+        /** 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, a {@linkplain NoAccessException} is thrown.
+         *  Otherwise a fresh copy of the given member is returned, with modifier bits filled in.
+         */
         public MemberName resolveOrFail(MemberName m, boolean searchSupers, Class<?> lookupClass) {
             MemberName result = resolveOrNull(m, searchSupers, lookupClass);
             if (result != null)
                 return result;
             throw newNoAccessException(m, lookupClass);
         }
+        /** 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}.
+         *  Inaccessible members are not added to the last.
+         */
         public List<MemberName> getMethods(Class<?> defc, boolean searchSupers,
                 Class<?> lookupClass) {
             return getMethods(defc, searchSupers, null, null, lookupClass);
         }
+        /** Return a list of matching methods defined by the given class.
+         *  Super types are searched (for inherited members) if {@code searchSupers} is true.
+         *  Returned methods will match the name (if not null) and the type (if not null).
+         *  Access checking is performed on behalf of the given {@code lookupClass}.
+         *  Inaccessible members are not added to the last.
+         */
         public List<MemberName> getMethods(Class<?> defc, boolean searchSupers,
                 String name, MethodType type, Class<?> lookupClass) {
             int matchFlags = IS_METHOD | (searchSupers ? SEARCH_ALL_SUPERS : 0);
             return getMembers(defc, name, type, matchFlags, lookupClass);
         }
+        /** Return a list of all constructors defined by the given class.
+         *  Access checking is performed on behalf of the given {@code lookupClass}.
+         *  Inaccessible members are not added to the last.
+         */
         public List<MemberName> getConstructors(Class<?> defc, Class<?> lookupClass) {
             return getMembers(defc, null, null, IS_CONSTRUCTOR, lookupClass);
         }
+        /** Return a list of all fields 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}.
+         *  Inaccessible members are not added to the last.
+         */
         public List<MemberName> getFields(Class<?> defc, boolean searchSupers,
                 Class<?> lookupClass) {
             return getFields(defc, searchSupers, null, null, lookupClass);
         }
+        /** Return a list of all fields defined by the given class.
+         *  Super types are searched (for inherited members) if {@code searchSupers} is true.
+         *  Returned fields will match the name (if not null) and the type (if not null).
+         *  Access checking is performed on behalf of the given {@code lookupClass}.
+         *  Inaccessible members are not added to the last.
+         */
         public List<MemberName> getFields(Class<?> defc, boolean searchSupers,
                 String name, Class<?> type, Class<?> lookupClass) {
             int matchFlags = IS_FIELD | (searchSupers ? SEARCH_ALL_SUPERS : 0);
             return getMembers(defc, name, type, matchFlags, lookupClass);
         }
+        /** Return a list of all nested types 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}.
+         *  Inaccessible members are not added to the last.
+         */
         public List<MemberName> getNestedTypes(Class<?> defc, boolean searchSupers,
                 Class<?> lookupClass) {
             int matchFlags = IS_TYPE | (searchSupers ? SEARCH_ALL_SUPERS : 0);
--- a/jdk/src/share/classes/sun/dyn/MethodHandleImpl.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/share/classes/sun/dyn/MethodHandleImpl.java	Wed Jul 21 09:57:21 2010 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2008, 2009, Oracle and/or its affiliates. All rights reserved.
+ * 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
@@ -127,7 +127,7 @@
 
     public static void initLookup(Access token, Lookup lookup) {
         Access.check(token);
-        if (IMPL_LOOKUP_INIT != null || lookup.lookupClass() != null)
+        if (IMPL_LOOKUP_INIT != null)
             throw new InternalError();
         IMPL_LOOKUP_INIT = lookup;
     }
@@ -176,28 +176,164 @@
             boolean doDispatch, Class<?> lookupClass) {
         Access.check(token);  // only trusted calls
         MethodType mtype = method.getMethodType();
-        MethodType rtype = mtype;
-        if (method.isStatic()) {
-            doDispatch = false;
-        } else {
+        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);
-            if (method.isConstructor())
-                doDispatch = true;
-            // FIXME: JVM has trouble building MH.invoke sites for
-            // classes off the boot class path
-            rtype = mtype;
-            if (recvType.getClassLoader() != null)
-                rtype = rtype.changeParameterType(0, Object.class);
         }
         DirectMethodHandle mh = new DirectMethodHandle(mtype, method, doDispatch, lookupClass);
         if (!mh.isValid())
             throw newNoAccessException(method, lookupClass);
-        MethodHandle rmh = AdapterMethodHandle.makePairwiseConvert(token, rtype, mh);
-        if (rmh == null)  throw new InternalError();
-        return rmh;
+        assert(mh.type() == mtype);
+        return mh;
+    }
+
+    public static
+    MethodHandle makeAllocator(Access token, MethodHandle rawConstructor) {
+        Access.check(token);
+        MethodType rawConType = rawConstructor.type();
+        // Wrap the raw (unsafe) constructor with the allocation of a suitable object.
+        MethodHandle allocator
+            = AllocateObject.make(token, rawConType.parameterType(0), rawConstructor);
+        assert(allocator.type()
+               .equals(rawConType.dropParameterTypes(0, 1).changeReturnType(rawConType.parameterType(0))));
+        return allocator;
+    }
+
+    static final class AllocateObject<C> extends JavaMethodHandle {
+        private static final Unsafe unsafe = Unsafe.getUnsafe();
+
+        private final Class<C> allocateClass;
+        private final MethodHandle rawConstructor;
+
+        private AllocateObject(MethodHandle invoker,
+                               Class<C> allocateClass, MethodHandle rawConstructor) {
+            super(invoker);
+            this.allocateClass = allocateClass;
+            this.rawConstructor = rawConstructor;
+        }
+        static MethodHandle make(Access token,
+                                 Class<?> allocateClass, MethodHandle rawConstructor) {
+            Access.check(token);
+            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(token, rawConstructor, conType, rawConType, null);
+                if (gcon == null)  return null;
+                MethodHandle galloc = new AllocateObject(invoke, allocateClass, gcon);
+                assert(galloc.type() == newType.generic());
+                return convertArguments(token, galloc, newType, galloc.type(), null);
+            } else {
+                MethodHandle invoke = VARARGS_INVOKE;
+                MethodType conType = CON_TYPES[nargs];
+                MethodHandle gcon = spreadArguments(token, rawConstructor, conType, 1);
+                if (gcon == null)  return null;
+                MethodHandle galloc = new AllocateObject(invoke, allocateClass, gcon);
+                return collectArguments(token, galloc, newType, 1, null);
+            }
+        }
+        @Override
+        public String toString() {
+            return allocateClass.getSimpleName();
+        }
+        @SuppressWarnings("unchecked")
+        private C allocate() throws InstantiationException {
+            return (C) unsafe.allocateInstance(allocateClass);
+        }
+        private C invoke_V(Object... av) throws Throwable {
+            C obj = allocate();
+            rawConstructor.<void>invokeExact((Object)obj, av);
+            return obj;
+        }
+        private C invoke_L0() throws Throwable {
+            C obj = allocate();
+            rawConstructor.<void>invokeExact((Object)obj);
+            return obj;
+        }
+        private C invoke_L1(Object a0) throws Throwable {
+            C obj = allocate();
+            rawConstructor.<void>invokeExact((Object)obj, a0);
+            return obj;
+        }
+        private C invoke_L2(Object a0, Object a1) throws Throwable {
+            C obj = allocate();
+            rawConstructor.<void>invokeExact((Object)obj, a0, a1);
+            return obj;
+        }
+        private C invoke_L3(Object a0, Object a1, Object a2) throws Throwable {
+            C obj = allocate();
+            rawConstructor.<void>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.<void>invokeExact((Object)obj, a0, a1, a2, a3);
+            return obj;
+        }
+        private C invoke_L5(Object a0, Object a1, Object a2, Object a3, Object a4) throws Throwable {
+            C obj = allocate();
+            rawConstructor.<void>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.<void>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.<void>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.<void>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 (NoAccessException 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(AllocateObject.class, "invoke_V", MethodType.genericMethodType(0, true));
+            } catch (NoAccessException ex) {
+                throw new InternalError("");
+            }
+        }
+        // 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);
+        }
     }
 
     public static
@@ -469,6 +605,7 @@
                                                 MethodType oldType,
                                                 int[] permutationOrNull) {
         Access.check(token);
+        assert(oldType.parameterCount() == target.type().parameterCount());
         if (permutationOrNull != null) {
             int outargs = oldType.parameterCount(), inargs = newType.parameterCount();
             if (permutationOrNull.length != outargs)
@@ -781,69 +918,93 @@
 
     private static class GuardWithTest extends JavaMethodHandle {
         private final MethodHandle test, target, fallback;
-        public GuardWithTest(MethodHandle test, MethodHandle target, MethodHandle fallback) {
-            this(INVOKES[target.type().parameterCount()], test, target, fallback);
-        }
-        public GuardWithTest(MethodHandle invoker,
-                             MethodHandle test, MethodHandle target, MethodHandle fallback) {
+        private GuardWithTest(MethodHandle invoker,
+                              MethodHandle test, MethodHandle target, MethodHandle fallback) {
             super(invoker);
             this.test = test;
             this.target = target;
             this.fallback = fallback;
         }
+        static MethodHandle make(Access token,
+                                 MethodHandle test, MethodHandle target, MethodHandle fallback) {
+            Access.check(token);
+            MethodType type = target.type();
+            int nargs = type.parameterCount();
+            if (nargs < INVOKES.length) {
+                MethodHandle invoke = INVOKES[nargs];
+                MethodType gtype = type.generic();
+                assert(invoke.type().dropParameterTypes(0,1) == gtype);
+                MethodHandle gtest = convertArguments(token, test, gtype.changeReturnType(boolean.class), test.type(), null);
+                MethodHandle gtarget = convertArguments(token, target, gtype, type, null);
+                MethodHandle gfallback = convertArguments(token, fallback, gtype, type, null);
+                if (gtest == null || gtarget == null || gfallback == null)  return null;
+                MethodHandle gguard = new GuardWithTest(invoke, gtest, gtarget, gfallback);
+                return convertArguments(token, gguard, type, gtype, null);
+            } else {
+                MethodHandle invoke = VARARGS_INVOKE;
+                MethodType gtype = MethodType.genericMethodType(1);
+                assert(invoke.type().dropParameterTypes(0,1) == gtype);
+                MethodHandle gtest = spreadArguments(token, test, gtype.changeReturnType(boolean.class), 0);
+                MethodHandle gtarget = spreadArguments(token, target, gtype, 0);
+                MethodHandle gfallback = spreadArguments(token, fallback, gtype, 0);
+                MethodHandle gguard = new GuardWithTest(invoke, gtest, gtarget, gfallback);
+                if (gtest == null || gtarget == null || gfallback == null)  return null;
+                return collectArguments(token, gguard, type, 0, null);
+            }
+        }
         @Override
         public String toString() {
             return target.toString();
         }
         private Object invoke_V(Object... av) throws Throwable {
-            if (test.<boolean>invoke(av))
-                return target.<Object>invoke(av);
-            return fallback.<Object>invoke(av);
+            if (test.<boolean>invokeExact(av))
+                return target.<Object>invokeExact(av);
+            return fallback.<Object>invokeExact(av);
         }
         private Object invoke_L0() throws Throwable {
-            if (test.<boolean>invoke())
-                return target.<Object>invoke();
-            return fallback.<Object>invoke();
+            if (test.<boolean>invokeExact())
+                return target.<Object>invokeExact();
+            return fallback.<Object>invokeExact();
         }
         private Object invoke_L1(Object a0) throws Throwable {
-            if (test.<boolean>invoke(a0))
-                return target.<Object>invoke(a0);
-            return fallback.<Object>invoke(a0);
+            if (test.<boolean>invokeExact(a0))
+                return target.<Object>invokeExact(a0);
+            return fallback.<Object>invokeExact(a0);
         }
         private Object invoke_L2(Object a0, Object a1) throws Throwable {
-            if (test.<boolean>invoke(a0, a1))
-                return target.<Object>invoke(a0, a1);
-            return fallback.<Object>invoke(a0, a1);
+            if (test.<boolean>invokeExact(a0, a1))
+                return target.<Object>invokeExact(a0, a1);
+            return fallback.<Object>invokeExact(a0, a1);
         }
         private Object invoke_L3(Object a0, Object a1, Object a2) throws Throwable {
-            if (test.<boolean>invoke(a0, a1, a2))
-                return target.<Object>invoke(a0, a1, a2);
-            return fallback.<Object>invoke(a0, a1, a2);
+            if (test.<boolean>invokeExact(a0, a1, a2))
+                return target.<Object>invokeExact(a0, a1, a2);
+            return fallback.<Object>invokeExact(a0, a1, a2);
         }
         private Object invoke_L4(Object a0, Object a1, Object a2, Object a3) throws Throwable {
-            if (test.<boolean>invoke(a0, a1, a2, a3))
-                return target.<Object>invoke(a0, a1, a2, a3);
-            return fallback.<Object>invoke(a0, a1, a2, a3);
+            if (test.<boolean>invokeExact(a0, a1, a2, a3))
+                return target.<Object>invokeExact(a0, a1, a2, a3);
+            return fallback.<Object>invokeExact(a0, a1, a2, a3);
         }
         private Object invoke_L5(Object a0, Object a1, Object a2, Object a3, Object a4) throws Throwable {
-            if (test.<boolean>invoke(a0, a1, a2, a3, a4))
-                return target.<Object>invoke(a0, a1, a2, a3, a4);
-            return fallback.<Object>invoke(a0, a1, a2, a3, a4);
+            if (test.<boolean>invokeExact(a0, a1, a2, a3, a4))
+                return target.<Object>invokeExact(a0, a1, a2, a3, a4);
+            return fallback.<Object>invokeExact(a0, a1, a2, a3, a4);
         }
         private Object invoke_L6(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5) throws Throwable {
-            if (test.<boolean>invoke(a0, a1, a2, a3, a4, a5))
-                return target.<Object>invoke(a0, a1, a2, a3, a4, a5);
-            return fallback.<Object>invoke(a0, a1, a2, a3, a4, a5);
+            if (test.<boolean>invokeExact(a0, a1, a2, a3, a4, a5))
+                return target.<Object>invokeExact(a0, a1, a2, a3, a4, a5);
+            return fallback.<Object>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 (test.<boolean>invoke(a0, a1, a2, a3, a4, a5, a6))
-                return target.<Object>invoke(a0, a1, a2, a3, a4, a5, a6);
-            return fallback.<Object>invoke(a0, a1, a2, a3, a4, a5, a6);
+            if (test.<boolean>invokeExact(a0, a1, a2, a3, a4, a5, a6))
+                return target.<Object>invokeExact(a0, a1, a2, a3, a4, a5, a6);
+            return fallback.<Object>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 (test.<boolean>invoke(a0, a1, a2, a3, a4, a5, a6, a7))
-                return target.<Object>invoke(a0, a1, a2, a3, a4, a5, a6, a7);
-            return fallback.<Object>invoke(a0, a1, a2, a3, a4, a5, a6, a7);
+            if (test.<boolean>invokeExact(a0, a1, a2, a3, a4, a5, a6, a7))
+                return target.<Object>invokeExact(a0, a1, a2, a3, a4, a5, a6, a7);
+            return fallback.<Object>invokeExact(a0, a1, a2, a3, a4, a5, a6, a7);
         }
         static MethodHandle[] makeInvokes() {
             ArrayList<MethodHandle> invokes = new ArrayList<MethodHandle>();
@@ -880,26 +1041,7 @@
                                    MethodHandle test,
                                    MethodHandle target,
                                    MethodHandle fallback) {
-        Access.check(token);
-        MethodType type = target.type();
-        int nargs = type.parameterCount();
-        if (nargs < GuardWithTest.INVOKES.length) {
-            MethodType gtype = type.generic();
-            MethodHandle gtest = convertArguments(token, test, gtype.changeReturnType(boolean.class), test.type(), null);
-            MethodHandle gtarget = convertArguments(token, target, gtype, type, null);
-            MethodHandle gfallback = convertArguments(token, fallback, gtype, type, null);
-            if (gtest == null || gtarget == null || gfallback == null)  return null;
-            MethodHandle gguard = new GuardWithTest(gtest, gtarget, gfallback);
-            return convertArguments(token, gguard, type, gtype, null);
-        } else {
-            MethodType gtype = MethodType.genericMethodType(0, true);
-            MethodHandle gtest = spreadArguments(token, test, gtype.changeReturnType(boolean.class), 0);
-            MethodHandle gtarget = spreadArguments(token, target, gtype, 0);
-            MethodHandle gfallback = spreadArguments(token, fallback, gtype, 0);
-            MethodHandle gguard = new GuardWithTest(GuardWithTest.VARARGS_INVOKE, gtest, gtarget, gfallback);
-            if (gtest == null || gtarget == null || gfallback == null)  return null;
-            return collectArguments(token, gguard, type, 0, null);
-        }
+        return GuardWithTest.make(token, test, target, fallback);
     }
 
     private static class GuardWithCatch extends JavaMethodHandle {
@@ -922,82 +1064,82 @@
         }
         private Object invoke_V(Object... av) throws Throwable {
             try {
-                return target.<Object>invoke(av);
+                return target.<Object>invokeExact(av);
             } catch (Throwable t) {
                 if (!exType.isInstance(t))  throw t;
-                return catcher.<Object>invoke(t, av);
+                return catcher.<Object>invokeExact(t, av);
             }
         }
         private Object invoke_L0() throws Throwable {
             try {
-                return target.<Object>invoke();
+                return target.<Object>invokeExact();
             } catch (Throwable t) {
                 if (!exType.isInstance(t))  throw t;
-                return catcher.<Object>invoke(t);
+                return catcher.<Object>invokeExact(t);
             }
         }
         private Object invoke_L1(Object a0) throws Throwable {
             try {
-                return target.<Object>invoke(a0);
+                return target.<Object>invokeExact(a0);
             } catch (Throwable t) {
                 if (!exType.isInstance(t))  throw t;
-                return catcher.<Object>invoke(t, a0);
+                return catcher.<Object>invokeExact(t, a0);
             }
         }
         private Object invoke_L2(Object a0, Object a1) throws Throwable {
             try {
-                return target.<Object>invoke(a0, a1);
+                return target.<Object>invokeExact(a0, a1);
             } catch (Throwable t) {
                 if (!exType.isInstance(t))  throw t;
-                return catcher.<Object>invoke(t, a0, a1);
+                return catcher.<Object>invokeExact(t, a0, a1);
             }
         }
         private Object invoke_L3(Object a0, Object a1, Object a2) throws Throwable {
             try {
-                return target.<Object>invoke(a0, a1, a2);
+                return target.<Object>invokeExact(a0, a1, a2);
             } catch (Throwable t) {
                 if (!exType.isInstance(t))  throw t;
-                return catcher.<Object>invoke(t, a0, a1, a2);
+                return catcher.<Object>invokeExact(t, a0, a1, a2);
             }
         }
         private Object invoke_L4(Object a0, Object a1, Object a2, Object a3) throws Throwable {
             try {
-                return target.<Object>invoke(a0, a1, a2, a3);
+                return target.<Object>invokeExact(a0, a1, a2, a3);
             } catch (Throwable t) {
                 if (!exType.isInstance(t))  throw t;
-                return catcher.<Object>invoke(t, a0, a1, a2, a3);
+                return catcher.<Object>invokeExact(t, a0, a1, a2, a3);
             }
         }
         private Object invoke_L5(Object a0, Object a1, Object a2, Object a3, Object a4) throws Throwable {
             try {
-                return target.<Object>invoke(a0, a1, a2, a3, a4);
+                return target.<Object>invokeExact(a0, a1, a2, a3, a4);
             } catch (Throwable t) {
                 if (!exType.isInstance(t))  throw t;
-                return catcher.<Object>invoke(t, a0, a1, a2, a3, a4);
+                return catcher.<Object>invokeExact(t, a0, a1, a2, a3, a4);
             }
         }
         private Object invoke_L6(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5) throws Throwable {
             try {
-                return target.<Object>invoke(a0, a1, a2, a3, a4, a5);
+                return target.<Object>invokeExact(a0, a1, a2, a3, a4, a5);
             } catch (Throwable t) {
                 if (!exType.isInstance(t))  throw t;
-                return catcher.<Object>invoke(t, a0, a1, a2, a3, a4, a5);
+                return catcher.<Object>invokeExact(t, 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 {
             try {
-                return target.<Object>invoke(a0, a1, a2, a3, a4, a5, a6);
+                return target.<Object>invokeExact(a0, a1, a2, a3, a4, a5, a6);
             } catch (Throwable t) {
                 if (!exType.isInstance(t))  throw t;
-                return catcher.<Object>invoke(t, a0, a1, a2, a3, a4, a5, a6);
+                return catcher.<Object>invokeExact(t, 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 {
             try {
-                return target.<Object>invoke(a0, a1, a2, a3, a4, a5, a6, a7);
+                return target.<Object>invokeExact(a0, a1, a2, a3, a4, a5, a6, a7);
             } catch (Throwable t) {
                 if (!exType.isInstance(t))  throw t;
-                return catcher.<Object>invoke(t, a0, a1, a2, a3, a4, a5, a6, a7);
+                return catcher.<Object>invokeExact(t, a0, a1, a2, a3, a4, a5, a6, a7);
             }
         }
         static MethodHandle[] makeInvokes() {
@@ -1106,4 +1248,14 @@
             throw new InternalError("unexpected code "+code+": "+message);
         }
     }
+
+    // Linkage support:
+    public static void registerBootstrap(Access token, Class<?> callerClass, MethodHandle bootstrapMethod) {
+        Access.check(token);
+        MethodHandleNatives.registerBootstrap(callerClass, bootstrapMethod);
+    }
+    public static MethodHandle getBootstrap(Access token, Class<?> callerClass) {
+        Access.check(token);
+        return MethodHandleNatives.getBootstrap(callerClass);
+    }
 }
--- a/jdk/src/share/classes/sun/dyn/MethodHandleNatives.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/share/classes/sun/dyn/MethodHandleNatives.java	Wed Jul 21 09:57:21 2010 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2008, 2009, Oracle and/or its affiliates. All rights reserved.
+ * 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
@@ -28,12 +28,16 @@
 import java.dyn.CallSite;
 import java.dyn.MethodHandle;
 import java.dyn.MethodType;
+import java.dyn.MethodHandles.Lookup;
 import java.lang.reflect.AccessibleObject;
 import java.lang.reflect.Field;
 import static sun.dyn.MethodHandleNatives.Constants.*;
+import static sun.dyn.MethodHandleImpl.IMPL_LOOKUP;
 
 /**
  * The JVM interface for the method handles package is all here.
+ * 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
  */
 class MethodHandleNatives {
@@ -60,8 +64,14 @@
     /** Initialize a method type, once per form. */
     static native void init(MethodType self);
 
+    /** Tell the JVM about a class's bootstrap method. */
+    static native void registerBootstrap(Class<?> caller, MethodHandle bootstrapMethod);
+
+    /** Ask the JVM about a class's bootstrap method. */
+    static native MethodHandle getBootstrap(Class<?> caller);
+
     /** Tell the JVM that we need to change the target of an invokedynamic. */
-    static native void linkCallSite(CallSite site, MethodHandle target);
+    static native void setCallSiteTarget(CallSite site, MethodHandle target);
 
     /** Fetch the vmtarget field.
      *  It will be sanitized as necessary to avoid exposing non-Java references.
@@ -114,22 +124,28 @@
      */
     static final int JVM_STACK_MOVE_UNIT;
 
+    /** Which conv-ops are implemented by the JVM? */
+    static final int CONV_OP_IMPLEMENTED_MASK;
+
     private static native void registerNatives();
     static {
         boolean JVM_SUPPORT_;
         int     JVM_PUSH_LIMIT_;
         int     JVM_STACK_MOVE_UNIT_;
+        int     CONV_OP_IMPLEMENTED_MASK_;
         try {
             registerNatives();
             JVM_SUPPORT_ = true;
             JVM_PUSH_LIMIT_ = getConstant(Constants.GC_JVM_PUSH_LIMIT);
             JVM_STACK_MOVE_UNIT_ = getConstant(Constants.GC_JVM_STACK_MOVE_UNIT);
+            CONV_OP_IMPLEMENTED_MASK_ = getConstant(Constants.GC_CONV_OP_IMPLEMENTED_MASK);
             //sun.reflect.Reflection.registerMethodsToFilter(MethodHandleImpl.class, "init");
         } catch (UnsatisfiedLinkError ee) {
             // ignore; if we use init() methods later we'll see linkage errors
             JVM_SUPPORT_ = false;
             JVM_PUSH_LIMIT_ = 3;  // arbitrary
             JVM_STACK_MOVE_UNIT_ = -1;  // arbitrary
+            CONV_OP_IMPLEMENTED_MASK_ = 0;
             //System.out.println("Warning: Running with JVM_SUPPORT=false");
             //System.out.println(ee);
             JVM_SUPPORT = JVM_SUPPORT_;
@@ -140,6 +156,9 @@
         JVM_SUPPORT = JVM_SUPPORT_;
         JVM_PUSH_LIMIT = JVM_PUSH_LIMIT_;
         JVM_STACK_MOVE_UNIT = JVM_STACK_MOVE_UNIT_;
+        if (CONV_OP_IMPLEMENTED_MASK_ == 0)
+            CONV_OP_IMPLEMENTED_MASK_ = DEFAULT_CONV_OP_IMPLEMENTED_MASK;
+        CONV_OP_IMPLEMENTED_MASK = CONV_OP_IMPLEMENTED_MASK_;
     }
 
     // All compile-time constants go here.
@@ -149,7 +168,8 @@
         // MethodHandleImpl
         static final int // for getConstant
                 GC_JVM_PUSH_LIMIT = 0,
-                GC_JVM_STACK_MOVE_UNIT = 1;
+                GC_JVM_STACK_MOVE_UNIT = 1,
+                GC_CONV_OP_IMPLEMENTED_MASK = 2;
         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)
@@ -206,9 +226,8 @@
             CONV_STACK_MOVE_MASK  = (1 << (32 - CONV_STACK_MOVE_SHIFT)) - 1;
 
         /** Which conv-ops are implemented by the JVM? */
-        static final int CONV_OP_IMPLEMENTED_MASK =
-                // TODO: The following expression should be replaced by
-                // a JVM query.
+        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)
@@ -218,7 +237,7 @@
                 |(1<<OP_ROT_ARGS)
                 |(1<<OP_DUP_ARGS)
                 |(1<<OP_DROP_ARGS)
-                //|(1<<OP_SPREAD_ARGS) // FIXME: Check JVM assembly code.
+                //|(1<<OP_SPREAD_ARGS)
                 );
 
         /**
@@ -239,6 +258,20 @@
             //T_ARRAY    = 13
             T_VOID     = 14;
             //T_ADDRESS  = 15
+
+        /**
+         * Constant pool reference-kind codes, as used by CONSTANT_MethodHandle CP entries.
+         */
+        static final int
+            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;
     }
 
     private static native int getNamedCon(int which, Object[] name);
@@ -263,4 +296,46 @@
     static {
         if (JVM_SUPPORT)  verifyConstants();
     }
+
+    // Up-calls from the JVM.
+    // These must NOT be public.
+
+    /**
+     * 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 CallSiteImpl.makeSite(bootstrapMethod, name, type, info, callerMethod, callerBCI);
+    }
+
+    /**
+     * The JVM wants a pointer to a MethodType.  Oblige it by finding or creating one.
+     */
+    static MethodType findMethodHandleType(Class<?> rtype, Class<?>[] ptypes) {
+        MethodType.genericMethodType(0);  // trigger initialization
+        return MethodTypeImpl.makeImpl(Access.TOKEN, rtype, ptypes, true);
+    }
+
+    /**
+     * 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.)
+     */
+    static MethodHandle linkMethodHandleConstant(Class<?> callerClass, int refKind,
+                                                 Class<?> defc, String name, Object type) {
+        Lookup lookup = IMPL_LOOKUP.in(callerClass);
+        switch (refKind) {
+        case REF_getField:          return lookup.findGetter(       defc, name, (Class<?>)   type );
+        case REF_getStatic:         return lookup.findStaticGetter( defc, name, (Class<?>)   type );
+        case REF_putField:          return lookup.findSetter(       defc, name, (Class<?>)   type );
+        case REF_putStatic:         return lookup.findStaticSetter( defc, name, (Class<?>)   type );
+        case REF_invokeVirtual:     return lookup.findVirtual(      defc, name, (MethodType) type );
+        case REF_invokeStatic:      return lookup.findStatic(       defc, name, (MethodType) type );
+        case REF_invokeSpecial:     return lookup.findSpecial(      defc, name, (MethodType) type, callerClass );
+        case REF_newInvokeSpecial:  return lookup.findConstructor(  defc,       (MethodType) type );
+        case REF_invokeInterface:   return lookup.findVirtual(      defc, name, (MethodType) type );
+        }
+        throw new IllegalArgumentException("bad MethodHandle constant "+name+" : "+type);
+    }
 }
--- a/jdk/src/share/classes/sun/dyn/MethodTypeImpl.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/share/classes/sun/dyn/MethodTypeImpl.java	Wed Jul 21 09:57:21 2010 -0700
@@ -88,6 +88,11 @@
     }
     static private MethodTypeFriend METHOD_TYPE_FRIEND;
 
+    static MethodType makeImpl(Access token, Class<?> rtype, Class<?>[] ptypes, boolean trusted) {
+        Access.check(token);
+        return METHOD_TYPE_FRIEND.makeImpl(rtype, ptypes, trusted);
+    }
+
     protected MethodTypeImpl(MethodType erasedType) {
         this.erasedType = erasedType;
 
@@ -233,8 +238,10 @@
             return primsAtEnd = t;
 
         // known to have a mix of 2 or 3 of ref, int, long
-        return primsAtEnd = reorderParameters(t, primsAtEndOrder(t), null);
-
+        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
@@ -273,7 +280,8 @@
             else if (!hasTwoArgSlots(pt))      ord = ifill++;
             else                               ord = lfill++;
             if (ord != i)  changed = true;
-            paramOrder[i] = ord;
+            assert(paramOrder[ord] == 0);
+            paramOrder[ord] = i;
         }
         assert(rfill == argc - pac && ifill == argc - lac && lfill == argc);
         if (!changed) {
@@ -292,15 +300,15 @@
         if (newParamOrder == null)  return mt;  // no-op reordering
         Class<?>[] ptypes = METHOD_TYPE_FRIEND.ptypes(mt);
         Class<?>[] ntypes = new Class<?>[newParamOrder.length];
-        int ordMax = ptypes.length + (moreParams == null ? 0 : moreParams.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 ord = newParamOrder[i];
-            if (ord != i)  changed = true;
+            int param = newParamOrder[i];
+            if (param != i)  changed = true;
             Class<?> nt;
-            if (ord < ptypes.length)   nt = ptypes[ord];
-            else if (ord == ordMax)    nt = mt.returnType();
-            else                       nt = moreParams[ord - ptypes.length];
+            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;
--- a/jdk/src/share/classes/sun/dyn/SpreadGeneric.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/share/classes/sun/dyn/SpreadGeneric.java	Wed Jul 21 09:57:21 2010 -0700
@@ -281,12 +281,12 @@
         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.<Object>invoke(a0, a1)); }
+             return target.<Object>invokeExact(a0, a1)); }
         protected Object invoke_S1(Object a0, Object av) throws Throwable { av = super.check(av,1);
-             return target.<Object>invoke(a0,
+             return target.<Object>invokeExact(a0,
                 super.select(av,0)); }
         protected Object invoke_S2(Object a0, Object av) throws Throwable { av = super.check(av,1);
-             return target.<Object>invoke(
+             return target.<Object>invokeExact(
                 super.select(av,0), super.select(av,1)); }
     }
     // */
@@ -304,10 +304,10 @@
         "        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.<Object>invoke(@av@); }",
+        "            return target.<Object>invokeExact(@av@); }",
         "        //@each-S@",
         "        protected Object invoke_S@S@(@Tvav,@Object av) throws Throwable { av = super.check(av, @S@);",
-        "            return target.<Object>invoke(@av,@@sv@); }",
+        "            return target.<Object>invokeExact(@av,@@sv@); }",
         "        //@end-S@",
         "    }",
     } };
@@ -418,16 +418,16 @@
         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.<Object>invoke(); }
+            return target.<Object>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.<Object>invoke(a0); }
+            return target.<Object>invokeExact(a0); }
         protected Object invoke_S1(Object av) throws Throwable { av = super.check(av, 1);
-            return target.<Object>invoke(
+            return target.<Object>invokeExact(
                 super.select(av,0)); }
     }
     static class S2 extends Adapter {
@@ -435,12 +435,12 @@
         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.<Object>invoke(a0, a1); }
+            return target.<Object>invokeExact(a0, a1); }
         protected Object invoke_S1(Object a0, Object av) throws Throwable { av = super.check(av, 1);
-            return target.<Object>invoke(a0,
+            return target.<Object>invokeExact(a0,
                 super.select(av,0)); }
         protected Object invoke_S2(Object av) throws Throwable { av = super.check(av, 2);
-            return target.<Object>invoke(
+            return target.<Object>invokeExact(
                 super.select(av,0), super.select(av,1)); }
     }
     static class S3 extends Adapter {
@@ -448,15 +448,15 @@
         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.<Object>invoke(a0, a1, a2); }
+            return target.<Object>invokeExact(a0, a1, a2); }
         protected Object invoke_S1(Object a0, Object a1, Object av) throws Throwable { av = super.check(av, 1);
-            return target.<Object>invoke(a0, a1,
+            return target.<Object>invokeExact(a0, a1,
                 super.select(av,0)); }
         protected Object invoke_S2(Object a0, Object av) throws Throwable { av = super.check(av, 2);
-            return target.<Object>invoke(a0,
+            return target.<Object>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.<Object>invoke(
+            return target.<Object>invokeExact(
                 super.select(av,0), super.select(av,1), super.select(av,2)); }
     }
     static class S4 extends Adapter {
@@ -464,18 +464,18 @@
         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.<Object>invoke(a0, a1, a2, a3); }
+            return target.<Object>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.<Object>invoke(a0, a1, a2,
+            return target.<Object>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.<Object>invoke(a0, a1,
+            return target.<Object>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.<Object>invoke(a0,
+            return target.<Object>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.<Object>invoke(
+            return target.<Object>invokeExact(
                 super.select(av,0), super.select(av,1), super.select(av,2), super.select(av,3)); }
     }
     static class S5 extends Adapter {
@@ -483,21 +483,21 @@
         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.<Object>invoke(a0, a1, a2, a3, a4); }
+            return target.<Object>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.<Object>invoke(a0, a1, a2, a3,
+            return target.<Object>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.<Object>invoke(a0, a1, a2,
+            return target.<Object>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.<Object>invoke(a0, a1,
+            return target.<Object>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.<Object>invoke(a0,
+            return target.<Object>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.<Object>invoke(
+            return target.<Object>invokeExact(
                 super.select(av,0), super.select(av,1), super.select(av,2), super.select(av,3),
                 super.select(av,4)); }
     }
@@ -506,25 +506,25 @@
         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.<Object>invoke(a0, a1, a2, a3, a4, a5); }
+            return target.<Object>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.<Object>invoke(a0, a1, a2, a3, a4,
+            return target.<Object>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.<Object>invoke(a0, a1, a2, a3,
+            return target.<Object>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.<Object>invoke(a0, a1, a2,
+            return target.<Object>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.<Object>invoke(a0, a1,
+            return target.<Object>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.<Object>invoke(a0,
+            return target.<Object>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.<Object>invoke(
+            return target.<Object>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)); }
     }
@@ -533,29 +533,29 @@
         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.<Object>invoke(a0, a1, a2, a3, a4, a5, a6); }
+            return target.<Object>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.<Object>invoke(a0, a1, a2, a3, a4, a5,
+            return target.<Object>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.<Object>invoke(a0, a1, a2, a3, a4,
+            return target.<Object>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.<Object>invoke(a0, a1, a2, a3,
+            return target.<Object>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.<Object>invoke(a0, a1, a2,
+            return target.<Object>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.<Object>invoke(a0, a1,
+            return target.<Object>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.<Object>invoke(a0,
+            return target.<Object>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.<Object>invoke(
+            return target.<Object>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)); }
     }
@@ -564,33 +564,33 @@
         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.<Object>invoke(a0, a1, a2, a3, a4, a5, a6, a7); }
+            return target.<Object>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.<Object>invoke(a0, a1, a2, a3, a4, a5, a6,
+            return target.<Object>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.<Object>invoke(a0, a1, a2, a3, a4, a5,
+            return target.<Object>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.<Object>invoke(a0, a1, a2, a3, a4,
+            return target.<Object>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.<Object>invoke(a0, a1, a2, a3,
+            return target.<Object>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.<Object>invoke(a0, a1, a2,
+            return target.<Object>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.<Object>invoke(a0, a1,
+            return target.<Object>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.<Object>invoke(a0,
+            return target.<Object>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.<Object>invoke(
+            return target.<Object>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)); }
     }
@@ -599,37 +599,37 @@
         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.<Object>invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8); }
+            return target.<Object>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.<Object>invoke(a0, a1, a2, a3, a4, a5, a6, a7,
+            return target.<Object>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.<Object>invoke(a0, a1, a2, a3, a4, a5, a6,
+            return target.<Object>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.<Object>invoke(a0, a1, a2, a3, a4, a5,
+            return target.<Object>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.<Object>invoke(a0, a1, a2, a3, a4,
+            return target.<Object>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.<Object>invoke(a0, a1, a2, a3,
+            return target.<Object>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.<Object>invoke(a0, a1, a2,
+            return target.<Object>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.<Object>invoke(a0, a1,
+            return target.<Object>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.<Object>invoke(a0,
+            return target.<Object>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.<Object>invoke(
+            return target.<Object>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)); }
@@ -639,42 +639,42 @@
         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.<Object>invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9); }
+            return target.<Object>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.<Object>invoke(a0, a1, a2, a3, a4, a5, a6, a7, a8,
+            return target.<Object>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.<Object>invoke(a0, a1, a2, a3, a4, a5, a6, a7,
+            return target.<Object>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.<Object>invoke(a0, a1, a2, a3, a4, a5, a6,
+            return target.<Object>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.<Object>invoke(a0, a1, a2, a3, a4, a5,
+            return target.<Object>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.<Object>invoke(a0, a1, a2, a3, a4,
+            return target.<Object>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.<Object>invoke(a0, a1, a2, a3,
+            return target.<Object>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.<Object>invoke(a0, a1, a2,
+            return target.<Object>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.<Object>invoke(a0, a1,
+            return target.<Object>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.<Object>invoke(a0,
+            return target.<Object>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.<Object>invoke(
+            return target.<Object>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/jdk/src/share/classes/sun/dyn/ToGeneric.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/share/classes/sun/dyn/ToGeneric.java	Wed Jul 21 09:57:21 2010 -0700
@@ -99,12 +99,12 @@
             // 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.convertArguments(Access.TOKEN,
                     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.invoke(obj1,obj2,int0)
-            if (true) throw new UnsupportedOperationException("NYI");
+            // and putPAE is (mh,int0,obj1,obj2) => mh.invokeExact(obj1,obj2,int0)
             return;
         }
 
@@ -341,7 +341,7 @@
 
         @Override
         public String toString() {
-            return target.toString();
+            return target == null ? "prototype:"+convert : target.toString();
         }
 
         protected boolean isPrototype() { return target == null; }
@@ -371,33 +371,33 @@
         // { return new ThisType(entryPoint, convert, target); }
 
         // Code to run when the arguments (<= 4) have all been boxed.
-        protected Object target()               throws Throwable { return invoker.<Object>invoke(target); }
-        protected Object target(Object a0)      throws Throwable { return invoker.<Object>invoke(target, a0); }
+        protected Object target()               throws Throwable { return invoker.<Object>invokeExact(target); }
+        protected Object target(Object a0)      throws Throwable { return invoker.<Object>invokeExact(target, a0); }
         protected Object target(Object a0, Object a1)
-                                                throws Throwable { return invoker.<Object>invoke(target, a0, a1); }
+                                                throws Throwable { return invoker.<Object>invokeExact(target, a0, a1); }
         protected Object target(Object a0, Object a1, Object a2)
-                                                throws Throwable { return invoker.<Object>invoke(target, a0, a1, a2); }
+                                                throws Throwable { return invoker.<Object>invokeExact(target, a0, a1, a2); }
         protected Object target(Object a0, Object a1, Object a2, Object a3)
-                                                throws Throwable { return invoker.<Object>invoke(target, a0, a1, a2, a3); }
+                                                throws Throwable { return invoker.<Object>invokeExact(target, a0, a1, a2, a3); }
         /*
-        protected Object target_0(Object... av) throws Throwable { return invoker.<Object>invoke(target, av); }
+        protected Object target_0(Object... av) throws Throwable { return invoker.<Object>invokeExact(target, av); }
         protected Object target_1(Object a0, Object... av)
-                                                throws Throwable { return invoker.<Object>invoke(target, a0, (Object)av); }
+                                                throws Throwable { return invoker.<Object>invokeExact(target, a0, (Object)av); }
         protected Object target_2(Object a0, Object a1, Object... av)
-                                                throws Throwable { return invoker.<Object>invoke(target, a0, a1, (Object)av); }
+                                                throws Throwable { return invoker.<Object>invokeExact(target, a0, a1, (Object)av); }
         protected Object target_3(Object a0, Object a1, Object a2, Object... av)
-                                                throws Throwable { return invoker.<Object>invoke(target, a0, a1, a2, (Object)av); }
+                                                throws Throwable { return invoker.<Object>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.<Object>invoke(target, a0, a1, a2, a3, (Object)av); }
+                                                throws Throwable { return invoker.<Object>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 convert.<Object>invoke(res); }
-        protected int    return_I(Object res) throws Throwable { return convert.<int   >invoke(res); }
-        protected long   return_J(Object res) throws Throwable { return convert.<long  >invoke(res); }
-        protected float  return_F(Object res) throws Throwable { return convert.<float >invoke(res); }
-        protected double return_D(Object res) throws Throwable { return convert.<double>invoke(res); }
+        protected Object return_L(Object res) throws Throwable { return convert.<Object>invokeExact(res); }
+        protected int    return_I(Object res) throws Throwable { return convert.<int   >invokeExact(res); }
+        protected long   return_J(Object res) throws Throwable { return convert.<long  >invokeExact(res); }
+        protected float  return_F(Object res) throws Throwable { return convert.<float >invokeExact(res); }
+        protected double return_D(Object res) throws Throwable { return convert.<double>invokeExact(res); }
 
         static private final String CLASS_PREFIX; // "sun.dyn.ToGeneric$"
         static {
@@ -424,7 +424,7 @@
         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.<Object>invoke(target, a0); }
+        protected Object target(Object a0)   throws Throwable { return invoker.<Object>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); }
@@ -462,7 +462,7 @@
         "        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.<Object>invoke(target, @av@); }",
+        "        protected Object target(@Ovav@)   throws Throwable { return invoker.<Object>invokeExact(target, @av@); }",
         "        //@each-Tv@",
         "        protected Object target@cat@(@Tvav@) throws Throwable { return target(@av@); }",
         "        //@end-Tv@",
@@ -622,7 +622,7 @@
         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.<Object>invoke(target); }
+        protected Object target()   throws Throwable { return invoker.<Object>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()); }
@@ -634,7 +634,7 @@
         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.<Object>invoke(target, a0); }
+        protected Object target(Object a0)   throws Throwable { return invoker.<Object>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); }
@@ -658,7 +658,7 @@
         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.<Object>invoke(target, a0, a1); }
+        protected Object target(Object a0, Object a1)   throws Throwable { return invoker.<Object>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); }
@@ -694,7 +694,7 @@
         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.<Object>invoke(target, a0, a1, a2); }
+        protected Object target(Object a0, Object a1, Object a2)   throws Throwable { return invoker.<Object>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); }
@@ -743,7 +743,7 @@
         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.<Object>invoke(target, a0, a1, a2, a3); }
+        protected Object target(Object a0, Object a1, Object a2, Object a3)   throws Throwable { return invoker.<Object>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); }
@@ -785,7 +785,7 @@
         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.<Object>invoke(target, a0, a1, a2, a3, a4); }
+        protected Object target(Object a0, Object a1, Object a2, Object a3, Object a4)   throws Throwable { return invoker.<Object>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); }
@@ -836,7 +836,7 @@
         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.<Object>invoke(target, a0, a1, a2, a3, a4, a5); }
+        protected Object target(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5)   throws Throwable { return invoker.<Object>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); }
@@ -870,7 +870,7 @@
         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.<Object>invoke(target, a0, a1, a2, a3, a4, a5, a6); }
+        protected Object target(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6)   throws Throwable { return invoker.<Object>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); }
@@ -908,7 +908,7 @@
         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.<Object>invoke(target, a0, a1, a2, a3, a4, a5, a6, a7); }
+        protected Object target(Object a0, Object a1, Object a2, Object a3, Object a4, Object a5, Object a6, Object a7)   throws Throwable { return invoker.<Object>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); }
@@ -950,7 +950,7 @@
         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.<Object>invoke(target, a0, a1, a2, a3, a4, a5, a6, a7, a8); }
+        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.<Object>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); }
@@ -996,7 +996,7 @@
         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.<Object>invoke(target, a0, a1, a2, a3, a4, a5, a6, a7, a8, a9); }
+        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.<Object>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); }
--- a/jdk/src/share/classes/sun/dyn/package-info.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/share/classes/sun/dyn/package-info.java	Wed Jul 21 09:57:21 2010 -0700
@@ -25,10 +25,6 @@
 
 /**
  * Implementation details for JSR 292 RI, package java.dyn.
- * This particular version is specific to Hotspot.
- * There is also a backport version of this sub-package which uses reflection,
- * and can therefore run (slowly) on older versions of Java.
- * Other JVM vendors may create their own versions of this sub-package.
  * @author jrose
  */
 
--- a/jdk/src/share/classes/sun/dyn/util/ValueConversions.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/share/classes/sun/dyn/util/ValueConversions.java	Wed Jul 21 09:57:21 2010 -0700
@@ -655,7 +655,7 @@
         if (nargs < ARRAYS.length)
             return ARRAYS[nargs];
         // else need to spin bytecode or do something else fancy
-        throw new UnsupportedOperationException("NYI");
+        throw new UnsupportedOperationException("NYI: cannot form a varargs array of length "+nargs);
     }
 
     private static final List<Object> NO_ARGS_LIST = Arrays.asList(NO_ARGS_ARRAY);
--- a/jdk/src/share/classes/sun/dyn/util/VerifyAccess.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/share/classes/sun/dyn/util/VerifyAccess.java	Wed Jul 21 09:57:21 2010 -0700
@@ -26,12 +26,12 @@
 package sun.dyn.util;
 
 import java.dyn.LinkagePermission;
-import java.dyn.MethodHandles.Lookup;
 import java.dyn.NoAccessException;
 import java.lang.reflect.Modifier;
 import sun.dyn.MemberName;
 import sun.dyn.MethodHandleImpl;
 import sun.dyn.empty.Empty;
+import static java.lang.reflect.Modifier.*;
 
 /**
  * This class centralizes information about the JVM's linkage access control.
@@ -41,49 +41,105 @@
 
     private VerifyAccess() { }  // cannot instantiate
 
+    private static final int PACKAGE_ONLY = 0;
+    private static final int ALL_ACCESS_MODES = (PUBLIC|PRIVATE|PROTECTED|PACKAGE_ONLY);
+
     /**
-     * Evaluate the JVM linkage rules for access to the given method on behalf of caller.
-     * Return non-null if and only if the given accessing class has at least partial
-     * privileges to invoke the given method.  The return value {@code Object.class}
-     * denotes unlimited privileges.
+     * Evaluate the JVM linkage rules for access to the given method
+     * on behalf of a caller class which proposes to perform the access.
+     * Return true if the caller class has privileges to invoke a method
+     * or access a field with the given properties.
+     * This requires an accessibility check of the referencing class,
+     * plus an accessibility check of the member within the class,
+     * which depends on the member's modifier flags.
      * <p>
-     * Some circumstances require an additional check on the
-     * leading parameter (the receiver) of the method, if it is non-static.
-     * In the case of {@code invokespecial} ({@code isSpecialInvoke} is true),
-     * the leading parameter must be the accessing class or a subclass.
-     * In the case of a call to a {@code protected} method outside the same
-     * package, the same constraint applies.
-     * @param m the proposed callee
-     * @param isSpecialInvoke if true, a non-static method m is checked as if for {@code invokespecial}
+     * The relevant properties include the defining class ({@code defc})
+     * of the member, and its modifier flags ({@code mods}).
+     * Also relevant is the class used to make the initial symbolic reference
+     * to the member ({@code refc}).  If this latter class is not distinguished,
+     * the defining class should be passed for both arguments ({@code defc == refc}).
+     * <h3>JVM Specification, 5.4.4 "Access Control"</h3>
+     * A field or method R is accessible to a class or interface D if
+     * and only if any of the following conditions is true:<ul>
+     * <li>R is public.
+     * <li>R is protected and is declared in a class C, and D is either
+     *     a subclass of C or C itself.  Furthermore, if R is not
+     *     static, then the symbolic reference to R must contain a
+     *     symbolic reference to a class T, such that T is either a
+     *     subclass of D, a superclass of D or D itself.
+     * <li>R is either protected or has default access (that is,
+     *     neither public nor protected nor private), and is declared
+     *     by a class in the same runtime package as D.
+     * <li>R is private and is declared in D.
+     * </ul>
+     * This discussion of access control omits a related restriction
+     * on the target of a protected field access or method invocation
+     * (the target must be of class D or a subtype of D). That
+     * requirement is checked as part of the verification process
+     * (5.4.1); it is not part of link-time access control.
+     * @param refc the class used in the symbolic reference to the proposed member
+     * @param defc the class in which the proposed member is actually defined
+     * @param mods modifier flags for the proposed member
      * @param lookupClass the class for which the access check is being made
-     * @return null if the method is not accessible, else a receiver type constraint, else {@code Object.class}
+     * @return true iff the the accessing class can access such a member
      */
-    public static Class<?> isAccessible(Class<?> defc, int mods,
-            Class<?> lookupClass, boolean isSpecialInvoke) {
-        if (!isAccessible(defc, lookupClass))
-            return null;
-        Class<?> constraint = Object.class;
-        if (isSpecialInvoke && !Modifier.isStatic(mods)) {
-            constraint = lookupClass;
+    public static boolean isMemberAccessible(Class<?> refc,  // symbolic ref class
+                                             Class<?> defc,  // actual def class
+                                             int      mods,  // actual member mods
+                                             Class<?> lookupClass) {
+        // Usually refc and defc are the same, but if they differ, verify them both.
+        if (refc != defc) {
+            if (!isClassAccessible(refc, lookupClass)) {
+                // Note that defc is verified in the switch below.
+                return false;
+            }
+            if ((mods & (ALL_ACCESS_MODES|STATIC)) == (PROTECTED|STATIC)) {
+                // Apply the special rules for refc here.
+                if (!isRelatedClass(refc, lookupClass))
+                    return isSamePackage(defc, lookupClass);
+                // If refc == defc, the call to isPublicSuperClass will do
+                // the whole job, since in that case refc (as defc) will be
+                // a superclass of the lookup class.
+            }
         }
-        if (Modifier.isPublic(mods))
-            return constraint;
-        if (Modifier.isPrivate(mods))
-            return isSamePackageMember(defc, lookupClass) ? constraint : null;
-        if (isSamePackage(defc, lookupClass))
-            return constraint;
-        if (Modifier.isProtected(mods) && defc.isAssignableFrom(lookupClass))
-            return constraint;
-        // else it is private or package scoped, and not close enough
-        return null;
+        switch (mods & ALL_ACCESS_MODES) {
+        case PUBLIC:
+            if (refc != defc)  return true;  // already checked above
+            return isClassAccessible(refc, lookupClass);
+        case PROTECTED:
+            return isSamePackage(defc, lookupClass) || isPublicSuperClass(defc, lookupClass);
+        case PACKAGE_ONLY:
+            return isSamePackage(defc, lookupClass);
+        case PRIVATE:
+            // Loosened rules for privates follows access rules for inner classes.
+            return isSamePackageMember(defc, lookupClass);
+        default:
+            throw new IllegalArgumentException("bad modifiers: "+Modifier.toString(mods));
+        }
+    }
+
+    static boolean isRelatedClass(Class<?> refc, Class<?> lookupClass) {
+        return (refc == lookupClass ||
+                refc.isAssignableFrom(lookupClass) ||
+                lookupClass.isAssignableFrom(refc));
+    }
+
+    static boolean isPublicSuperClass(Class<?> defc, Class<?> lookupClass) {
+        return isPublic(defc.getModifiers()) && defc.isAssignableFrom(lookupClass);
     }
 
     /**
      * Evaluate the JVM linkage rules for access to the given class on behalf of caller.
+     * <h3>JVM Specification, 5.4.4 "Access Control"</h3>
+     * A class or interface C is accessible to a class or interface D
+     * if and only if either of the following conditions are true:<ul>
+     * <li>C is public.
+     * <li>C and D are members of the same runtime package.
+     * </ul>
      */
-    public static boolean isAccessible(Class<?> refc, Class<?> lookupClass) {
+    public static boolean isClassAccessible(Class<?> refc, Class<?> lookupClass) {
         int mods = refc.getModifiers();
-        if (Modifier.isPublic(mods))
+        if (isPublic(mods))
             return true;
         if (isSamePackage(lookupClass, refc))
             return true;
@@ -170,38 +226,4 @@
         if (isSamePackage(requestingClass, subjectClass))  return;
         security.checkPermission(new LinkagePermission(permissionName, requestingClass));
     }
-
-    private static RuntimeException checkNameFailed(MemberName self, Lookup lookup, String comment) {
-        return new NoAccessException("cannot access from "+lookup+": "+self.toString()+": "+comment);
-    }
-    public static void checkName(MemberName self, Lookup lookup) {
-        Class<?> lc = lookup.lookupClass();
-        if (lc == null)  return;  // lookup is privileged
-        Class<?> dc = self.getDeclaringClass();
-        int samepkg = 0;
-        // First check the containing class.  Must be public or local.
-        if (!Modifier.isPublic(dc.getModifiers())) {
-            if (lc != Empty.class)
-                samepkg = (isSamePackage(dc, lc) ? 1 : -1);
-            if (samepkg <= 0)
-                throw checkNameFailed(self, lookup, "class is not public");
-        }
-        // At this point dc is known to be accessible.
-        if (self.isPublic()) {
-            return;
-        } else if (lc == Empty.class) {
-            throw checkNameFailed(self, lookup, "member is not public");
-        } else if (self.isProtected()) {
-            if (dc.isAssignableFrom(lc))  return;
-        } else if (self.isPrivate()) {
-            if (isSamePackageMember(dc, lc))  return;
-            throw checkNameFailed(self, lookup, "member is private");
-        }
-        // Fall-through handles the package-private and protected cases.
-        if (samepkg == 0)
-            samepkg = (isSamePackage(dc, lc) ? 1 : -1);
-        if (samepkg > 0)  return;
-        throw checkNameFailed(self, lookup,
-                self.isProtected() ? "member is protected" : "member is private to package");
-    }
 }
--- a/jdk/src/share/classes/sun/font/FontUtilities.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/share/classes/sun/font/FontUtilities.java	Wed Jul 21 09:57:21 2010 -0700
@@ -60,6 +60,10 @@
 
     static final String LUCIDA_FILE_NAME = "LucidaSansRegular.ttf";
 
+    private static boolean debugFonts = false;
+    private static PlatformLogger logger = null;
+    private static boolean logging;
+
     // This static initializer block figures out the OS constants.
     static {
 
@@ -115,6 +119,25 @@
                 File lucidaFile = new File(jreFontDirName + File.separator
                                            + LUCIDA_FILE_NAME);
                 isOpenJDK = !lucidaFile.exists();
+
+                String debugLevel =
+                    System.getProperty("sun.java2d.debugfonts");
+
+                if (debugLevel != null && !debugLevel.equals("false")) {
+                    debugFonts = true;
+                    logger = PlatformLogger.getLogger("sun.java2d");
+                    if (debugLevel.equals("warning")) {
+                        logger.setLevel(PlatformLogger.WARNING);
+                    } else if (debugLevel.equals("severe")) {
+                        logger.setLevel(PlatformLogger.SEVERE);
+                    }
+                }
+
+                if (debugFonts) {
+                    logger = PlatformLogger.getLogger("sun.java2d");
+                    logging = logger.isEnabled();
+                }
+
                 return null;
             }
         });
@@ -140,32 +163,6 @@
      */
     public static final int MAX_LAYOUT_CHARCODE = 0x206F;
 
-    private static boolean debugFonts = false;
-    private static PlatformLogger logger = null;
-    private static boolean logging;
-
-    static {
-
-        String debugLevel =
-            System.getProperty("sun.java2d.debugfonts");
-
-        if (debugLevel != null && !debugLevel.equals("false")) {
-            debugFonts = true;
-            logger = PlatformLogger.getLogger("sun.java2d");
-            if (debugLevel.equals("warning")) {
-                logger.setLevel(PlatformLogger.WARNING);
-            } else if (debugLevel.equals("severe")) {
-                logger.setLevel(PlatformLogger.SEVERE);
-            }
-        }
-
-        if (debugFonts) {
-            logger = PlatformLogger.getLogger("sun.java2d");
-            logging = logger.isEnabled();
-        }
-
-    }
-
     /**
      * Calls the private getFont2D() method in java.awt.Font objects.
      *
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/src/share/classes/sun/font/GlyphDisposedListener.java	Wed Jul 21 09:57:21 2010 -0700
@@ -0,0 +1,32 @@
+/*
+ * Copyright 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 sun.font;
+
+import java.util.*;
+
+public interface GlyphDisposedListener {
+    public void glyphDisposed(ArrayList<Long> glyphs);
+}
--- a/jdk/src/share/classes/sun/font/StrikeCache.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/share/classes/sun/font/StrikeCache.java	Wed Jul 21 09:57:21 2010 -0700
@@ -31,6 +31,7 @@
 import java.lang.ref.ReferenceQueue;
 import java.lang.ref.SoftReference;
 import java.lang.ref.WeakReference;
+import java.util.*;
 
 import sun.java2d.Disposer;
 import sun.java2d.pipe.BufferedContext;
@@ -66,6 +67,9 @@
 
     static ReferenceQueue refQueue = Disposer.getQueue();
 
+    static ArrayList<GlyphDisposedListener> disposeListeners = new ArrayList<GlyphDisposedListener>(1);
+
+
     /* Reference objects may have their referents cleared when GC chooses.
      * During application client start-up there is typically at least one
      * GC which causes the hotspot VM to clear soft (not just weak) references
@@ -108,6 +112,8 @@
     static int topLeftXOffset;
     static int topLeftYOffset;
     static int pixelDataOffset;
+    static int cacheCellOffset;
+    static int managedOffset;
     static long invisibleGlyphPtr;
 
     /* Native method used to return information used for unsafe
@@ -129,7 +135,7 @@
 
     static {
 
-        long[] nativeInfo = new long[11];
+        long[] nativeInfo = new long[13];
         getGlyphCacheDescription(nativeInfo);
         //Can also get address size from Unsafe class :-
         //nativeAddressSize = unsafe.addressSize();
@@ -144,6 +150,9 @@
         topLeftYOffset    = (int)nativeInfo[8];
         pixelDataOffset   = (int)nativeInfo[9];
         invisibleGlyphPtr = nativeInfo[10];
+        cacheCellOffset = (int) nativeInfo[11];
+        managedOffset = (int) nativeInfo[12];
+
         if (nativeAddressSize < 4) {
             throw new InternalError("Unexpected address size for font data: " +
                                     nativeAddressSize);
@@ -195,10 +204,10 @@
 
     private static final void doDispose(FontStrikeDisposer disposer) {
         if (disposer.intGlyphImages != null) {
-            freeIntMemory(disposer.intGlyphImages,
+            freeCachedIntMemory(disposer.intGlyphImages,
                     disposer.pScalerContext);
         } else if (disposer.longGlyphImages != null) {
-            freeLongMemory(disposer.longGlyphImages,
+            freeCachedLongMemory(disposer.longGlyphImages,
                     disposer.pScalerContext);
         } else if (disposer.segIntGlyphImages != null) {
             /* NB Now making multiple JNI calls in this case.
@@ -207,7 +216,7 @@
              */
             for (int i=0; i<disposer.segIntGlyphImages.length; i++) {
                 if (disposer.segIntGlyphImages[i] != null) {
-                    freeIntMemory(disposer.segIntGlyphImages[i],
+                    freeCachedIntMemory(disposer.segIntGlyphImages[i],
                             disposer.pScalerContext);
                     /* native will only free the scaler context once */
                     disposer.pScalerContext = 0L;
@@ -218,19 +227,19 @@
              * for a strike that never was asked to rasterise a glyph.
              */
             if (disposer.pScalerContext != 0L) {
-                freeIntMemory(new int[0], disposer.pScalerContext);
+                freeCachedIntMemory(new int[0], disposer.pScalerContext);
             }
         } else if (disposer.segLongGlyphImages != null) {
             for (int i=0; i<disposer.segLongGlyphImages.length; i++) {
                 if (disposer.segLongGlyphImages[i] != null) {
-                    freeLongMemory(disposer.segLongGlyphImages[i],
+                    freeCachedLongMemory(disposer.segLongGlyphImages[i],
                             disposer.pScalerContext);
                     disposer.pScalerContext = 0L;
                     disposer.segLongGlyphImages[i] = null;
                 }
             }
             if (disposer.pScalerContext != 0L) {
-                freeLongMemory(new long[0], disposer.pScalerContext);
+                freeCachedLongMemory(new long[0], disposer.pScalerContext);
             }
         } else if (disposer.pScalerContext != 0L) {
             /* Rarely a strike may have been created that never cached
@@ -238,9 +247,9 @@
              * context.
              */
             if (longAddresses()) {
-                freeLongMemory(new long[0], disposer.pScalerContext);
+                freeCachedLongMemory(new long[0], disposer.pScalerContext);
             } else {
-                freeIntMemory(new int[0], disposer.pScalerContext);
+                freeCachedIntMemory(new int[0], disposer.pScalerContext);
             }
         }
     }
@@ -304,6 +313,68 @@
     private static native void freeIntMemory(int[] glyphPtrs, long pContext);
     private static native void freeLongMemory(long[] glyphPtrs, long pContext);
 
+    private static void freeCachedIntMemory(int[] glyphPtrs, long pContext) {
+        synchronized(disposeListeners) {
+            if (disposeListeners.size() > 0) {
+                ArrayList<Long> gids = null;
+
+                for (int i = 0; i < glyphPtrs.length; i++) {
+                    if (glyphPtrs[i] != 0 && unsafe.getByte(glyphPtrs[i] + managedOffset) == 0
+                            && unsafe.getInt(glyphPtrs[i] + cacheCellOffset) != 0) {
+
+                        if (gids == null) {
+                            gids = new ArrayList<Long>();
+                        }
+                        gids.add((long) glyphPtrs[i]);
+                    }
+                }
+
+                if (gids != null) {
+                    notifyDisposeListeners(gids);
+                }
+            }
+        }
+
+        freeIntMemory(glyphPtrs, pContext);
+    }
+
+    private static void  freeCachedLongMemory(long[] glyphPtrs, long pContext) {
+        synchronized(disposeListeners) {
+        if (disposeListeners.size() > 0)  {
+                ArrayList<Long> gids = null;
+
+                for (int i=0; i < glyphPtrs.length; i++) {
+                    if (glyphPtrs[i] != 0
+                            && unsafe.getByte(glyphPtrs[i] + managedOffset) == 0
+                            && unsafe.getInt(glyphPtrs[i] + cacheCellOffset) != 0) {
+
+                        if (gids == null) {
+                            gids = new ArrayList<Long>();
+                        }
+                        gids.add((long) glyphPtrs[i]);
+                    }
+                }
+
+                if (gids != null) {
+                    notifyDisposeListeners(gids);
+                }
+        }
+        }
+
+        freeLongMemory(glyphPtrs, pContext);
+    }
+
+    public static void addGlyphDisposedListener(GlyphDisposedListener listener) {
+        synchronized(disposeListeners) {
+            disposeListeners.add(listener);
+        }
+    }
+
+    private static void notifyDisposeListeners(ArrayList<Long> glyphs) {
+        for (GlyphDisposedListener listener : disposeListeners) {
+            listener.glyphDisposed(glyphs);
+        }
+    }
 
     public static Reference getStrikeRef(FontStrike strike) {
         return getStrikeRef(strike, cacheRefTypeWeak);
--- a/jdk/src/share/classes/sun/font/SunFontManager.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/share/classes/sun/font/SunFontManager.java	Wed Jul 21 09:57:21 2010 -0700
@@ -73,7 +73,9 @@
                 return(name.startsWith(".ttf", offset) ||
                        name.startsWith(".TTF", offset) ||
                        name.startsWith(".ttc", offset) ||
-                       name.startsWith(".TTC", offset));
+                       name.startsWith(".TTC", offset) ||
+                       name.startsWith(".otf", offset) ||
+                       name.startsWith(".OTF", offset));
             }
         }
     }
@@ -108,7 +110,9 @@
                     name.startsWith(".ttf", offset) ||
                     name.startsWith(".TTF", offset) ||
                     name.startsWith(".ttc", offset) ||
-                    name.startsWith(".TTC", offset);
+                    name.startsWith(".TTC", offset) ||
+                    name.startsWith(".otf", offset) ||
+                    name.startsWith(".OTF", offset);
                 if (isTT) {
                     return true;
                 } else if (noType1Font) {
--- a/jdk/src/share/classes/sun/io/ByteToCharISO2022.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/share/classes/sun/io/ByteToCharISO2022.java	Wed Jul 21 09:57:21 2010 -0700
@@ -124,15 +124,15 @@
         switch(shiftFlag) {
         case SOFlag:
             tmpIndex = curSODes;
-            tmpConverter = (ByteToCharConverter [])SOConverter;
+            tmpConverter = SOConverter;
             break;
         case SS2Flag:
             tmpIndex = curSS2Des;
-            tmpConverter = (ByteToCharConverter [])SS2Converter;
+            tmpConverter = SS2Converter;
             break;
         case SS3Flag:
             tmpIndex = curSS3Des;
-            tmpConverter = (ByteToCharConverter [])SS3Converter;
+            tmpConverter = SS3Converter;
             break;
         }
 
--- a/jdk/src/share/classes/sun/io/ByteToCharISO2022JP.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/share/classes/sun/io/ByteToCharISO2022JP.java	Wed Jul 21 09:57:21 2010 -0700
@@ -141,7 +141,7 @@
                         } else {
                             savedSize = 2;
                             savedBytes[0] = (byte)byte1;
-                            savedBytes[1] = (byte)input[readOff + inputSize];
+                            savedBytes[1] = input[readOff + inputSize];
                             inputSize++;
                         }
                         break;
--- a/jdk/src/share/classes/sun/io/ByteToCharJISAutoDetect.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/share/classes/sun/io/ByteToCharJISAutoDetect.java	Wed Jul 21 09:57:21 2010 -0700
@@ -34,14 +34,12 @@
     private final static int SJIS1B_MASK = 0x04;
     private final static int EUCJP_KANA1_MASK = 0x08;
     private final static int EUCJP_KANA2_MASK = 0x10;
-    private static byte[] maskTable1;
-    private static byte[] maskTable2;
+    private final static byte[] maskTable1 = JISAutoDetect.getByteMask1();
+    private final static byte[] maskTable2 = JISAutoDetect.getByteMask2();
 
     private final static int SS2 = 0x8e;
     private final static int SS3 = 0x8f;
 
-    private final static JISAutoDetect nioCoder = new JISAutoDetect();
-
     // SJISName is set to either "SJIS" or "MS932"
     private String SJISName;
     private String EUCJPName;
@@ -57,8 +55,6 @@
         defaultConv = new ByteToCharISO8859_1();
         defaultConv.subChars = subChars;
         defaultConv.subMode = subMode;
-        maskTable1 = nioCoder.getByteMask1();
-        maskTable2 = nioCoder.getByteMask2();
     }
 
     public int flush(char [] output, int outStart, int outEnd)
@@ -133,7 +129,7 @@
                                 break;
                             }
                             if ((mask == SJIS2B_MASK) || (mask == SJIS1B_MASK)
-                                || (nioCoder.canBeSJIS1B(firstmask) && secondmask == 0)) {
+                                || (JISAutoDetect.canBeSJIS1B(firstmask) && secondmask == 0)) {
                                 convName = SJISName;
                                 break;
                             }
@@ -145,15 +141,15 @@
                             // character boundary. If we tried both
                             // possibilities here, it might be able to be
                             // determined correctly.
-                            if ((byte1 == SS3) && nioCoder.canBeEUCJP(secondmask)) {
+                            if ((byte1 == SS3) && JISAutoDetect.canBeEUCJP(secondmask)) {
                                 if (cnt+1 < inEnd) {
                                     int nextbyte = input[cnt+1] & 0xff;
-                                    if (! nioCoder.canBeEUCJP(maskTable2[nextbyte]))
+                                    if (! JISAutoDetect.canBeEUCJP(maskTable2[nextbyte]))
                                         convName = SJISName;
                                 } else
                                     convName = SJISName;
                             }
-                            if (nioCoder.canBeEUCKana(firstmask, secondmask))
+                            if (JISAutoDetect.canBeEUCKana(firstmask, secondmask))
                                 euckana++;
                         } else {
                             if ((firstmask & SJIS1B_MASK) != 0) {
--- a/jdk/src/share/classes/sun/io/CharToByteDBCS_ASCII.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/share/classes/sun/io/CharToByteDBCS_ASCII.java	Wed Jul 21 09:57:21 2010 -0700
@@ -24,7 +24,6 @@
  */
 package sun.io;
 
-import sun.nio.cs.Surrogate;
 import sun.nio.cs.ext.DoubleByte;
 import static sun.nio.cs.CharsetMapping.*;
 
--- a/jdk/src/share/classes/sun/io/CharToByteDBCS_EBCDIC.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/share/classes/sun/io/CharToByteDBCS_EBCDIC.java	Wed Jul 21 09:57:21 2010 -0700
@@ -24,7 +24,6 @@
  */
 package sun.io;
 
-import sun.nio.cs.Surrogate;
 import sun.nio.cs.ext.DoubleByte;
 import static sun.nio.cs.CharsetMapping.*;
 
--- a/jdk/src/share/classes/sun/io/CharToBytePCK.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/share/classes/sun/io/CharToBytePCK.java	Wed Jul 21 09:57:21 2010 -0700
@@ -66,7 +66,7 @@
 
          switch (ch) {
             case '\u2015':
-                return (int)0x815C;
+                return 0x815C;
             case '\u2014':
                 return 0;
             default:
--- a/jdk/src/share/classes/sun/java2d/HeadlessGraphicsEnvironment.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/share/classes/sun/java2d/HeadlessGraphicsEnvironment.java	Wed Jul 21 09:57:21 2010 -0700
@@ -59,17 +59,12 @@
  * Headless decorator implementation of a SunGraphicsEnvironment
  */
 
-public class HeadlessGraphicsEnvironment extends GraphicsEnvironment
-    implements FontSupport {
+public class HeadlessGraphicsEnvironment extends GraphicsEnvironment {
 
     private GraphicsEnvironment ge;
-    private FontSupport fontSupport;
 
     public HeadlessGraphicsEnvironment(GraphicsEnvironment ge) {
         this.ge = ge;
-        if (ge instanceof FontSupport) {
-            fontSupport = (FontSupport)ge;
-        }
     }
 
     public GraphicsDevice[] getScreenDevices()
@@ -101,13 +96,6 @@
     public String[] getAvailableFontFamilyNames(Locale l) {
         return ge.getAvailableFontFamilyNames(l); }
 
-    public FontConfiguration getFontConfiguration() {
-        if (fontSupport != null) {
-            return fontSupport.getFontConfiguration();
-        }
-        return null;
-    }
-
     /* Used by FontManager : internal API */
     public GraphicsEnvironment getSunGraphicsEnvironment() {
         return ge;
--- a/jdk/src/share/classes/sun/java2d/pipe/BufferedPaints.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/share/classes/sun/java2d/pipe/BufferedPaints.java	Wed Jul 21 09:57:21 2010 -0700
@@ -307,7 +307,7 @@
      * linear RGB space.  Copied directly from the
      * MultipleGradientPaintContext class.
      */
-    private static int convertSRGBtoLinearRGB(int color) {
+    public static int convertSRGBtoLinearRGB(int color) {
         float input, output;
 
         input = color / 255.0f;
--- a/jdk/src/share/classes/sun/java2d/pipe/RenderBuffer.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/share/classes/sun/java2d/pipe/RenderBuffer.java	Wed Jul 21 09:57:21 2010 -0700
@@ -117,6 +117,11 @@
         curAddress = baseAddress;
     }
 
+    public final RenderBuffer skip(long numBytes) {
+        curAddress += numBytes;
+        return this;
+    }
+
     /**
      * putByte() methods...
      */
--- a/jdk/src/share/classes/sun/jvmstat/monitor/AbstractMonitor.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/share/classes/sun/jvmstat/monitor/AbstractMonitor.java	Wed Jul 21 09:57:21 2010 -0700
@@ -25,9 +25,6 @@
 
 package sun.jvmstat.monitor;
 
-import sun.management.counter.Units;
-import sun.management.counter.Variability;
-
 /**
  * The base class for Instrumentation Monitoring Objects. This base class
  * provides implementations of the {@link Monitor} methods that are common
--- a/jdk/src/share/classes/sun/jvmstat/monitor/Monitor.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/share/classes/sun/jvmstat/monitor/Monitor.java	Wed Jul 21 09:57:21 2010 -0700
@@ -25,9 +25,6 @@
 
 package sun.jvmstat.monitor;
 
-import sun.management.counter.Units;
-import sun.management.counter.Variability;
-
 /**
  * Interface provided by Instrumentation Monitoring Objects.
  *
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/src/share/classes/sun/jvmstat/monitor/Units.java	Wed Jul 21 09:57:21 2010 -0700
@@ -0,0 +1,128 @@
+/*
+ * Copyright 2003-2004 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 sun.jvmstat.monitor;
+
+/**
+ * Provides a typesafe enumeration for describing units of measurement
+ * attribute for instrumentation objects.
+ *
+ * @author   Brian Doherty
+ */
+public class Units implements java.io.Serializable {
+
+    /* The enumeration values for this typesafe enumeration must be
+     * kept in synchronization with the Units enum in the perfData.hpp file
+     * in the HotSpot source base.
+     */
+
+    private static final int NUNITS=8;
+
+    private static Units[] map = new Units[NUNITS];
+
+    private final String name;
+    private final int value;
+
+    /**
+     * An Invalid Units value.
+     */
+    public static final Units INVALID = new Units("Invalid", 0);
+
+    /**
+     * Units attribute representing unit-less quantities.
+     */
+    public static final Units NONE = new Units("None", 1);
+
+    /**
+     * Units attribute representing Bytes.
+     */
+    public static final Units BYTES = new Units("Bytes", 2);
+
+    /**
+     * Units attribute representing Ticks.
+     */
+    public static final Units TICKS = new Units("Ticks", 3);
+
+    /**
+     * Units attribute representing a count of events.
+     */
+    public static final Units EVENTS = new Units("Events", 4);
+
+    /**
+     * Units attribute representing String data. Although not really
+     * a unit of measure, this Units value serves to distinguish String
+     * instrumentation objects from instrumentation objects of other types.
+     */
+    public static final Units STRING = new Units("String", 5);
+
+    /**
+     * Units attribute representing Hertz (frequency).
+     */
+    public static final Units HERTZ = new Units("Hertz", 6);
+
+    /**
+     * Returns a string describing this Unit of measurement attribute
+     *
+     * @return String - a descriptive string for this enum.
+     */
+    public String toString() {
+        return name;
+    }
+
+    /**
+     * Returns the integer representation of this Units attribute
+     *
+     * @return int - an integer representation of this Units attribute.
+     */
+    public int intValue() {
+        return value;
+    }
+
+    /**
+     * Maps an integer value to its corresponding Units attribute.
+     * If the integer value does not have a corresponding Units enum
+     * value, then {@link Units#INVALID} is returned.
+     *
+     * @param value an integer representation of counter Units
+     * @return Units - the Units object for the given <code>value</code>
+     *                 or {@link Units#INVALID} if out of range.
+     */
+    public static Units toUnits(int value) {
+
+        if (value < 0 || value >= map.length || map[value] == null) {
+            return INVALID;
+        }
+
+        return map[value];
+    }
+
+    private Units(String name, int value) {
+        this.name = name;
+        this.value = value;
+        map[value] = this;
+    }
+
+    private static final long serialVersionUID = 6992337162326171013L;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/src/share/classes/sun/jvmstat/monitor/Variability.java	Wed Jul 21 09:57:21 2010 -0700
@@ -0,0 +1,111 @@
+/*
+ * Copyright 2003-2004 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 sun.jvmstat.monitor;
+
+/**
+ * Provides a typesafe enumeration for the Variability attribute for
+ * instrumentation objects.
+ *
+ * @author   Brian Doherty
+ */
+public class Variability implements java.io.Serializable {
+
+    /* The enumeration values for this typesafe enumeration must be
+     * kept in synchronization with the Variability enum in the perfData.hpp file
+     * in the HotSpot source base.
+     */
+
+    private static final int NATTRIBUTES = 4;
+    private static Variability[] map = new Variability[NATTRIBUTES];
+
+    private String name;
+    private int value;
+
+    /**
+     * An invalid Variablity value.
+     */
+    public static final Variability INVALID = new Variability("Invalid",0);
+
+    /**
+     * Variability attribute representing Constant counters.
+     */
+    public static final Variability CONSTANT = new Variability("Constant",1);
+
+    /**
+     * Variability attribute representing a Monotonically changing counters.
+     */
+    public static final Variability MONOTONIC = new Variability("Monotonic",2);
+
+    /**
+     * Variability attribute representing Variable counters.
+     */
+    public static final Variability VARIABLE = new Variability("Variable",3);
+
+    /**
+     * Returns a string describing this Variability attribute.
+     *
+     * @return String - a descriptive string for this enum.
+     */
+    public String toString() {
+        return name;
+    }
+
+    /**
+     * Returns the integer representation of this Variability attribute.
+     *
+     * @return int - an integer representation of this Variability attribute.
+     */
+    public int intValue() {
+        return value;
+    }
+
+    /**
+     * Maps an integer value its corresponding Variability attribute.
+     * If the integer value does not have a corresponding Variability enum
+     * value, the {@link Variability#INVALID} is returned
+     *
+     * @param value an integer representation of a Variability attribute
+     * @return Variability - The Variability object for the given
+     *                       <code>value</code> or {@link Variability#INVALID}
+     *                       if out of range.
+     */
+    public static Variability toVariability(int value) {
+
+        if (value < 0 || value >= map.length || map[value] == null) {
+            return INVALID;
+        }
+
+        return map[value];
+    }
+
+    private Variability(String name, int value) {
+        this.name = name;
+        this.value = value;
+        map[value]=this;
+    }
+
+    private static final long serialVersionUID = 6992337162326171013L;
+}
--- a/jdk/src/share/classes/sun/jvmstat/perfdata/monitor/PerfByteArrayMonitor.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/share/classes/sun/jvmstat/perfdata/monitor/PerfByteArrayMonitor.java	Wed Jul 21 09:57:21 2010 -0700
@@ -26,8 +26,6 @@
 package sun.jvmstat.perfdata.monitor;
 
 import sun.jvmstat.monitor.*;
-import sun.management.counter.Units;
-import sun.management.counter.Variability;
 import java.nio.ByteBuffer;
 
 /**
--- a/jdk/src/share/classes/sun/jvmstat/perfdata/monitor/PerfIntegerMonitor.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/share/classes/sun/jvmstat/perfdata/monitor/PerfIntegerMonitor.java	Wed Jul 21 09:57:21 2010 -0700
@@ -26,8 +26,6 @@
 package sun.jvmstat.perfdata.monitor;
 
 import sun.jvmstat.monitor.*;
-import sun.management.counter.Units;
-import sun.management.counter.Variability;
 import java.nio.IntBuffer;
 
 /**
--- a/jdk/src/share/classes/sun/jvmstat/perfdata/monitor/PerfLongMonitor.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/share/classes/sun/jvmstat/perfdata/monitor/PerfLongMonitor.java	Wed Jul 21 09:57:21 2010 -0700
@@ -26,8 +26,6 @@
 package sun.jvmstat.perfdata.monitor;
 
 import sun.jvmstat.monitor.*;
-import sun.management.counter.Units;
-import sun.management.counter.Variability;
 import java.nio.LongBuffer;
 
 /**
--- a/jdk/src/share/classes/sun/jvmstat/perfdata/monitor/PerfStringConstantMonitor.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/share/classes/sun/jvmstat/perfdata/monitor/PerfStringConstantMonitor.java	Wed Jul 21 09:57:21 2010 -0700
@@ -26,7 +26,6 @@
 package sun.jvmstat.perfdata.monitor;
 
 import sun.jvmstat.monitor.*;
-import sun.management.counter.Variability;
 import java.nio.ByteBuffer;
 
 /**
--- a/jdk/src/share/classes/sun/jvmstat/perfdata/monitor/PerfStringMonitor.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/share/classes/sun/jvmstat/perfdata/monitor/PerfStringMonitor.java	Wed Jul 21 09:57:21 2010 -0700
@@ -26,8 +26,6 @@
 package sun.jvmstat.perfdata.monitor;
 
 import sun.jvmstat.monitor.*;
-import sun.management.counter.Units;
-import sun.management.counter.Variability;
 import java.nio.ByteBuffer;
 import java.nio.charset.Charset;
 
--- a/jdk/src/share/classes/sun/jvmstat/perfdata/monitor/PerfStringVariableMonitor.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/share/classes/sun/jvmstat/perfdata/monitor/PerfStringVariableMonitor.java	Wed Jul 21 09:57:21 2010 -0700
@@ -26,7 +26,6 @@
 package sun.jvmstat.perfdata.monitor;
 
 import sun.jvmstat.monitor.*;
-import sun.management.counter.Variability;
 import java.nio.ByteBuffer;
 
 /**
--- a/jdk/src/share/classes/sun/jvmstat/perfdata/monitor/v1_0/PerfDataBuffer.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/share/classes/sun/jvmstat/perfdata/monitor/v1_0/PerfDataBuffer.java	Wed Jul 21 09:57:21 2010 -0700
@@ -25,8 +25,6 @@
 
 package sun.jvmstat.perfdata.monitor.v1_0;
 
-import sun.management.counter.Units;
-import sun.management.counter.Variability;
 import sun.jvmstat.monitor.*;
 import sun.jvmstat.perfdata.monitor.*;
 import java.util.*;
--- a/jdk/src/share/classes/sun/jvmstat/perfdata/monitor/v2_0/PerfDataBuffer.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/share/classes/sun/jvmstat/perfdata/monitor/v2_0/PerfDataBuffer.java	Wed Jul 21 09:57:21 2010 -0700
@@ -27,8 +27,6 @@
 
 import sun.jvmstat.monitor.*;
 import sun.jvmstat.perfdata.monitor.*;
-import sun.management.counter.Units;
-import sun.management.counter.Variability;
 import java.util.*;
 import java.util.regex.*;
 import java.nio.*;
--- a/jdk/src/share/classes/sun/launcher/LauncherHelper.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/share/classes/sun/launcher/LauncherHelper.java	Wed Jul 21 09:57:21 2010 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2007, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2007, 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
@@ -208,7 +208,7 @@
         Method method = null;
         try {
             method = clazz.getMethod("main", String[].class);
-        } catch (Exception e) {
+        } catch (NoSuchMethodException nsme) {
             ostream.println(getLocalizedMessage("java.launcher.cls.error4",
                     classname));
             throw new RuntimeException("Main method not found in " + classname);
@@ -225,8 +225,7 @@
             throw new RuntimeException("Main method is not static in class " +
                     classname);
         }
-        Class<?> rType = method.getReturnType();
-        if (!rType.isPrimitive() || !rType.getName().equals("void")) {
+        if (method.getReturnType() != java.lang.Void.TYPE) {
             ostream.println(getLocalizedMessage("java.launcher.cls.error3",
                     classname));
             throw new RuntimeException("Main method must return a value" +
--- a/jdk/src/share/classes/sun/net/httpserver/ExchangeImpl.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/share/classes/sun/net/httpserver/ExchangeImpl.java	Wed Jul 21 09:57:21 2010 -0700
@@ -52,14 +52,16 @@
     boolean http10 = false;
 
     /* for formatting the Date: header */
-    static TimeZone tz;
-    static DateFormat df;
-    static {
-        String pattern = "EEE, dd MMM yyyy HH:mm:ss zzz";
-        tz = TimeZone.getTimeZone ("GMT");
-        df = new SimpleDateFormat (pattern, Locale.US);
-        df.setTimeZone (tz);
-    }
+    private static final String pattern = "EEE, dd MMM yyyy HH:mm:ss zzz";
+    private static final TimeZone gmtTZ = TimeZone.getTimeZone("GMT");
+    private static final ThreadLocal<DateFormat> dateFormat =
+         new ThreadLocal<DateFormat>() {
+             @Override protected DateFormat initialValue() {
+                 DateFormat df = new SimpleDateFormat(pattern, Locale.US);
+                 df.setTimeZone(gmtTZ);
+                 return df;
+         }
+     };
 
     private static final String HEAD = "HEAD";
 
@@ -206,7 +208,7 @@
         PlaceholderOutputStream o = getPlaceholderResponseBody();
         tmpout.write (bytes(statusLine, 0), 0, statusLine.length());
         boolean noContentToSend = false; // assume there is content
-        rspHdrs.set ("Date", df.format (new Date()));
+        rspHdrs.set ("Date", dateFormat.get().format (new Date()));
 
         /* check for response type that is not allowed to send a body */
 
--- a/jdk/src/share/classes/sun/net/www/protocol/http/HttpURLConnection.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/share/classes/sun/net/www/protocol/http/HttpURLConnection.java	Wed Jul 21 09:57:21 2010 -0700
@@ -2331,7 +2331,7 @@
      * closed the connection to the web server.
      */
     private void disconnectWeb() throws IOException {
-        if (usingProxy()) {
+        if (usingProxy() && http.isKeepingAlive()) {
             responseCode = -1;
             // clean up, particularly, skip the content part
             // of a 401 error response
--- a/jdk/src/share/classes/sun/nio/ch/CompletedFuture.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/share/classes/sun/nio/ch/CompletedFuture.java	Wed Jul 21 09:57:21 2010 -0700
@@ -44,20 +44,17 @@
         this.exc = exc;
     }
 
-    @SuppressWarnings("unchecked")
     static <V> CompletedFuture<V> withResult(V result) {
         return new CompletedFuture<V>(result, null);
     }
 
-    @SuppressWarnings("unchecked")
     static <V> CompletedFuture<V> withFailure(Throwable exc) {
         // exception must be IOException or SecurityException
         if (!(exc instanceof IOException) && !(exc instanceof SecurityException))
             exc = new IOException(exc);
-        return new CompletedFuture(null, exc);
+        return new CompletedFuture<V>(null, exc);
     }
 
-    @SuppressWarnings("unchecked")
     static <V> CompletedFuture<V> withResult(V result, Throwable exc) {
         if (exc == null) {
             return withResult(result);
--- a/jdk/src/share/classes/sun/nio/ch/DatagramSocketAdaptor.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/share/classes/sun/nio/ch/DatagramSocketAdaptor.java	Wed Jul 21 09:57:21 2010 -0700
@@ -171,10 +171,9 @@
 
     // Must hold dc.blockingLock()
     //
-    private void receive(ByteBuffer bb) throws IOException {
+    private SocketAddress receive(ByteBuffer bb) throws IOException {
         if (timeout == 0) {
-            dc.receive(bb);
-            return;
+            return dc.receive(bb);
         }
 
         // Implement timeout with a selector
@@ -183,8 +182,9 @@
         dc.configureBlocking(false);
         try {
             int n;
-            if (dc.receive(bb) != null)
-                return;
+            SocketAddress sender;
+            if ((sender = dc.receive(bb)) != null)
+                return sender;
             sel = Util.getTemporarySelector(dc);
             sk = dc.register(sel, SelectionKey.OP_READ);
             long to = timeout;
@@ -194,8 +194,8 @@
                 long st = System.currentTimeMillis();
                 int ns = sel.select(to);
                 if (ns > 0 && sk.isReadable()) {
-                    if (dc.receive(bb) != null)
-                        return;
+                    if ((sender = dc.receive(bb)) != null)
+                        return sender;
                 }
                 sel.selectedKeys().remove(sk);
                 to -= System.currentTimeMillis() - st;
@@ -222,7 +222,8 @@
                     ByteBuffer bb = ByteBuffer.wrap(p.getData(),
                                                     p.getOffset(),
                                                     p.getLength());
-                    receive(bb);
+                    SocketAddress sender = receive(bb);
+                    p.setSocketAddress(sender);
                     p.setLength(bb.position() - p.getOffset());
                 }
             } catch (IOException x) {
--- a/jdk/src/share/classes/sun/nio/ch/ServerSocketAdaptor.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/share/classes/sun/nio/ch/ServerSocketAdaptor.java	Wed Jul 21 09:57:21 2010 -0700
@@ -144,11 +144,7 @@
     }
 
     public void close() throws IOException {
-        try {
-            ssc.close();
-        } catch (Exception x) {
-            Net.translateException(x);
-        }
+        ssc.close();
     }
 
     public ServerSocketChannel getChannel() {
--- a/jdk/src/share/classes/sun/nio/ch/SocketAdaptor.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/share/classes/sun/nio/ch/SocketAdaptor.java	Wed Jul 21 09:57:21 2010 -0700
@@ -404,11 +404,7 @@
     }
 
     public void close() throws IOException {
-        try {
-            sc.close();
-        } catch (Exception x) {
-            Net.translateToSocketException(x);
-        }
+        sc.close();
     }
 
     public void shutdownInput() throws IOException {
--- a/jdk/src/share/classes/sun/nio/cs/Surrogate.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/share/classes/sun/nio/cs/Surrogate.java	Wed Jul 21 09:57:21 2010 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2001, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 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
@@ -34,8 +34,9 @@
  * Utility class for dealing with surrogates.
  *
  * @author Mark Reinhold
+ * @author Martin Buchholz
+ * @author Ulf Zibis
  */
-
 public class Surrogate {
 
     private Surrogate() { }
@@ -75,16 +76,9 @@
     }
 
     /**
-     * Tells whether or not the given UCS-4 character is in the Basic
-     * Multilingual Plane, and can be represented using a single char.
-     */
-    public static boolean isBMPCodePoint(int uc) {
-        return uc >> 16 == 0;
-    }
-
-    /**
      * Tells whether or not the given UCS-4 character must be represented as a
      * surrogate pair in UTF-16.
+     * Use of {@link Character#isSupplementaryCodePoint} is generally preferred.
      */
     public static boolean neededFor(int uc) {
         return Character.isSupplementaryCodePoint(uc);
@@ -92,24 +86,25 @@
 
     /**
      * Returns the high UTF-16 surrogate for the given supplementary UCS-4 character.
+     * Use of {@link Character#highSurrogate} is generally preferred.
      */
     public static char high(int uc) {
         assert Character.isSupplementaryCodePoint(uc);
-        return (char)((uc >> 10)
-                      + (Character.MIN_HIGH_SURROGATE
-                         - (Character.MIN_SUPPLEMENTARY_CODE_POINT >> 10)));
+        return Character.highSurrogate(uc);
     }
 
     /**
      * Returns the low UTF-16 surrogate for the given supplementary UCS-4 character.
+     * Use of {@link Character#lowSurrogate} is generally preferred.
      */
     public static char low(int uc) {
         assert Character.isSupplementaryCodePoint(uc);
-        return (char)((uc & 0x3ff) + Character.MIN_LOW_SURROGATE);
+        return Character.lowSurrogate(uc);
     }
 
     /**
      * Converts the given surrogate pair into a 32-bit UCS-4 character.
+     * Use of {@link Character#toCodePoint} is generally preferred.
      */
     public static int toUCS4(char c, char d) {
         assert Character.isHighSurrogate(c) && Character.isLowSurrogate(d);
@@ -290,8 +285,9 @@
          *           error() will return a descriptive result object
          */
         public int generate(int uc, int len, CharBuffer dst) {
-            if (Surrogate.isBMPCodePoint(uc)) {
-                if (Surrogate.is(uc)) {
+            if (Character.isBmpCodePoint(uc)) {
+                char c = (char) uc;
+                if (Character.isSurrogate(c)) {
                     error = CoderResult.malformedForLength(len);
                     return -1;
                 }
@@ -299,16 +295,16 @@
                     error = CoderResult.OVERFLOW;
                     return -1;
                 }
-                dst.put((char)uc);
+                dst.put(c);
                 error = null;
                 return 1;
-            } else if (Character.isSupplementaryCodePoint(uc)) {
+            } else if (Character.isValidCodePoint(uc)) {
                 if (dst.remaining() < 2) {
                     error = CoderResult.OVERFLOW;
                     return -1;
                 }
-                dst.put(Surrogate.high(uc));
-                dst.put(Surrogate.low(uc));
+                dst.put(Character.highSurrogate(uc));
+                dst.put(Character.lowSurrogate(uc));
                 error = null;
                 return 2;
             } else {
@@ -334,8 +330,9 @@
          *           error() will return a descriptive result object
          */
         public int generate(int uc, int len, char[] da, int dp, int dl) {
-            if (Surrogate.isBMPCodePoint(uc)) {
-                if (Surrogate.is(uc)) {
+            if (Character.isBmpCodePoint(uc)) {
+                char c = (char) uc;
+                if (Character.isSurrogate(c)) {
                     error = CoderResult.malformedForLength(len);
                     return -1;
                 }
@@ -343,16 +340,16 @@
                     error = CoderResult.OVERFLOW;
                     return -1;
                 }
-                da[dp] = (char)uc;
+                da[dp] = c;
                 error = null;
                 return 1;
-            } else if (Character.isSupplementaryCodePoint(uc)) {
+            } else if (Character.isValidCodePoint(uc)) {
                 if (dl - dp < 2) {
                     error = CoderResult.OVERFLOW;
                     return -1;
                 }
-                da[dp] = Surrogate.high(uc);
-                da[dp + 1] = Surrogate.low(uc);
+                da[dp] = Character.highSurrogate(uc);
+                da[dp + 1] = Character.lowSurrogate(uc);
                 error = null;
                 return 2;
             } else {
--- a/jdk/src/share/classes/sun/nio/cs/UTF_32Coder.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/share/classes/sun/nio/cs/UTF_32Coder.java	Wed Jul 21 09:57:21 2010 -0700
@@ -86,22 +86,21 @@
                         src.position(mark);
                     }
                 }
-                while (src.remaining() > 3) {
+                while (src.remaining() >= 4) {
                     cp = getCP(src);
-                    if (cp < 0 || cp > Surrogate.UCS4_MAX) {
-                        return CoderResult.malformedForLength(4);
-                    }
-                    if (cp < Surrogate.UCS4_MIN) {
+                    if (Character.isBmpCodePoint(cp)) {
                         if (!dst.hasRemaining())
                             return CoderResult.OVERFLOW;
                         mark += 4;
-                        dst.put((char)cp);
-                    } else {
+                        dst.put((char) cp);
+                    } else if (Character.isValidCodePoint(cp)) {
                         if (dst.remaining() < 2)
                             return CoderResult.OVERFLOW;
                         mark += 4;
-                        dst.put(Surrogate.high(cp));
-                        dst.put(Surrogate.low(cp));
+                        dst.put(Character.highSurrogate(cp));
+                        dst.put(Character.lowSurrogate(cp));
+                    } else {
+                        return CoderResult.malformedForLength(4);
                     }
                 }
                 return CoderResult.UNDERFLOW;
@@ -154,7 +153,12 @@
             try {
                 while (src.hasRemaining()) {
                     char c = src.get();
-                    if (Character.isHighSurrogate(c)) {
+                    if (!Character.isSurrogate(c)) {
+                        if (dst.remaining() < 4)
+                            return CoderResult.OVERFLOW;
+                        mark++;
+                        put(c, dst);
+                    } else if (Character.isHighSurrogate(c)) {
                         if (!src.hasRemaining())
                             return CoderResult.UNDERFLOW;
                         char low = src.get();
@@ -162,17 +166,13 @@
                             if (dst.remaining() < 4)
                                 return CoderResult.OVERFLOW;
                             mark += 2;
-                            put(Surrogate.toUCS4(c, low), dst);
+                            put(Character.toCodePoint(c, low), dst);
                         } else {
                             return CoderResult.malformedForLength(1);
                         }
-                    } else if (Character.isLowSurrogate(c)) {
+                    } else {
+                        // assert Character.isLowSurrogate(c);
                         return CoderResult.malformedForLength(1);
-                    } else {
-                        if (dst.remaining() < 4)
-                            return CoderResult.OVERFLOW;
-                        mark++;
-                        put(c, dst);
                     }
                 }
                 return CoderResult.UNDERFLOW;
--- a/jdk/src/share/classes/sun/nio/cs/UTF_8.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/share/classes/sun/nio/cs/UTF_8.java	Wed Jul 21 09:57:21 2010 -0700
@@ -102,7 +102,7 @@
         //  [F1..F3] [80..BF] [80..BF] [80..BF]
         //  [F4]     [80..8F] [80..BF] [80..BF]
         //  only check 80-be range here, the [0xf0,0x80...] and [0xf4,0x90-...]
-        //  will be checked by Surrogate.neededFor(uc)
+        //  will be checked by Character.isSupplementaryCodePoint(uc)
         private static boolean isMalformed4(int b2, int b3, int b4) {
             return (b2 & 0xc0) != 0x80 || (b3 & 0xc0) != 0x80 ||
                    (b4 & 0xc0) != 0x80;
@@ -207,15 +207,15 @@
 
             // ASCII only loop
             while (dp < dlASCII && sa[sp] >= 0)
-                da[dp++] = (char)sa[sp++];
+                da[dp++] = (char) sa[sp++];
 
             while (sp < sl) {
                 int b1 = sa[sp];
-                if (b1  >= 0) {
+                if (b1 >= 0) {
                     // 1 byte, 7 bits: 0xxxxxxx
                     if (dp >= dl)
                         return xflow(src, sp, sl, dst, dp, 1);
-                    da[dp++] = (char)b1;
+                    da[dp++] = (char) b1;
                     sp++;
                 } else if ((b1 >> 5) == -2) {
                     // 2 bytes, 11 bits: 110xxxxx 10xxxxxx
@@ -224,7 +224,10 @@
                     int b2 = sa[sp + 1];
                     if (isMalformed2(b1, b2))
                         return malformed(src, sp, dst, dp, 2);
-                    da[dp++] = (char) (((b1 << 6) ^ b2) ^ 0x0f80);
+                    da[dp++] = (char) (((b1 << 6) ^ b2)
+                                       ^
+                                       (((byte) 0xC0 << 6) ^
+                                        ((byte) 0x80 << 0)));
                     sp += 2;
                 } else if ((b1 >> 4) == -2) {
                     // 3 bytes, 16 bits: 1110xxxx 10xxxxxx 10xxxxxx
@@ -234,7 +237,13 @@
                     int b3 = sa[sp + 2];
                     if (isMalformed3(b1, b2, b3))
                         return malformed(src, sp, dst, dp, 3);
-                    da[dp++] = (char) (((b1 << 12) ^ (b2 << 6) ^ b3) ^ 0x1f80);
+                    da[dp++] = (char)
+                        ((b1 << 12) ^
+                         (b2 <<  6) ^
+                         (b3 ^
+                          (((byte) 0xE0 << 12) ^
+                           ((byte) 0x80 <<  6) ^
+                           ((byte) 0x80 <<  0))));
                     sp += 3;
                 } else if ((b1 >> 3) == -2) {
                     // 4 bytes, 21 bits: 11110xxx 10xxxxxx 10xxxxxx 10xxxxxx
@@ -243,16 +252,21 @@
                     int b2 = sa[sp + 1];
                     int b3 = sa[sp + 2];
                     int b4 = sa[sp + 3];
-                    int uc = ((b1 & 0x07) << 18) |
-                             ((b2 & 0x3f) << 12) |
-                             ((b3 & 0x3f) << 06) |
-                             (b4 & 0x3f);
+                    int uc = ((b1 << 18) ^
+                              (b2 << 12) ^
+                              (b3 <<  6) ^
+                              (b4 ^
+                               (((byte) 0xF0 << 18) ^
+                                ((byte) 0x80 << 12) ^
+                                ((byte) 0x80 <<  6) ^
+                                ((byte) 0x80 <<  0))));
                     if (isMalformed4(b2, b3, b4) ||
-                        !Surrogate.neededFor(uc)) {
+                        // shortest form check
+                        !Character.isSupplementaryCodePoint(uc)) {
                         return malformed(src, sp, dst, dp, 4);
                     }
-                    da[dp++] = Surrogate.high(uc);
-                    da[dp++] = Surrogate.low(uc);
+                    da[dp++] = Character.highSurrogate(uc);
+                    da[dp++] = Character.lowSurrogate(uc);
                     sp += 4;
                 } else
                     return malformed(src, sp, dst, dp, 1);
@@ -270,8 +284,8 @@
                 if (b1 >= 0) {
                     // 1 byte, 7 bits: 0xxxxxxx
                     if (dst.remaining() < 1)
-                        return xflow(src, mark, 1);  //overflow
-                    dst.put((char)b1);
+                        return xflow(src, mark, 1); // overflow
+                    dst.put((char) b1);
                     mark++;
                 } else if ((b1 >> 5) == -2) {
                     // 2 bytes, 11 bits: 110xxxxx 10xxxxxx
@@ -280,7 +294,10 @@
                     int b2 = src.get();
                     if (isMalformed2(b1, b2))
                         return malformed(src, mark, 2);
-                    dst.put((char) (((b1 << 6) ^ b2) ^ 0x0f80));
+                    dst.put((char) (((b1 << 6) ^ b2)
+                                    ^
+                                    (((byte) 0xC0 << 6) ^
+                                     ((byte) 0x80 << 0))));
                     mark += 2;
                 } else if ((b1 >> 4) == -2) {
                     // 3 bytes, 16 bits: 1110xxxx 10xxxxxx 10xxxxxx
@@ -290,7 +307,13 @@
                     int b3 = src.get();
                     if (isMalformed3(b1, b2, b3))
                         return malformed(src, mark, 3);
-                    dst.put((char) (((b1 << 12) ^ (b2 << 6) ^ b3) ^ 0x1f80));
+                    dst.put((char)
+                            ((b1 << 12) ^
+                             (b2 <<  6) ^
+                             (b3 ^
+                              (((byte) 0xE0 << 12) ^
+                               ((byte) 0x80 <<  6) ^
+                               ((byte) 0x80 <<  0)))));
                     mark += 3;
                 } else if ((b1 >> 3) == -2) {
                     // 4 bytes, 21 bits: 11110xxx 10xxxxxx 10xxxxxx 10xxxxxx
@@ -299,16 +322,21 @@
                     int b2 = src.get();
                     int b3 = src.get();
                     int b4 = src.get();
-                    int uc = ((b1 & 0x07) << 18) |
-                             ((b2 & 0x3f) << 12) |
-                             ((b3 & 0x3f) << 06) |
-                             (b4 & 0x3f);
+                    int uc = ((b1 << 18) ^
+                              (b2 << 12) ^
+                              (b3 <<  6) ^
+                              (b4 ^
+                               (((byte) 0xF0 << 18) ^
+                                ((byte) 0x80 << 12) ^
+                                ((byte) 0x80 <<  6) ^
+                                ((byte) 0x80 <<  0))));
                     if (isMalformed4(b2, b3, b4) ||
-                        !Surrogate.neededFor(uc)) { // shortest form check
+                        // shortest form check
+                        !Character.isSupplementaryCodePoint(uc)) {
                         return malformed(src, mark, 4);
                     }
-                    dst.put(Surrogate.high(uc));
-                    dst.put(Surrogate.low(uc));
+                    dst.put(Character.highSurrogate(uc));
+                    dst.put(Character.lowSurrogate(uc));
                     mark += 4;
                 } else {
                     return malformed(src, mark, 1);
@@ -366,7 +394,7 @@
             int dl = dst.arrayOffset() + dst.limit();
             int dlASCII = dp + Math.min(sl - sp, dl - dp);
 
-            //ASCII only loop
+            // ASCII only loop
             while (dp < dlASCII && sa[sp] < '\u0080')
                 da[dp++] = (byte) sa[sp++];
             while (sp < sl) {
@@ -380,7 +408,7 @@
                     // 2 bytes, 11 bits
                     if (dl - dp < 2)
                         return overflow(src, sp, dst, dp);
-                    da[dp++] = (byte)(0xc0 | ((c >> 06)));
+                    da[dp++] = (byte)(0xc0 | (c >> 6));
                     da[dp++] = (byte)(0x80 | (c & 0x3f));
                 } else if (Character.isSurrogate(c)) {
                     // Have a surrogate pair
@@ -395,7 +423,7 @@
                         return overflow(src, sp, dst, dp);
                     da[dp++] = (byte)(0xf0 | ((uc >> 18)));
                     da[dp++] = (byte)(0x80 | ((uc >> 12) & 0x3f));
-                    da[dp++] = (byte)(0x80 | ((uc >> 06) & 0x3f));
+                    da[dp++] = (byte)(0x80 | ((uc >>  6) & 0x3f));
                     da[dp++] = (byte)(0x80 | (uc & 0x3f));
                     sp++;  // 2 chars
                 } else {
@@ -403,7 +431,7 @@
                     if (dl - dp < 3)
                         return overflow(src, sp, dst, dp);
                     da[dp++] = (byte)(0xe0 | ((c >> 12)));
-                    da[dp++] = (byte)(0x80 | ((c >> 06) & 0x3f));
+                    da[dp++] = (byte)(0x80 | ((c >>  6) & 0x3f));
                     da[dp++] = (byte)(0x80 | (c & 0x3f));
                 }
                 sp++;
@@ -427,7 +455,7 @@
                     // 2 bytes, 11 bits
                     if (dst.remaining() < 2)
                         return overflow(src, mark);
-                    dst.put((byte)(0xc0 | ((c >> 06))));
+                    dst.put((byte)(0xc0 | (c >> 6)));
                     dst.put((byte)(0x80 | (c & 0x3f)));
                 } else if (Character.isSurrogate(c)) {
                     // Have a surrogate pair
@@ -442,15 +470,15 @@
                         return overflow(src, mark);
                     dst.put((byte)(0xf0 | ((uc >> 18))));
                     dst.put((byte)(0x80 | ((uc >> 12) & 0x3f)));
-                    dst.put((byte)(0x80 | ((uc >> 06) & 0x3f)));
+                    dst.put((byte)(0x80 | ((uc >>  6) & 0x3f)));
                     dst.put((byte)(0x80 | (uc & 0x3f)));
-                    mark++;  //2 chars
+                    mark++;  // 2 chars
                 } else {
                     // 3 bytes, 16 bits
                     if (dst.remaining() < 3)
                         return overflow(src, mark);
                     dst.put((byte)(0xe0 | ((c >> 12))));
-                    dst.put((byte)(0x80 | ((c >> 06) & 0x3f)));
+                    dst.put((byte)(0x80 | ((c >>  6) & 0x3f)));
                     dst.put((byte)(0x80 | (c & 0x3f)));
                 }
                 mark++;
--- a/jdk/src/share/classes/sun/nio/cs/UnicodeEncoder.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/share/classes/sun/nio/cs/UnicodeEncoder.java	Wed Jul 21 09:57:21 2010 -0700
@@ -93,8 +93,8 @@
                 if (dst.remaining() < 4)
                     return CoderResult.OVERFLOW;
                 mark += 2;
-                put(Surrogate.high(d), dst);
-                put(Surrogate.low(d), dst);
+                put(Character.highSurrogate(d), dst);
+                put(Character.lowSurrogate(d), dst);
             }
             return CoderResult.UNDERFLOW;
         } finally {
--- a/jdk/src/share/classes/sun/nio/cs/ext/DoubleByte.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/share/classes/sun/nio/cs/ext/DoubleByte.java	Wed Jul 21 09:57:21 2010 -0700
@@ -103,7 +103,7 @@
     public final static char[] B2C_UNMAPPABLE;
     static {
         B2C_UNMAPPABLE = new char[0x100];
-        Arrays.fill(B2C_UNMAPPABLE, (char)UNMAPPABLE_DECODING);
+        Arrays.fill(B2C_UNMAPPABLE, UNMAPPABLE_DECODING);
     }
 
     public static class Decoder extends CharsetDecoder
@@ -374,7 +374,7 @@
         static final char[] b2cSB;
         static {
             b2cSB = new char[0x100];
-            Arrays.fill(b2cSB, (char)UNMAPPABLE_DECODING);
+            Arrays.fill(b2cSB, UNMAPPABLE_DECODING);
         }
         Decoder_EBCDIC_DBCSONLY(Charset cs, char[][] b2c, int b2Min, int b2Max) {
             super(cs, 0.5f, 1.0f, b2c, b2cSB, b2Min, b2Max);
--- a/jdk/src/share/classes/sun/nio/cs/ext/EUC_JP.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/share/classes/sun/nio/cs/ext/EUC_JP.java	Wed Jul 21 09:57:21 2010 -0700
@@ -79,8 +79,10 @@
         JIS_X_0201.Decoder decoderJ0201;
         JIS_X_0212_Decoder decoderJ0212;
 
-        short[] j0208Index1;
-        String[] j0208Index2;
+        private static final short[] j0208Index1 =
+          JIS_X_0208_Decoder.getIndex1();
+        private static final String[] j0208Index2 =
+          JIS_X_0208_Decoder.getIndex2();
 
         protected Decoder(Charset cs) {
             super(cs);
@@ -88,8 +90,6 @@
             decoderJ0212 = new JIS_X_0212_Decoder(cs);
             start = 0xa1;
             end = 0xfe;
-            j0208Index1 = super.getIndex1();
-            j0208Index2 = super.getIndex2();
         }
         protected char decode0212(int byte1, int byte2) {
              return decoderJ0212.decodeDouble(byte1, byte2);
@@ -238,8 +238,10 @@
         JIS_X_0201.Encoder encoderJ0201;
         JIS_X_0212_Encoder encoderJ0212;
 
-        short[] j0208Index1;
-        String[] j0208Index2;
+        private static final short[] j0208Index1 =
+          JIS_X_0208_Encoder.getIndex1();
+        private static final String[] j0208Index2 =
+          JIS_X_0208_Encoder.getIndex2();
 
         private final Surrogate.Parser sgp = new Surrogate.Parser();
 
@@ -247,8 +249,6 @@
             super(cs, 3.0f, 3.0f);
             encoderJ0201 = new JIS_X_0201.Encoder(cs);
             encoderJ0212 = new JIS_X_0212_Encoder(cs);
-            j0208Index1 = super.getIndex1();
-            j0208Index2 = super.getIndex2();
         }
 
         public boolean canEncode(char c) {
--- a/jdk/src/share/classes/sun/nio/cs/ext/EUC_JP_LINUX.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/share/classes/sun/nio/cs/ext/EUC_JP_LINUX.java	Wed Jul 21 09:57:21 2010 -0700
@@ -65,20 +65,18 @@
 
     private static class Decoder extends CharsetDecoder {
         JIS_X_0201.Decoder decoderJ0201;
-        JIS_X_0208_Decoder decodeMappingJ0208;
         protected final char REPLACE_CHAR='\uFFFD';
 
-        short[] jis0208Index1;
-        String[] jis0208Index2;
+        private static final int start = 0xa1;
+        private static final int end = 0xfe;
+        private static final short[] jis0208Index1 =
+            JIS_X_0208_Decoder.getIndex1();
+        private static final String[] jis0208Index2 =
+            JIS_X_0208_Decoder.getIndex2();
 
         private Decoder(Charset cs) {
             super(cs, 1.0f, 1.0f);
             decoderJ0201 = new JIS_X_0201.Decoder(cs);
-            decodeMappingJ0208 = new JIS_X_0208_Decoder(cs);
-            decodeMappingJ0208.start = 0xa1;
-            decodeMappingJ0208.end = 0xfe;
-            jis0208Index1 = decodeMappingJ0208.getIndex1();
-            jis0208Index2 = decodeMappingJ0208.getIndex2();
         }
 
         protected char convSingleByte(int b) {
@@ -93,11 +91,11 @@
             }
 
             if (((byte1 < 0) || (byte1 > jis0208Index1.length))
-                || ((byte2 < decodeMappingJ0208.start) || (byte2 > decodeMappingJ0208.end)))
+                || ((byte2 < start) || (byte2 > end)))
                 return REPLACE_CHAR;
 
-            int n = (jis0208Index1[byte1 - 0x80] & 0xf) * (decodeMappingJ0208.end - decodeMappingJ0208.start + 1)
-                    + (byte2 - decodeMappingJ0208.start);
+            int n = (jis0208Index1[byte1 - 0x80] & 0xf) * (end - start + 1)
+                    + (byte2 - start);
             return jis0208Index2[jis0208Index1[byte1 - 0x80] >> 4].charAt(n);
         }
 
@@ -213,18 +211,16 @@
     private static class Encoder extends CharsetEncoder {
 
         JIS_X_0201.Encoder encoderJ0201;
-        JIS_X_0208_Encoder encoderJ0208;
 
         private final Surrogate.Parser sgp = new Surrogate.Parser();
-        short[] jis0208Index1;
-        String[] jis0208Index2;
+        private static final short[] jis0208Index1 =
+            JIS_X_0208_Encoder.getIndex1();
+        private static final String[] jis0208Index2 =
+            JIS_X_0208_Encoder.getIndex2();
 
         private Encoder(Charset cs) {
             super(cs, 2.0f, 2.0f);
             encoderJ0201 = new JIS_X_0201.Encoder(cs);
-            encoderJ0208 = new JIS_X_0208_Encoder(cs);
-            jis0208Index1 = encoderJ0208.getIndex1();
-            jis0208Index2 = encoderJ0208.getIndex2();
         }
 
         public boolean canEncode(char c) {
--- a/jdk/src/share/classes/sun/nio/cs/ext/EUC_JP_Open.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/share/classes/sun/nio/cs/ext/EUC_JP_Open.java	Wed Jul 21 09:57:21 2010 -0700
@@ -75,8 +75,12 @@
         JIS_X_0212_Solaris_Decoder decodeMappingJ0212;
         JIS_X_0208_Solaris_Decoder decodeMappingJ0208;
 
-        short[] j0208Index1;
-        String[] j0208Index2;
+        private static final short[] j0208Index1 =
+          JIS_X_0208_Solaris_Decoder.getIndex1();
+        private static final String[] j0208Index2 =
+          JIS_X_0208_Solaris_Decoder.getIndex2();
+        private static final int start = 0xa1;
+        private static final int end = 0xfe;
 
         protected final char REPLACE_CHAR='\uFFFD';
 
@@ -84,11 +88,6 @@
             super(cs);
             decoderJ0201 = new JIS_X_0201.Decoder(cs);
             decodeMappingJ0212 = new JIS_X_0212_Solaris_Decoder(cs);
-            decodeMappingJ0208 = new JIS_X_0208_Solaris_Decoder(cs);
-            decodeMappingJ0208.start = 0xa1;
-            decodeMappingJ0208.end = 0xfe;
-            j0208Index1 = decodeMappingJ0208.getIndex1();
-            j0208Index2 = decodeMappingJ0208.getIndex2();
         }
 
 
@@ -103,9 +102,9 @@
             }
 
             if (((byte1 < 0)
-                || (byte1 > decodeMappingJ0208.getIndex1().length))
-                || ((byte2 < decodeMappingJ0208.start)
-                || (byte2 > decodeMappingJ0208.end)))
+                || (byte1 > j0208Index1.length))
+                || ((byte2 < start)
+                || (byte2 > end)))
                 return REPLACE_CHAR;
 
             char result = super.decodeDouble(byte1, byte2);
@@ -113,8 +112,8 @@
                 return result;
             } else {
                 int n = (j0208Index1[byte1 - 0x80] & 0xf) *
-                        (decodeMappingJ0208.end - decodeMappingJ0208.start + 1)
-                        + (byte2 - decodeMappingJ0208.start);
+                        (end - start + 1)
+                        + (byte2 - start);
                 return j0208Index2[j0208Index1[byte1 - 0x80] >> 4].charAt(n);
             }
         }
@@ -125,10 +124,11 @@
 
         JIS_X_0201.Encoder encoderJ0201;
         JIS_X_0212_Solaris_Encoder encoderJ0212;
-        JIS_X_0208_Solaris_Encoder encoderJ0208;
 
-        short[] j0208Index1;
-        String[] j0208Index2;
+        private static final short[] j0208Index1 =
+            JIS_X_0208_Solaris_Encoder.getIndex1();
+        private static final String[] j0208Index2 =
+            JIS_X_0208_Solaris_Encoder.getIndex2();
 
         private final Surrogate.Parser sgp = new Surrogate.Parser();
 
@@ -136,9 +136,6 @@
             super(cs);
             encoderJ0201 = new JIS_X_0201.Encoder(cs);
             encoderJ0212 = new JIS_X_0212_Solaris_Encoder(cs);
-            encoderJ0208 = new JIS_X_0208_Solaris_Encoder(cs);
-            j0208Index1 = encoderJ0208.getIndex1();
-            j0208Index2 = encoderJ0208.getIndex2();
         }
 
         protected int encodeSingle(char inputChar, byte[] outputByte) {
--- a/jdk/src/share/classes/sun/nio/cs/ext/EUC_TW.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/share/classes/sun/nio/cs/ext/EUC_TW.java	Wed Jul 21 09:57:21 2010 -0700
@@ -34,7 +34,6 @@
 import java.nio.charset.CoderResult;
 import java.util.Arrays;
 import sun.nio.cs.HistoricallyNamedCharset;
-import sun.nio.cs.Surrogate;
 import static sun.nio.cs.CharsetMapping.*;
 
 public class EUC_TW extends Charset implements HistoricallyNamedCharset
@@ -159,8 +158,8 @@
                 c1[0] = c;
                 return c1;
             } else {
-                c2[0] = Surrogate.high(0x20000 + c);
-                c2[1] = Surrogate.low(0x20000 + c);
+                c2[0] = Character.highSurrogate(0x20000 + c);
+                c2[1] = Character.lowSurrogate(0x20000 + c);
                 return c2;
             }
         }
@@ -423,7 +422,7 @@
                     if (dst.remaining() < outSize)
                         return CoderResult.OVERFLOW;
                     for (int i = 0; i < outSize; i++)
-                        dst.put((byte)bb[i]);
+                        dst.put(bb[i]);
                     mark += inSize;
                 }
                 return CoderResult.UNDERFLOW;
@@ -441,7 +440,7 @@
         }
 
         static int encode(char hi, char low, byte[] bb) {
-            int c = Surrogate.toUCS4(hi, low);
+            int c = Character.toCodePoint(hi, low);
             if ((c & 0xf0000) != 0x20000)
                 return -1;
             c -= 0x20000;
--- a/jdk/src/share/classes/sun/nio/cs/ext/GB18030.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/share/classes/sun/nio/cs/ext/GB18030.java	Wed Jul 21 09:57:21 2010 -0700
@@ -12339,7 +12339,7 @@
             int start = 0x40, end = 0xFE;
             if (((byte1 < 0) || (byte1 > index1.length))
                 || ((byte2 < start) || (byte2 > end)))
-                return (char)'\uFFFD';
+                return '\uFFFD';
 
             int n = (index1[byte1] & 0xf) * (end - start + 1) + (byte2 - start);
             return index2[index1[byte1] >> 4].charAt(n);
@@ -12628,7 +12628,7 @@
                     if (Character.isSurrogate(c)) {
                         if ((condensedKey=sgp.parse(c, sa, sp, sl)) < 0)
                             return sgp.error();
-                        // Surogate.toUCS4 looks like
+                        // Character.toCodePoint looks like
                         // (((high & 0x3ff) << 10) | (low & 0x3ff)) + 0x10000;
                         // so we add (0x2e248 - 0x10000) to get the "key".
                         condensedKey += 0x1E248;
--- a/jdk/src/share/classes/sun/nio/cs/ext/HKSCS.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/share/classes/sun/nio/cs/ext/HKSCS.java	Wed Jul 21 09:57:21 2010 -0700
@@ -43,7 +43,7 @@
 
         private char[][] b2cBmp;
         private char[][] b2cSupp;
-        private static DoubleByte.Decoder big5Dec;
+        private DoubleByte.Decoder big5Dec;
 
         protected Decoder(Charset cs,
                           DoubleByte.Decoder big5Dec,
@@ -355,7 +355,7 @@
                             c2b[hi] = new char[0x100];
                             Arrays.fill(c2b[hi], (char)UNMAPPABLE_ENCODING);
                         }
-                        c2b[hi][c & 0xff] = (char)bb;
+                        c2b[hi][c & 0xff] = bb;
                     }
                     c++;
                 }
--- a/jdk/src/share/classes/sun/nio/cs/ext/IBM33722.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/share/classes/sun/nio/cs/ext/IBM33722.java	Wed Jul 21 09:57:21 2010 -0700
@@ -36,7 +36,6 @@
 import java.nio.charset.CharsetEncoder;
 import java.nio.charset.CoderResult;
 import sun.nio.cs.HistoricallyNamedCharset;
-import sun.nio.cs.Surrogate;
 
 public class IBM33722
     extends Charset
--- a/jdk/src/share/classes/sun/nio/cs/ext/IBM964.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/share/classes/sun/nio/cs/ext/IBM964.java	Wed Jul 21 09:57:21 2010 -0700
@@ -36,7 +36,6 @@
 import java.nio.charset.CharsetEncoder;
 import java.nio.charset.CoderResult;
 import sun.nio.cs.HistoricallyNamedCharset;
-import sun.nio.cs.Surrogate;
 
 public class IBM964
     extends Charset
--- a/jdk/src/share/classes/sun/nio/cs/ext/ISO2022.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/share/classes/sun/nio/cs/ext/ISO2022.java	Wed Jul 21 09:57:21 2010 -0700
@@ -104,15 +104,15 @@
             switch(shiftFlag) {
             case SOFlag:
                 tmpIndex = curSODes;
-                tmpDecoder = (CharsetDecoder [])SODecoder;
+                tmpDecoder = SODecoder;
                 break;
             case SS2Flag:
                 tmpIndex = curSS2Des;
-                tmpDecoder = (CharsetDecoder [])SS2Decoder;
+                tmpDecoder = SS2Decoder;
                 break;
             case SS3Flag:
                 tmpIndex = curSS3Des;
-                tmpDecoder = (CharsetDecoder [])SS3Decoder;
+                tmpDecoder = SS3Decoder;
                 break;
             }
 
--- a/jdk/src/share/classes/sun/nio/cs/ext/JISAutoDetect.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/share/classes/sun/nio/cs/ext/JISAutoDetect.java	Wed Jul 21 09:57:21 2010 -0700
@@ -82,11 +82,11 @@
      * with the sun.io JISAutoDetect implementation
      */
 
-    public byte[] getByteMask1() {
+    public static byte[] getByteMask1() {
         return Decoder.maskTable1;
     }
 
-    public byte[] getByteMask2() {
+    public static byte[] getByteMask2() {
         return Decoder.maskTable2;
     }
 
--- a/jdk/src/share/classes/sun/nio/cs/ext/PCK.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/share/classes/sun/nio/cs/ext/PCK.java	Wed Jul 21 09:57:21 2010 -0700
@@ -101,17 +101,15 @@
     private static class Encoder extends SJIS.Encoder {
 
         private JIS_X_0201.Encoder jis0201;
-        private JIS_X_0208_Solaris_Encoder jis0208;
 
-        short[] j0208Index1;
-        String[] j0208Index2;
+        private static final short[] j0208Index1 =
+            JIS_X_0208_Solaris_Encoder.getIndex1();
+        private static final String[] j0208Index2 =
+            JIS_X_0208_Solaris_Encoder.getIndex2();
 
         private Encoder(Charset cs) {
             super(cs);
             jis0201 = new JIS_X_0201.Encoder(cs);
-            jis0208 = new JIS_X_0208_Solaris_Encoder(cs);
-            j0208Index1 = jis0208.getIndex1();
-            j0208Index2 = jis0208.getIndex2();
         }
 
         protected int encodeDouble(char ch) {
@@ -121,7 +119,7 @@
 
             switch (ch) {
                 case '\u2015':
-                    return (int)0x815C;
+                    return 0x815C;
                 case '\u2014':
                     return 0;
                 default:
--- a/jdk/src/share/classes/sun/nio/cs/ext/SJIS.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/share/classes/sun/nio/cs/ext/SJIS.java	Wed Jul 21 09:57:21 2010 -0700
@@ -114,14 +114,14 @@
 
         private JIS_X_0201.Encoder jis0201;
 
-        short[] j0208Index1;
-        String[] j0208Index2;
+        private static final short[] j0208Index1 =
+            JIS_X_0208_Encoder.getIndex1();
+        private static final String[] j0208Index2 =
+            JIS_X_0208_Encoder.getIndex2();
 
         protected Encoder(Charset cs) {
             super(cs);
             jis0201 = new JIS_X_0201.Encoder(cs);
-            j0208Index1 = super.getIndex1();
-            j0208Index2 = super.getIndex2();
         }
 
         protected int encodeSingle(char inputChar) {
--- a/jdk/src/share/classes/sun/rmi/rmic/BatchEnvironment.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/share/classes/sun/rmi/rmic/BatchEnvironment.java	Wed Jul 21 09:57:21 2010 -0700
@@ -429,7 +429,7 @@
                         st.hasMoreTokens();) {
                         String elt = st.nextToken();
                         if (jarParent != null)
-                            elt = new File(jarParent, elt).toString();
+                            elt = new File(jarParent, elt).getCanonicalPath();
                         addFile(elt, warn);
                     }
                 } finally {
--- a/jdk/src/share/classes/sun/security/krb5/Credentials.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/share/classes/sun/security/krb5/Credentials.java	Wed Jul 21 09:57:21 2010 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 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
@@ -33,9 +33,7 @@
 
 import sun.security.krb5.internal.*;
 import sun.security.krb5.internal.ccache.CredentialsCache;
-import sun.security.krb5.internal.ktab.*;
 import sun.security.krb5.internal.crypto.EType;
-import java.io.File;
 import java.io.IOException;
 import java.util.Date;
 import java.net.InetAddress;
@@ -506,59 +504,6 @@
         return result;
     }
 
-
-    /**
-     * Gets service credential from key table. The credential is used to
-     * decrypt the received client message
-     * and authenticate the client by verifying the client's credential.
-     *
-     * @param serviceName the name of service, using format component@realm
-     * @param keyTabFile the file of key table.
-     * @return a <code>KrbCreds</code> object.
-     */
-    public static Credentials getServiceCreds(String serviceName,
-                                              File keyTabFile) {
-        EncryptionKey k = null;
-        PrincipalName service = null;
-        Credentials result = null;
-        try {
-            service = new PrincipalName(serviceName);
-            if (service.getRealm() == null) {
-                String realm = Config.getInstance().getDefaultRealm();
-                if (realm == null) {
-                    return null;
-                } else {
-                    service.setRealm(realm);
-                }
-            }
-        } catch (RealmException e) {
-            if (DEBUG) {
-                e.printStackTrace();
-            }
-            return null;
-        } catch (KrbException e) {
-            if (DEBUG) {
-                e.printStackTrace();
-            }
-            return null;
-        }
-        KeyTab kt;
-        if (keyTabFile == null) {
-            kt = KeyTab.getInstance();
-        } else {
-            kt = KeyTab.getInstance(keyTabFile);
-        }
-        if ((kt != null) && (kt.findServiceEntry(service))) {
-            k = kt.readServiceKey(service);
-            result = new Credentials(null, service, null, null, null,
-                                     null, null, null, null, null);
-            result.serviceKey = k;
-        }
-        return result;
-    }
-
-
-
     /**
      * Acquires credentials for a specified service using initial credential.
      * When the service has a different realm
--- a/jdk/src/share/classes/sun/security/krb5/EncryptedData.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/share/classes/sun/security/krb5/EncryptedData.java	Wed Jul 21 09:57:21 2010 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 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
@@ -336,38 +336,29 @@
     }
 
     /**
-     * Reset data stream after decryption, remove redundant bytes.
+     * Reset asn.1 data stream after decryption, remove redundant bytes.
      * @param data the decrypted data from decrypt().
-     * @param encoded true if the encrypted data is ASN1 encoded data,
-     * false if the encrypted data is not ASN1 encoded data.
      * @return the reset byte array which holds exactly one asn1 datum
      * including its tag and length.
      *
      */
-    public byte[] reset(byte[] data, boolean encoded) {
+    public byte[] reset(byte[] data) {
         byte[]  bytes = null;
-        // if it is encoded data, we use length field to
+        // for asn.1 encoded data, we use length field to
         // determine the data length and remove redundant paddings.
-        if (encoded) {
-            if ((data[1] & 0xFF) < 128) {
-                bytes = new byte[data[1] + 2];
-                System.arraycopy(data, 0, bytes, 0, data[1] + 2);
-            } else
-                if ((data[1] & 0xFF) > 128) {
-                    int len = data[1] & (byte)0x7F;
-                    int result = 0;
-                    for (int i = 0; i < len; i++) {
-                        result |= (data[i + 2] & 0xFF) << (8 * (len - i - 1));
-                    }
-                    bytes = new byte[result + len + 2];
-                    System.arraycopy(data, 0, bytes, 0, result + len + 2);
+        if ((data[1] & 0xFF) < 128) {
+            bytes = new byte[data[1] + 2];
+            System.arraycopy(data, 0, bytes, 0, data[1] + 2);
+        } else {
+            if ((data[1] & 0xFF) > 128) {
+                int len = data[1] & (byte)0x7F;
+                int result = 0;
+                for (int i = 0; i < len; i++) {
+                    result |= (data[i + 2] & 0xFF) << (8 * (len - i - 1));
                 }
-        } else {
-            // if it is not encoded, which happens in GSS tokens,
-            // we remove padding data according to padding pattern.
-            bytes = new byte[data.length - data[data.length - 1]];
-            System.arraycopy(data, 0, bytes, 0,
-                             data.length - data[data.length - 1]);
+                bytes = new byte[result + len + 2];
+                System.arraycopy(data, 0, bytes, 0, result + len + 2);
+            }
         }
         return bytes;
     }
--- a/jdk/src/share/classes/sun/security/krb5/EncryptionKey.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/share/classes/sun/security/krb5/EncryptionKey.java	Wed Jul 21 09:57:21 2010 -0700
@@ -188,24 +188,13 @@
             etypes = EType.getBuiltInDefaults();
         }
 
-        // set the preferred etype for preauth
-        if ((pa_exists) && (pa_etype != EncryptedData.ETYPE_NULL)) {
-            if (DEBUG) {
-                System.out.println("Pre-Authentication: " +
-                        "Set preferred etype = " + pa_etype);
-            }
-            if (EType.isSupported(pa_etype)) {
-                // reset etypes to preferred value
-                etypes = new int[1];
-                etypes[0] = pa_etype;
-            }
-        }
-
         EncryptionKey[] encKeys = new EncryptionKey[etypes.length];
         for (int i = 0; i < etypes.length; i++) {
             if (EType.isSupported(etypes[i])) {
+                byte[] s2kparams = (pa_exists && etypes[i] == pa_etype)
+                        ? pa_s2kparams : null;
                 encKeys[i] = new EncryptionKey(
-                        stringToKey(password, salt, pa_s2kparams, etypes[i]),
+                        stringToKey(password, salt, s2kparams, etypes[i]),
                         etypes[i], null);
             } else {
                 if (DEBUG) {
--- a/jdk/src/share/classes/sun/security/krb5/KrbApRep.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/share/classes/sun/security/krb5/KrbApRep.java	Wed Jul 21 09:57:21 2010 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 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
@@ -130,7 +130,7 @@
 
         byte[] temp = rep.encPart.decrypt(tgs_creds.key,
             KeyUsage.KU_ENC_AP_REP_PART);
-        byte[] enc_ap_rep_part = rep.encPart.reset(temp, true);
+        byte[] enc_ap_rep_part = rep.encPart.reset(temp);
 
         encoding = new DerValue(enc_ap_rep_part);
         encPart = new EncAPRepPart(encoding);
--- a/jdk/src/share/classes/sun/security/krb5/KrbApReq.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/share/classes/sun/security/krb5/KrbApReq.java	Wed Jul 21 09:57:21 2010 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 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
@@ -279,14 +279,14 @@
 
         byte[] bytes = apReqMessg.ticket.encPart.decrypt(dkey,
             KeyUsage.KU_TICKET);
-        byte[] temp = apReqMessg.ticket.encPart.reset(bytes, true);
+        byte[] temp = apReqMessg.ticket.encPart.reset(bytes);
         EncTicketPart enc_ticketPart = new EncTicketPart(temp);
 
         checkPermittedEType(enc_ticketPart.key.getEType());
 
         byte[] bytes2 = apReqMessg.authenticator.decrypt(enc_ticketPart.key,
             KeyUsage.KU_AP_REQ_AUTHENTICATOR);
-        byte[] temp2 = apReqMessg.authenticator.reset(bytes2, true);
+        byte[] temp2 = apReqMessg.authenticator.reset(bytes2);
         authenticator = new Authenticator(temp2);
         ctime = authenticator.ctime;
         cusec = authenticator.cusec;
--- a/jdk/src/share/classes/sun/security/krb5/KrbAsRep.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/share/classes/sun/security/krb5/KrbAsRep.java	Wed Jul 21 09:57:21 2010 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2005, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 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
@@ -95,7 +95,7 @@
 
         byte[] enc_as_rep_bytes = rep.encPart.decrypt(dkey,
             KeyUsage.KU_ENC_AS_REP_PART);
-        byte[] enc_as_rep_part = rep.encPart.reset(enc_as_rep_bytes, true);
+        byte[] enc_as_rep_part = rep.encPart.reset(enc_as_rep_bytes);
 
         encoding = new DerValue(enc_as_rep_part);
         EncASRepPart enc_part = new EncASRepPart(encoding);
--- a/jdk/src/share/classes/sun/security/krb5/KrbAsReq.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/share/classes/sun/security/krb5/KrbAsReq.java	Wed Jul 21 09:57:21 2010 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 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
@@ -342,23 +342,20 @@
         }
 
         princName = cname;
-
-        EncryptionKey key = null;
-        int[] tktETypes = null;
-        if (pa_exists && pa_etype != EncryptedData.ETYPE_NULL) {
-            if (DEBUG) {
-                System.out.println("Pre-Authenticaton: find key for etype = " + pa_etype);
-            }
-            key = EncryptionKey.findKey(pa_etype, keys);
-            tktETypes = new int[1];
-            tktETypes[0] = pa_etype;
-        } else {
-            tktETypes = EType.getDefaults("default_tkt_enctypes", keys);
-            key = EncryptionKey.findKey(tktETypes[0], keys);
-        }
-
+        int[] tktETypes = EType.getDefaults("default_tkt_enctypes", keys);
         PAData[] paData = null;
         if (PA_ENC_TIMESTAMP_REQUIRED) {
+            EncryptionKey key = null;
+            if (pa_etype != EncryptedData.ETYPE_NULL) {
+                if (DEBUG) {
+                    System.out.println("Pre-Authenticaton: find key for etype = " + pa_etype);
+                }
+                key = EncryptionKey.findKey(pa_etype, keys);
+            } else {
+                if (tktETypes.length > 0) {
+                    key = EncryptionKey.findKey(tktETypes[0], keys);
+                }
+            }
             if (DEBUG) {
                 System.out.println("AS-REQ: Add PA_ENC_TIMESTAMP now");
             }
--- a/jdk/src/share/classes/sun/security/krb5/KrbCred.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/share/classes/sun/security/krb5/KrbCred.java	Wed Jul 21 09:57:21 2010 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 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
@@ -130,7 +130,7 @@
 
         byte[] temp = credMessg.encPart.decrypt(key,
             KeyUsage.KU_ENC_KRB_CRED_PART);
-        byte[] plainText = credMessg.encPart.reset(temp, true);
+        byte[] plainText = credMessg.encPart.reset(temp);
         DerValue encoding = new DerValue(plainText);
         EncKrbCredPart encPart = new EncKrbCredPart(encoding);
 
--- a/jdk/src/share/classes/sun/security/krb5/KrbPriv.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/share/classes/sun/security/krb5/KrbPriv.java	Wed Jul 21 09:57:21 2010 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 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
@@ -31,7 +31,6 @@
 
 package sun.security.krb5;
 
-import sun.security.krb5.EncryptionKey;
 import sun.security.krb5.internal.*;
 import sun.security.krb5.internal.crypto.*;
 import sun.security.util.*;
@@ -159,7 +158,7 @@
 
                                byte[] bytes = krb_priv.encPart.decrypt(key,
                                    KeyUsage.KU_ENC_KRB_PRIV_PART);
-                               byte[] temp = krb_priv.encPart.reset(bytes, true);
+                               byte[] temp = krb_priv.encPart.reset(bytes);
                                DerValue ref = new DerValue(temp);
                                EncKrbPrivPart enc_part = new EncKrbPrivPart(ref);
 
--- a/jdk/src/share/classes/sun/security/krb5/KrbTgsRep.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/share/classes/sun/security/krb5/KrbTgsRep.java	Wed Jul 21 09:57:21 2010 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2005, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 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
@@ -79,7 +79,7 @@
             tgsReq.usedSubkey() ? KeyUsage.KU_ENC_TGS_REP_PART_SUBKEY :
             KeyUsage.KU_ENC_TGS_REP_PART_SESSKEY);
 
-        byte[] enc_tgs_rep_part = rep.encPart.reset(enc_tgs_rep_bytes, true);
+        byte[] enc_tgs_rep_part = rep.encPart.reset(enc_tgs_rep_bytes);
         ref = new DerValue(enc_tgs_rep_part);
         EncTGSRepPart enc_part = new EncTGSRepPart(ref);
         rep.ticket.sname.setRealm(rep.ticket.realm);
--- a/jdk/src/share/classes/sun/security/krb5/internal/KRBError.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/share/classes/sun/security/krb5/internal/KRBError.java	Wed Jul 21 09:57:21 2010 -0700
@@ -286,6 +286,19 @@
                         salt = info.getSalt();
                         if (DEBUG) {
                             System.out.println("\t PA-ETYPE-INFO etype = " + etype);
+                            System.out.println("\t PA-ETYPE-INFO salt = " + salt);
+                        }
+                        while (der.data.available() > 0) {
+                            value = der.data.getDerValue();
+                            info = new ETypeInfo(value);
+                            if (DEBUG) {
+                                etype = info.getEType();
+                                System.out.println("\t salt for " + etype
+                                        + " is " + info.getSalt());
+                            }
+                            if (salt == null || salt.isEmpty()) {
+                                salt = info.getSalt();
+                            }
                         }
                     }
                     break;
@@ -299,6 +312,19 @@
                         s2kparams = info2.getParams();
                         if (DEBUG) {
                             System.out.println("\t PA-ETYPE-INFO2 etype = " + etype);
+                            System.out.println("\t PA-ETYPE-INFO salt = " + salt);
+                        }
+                        while (der.data.available() > 0) {
+                            value = der.data.getDerValue();
+                            info2 = new ETypeInfo2(value);
+                            if (DEBUG) {
+                                etype = info2.getEType();
+                                System.out.println("\t salt for " + etype
+                                        + " is " + info2.getSalt());
+                            }
+                            if (salt == null || salt.isEmpty()) {
+                                salt = info2.getSalt();
+                            }
                         }
                     }
                     break;
--- a/jdk/src/share/classes/sun/security/krb5/internal/KerberosTime.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/share/classes/sun/security/krb5/internal/KerberosTime.java	Wed Jul 21 09:57:21 2010 -0700
@@ -57,11 +57,20 @@
  * specification available at
  * <a href="http://www.ietf.org/rfc/rfc4120.txt">
  * http://www.ietf.org/rfc/rfc4120.txt</a>.
+ *
+ * The implementation also includes the microseconds info so that the
+ * same class can be used as a precise timestamp in Authenticator etc.
  */
 
 public class KerberosTime implements Cloneable {
 
     private long kerberosTime; // milliseconds since epoch, a Date.getTime() value
+    private int  microSeconds; // the last three digits of the microsecond value
+
+    // The time when this class is loaded. Used in setNow()
+    private static final long initMilli = System.currentTimeMillis();
+    private static final long initMicro = System.nanoTime() / 1000;
+
     private static long syncTime;
     private static boolean DEBUG = Krb5.DEBUG;
 
@@ -77,9 +86,13 @@
         kerberosTime = time;
     }
 
+    private KerberosTime(long time, int micro) {
+        kerberosTime = time;
+        microSeconds = micro;
+    }
 
     public Object clone() {
-        return new KerberosTime(kerberosTime);
+        return new KerberosTime(kerberosTime, microSeconds);
     }
 
     // This constructor is used in the native code
@@ -109,8 +122,8 @@
         //  |   | | | | | |
         //  0   4 6 8 | | |
         //           10 | |
-        //                         12 |
-        //                           14
+        //             12 |
+        //               14
 
         if (time.length() != 15)
             throw new Asn1Exception(Krb5.ASN1_BAD_TIMEFORMAT);
@@ -148,11 +161,8 @@
 
     public KerberosTime(boolean initToNow) {
         if (initToNow) {
-            Date temp = new Date();
-            setTime(temp);
+            setNow();
         }
-        else
-            kerberosTime = 0;
     }
 
     /**
@@ -192,10 +202,12 @@
 
     public void setTime(Date time) {
         kerberosTime = time.getTime(); // (time.getTimezoneOffset() * 60000L);
+        microSeconds = 0;
     }
 
     public void setTime(long time) {
         kerberosTime = time;
+        microSeconds = 0;
     }
 
     public Date toDate() {
@@ -205,16 +217,18 @@
     }
 
     public void setNow() {
-        Date temp = new Date();
-        setTime(temp);
+        long microElapsed = System.nanoTime() / 1000 - initMicro;
+        setTime(initMilli + microElapsed/1000);
+        microSeconds = (int)(microElapsed % 1000);
     }
 
     public int getMicroSeconds() {
         Long temp_long = new Long((kerberosTime % 1000L) * 1000L);
-        return temp_long.intValue();
+        return temp_long.intValue() + microSeconds;
     }
 
     public void setMicroSeconds(int usec) {
+        microSeconds = usec % 1000;
         Integer temp_int = new Integer(usec);
         long temp_long = temp_int.longValue() / 1000L;
         kerberosTime = kerberosTime - (kerberosTime % 1000L) + temp_long;
@@ -222,6 +236,7 @@
 
     public void setMicroSeconds(Integer usec) {
         if (usec != null) {
+            microSeconds = usec.intValue() % 1000;
             long temp_long = usec.longValue() / 1000L;
             kerberosTime = kerberosTime - (kerberosTime % 1000L) + temp_long;
         }
@@ -262,7 +277,9 @@
     }
 
     public boolean greaterThan(KerberosTime time) {
-        return kerberosTime > time.kerberosTime;
+        return kerberosTime > time.kerberosTime ||
+            kerberosTime == time.kerberosTime &&
+                    microSeconds > time.microSeconds;
     }
 
     public boolean equals(Object obj) {
@@ -274,15 +291,17 @@
             return false;
         }
 
-        return kerberosTime == ((KerberosTime)obj).kerberosTime;
+        return kerberosTime == ((KerberosTime)obj).kerberosTime &&
+                microSeconds == ((KerberosTime)obj).microSeconds;
     }
 
     public int hashCode() {
-        return 37 * 17 + (int)(kerberosTime ^ (kerberosTime >>> 32));
+        int result = 37 * 17 + (int)(kerberosTime ^ (kerberosTime >>> 32));
+        return result * 17 + microSeconds;
     }
 
     public boolean isZero() {
-        return kerberosTime == 0;
+        return kerberosTime == 0 && microSeconds == 0;
     }
 
     public int getSeconds() {
--- a/jdk/src/share/classes/sun/security/krb5/internal/crypto/EType.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/share/classes/sun/security/krb5/internal/crypto/EType.java	Wed Jul 21 09:57:21 2010 -0700
@@ -185,20 +185,20 @@
     // is set to false.
 
     private static final int[] BUILTIN_ETYPES = new int[] {
-        EncryptedData.ETYPE_DES_CBC_MD5,
-        EncryptedData.ETYPE_DES_CBC_CRC,
+        EncryptedData.ETYPE_AES256_CTS_HMAC_SHA1_96,
+        EncryptedData.ETYPE_AES128_CTS_HMAC_SHA1_96,
+        EncryptedData.ETYPE_DES3_CBC_HMAC_SHA1_KD,
         EncryptedData.ETYPE_ARCFOUR_HMAC,
-        EncryptedData.ETYPE_DES3_CBC_HMAC_SHA1_KD,
-        EncryptedData.ETYPE_AES128_CTS_HMAC_SHA1_96,
-        EncryptedData.ETYPE_AES256_CTS_HMAC_SHA1_96,
+        EncryptedData.ETYPE_DES_CBC_CRC,
+        EncryptedData.ETYPE_DES_CBC_MD5,
     };
 
     private static final int[] BUILTIN_ETYPES_NOAES256 = new int[] {
-        EncryptedData.ETYPE_DES_CBC_MD5,
-        EncryptedData.ETYPE_DES_CBC_CRC,
+        EncryptedData.ETYPE_AES128_CTS_HMAC_SHA1_96,
+        EncryptedData.ETYPE_DES3_CBC_HMAC_SHA1_KD,
         EncryptedData.ETYPE_ARCFOUR_HMAC,
-        EncryptedData.ETYPE_DES3_CBC_HMAC_SHA1_KD,
-        EncryptedData.ETYPE_AES128_CTS_HMAC_SHA1_96,
+        EncryptedData.ETYPE_DES_CBC_CRC,
+        EncryptedData.ETYPE_DES_CBC_MD5,
     };
 
 
@@ -217,8 +217,8 @@
             result = BUILTIN_ETYPES;
         }
         if (!ALLOW_WEAK_CRYPTO) {
-            // The first 2 etypes are now weak ones
-            return Arrays.copyOfRange(result, 2, result.length);
+            // The last 2 etypes are now weak ones
+            return Arrays.copyOfRange(result, 0, result.length - 2);
         }
         return result;
     }
--- a/jdk/src/share/classes/sun/security/krb5/internal/ktab/KeyTab.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/share/classes/sun/security/krb5/internal/ktab/KeyTab.java	Wed Jul 21 09:57:21 2010 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 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
@@ -228,37 +228,6 @@
     }
 
     /**
-     * Reads the service key from the keytab file.
-     * @param service the PrincipalName of the requested service.
-     * @return the last service key in the keytab with the highest kvno
-     */
-    public EncryptionKey readServiceKey(PrincipalName service) {
-        KeyTabEntry entry = null;
-        EncryptionKey key = null;
-        if (entries != null) {
-            // Find latest entry for this service that has an etype
-            // that has been configured for use
-            for (int i = entries.size()-1; i >= 0; i--) {
-                entry = entries.elementAt(i);
-                if (entry.service.match(service)) {
-                    if (EType.isSupported(entry.keyType)) {
-                        if (key == null ||
-                                entry.keyVersion > key.getKeyVersionNumber()) {
-                            key = new EncryptionKey(entry.keyblock,
-                                             entry.keyType,
-                                             new Integer(entry.keyVersion));
-                        }
-                    } else if (DEBUG) {
-                        System.out.println("Found unsupported keytype (" +
-                            entry.keyType + ") for " + service);
-                    }
-                }
-            }
-        }
-        return key;
-    }
-
-    /**
      * Reads all keys for a service from the keytab file that have
      * etypes that have been configured for use. If there are multiple
      * keys with same etype, the one with the highest kvno is returned.
@@ -309,7 +278,7 @@
         Arrays.sort(retVal, new Comparator<EncryptionKey>() {
             @Override
             public int compare(EncryptionKey o1, EncryptionKey o2) {
-                if (etypes != null && etypes != EType.getBuiltInDefaults()) {
+                if (etypes != null) {
                     int o1EType = o1.getEType();
                     int o2EType = o2.getEType();
                     if (o1EType != o2EType) {
@@ -320,6 +289,9 @@
                                 return 1;
                             }
                         }
+                        // Neither o1EType nor o2EType in default_tkt_enctypes,
+                        // therefore won't be used in AS-REQ. We do not care
+                        // about their order, use kvno is OK.
                     }
                 }
                 return o2.getKeyVersionNumber().intValue()
--- a/jdk/src/share/classes/sun/security/pkcs12/PKCS12KeyStore.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/share/classes/sun/security/pkcs12/PKCS12KeyStore.java	Wed Jul 21 09:57:21 2010 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 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
@@ -180,24 +180,15 @@
         String alias;
     };
 
-    private static class KeyId {
-        byte[] keyId;
-
-        KeyId(byte[] keyId) {
+    // A certificate with its PKCS #9 attributes
+    private static class CertEntry {
+        final X509Certificate cert;
+        final byte[] keyId;
+        final String alias;
+        CertEntry(X509Certificate cert, byte[] keyId, String alias) {
+            this.cert = cert;
             this.keyId = keyId;
-        }
-        public int hashCode() {
-            int hash = 0;
-
-            for (int i = 0; i < keyId.length; i++)
-                hash += keyId[i];
-            return hash;
-        }
-        public boolean equals(Object obj) {
-            if (!(obj instanceof KeyId))
-                return false;
-            KeyId that = (KeyId)obj;
-            return (Arrays.equals(this.keyId, that.keyId));
+            this.alias = alias;
         }
     }
 
@@ -209,7 +200,9 @@
                                 new Hashtable<String, KeyEntry>();
 
     private ArrayList<KeyEntry> keyList = new ArrayList<KeyEntry>();
-    private LinkedHashMap<Object, X509Certificate> certs = new LinkedHashMap<Object, X509Certificate>();
+    private LinkedHashMap<X500Principal, X509Certificate> certsMap =
+            new LinkedHashMap<X500Principal, X509Certificate>();
+    private ArrayList<CertEntry> certEntries = new ArrayList<CertEntry>();
 
     /**
      * Returns the key associated with the given alias, using the given
@@ -472,6 +465,15 @@
         KeyEntry entry = new KeyEntry();
         entry.date = new Date();
 
+        try {
+            // set the keyId to current date
+            entry.keyId = ("Time " + (entry.date).getTime()).getBytes("UTF8");
+        } catch (UnsupportedEncodingException ex) {
+            // Won't happen
+        }
+        // set the alias
+        entry.alias = alias.toLowerCase();
+
         entry.protectedPrivKey = key.clone();
         if (chain != null) {
            entry.chain = chain.clone();
@@ -1027,10 +1029,9 @@
                 // All Certs should have a unique friendlyName.
                 // This change is made to meet NSS requirements.
                 byte[] bagAttrs = null;
-                String friendlyName = cert.getSubjectX500Principal().getName();
                 if (i == 0) {
                     // Only End-Entity Cert should have a localKeyId.
-                    bagAttrs = getBagAttributes(friendlyName, entry.keyId);
+                    bagAttrs = getBagAttributes(entry.alias, entry.keyId);
                 } else {
                     // Trusted root CA certs and Intermediate CA certs do not
                     // need to have a localKeyId, and hence localKeyId is null
@@ -1038,7 +1039,8 @@
                     // NSS pkcs12 library requires trusted CA certs in the
                     // certificate chain to have unique or null localKeyID.
                     // However, IE/OpenSSL do not impose this restriction.
-                    bagAttrs = getBagAttributes(friendlyName, null);
+                    bagAttrs = getBagAttributes(
+                            cert.getSubjectX500Principal().getName(), null);
                 }
                 if (bagAttrs != null) {
                     safeBag.write(bagAttrs);
@@ -1333,24 +1335,49 @@
             if (entry.keyId != null) {
                 ArrayList<X509Certificate> chain =
                                 new ArrayList<X509Certificate>();
-                X509Certificate cert = certs.get(new KeyId(entry.keyId));
+                X509Certificate cert = findMatchedCertificate(entry);
                 while (cert != null) {
                     chain.add(cert);
                     X500Principal issuerDN = cert.getIssuerX500Principal();
                     if (issuerDN.equals(cert.getSubjectX500Principal())) {
                         break;
                     }
-                    cert = certs.get(issuerDN);
+                    cert = certsMap.get(issuerDN);
                 }
                 /* Update existing KeyEntry in entries table */
                 if (chain.size() > 0)
                     entry.chain = chain.toArray(new Certificate[chain.size()]);
             }
         }
-        certs.clear();
+        certEntries.clear();
+        certsMap.clear();
         keyList.clear();
     }
 
+    /**
+     * Locates a matched CertEntry from certEntries, and returns its cert.
+     * @param entry the KeyEntry to match
+     * @return a certificate, null if not found
+     */
+    private X509Certificate findMatchedCertificate(KeyEntry entry) {
+        CertEntry keyIdMatch = null;
+        CertEntry aliasMatch = null;
+        for (CertEntry ce: certEntries) {
+            if (Arrays.equals(entry.keyId, ce.keyId)) {
+                keyIdMatch = ce;
+                if (entry.alias.equalsIgnoreCase(ce.alias)) {
+                    // Full match!
+                    return ce.cert;
+                }
+            } else if (entry.alias.equalsIgnoreCase(ce.alias)) {
+                aliasMatch = ce;
+            }
+        }
+        // keyId match first, for compatibility
+        if (keyIdMatch != null) return keyIdMatch.cert;
+        else if (aliasMatch != null) return aliasMatch.cert;
+        else return null;
+    }
 
     private void loadSafeContents(DerInputStream stream, char[] password)
         throws IOException, NoSuchAlgorithmException, CertificateException
@@ -1491,19 +1518,12 @@
                         keyId = "01".getBytes("UTF8");
                     }
                 }
-                if (keyId != null) {
-                    KeyId keyid = new KeyId(keyId);
-                    if (!certs.containsKey(keyid))
-                        certs.put(keyid, cert);
-                }
-                if (alias != null) {
-                    if (!certs.containsKey(alias))
-                        certs.put(alias, cert);
-                }
+                certEntries.add(new CertEntry(cert, keyId, alias));
                 X500Principal subjectDN = cert.getSubjectX500Principal();
                 if (subjectDN != null) {
-                    if (!certs.containsKey(subjectDN))
-                        certs.put(subjectDN, cert);
+                    if (!certsMap.containsKey(subjectDN)) {
+                        certsMap.put(subjectDN, cert);
+                    }
                 }
             }
         }
--- a/jdk/src/share/classes/sun/security/provider/X509Factory.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/share/classes/sun/security/provider/X509Factory.java	Wed Jul 21 09:57:21 2010 -0700
@@ -518,6 +518,7 @@
 
             // Step 2: Read the rest of header, determine the line end
             int end;
+            StringBuffer header = new StringBuffer("-----");
             while (true) {
                 int next = is.read();
                 if (next == -1) {
@@ -540,6 +541,7 @@
                     }
                     break;
                 }
+                header.append((char)next);
             }
 
             // Step 3: Read the data
@@ -559,6 +561,7 @@
             }
 
             // Step 4: Consume the footer
+            StringBuffer footer = new StringBuffer("-");
             while (true) {
                 int next = is.read();
                 // Add next == '\n' for maximum safety, in case endline
@@ -566,13 +569,34 @@
                 if (next == -1 || next == end || next == '\n') {
                     break;
                 }
+                if (next != '\r') footer.append((char)next);
             }
 
+            checkHeaderFooter(header.toString(), footer.toString());
+
             BASE64Decoder decoder = new BASE64Decoder();
             return decoder.decodeBuffer(new String(data, 0, pos));
         }
     }
 
+    private static void checkHeaderFooter(String header,
+            String footer) throws IOException {
+        if (header.length() < 16 || !header.startsWith("-----BEGIN ") ||
+                !header.endsWith("-----")) {
+            throw new IOException("Illegal header: " + header);
+        }
+        if (footer.length() < 14 || !footer.startsWith("-----END ") ||
+                !footer.endsWith("-----")) {
+            throw new IOException("Illegal footer: " + footer);
+        }
+        String headerType = header.substring(11, header.length()-5);
+        String footerType = footer.substring(9, footer.length()-5);
+        if (!headerType.equals(footerType)) {
+            throw new IOException("Header and footer do not match: " +
+                    header + " " + footer);
+        }
+    }
+
     /**
      * Read one BER data block. This method is aware of indefinite-length BER
      * encoding and will read all of the sub-sections in a recursive way
--- a/jdk/src/share/classes/sun/security/ssl/krb5/KerberosClientKeyExchangeImpl.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/share/classes/sun/security/ssl/krb5/KerberosClientKeyExchangeImpl.java	Wed Jul 21 09:57:21 2010 -0700
@@ -212,7 +212,7 @@
             byte[] bytes = encPart.decrypt(secretKey, KeyUsage.KU_TICKET);
 
             // Reset data stream after decryption, remove redundant bytes
-            byte[] temp = encPart.reset(bytes, true);
+            byte[] temp = encPart.reset(bytes);
             EncTicketPart encTicketPart = new EncTicketPart(temp);
 
             // Record the Kerberos Principals
--- a/jdk/src/share/classes/sun/security/ssl/krb5/KerberosPreMasterSecret.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/share/classes/sun/security/ssl/krb5/KerberosPreMasterSecret.java	Wed Jul 21 09:57:21 2010 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 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
@@ -27,7 +27,7 @@
 
 import java.io.*;
 import java.security.*;
-import java.security.interfaces.*;
+import java.util.Arrays;
 
 import javax.net.ssl.*;
 
@@ -128,8 +128,8 @@
                "are not supported for TLS Kerberos cipher suites");
         }
 
-         // Decrypt premaster secret
-         try {
+        // Decrypt premaster secret
+        try {
             EncryptedData data = new EncryptedData(sessionKey.getEType(),
                         null /* optional kvno */, encrypted);
 
@@ -141,8 +141,25 @@
                  }
             }
 
-            // Reset data stream after decryption, remove redundant bytes
-            preMaster =  data.reset(temp, false);
+            // Remove padding bytes after decryption. Only DES and DES3 have
+            // paddings and we don't support DES3 in TLS (see above)
+
+            if (temp.length == 52 &&
+                    data.getEType() == EncryptedData.ETYPE_DES_CBC_CRC) {
+                // For des-cbc-crc, 4 paddings. Value can be 0x04 or 0x00.
+                if (paddingByteIs(temp, 52, (byte)4) ||
+                        paddingByteIs(temp, 52, (byte)0)) {
+                    temp = Arrays.copyOf(temp, 48);
+                }
+            } else if (temp.length == 56 &&
+                    data.getEType() == EncryptedData.ETYPE_DES_CBC_MD5) {
+                // For des-cbc-md5, 8 paddings with 0x08, or no padding
+                if (paddingByteIs(temp, 56, (byte)8)) {
+                    temp = Arrays.copyOf(temp, 48);
+                }
+            }
+
+            preMaster = temp;
 
             protocolVersion = ProtocolVersion.valueOf(preMaster[0],
                  preMaster[1]);
@@ -191,6 +208,19 @@
         }
     }
 
+    /**
+     * Checks if all paddings of data are b
+     * @param data the block with padding
+     * @param len length of data, >= 48
+     * @param b expected padding byte
+     */
+    private static boolean paddingByteIs(byte[] data, int len, byte b) {
+        for (int i=48; i<len; i++) {
+            if (data[i] != b) return false;
+        }
+        return true;
+    }
+
     /*
      * Used by server to generate premaster secret in case of
      * problem decoding ticket.
--- a/jdk/src/share/classes/sun/security/tools/JarSigner.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/share/classes/sun/security/tools/JarSigner.java	Wed Jul 21 09:57:21 2010 -0700
@@ -1486,7 +1486,7 @@
         for (int i=0; i<len; i++) {
             switch (bs[i]) {
                 case '\r':
-                    if (i < len && bs[i+1] == '\n') i++;
+                    if (i < len - 1 && bs[i+1] == '\n') i++;
                     // fallthrough
                 case '\n':
                     if (newline) return i+1;    //+1 to get length
--- a/jdk/src/share/classes/sun/security/tools/PolicyTool.java	Tue Jul 20 16:09:44 2010 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,4261 +0,0 @@
-/*
- * Copyright (c) 1997, 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.security.tools;
-
-import java.io.*;
-import java.util.LinkedList;
-import java.util.ListIterator;
-import java.util.Vector;
-import java.util.Enumeration;
-import java.net.URL;
-import java.net.MalformedURLException;
-import java.lang.reflect.*;
-import java.text.Collator;
-import java.text.MessageFormat;
-import sun.security.util.PropertyExpander;
-import sun.security.util.PropertyExpander.ExpandException;
-import java.awt.*;
-import java.awt.event.*;
-import java.security.cert.Certificate;
-import java.security.cert.CertificateException;
-import java.security.*;
-import sun.security.provider.*;
-import sun.security.util.PolicyUtil;
-import javax.security.auth.x500.X500Principal;
-
-/**
- * PolicyTool may be used by users and administrators to configure the
- * overall java security policy (currently stored in the policy file).
- * Using PolicyTool administators may add and remove policies from
- * the policy file. <p>
- *
- * @see java.security.Policy
- * @since   1.2
- */
-
-public class PolicyTool {
-
-    // for i18n
-    static final java.util.ResourceBundle rb =
-        java.util.ResourceBundle.getBundle("sun.security.util.Resources");
-    static final Collator collator = Collator.getInstance();
-    static {
-        // this is for case insensitive string comparisons
-        collator.setStrength(Collator.PRIMARY);
-    };
-
-    // anyone can add warnings
-    Vector<String> warnings;
-    boolean newWarning = false;
-
-    // set to true if policy modified.
-    // this way upon exit we know if to ask the user to save changes
-    boolean modified = false;
-
-    private static final boolean testing = false;
-    private static final Class[] TWOPARAMS = { String.class, String.class };
-    private static final Class[] ONEPARAMS = { String.class };
-    private static final Class[] NOPARAMS  = {};
-    /*
-     * All of the policy entries are read in from the
-     * policy file and stored here.  Updates to the policy entries
-     * using addEntry() and removeEntry() are made here.  To ultimately save
-     * the policy entries back to the policy file, the SavePolicy button
-     * must be clicked.
-     **/
-    private static String policyFileName = null;
-    private Vector<PolicyEntry> policyEntries = null;
-    private PolicyParser parser = null;
-
-    /* The public key alias information is stored here.  */
-    private KeyStore keyStore = null;
-    private String keyStoreName = " ";
-    private String keyStoreType = " ";
-    private String keyStoreProvider = " ";
-    private String keyStorePwdURL = " ";
-
-    /* standard PKCS11 KeyStore type */
-    private static final String P11KEYSTORE = "PKCS11";
-
-    /* reserved word for PKCS11 KeyStores */
-    private static final String NONE = "NONE";
-
-    /**
-     * default constructor
-     */
-    private PolicyTool() {
-        policyEntries = new Vector<PolicyEntry>();
-        parser = new PolicyParser();
-        warnings = new Vector<String>();
-    }
-
-    /**
-     * get the PolicyFileName
-     */
-    String getPolicyFileName() {
-        return policyFileName;
-    }
-
-    /**
-     * set the PolicyFileName
-     */
-    void setPolicyFileName(String policyFileName) {
-        this.policyFileName = policyFileName;
-    }
-
-   /**
-    * clear keyStore info
-    */
-    void clearKeyStoreInfo() {
-        this.keyStoreName = null;
-        this.keyStoreType = null;
-        this.keyStoreProvider = null;
-        this.keyStorePwdURL = null;
-
-        this.keyStore = null;
-    }
-
-    /**
-     * get the keyStore URL name
-     */
-    String getKeyStoreName() {
-        return keyStoreName;
-    }
-
-    /**
-     * get the keyStore Type
-     */
-    String getKeyStoreType() {
-        return keyStoreType;
-    }
-
-    /**
-     * get the keyStore Provider
-     */
-    String getKeyStoreProvider() {
-        return keyStoreProvider;
-    }
-
-    /**
-     * get the keyStore password URL
-     */
-    String getKeyStorePwdURL() {
-        return keyStorePwdURL;
-    }
-
-    /**
-     * Open and read a policy file
-     */
-    void openPolicy(String filename) throws FileNotFoundException,
-                                        PolicyParser.ParsingException,
-                                        KeyStoreException,
-                                        CertificateException,
-                                        InstantiationException,
-                                        MalformedURLException,
-                                        IOException,
-                                        NoSuchAlgorithmException,
-                                        IllegalAccessException,
-                                        NoSuchMethodException,
-                                        UnrecoverableKeyException,
-                                        NoSuchProviderException,
-                                        ClassNotFoundException,
-                                        PropertyExpander.ExpandException,
-                                        InvocationTargetException {
-
-        newWarning = false;
-
-        // start fresh - blow away the current state
-        policyEntries = new Vector<PolicyEntry>();
-        parser = new PolicyParser();
-        warnings = new Vector<String>();
-        setPolicyFileName(null);
-        clearKeyStoreInfo();
-
-        // see if user is opening a NEW policy file
-        if (filename == null) {
-            modified = false;
-            return;
-        }
-
-        // Read in the policy entries from the file and
-        // populate the parser vector table.  The parser vector
-        // table only holds the entries as strings, so it only
-        // guarantees that the policies are syntactically
-        // correct.
-        setPolicyFileName(filename);
-        parser.read(new FileReader(filename));
-
-        // open the keystore
-        openKeyStore(parser.getKeyStoreUrl(), parser.getKeyStoreType(),
-                parser.getKeyStoreProvider(), parser.getStorePassURL());
-
-        // Update the local vector with the same policy entries.
-        // This guarantees that the policy entries are not only
-        // syntactically correct, but semantically valid as well.
-        Enumeration<PolicyParser.GrantEntry> enum_ = parser.grantElements();
-        while (enum_.hasMoreElements()) {
-            PolicyParser.GrantEntry ge = enum_.nextElement();
-
-            // see if all the signers have public keys
-            if (ge.signedBy != null) {
-
-                String signers[] = parseSigners(ge.signedBy);
-                for (int i = 0; i < signers.length; i++) {
-                    PublicKey pubKey = getPublicKeyAlias(signers[i]);
-                    if (pubKey == null) {
-                        newWarning = true;
-                        MessageFormat form = new MessageFormat(rb.getString
-                            ("Warning: A public key for alias " +
-                            "'signers[i]' does not exist.  " +
-                            "Make sure a KeyStore is properly configured."));
-                        Object[] source = {signers[i]};
-                        warnings.addElement(form.format(source));
-                    }
-                }
-            }
-
-            // check to see if the Principals are valid
-            ListIterator<PolicyParser.PrincipalEntry> prinList =
-                                                ge.principals.listIterator(0);
-            while (prinList.hasNext()) {
-                PolicyParser.PrincipalEntry pe = prinList.next();
-                try {
-                    verifyPrincipal(pe.getPrincipalClass(),
-                                pe.getPrincipalName());
-                } catch (ClassNotFoundException fnfe) {
-                    newWarning = true;
-                    MessageFormat form = new MessageFormat(rb.getString
-                                ("Warning: Class not found: class"));
-                    Object[] source = {pe.getPrincipalClass()};
-                    warnings.addElement(form.format(source));
-                }
-            }
-
-            // check to see if the Permissions are valid
-            Enumeration<PolicyParser.PermissionEntry> perms =
-                                                ge.permissionElements();
-            while (perms.hasMoreElements()) {
-                PolicyParser.PermissionEntry pe = perms.nextElement();
-                try {
-                    verifyPermission(pe.permission, pe.name, pe.action);
-                } catch (ClassNotFoundException fnfe) {
-                    newWarning = true;
-                    MessageFormat form = new MessageFormat(rb.getString
-                                ("Warning: Class not found: class"));
-                    Object[] source = {pe.permission};
-                    warnings.addElement(form.format(source));
-                } catch (InvocationTargetException ite) {
-                    newWarning = true;
-                    MessageFormat form = new MessageFormat(rb.getString
-                        ("Warning: Invalid argument(s) for constructor: arg"));
-                    Object[] source = {pe.permission};
-                    warnings.addElement(form.format(source));
-                }
-
-                // see if all the permission signers have public keys
-                if (pe.signedBy != null) {
-
-                    String signers[] = parseSigners(pe.signedBy);
-
-                    for (int i = 0; i < signers.length; i++) {
-                        PublicKey pubKey = getPublicKeyAlias(signers[i]);
-                        if (pubKey == null) {
-                            newWarning = true;
-                            MessageFormat form = new MessageFormat(rb.getString
-                                ("Warning: A public key for alias " +
-                                "'signers[i]' does not exist.  " +
-                               "Make sure a KeyStore is properly configured."));
-                            Object[] source = {signers[i]};
-                            warnings.addElement(form.format(source));
-                        }
-                    }
-                }
-            }
-            PolicyEntry pEntry = new PolicyEntry(this, ge);
-            policyEntries.addElement(pEntry);
-        }
-
-        // just read in the policy -- nothing has been modified yet
-        modified = false;
-    }
-
-
-    /**
-     * Save a policy to a file
-     */
-    void savePolicy(String filename)
-    throws FileNotFoundException, IOException {
-        // save the policy entries to a file
-        parser.setKeyStoreUrl(keyStoreName);
-        parser.setKeyStoreType(keyStoreType);
-        parser.setKeyStoreProvider(keyStoreProvider);
-        parser.setStorePassURL(keyStorePwdURL);
-        parser.write(new FileWriter(filename));
-        modified = false;
-    }
-
-    /**
-     * Open the KeyStore
-     */
-    void openKeyStore(String name,
-                String type,
-                String provider,
-                String pwdURL) throws   KeyStoreException,
-                                        NoSuchAlgorithmException,
-                                        UnrecoverableKeyException,
-                                        IOException,
-                                        CertificateException,
-                                        NoSuchProviderException,
-                                        ExpandException {
-
-        if (name == null && type == null &&
-            provider == null && pwdURL == null) {
-
-            // policy did not specify a keystore during open
-            // or use wants to reset keystore values
-
-            this.keyStoreName = null;
-            this.keyStoreType = null;
-            this.keyStoreProvider = null;
-            this.keyStorePwdURL = null;
-
-            // caller will set (tool.modified = true) if appropriate
-
-            return;
-        }
-
-        URL policyURL = null;
-        if (policyFileName != null) {
-            File pfile = new File(policyFileName);
-            policyURL = new URL("file:" + pfile.getCanonicalPath());
-        }
-
-        // although PolicyUtil.getKeyStore may properly handle
-        // defaults and property expansion, we do it here so that
-        // if the call is successful, we can set the proper values
-        // (PolicyUtil.getKeyStore does not return expanded values)
-
-        if (name != null && name.length() > 0) {
-            name = PropertyExpander.expand(name).replace
-                                        (File.separatorChar, '/');
-        }
-        if (type == null || type.length() == 0) {
-            type = KeyStore.getDefaultType();
-        }
-        if (pwdURL != null && pwdURL.length() > 0) {
-            pwdURL = PropertyExpander.expand(pwdURL).replace
-                                        (File.separatorChar, '/');
-        }
-
-        try {
-            this.keyStore = PolicyUtil.getKeyStore(policyURL,
-                                                name,
-                                                type,
-                                                provider,
-                                                pwdURL,
-                                                null);
-        } catch (IOException ioe) {
-
-            // copied from sun.security.pkcs11.SunPKCS11
-            String MSG = "no password provided, and no callback handler " +
-                        "available for retrieving password";
-
-            Throwable cause = ioe.getCause();
-            if (cause != null &&
-                cause instanceof javax.security.auth.login.LoginException &&
-                MSG.equals(cause.getMessage())) {
-
-                // throw a more friendly exception message
-                throw new IOException(MSG);
-            } else {
-                throw ioe;
-            }
-        }
-
-        this.keyStoreName = name;
-        this.keyStoreType = type;
-        this.keyStoreProvider = provider;
-        this.keyStorePwdURL = pwdURL;
-
-        // caller will set (tool.modified = true)
-    }
-
-    /**
-     * Add a Grant entry to the overall policy at the specified index.
-     * A policy entry consists of a CodeSource.
-     */
-    boolean addEntry(PolicyEntry pe, int index) {
-
-        if (index < 0) {
-            // new entry -- just add it to the end
-            policyEntries.addElement(pe);
-            parser.add(pe.getGrantEntry());
-        } else {
-            // existing entry -- replace old one
-            PolicyEntry origPe = policyEntries.elementAt(index);
-            parser.replace(origPe.getGrantEntry(), pe.getGrantEntry());
-            policyEntries.setElementAt(pe, index);
-        }
-        return true;
-    }
-
-    /**
-     * Add a Principal entry to an existing PolicyEntry at the specified index.
-     * A Principal entry consists of a class, and name.
-     *
-     * If the principal already exists, it is not added again.
-     */
-    boolean addPrinEntry(PolicyEntry pe,
-                        PolicyParser.PrincipalEntry newPrin,
-                        int index) {
-
-        // first add the principal to the Policy Parser entry
-        PolicyParser.GrantEntry grantEntry = pe.getGrantEntry();
-        if (grantEntry.contains(newPrin) == true)
-            return false;
-
-        LinkedList<PolicyParser.PrincipalEntry> prinList =
-                                                grantEntry.principals;
-        if (index != -1)
-            prinList.set(index, newPrin);
-        else
-            prinList.add(newPrin);
-
-        modified = true;
-        return true;
-    }
-
-    /**
-     * Add a Permission entry to an existing PolicyEntry at the specified index.
-     * A Permission entry consists of a permission, name, and actions.
-     *
-     * If the permission already exists, it is not added again.
-     */
-    boolean addPermEntry(PolicyEntry pe,
-                        PolicyParser.PermissionEntry newPerm,
-                        int index) {
-
-        // first add the permission to the Policy Parser Vector
-        PolicyParser.GrantEntry grantEntry = pe.getGrantEntry();
-        if (grantEntry.contains(newPerm) == true)
-            return false;
-
-        Vector<PolicyParser.PermissionEntry> permList =
-                                                grantEntry.permissionEntries;
-        if (index != -1)
-            permList.setElementAt(newPerm, index);
-        else
-            permList.addElement(newPerm);
-
-        modified = true;
-        return true;
-    }
-
-    /**
-     * Remove a Permission entry from an existing PolicyEntry.
-     */
-    boolean removePermEntry(PolicyEntry pe,
-                        PolicyParser.PermissionEntry perm) {
-
-        // remove the Permission from the GrantEntry
-        PolicyParser.GrantEntry ppge = pe.getGrantEntry();
-        modified = ppge.remove(perm);
-        return modified;
-    }
-
-    /**
-     * remove an entry from the overall policy
-     */
-    boolean removeEntry(PolicyEntry pe) {
-
-        parser.remove(pe.getGrantEntry());
-        modified = true;
-        return (policyEntries.removeElement(pe));
-    }
-
-    /**
-     * retrieve all Policy Entries
-     */
-    PolicyEntry[] getEntry() {
-
-        if (policyEntries.size() > 0) {
-            PolicyEntry entries[] = new PolicyEntry[policyEntries.size()];
-            for (int i = 0; i < policyEntries.size(); i++)
-                entries[i] = policyEntries.elementAt(i);
-            return entries;
-        }
-        return null;
-    }
-
-    /**
-     * Retrieve the public key mapped to a particular name.
-     * If the key has expired, a KeyException is thrown.
-     */
-    PublicKey getPublicKeyAlias(String name) throws KeyStoreException {
-        if (keyStore == null) {
-            return null;
-        }
-
-        Certificate cert = keyStore.getCertificate(name);
-        if (cert == null) {
-            return null;
-        }
-        PublicKey pubKey = cert.getPublicKey();
-        return pubKey;
-    }
-
-    /**
-     * Retrieve all the alias names stored in the certificate database
-     */
-    String[] getPublicKeyAlias() throws KeyStoreException {
-
-        int numAliases = 0;
-        String aliases[] = null;
-
-        if (keyStore == null) {
-            return null;
-        }
-        Enumeration<String> enum_ = keyStore.aliases();
-
-        // first count the number of elements
-        while (enum_.hasMoreElements()) {
-            enum_.nextElement();
-            numAliases++;
-        }
-
-        if (numAliases > 0) {
-            // now copy them into an array
-            aliases = new String[numAliases];
-            numAliases = 0;
-            enum_ = keyStore.aliases();
-            while (enum_.hasMoreElements()) {
-                aliases[numAliases] = new String(enum_.nextElement());
-                numAliases++;
-            }
-        }
-        return aliases;
-    }
-
-    /**
-     * This method parses a single string of signers separated by commas
-     * ("jordan, duke, pippen") into an array of individual strings.
-     */
-    String[] parseSigners(String signedBy) {
-
-        String signers[] = null;
-        int numSigners = 1;
-        int signedByIndex = 0;
-        int commaIndex = 0;
-        int signerNum = 0;
-
-        // first pass thru "signedBy" counts the number of signers
-        while (commaIndex >= 0) {
-            commaIndex = signedBy.indexOf(',', signedByIndex);
-            if (commaIndex >= 0) {
-                numSigners++;
-                signedByIndex = commaIndex + 1;
-            }
-        }
-        signers = new String[numSigners];
-
-        // second pass thru "signedBy" transfers signers to array
-        commaIndex = 0;
-        signedByIndex = 0;
-        while (commaIndex >= 0) {
-            if ((commaIndex = signedBy.indexOf(',', signedByIndex)) >= 0) {
-                // transfer signer and ignore trailing part of the string
-                signers[signerNum] =
-                        signedBy.substring(signedByIndex, commaIndex).trim();
-                signerNum++;
-                signedByIndex = commaIndex + 1;
-            } else {
-                // we are at the end of the string -- transfer signer
-                signers[signerNum] = signedBy.substring(signedByIndex).trim();
-            }
-        }
-        return signers;
-    }
-
-    /**
-     * Check to see if the Principal contents are OK
-     */
-    void verifyPrincipal(String type, String name)
-        throws ClassNotFoundException,
-               InstantiationException
-    {
-        if (type.equals(PolicyParser.PrincipalEntry.WILDCARD_CLASS) ||
-            type.equals(PolicyParser.REPLACE_NAME)) {
-            return;
-        };
-        Class<?> PRIN = Class.forName("java.security.Principal");
-        Class<?> pc = Class.forName(type, true,
-                Thread.currentThread().getContextClassLoader());
-        if (!PRIN.isAssignableFrom(pc)) {
-            MessageFormat form = new MessageFormat(rb.getString
-                        ("Illegal Principal Type: type"));
-            Object[] source = {type};
-            throw new InstantiationException(form.format(source));
-        }
-
-        if (ToolDialog.X500_PRIN_CLASS.equals(pc.getName())) {
-            // PolicyParser checks validity of X500Principal name
-            // - PolicyTool needs to as well so that it doesn't store
-            //   an invalid name that can't be read in later
-            //
-            // this can throw an IllegalArgumentException
-            X500Principal newP = new X500Principal(name);
-        }
-    }
-
-    /**
-     * Check to see if the Permission contents are OK
-     */
-    void verifyPermission(String type,
-                                    String name,
-                                    String actions)
-        throws ClassNotFoundException,
-               InstantiationException,
-               IllegalAccessException,
-               NoSuchMethodException,
-               InvocationTargetException
-    {
-
-        //XXX we might want to keep a hash of created factories...
-        Class<?> pc = Class.forName(type, true,
-                Thread.currentThread().getContextClassLoader());
-        Constructor<?> c = null;
-        Vector<String> objects = new Vector<String>(2);
-        if (name != null) objects.add(name);
-        if (actions != null) objects.add(actions);
-        switch (objects.size()) {
-        case 0:
-            try {
-                c = pc.getConstructor(NOPARAMS);
-                break;
-            } catch (NoSuchMethodException ex) {
-                // proceed to the one-param constructor
-                objects.add(null);
-            }
-        case 1:
-            try {
-                c = pc.getConstructor(ONEPARAMS);
-                break;
-            } catch (NoSuchMethodException ex) {
-                // proceed to the two-param constructor
-                objects.add(null);
-            }
-        case 2:
-            c = pc.getConstructor(TWOPARAMS);
-            break;
-        }
-        Object parameters[] = objects.toArray();
-        Permission p = (Permission)c.newInstance(parameters);
-    }
-
-    /*
-     * Parse command line arguments.
-     */
-    static void parseArgs(String args[]) {
-        /* parse flags */
-        int n = 0;
-
-        for (n=0; (n < args.length) && args[n].startsWith("-"); n++) {
-
-            String flags = args[n];
-
-            if (collator.compare(flags, "-file") == 0) {
-                if (++n == args.length) usage();
-                policyFileName = args[n];
-            } else {
-                MessageFormat form = new MessageFormat(rb.getString
-                                ("Illegal option: option"));
-                Object[] source = { flags };
-                System.err.println(form.format(source));
-                usage();
-            }
-        }
-    }
-
-    static void usage() {
-        System.out.println(rb.getString("Usage: policytool [options]"));
-        System.out.println();
-        System.out.println(rb.getString
-                ("  [-file <file>]    policy file location"));
-        System.out.println();
-
-        System.exit(1);
-    }
-
-    /**
-     * run the PolicyTool
-     */
-    public static void main(String args[]) {
-        parseArgs(args);
-        ToolWindow tw = new ToolWindow(new PolicyTool());
-        tw.displayToolWindow(args);
-    }
-
-    // split instr to words according to capitalization,
-    // like, AWTControl -> A W T Control
-    // this method is for easy pronounciation
-    static String splitToWords(String instr) {
-        return instr.replaceAll("([A-Z])", " $1");
-    }
-
-}
-
-/**
- * Each entry in the policy configuration file is represented by a
- * PolicyEntry object.
- *
- * A PolicyEntry is a (CodeSource,Permission) pair.  The
- * CodeSource contains the (URL, PublicKey) that together identify
- * where the Java bytecodes come from and who (if anyone) signed
- * them.  The URL could refer to localhost.  The URL could also be
- * null, meaning that this policy entry is given to all comers, as
- * long as they match the signer field.  The signer could be null,
- * meaning the code is not signed.
- *
- * The Permission contains the (Type, Name, Action) triplet.
- *
- */
-class PolicyEntry {
-
-    private CodeSource codesource;
-    private PolicyTool tool;
-    private PolicyParser.GrantEntry grantEntry;
-    private boolean testing = false;
-
-    /**
-     * Create a PolicyEntry object from the information read in
-     * from a policy file.
-     */
-    PolicyEntry(PolicyTool tool, PolicyParser.GrantEntry ge)
-    throws MalformedURLException, NoSuchMethodException,
-    ClassNotFoundException, InstantiationException, IllegalAccessException,
-    InvocationTargetException, CertificateException,
-    IOException, NoSuchAlgorithmException, UnrecoverableKeyException {
-
-        this.tool = tool;
-
-        URL location = null;
-
-        // construct the CodeSource
-        if (ge.codeBase != null)
-            location = new URL(ge.codeBase);
-        this.codesource = new CodeSource(location,
-            (java.security.cert.Certificate[]) null);
-
-        if (testing) {
-            System.out.println("Adding Policy Entry:");
-            System.out.println("    CodeBase = " + location);
-            System.out.println("    Signers = " + ge.signedBy);
-            System.out.println("    with " + ge.principals.size() +
-                    " Principals");
-        }
-
-        this.grantEntry = ge;
-    }
-
-    /**
-     * get the codesource associated with this PolicyEntry
-     */
-    CodeSource getCodeSource() {
-        return codesource;
-    }
-
-    /**
-     * get the GrantEntry associated with this PolicyEntry
-     */
-    PolicyParser.GrantEntry getGrantEntry() {
-        return grantEntry;
-    }
-
-    /**
-     * convert the header portion, i.e. codebase, signer, principals, of
-     * this policy entry into a string
-     */
-    String headerToString() {
-        String pString = principalsToString();
-        if (pString.length() == 0) {
-            return codebaseToString();
-        } else {
-            return codebaseToString() + ", " + pString;
-        }
-    }
-
-    /**
-     * convert the Codebase/signer portion of this policy entry into a string
-     */
-    String codebaseToString() {
-
-        String stringEntry = new String();
-
-        if (grantEntry.codeBase != null &&
-            grantEntry.codeBase.equals("") == false)
-            stringEntry = stringEntry.concat
-                                ("CodeBase \"" +
-                                grantEntry.codeBase +
-                                "\"");
-
-        if (grantEntry.signedBy != null &&
-            grantEntry.signedBy.equals("") == false)
-            stringEntry = ((stringEntry.length() > 0) ?
-                stringEntry.concat(", SignedBy \"" +
-                                grantEntry.signedBy +
-                                "\"") :
-                stringEntry.concat("SignedBy \"" +
-                                grantEntry.signedBy +
-                                "\""));
-
-        if (stringEntry.length() == 0)
-            return new String("CodeBase <ALL>");
-        return stringEntry;
-    }
-
-    /**
-     * convert the Principals portion of this policy entry into a string
-     */
-    String principalsToString() {
-        String result = "";
-        if ((grantEntry.principals != null) &&
-            (!grantEntry.principals.isEmpty())) {
-            StringBuffer buffer = new StringBuffer(200);
-            ListIterator<PolicyParser.PrincipalEntry> list =
-                                grantEntry.principals.listIterator();
-            while (list.hasNext()) {
-                PolicyParser.PrincipalEntry pppe = list.next();
-                buffer.append(" Principal " + pppe.getDisplayClass() + " " +
-                    pppe.getDisplayName(true));
-                if (list.hasNext()) buffer.append(", ");
-            }
-            result = buffer.toString();
-        }
-        return result;
-    }
-
-    /**
-     * convert this policy entry into a PolicyParser.PermissionEntry
-     */
-    PolicyParser.PermissionEntry toPermissionEntry(Permission perm) {
-
-        String actions = null;
-
-        // get the actions
-        if (perm.getActions() != null &&
-            perm.getActions().trim() != "")
-                actions = perm.getActions();
-
-        PolicyParser.PermissionEntry pe = new PolicyParser.PermissionEntry
-                        (perm.getClass().getName(),
-                        perm.getName(),
-                        actions);
-        return pe;
-    }
-}
-
-/**
- * The main window for the PolicyTool
- */
-class ToolWindow extends Frame {
-    // use serialVersionUID from JDK 1.2.2 for interoperability
-    private static final long serialVersionUID = 5682568601210376777L;
-
-    /* external paddings */
-    public static final Insets TOP_PADDING = new Insets(25,0,0,0);
-    public static final Insets BOTTOM_PADDING = new Insets(0,0,25,0);
-    public static final Insets LITE_BOTTOM_PADDING = new Insets(0,0,10,0);
-    public static final Insets LR_PADDING = new Insets(0,10,0,10);
-    public static final Insets TOP_BOTTOM_PADDING = new Insets(15, 0, 15, 0);
-    public static final Insets L_TOP_BOTTOM_PADDING = new Insets(5,10,15,0);
-    public static final Insets LR_BOTTOM_PADDING = new Insets(0,10,5,10);
-    public static final Insets L_BOTTOM_PADDING = new Insets(0,10,5,0);
-    public static final Insets R_BOTTOM_PADDING = new Insets(0,0,5,10);
-
-    /* buttons and menus */
-    public static final String NEW_POLICY_FILE          =
-                        PolicyTool.rb.getString("New");
-    public static final String OPEN_POLICY_FILE         =
-                        PolicyTool.rb.getString("Open");
-    public static final String SAVE_POLICY_FILE         =
-                        PolicyTool.rb.getString("Save");
-    public static final String SAVE_AS_POLICY_FILE      =
-                        PolicyTool.rb.getString("Save As");
-    public static final String VIEW_WARNINGS            =
-                        PolicyTool.rb.getString("View Warning Log");
-    public static final String QUIT                     =
-                        PolicyTool.rb.getString("Exit");
-    public static final String ADD_POLICY_ENTRY         =
-                        PolicyTool.rb.getString("Add Policy Entry");
-    public static final String EDIT_POLICY_ENTRY        =
-                        PolicyTool.rb.getString("Edit Policy Entry");
-    public static final String REMOVE_POLICY_ENTRY      =
-                        PolicyTool.rb.getString("Remove Policy Entry");
-    public static final String EDIT_KEYSTORE            =
-                        PolicyTool.rb.getString("Edit");
-    public static final String ADD_PUBKEY_ALIAS         =
-                        PolicyTool.rb.getString("Add Public Key Alias");
-    public static final String REMOVE_PUBKEY_ALIAS      =
-                        PolicyTool.rb.getString("Remove Public Key Alias");
-
-    /* gridbag index for components in the main window (MW) */
-    public static final int MW_FILENAME_LABEL           = 0;
-    public static final int MW_FILENAME_TEXTFIELD       = 1;
-    public static final int MW_PANEL                    = 2;
-    public static final int MW_ADD_BUTTON               = 0;
-    public static final int MW_EDIT_BUTTON              = 1;
-    public static final int MW_REMOVE_BUTTON            = 2;
-    public static final int MW_POLICY_LIST              = 3; // follows MW_PANEL
-
-    private PolicyTool tool;
-
-    /**
-     * Constructor
-     */
-    ToolWindow(PolicyTool tool) {
-        this.tool = tool;
-    }
-
-    /**
-     * Initialize the PolicyTool window with the necessary components
-     */
-    private void initWindow() {
-
-        // create the top menu bar
-        MenuBar menuBar = new MenuBar();
-
-        // create a File menu
-        Menu menu = new Menu(PolicyTool.rb.getString("File"));
-        menu.add(NEW_POLICY_FILE);
-        menu.add(OPEN_POLICY_FILE);
-        menu.add(SAVE_POLICY_FILE);
-        menu.add(SAVE_AS_POLICY_FILE);
-        menu.add(VIEW_WARNINGS);
-        menu.add(QUIT);
-        menu.addActionListener(new FileMenuListener(tool, this));
-        menuBar.add(menu);
-        setMenuBar(menuBar);
-
-        // create a KeyStore menu
-        menu = new Menu(PolicyTool.rb.getString("KeyStore"));
-        menu.add(EDIT_KEYSTORE);
-        menu.addActionListener(new MainWindowListener(tool, this));
-        menuBar.add(menu);
-        setMenuBar(menuBar);
-
-
-        // policy entry listing
-        Label label = new Label(PolicyTool.rb.getString("Policy File:"));
-        addNewComponent(this, label, MW_FILENAME_LABEL,
-                        0, 0, 1, 1, 0.0, 0.0, GridBagConstraints.BOTH,
-                        TOP_BOTTOM_PADDING);
-        TextField tf = new TextField(50);
-        tf.getAccessibleContext().setAccessibleName(
-                PolicyTool.rb.getString("Policy File:"));
-        tf.setEditable(false);
-        addNewComponent(this, tf, MW_FILENAME_TEXTFIELD,
-                        1, 0, 1, 1, 0.0, 0.0, GridBagConstraints.BOTH,
-                        TOP_BOTTOM_PADDING);
-
-
-        // add ADD/REMOVE/EDIT buttons in a new panel
-        Panel panel = new Panel();
-        panel.setLayout(new GridBagLayout());
-
-        Button button = new Button(ADD_POLICY_ENTRY);
-        button.addActionListener(new MainWindowListener(tool, this));
-        addNewComponent(panel, button, MW_ADD_BUTTON,
-                        0, 0, 1, 1, 0.0, 0.0, GridBagConstraints.BOTH,
-                        LR_PADDING);
-
-        button = new Button(EDIT_POLICY_ENTRY);
-        button.addActionListener(new MainWindowListener(tool, this));
-        addNewComponent(panel, button, MW_EDIT_BUTTON,
-                        1, 0, 1, 1, 0.0, 0.0, GridBagConstraints.BOTH,
-                        LR_PADDING);
-
-        button = new Button(REMOVE_POLICY_ENTRY);
-        button.addActionListener(new MainWindowListener(tool, this));
-        addNewComponent(panel, button, MW_REMOVE_BUTTON,
-                        2, 0, 1, 1, 0.0, 0.0, GridBagConstraints.BOTH,
-                        LR_PADDING);
-
-        addNewComponent(this, panel, MW_PANEL,
-                        0, 2, 2, 1, 0.0, 0.0, GridBagConstraints.BOTH,
-                        BOTTOM_PADDING);
-
-
-        String policyFile = tool.getPolicyFileName();
-        if (policyFile == null) {
-            String userHome;
-            userHome = java.security.AccessController.doPrivileged(
-                    new sun.security.action.GetPropertyAction("user.home"));
-            policyFile = userHome + File.separatorChar + ".java.policy";
-        }
-
-        try {
-            // open the policy file
-            tool.openPolicy(policyFile);
-
-            // display the policy entries via the policy list textarea
-            List list = new List(40, false);
-            list.addActionListener(new PolicyListListener(tool, this));
-            PolicyEntry entries[] = tool.getEntry();
-            if (entries != null) {
-                for (int i = 0; i < entries.length; i++)
-                    list.add(entries[i].headerToString());
-            }
-            TextField newFilename = (TextField)
-                                getComponent(MW_FILENAME_TEXTFIELD);
-            newFilename.setText(policyFile);
-            initPolicyList(list);
-
-        } catch (FileNotFoundException fnfe) {
-            // add blank policy listing
-            List list = new List(40, false);
-            list.addActionListener(new PolicyListListener(tool, this));
-            initPolicyList(list);
-            tool.setPolicyFileName(null);
-            tool.modified = false;
-            setVisible(true);
-
-            // just add warning
-            tool.warnings.addElement(fnfe.toString());
-
-        } catch (Exception e) {
-            // add blank policy listing
-            List list = new List(40, false);
-            list.addActionListener(new PolicyListListener(tool, this));
-            initPolicyList(list);
-            tool.setPolicyFileName(null);
-            tool.modified = false;
-            setVisible(true);
-
-            // display the error
-            MessageFormat form = new MessageFormat(PolicyTool.rb.getString
-                ("Could not open policy file: policyFile: e.toString()"));
-            Object[] source = {policyFile, e.toString()};
-            displayErrorDialog(null, form.format(source));
-        }
-    }
-
-
-    /**
-     * Add a component to the PolicyTool window
-     */
-    void addNewComponent(Container container, Component component,
-        int index, int gridx, int gridy, int gridwidth, int gridheight,
-        double weightx, double weighty, int fill, Insets is) {
-
-        // add the component at the specified gridbag index
-        container.add(component, index);
-
-        // set the constraints
-        GridBagLayout gbl = (GridBagLayout)container.getLayout();
-        GridBagConstraints gbc = new GridBagConstraints();
-        gbc.gridx = gridx;
-        gbc.gridy = gridy;
-        gbc.gridwidth = gridwidth;
-        gbc.gridheight = gridheight;
-        gbc.weightx = weightx;
-        gbc.weighty = weighty;
-        gbc.fill = fill;
-        if (is != null) gbc.insets = is;
-        gbl.setConstraints(component, gbc);
-    }
-
-
-    /**
-     * Add a component to the PolicyTool window without external padding
-     */
-    void addNewComponent(Container container, Component component,
-        int index, int gridx, int gridy, int gridwidth, int gridheight,
-        double weightx, double weighty, int fill) {
-
-        // delegate with "null" external padding
-        addNewComponent(container, component, index, gridx, gridy,
-                        gridwidth, gridheight, weightx, weighty,
-                        fill, null);
-    }
-
-
-    /**
-     * Init the policy_entry_list TEXTAREA component in the
-     * PolicyTool window
-     */
-    void initPolicyList(List policyList) {
-
-        // add the policy list to the window
-        addNewComponent(this, policyList, MW_POLICY_LIST,
-                        0, 3, 2, 1, 1.0, 1.0, GridBagConstraints.BOTH);
-    }
-
-    /**
-     * Replace the policy_entry_list TEXTAREA component in the
-     * PolicyTool window with an updated one.
-     */
-    void replacePolicyList(List policyList) {
-
-        // remove the original list of Policy Entries
-        // and add the new list of entries
-        List list = (List)getComponent(MW_POLICY_LIST);
-        list.removeAll();
-        String newItems[] = policyList.getItems();
-        for (int i = 0; i < newItems.length; i++)
-            list.add(newItems[i]);
-    }
-
-    /**
-     * display the main PolicyTool window
-     */
-    void displayToolWindow(String args[]) {
-
-        setTitle(PolicyTool.rb.getString("Policy Tool"));
-        setResizable(true);
-        addWindowListener(new ToolWindowListener(this));
-        setBounds(135, 80, 500, 500);
-        setLayout(new GridBagLayout());
-
-        initWindow();
-
-        // display it
-        setVisible(true);
-
-        if (tool.newWarning == true) {
-            displayStatusDialog(this, PolicyTool.rb.getString
-                ("Errors have occurred while opening the " +
-                "policy configuration.  View the Warning Log " +
-                "for more information."));
-        }
-    }
-
-    /**
-     * displays a dialog box describing an error which occurred.
-     */
-    void displayErrorDialog(Window w, String error) {
-        ToolDialog ed = new ToolDialog
-                (PolicyTool.rb.getString("Error"), tool, this, true);
-
-        // find where the PolicyTool gui is
-        Point location = ((w == null) ?
-                getLocationOnScreen() : w.getLocationOnScreen());
-        ed.setBounds(location.x + 50, location.y + 50, 600, 100);
-        ed.setLayout(new GridBagLayout());
-
-        Label label = new Label(error);
-        addNewComponent(ed, label, 0,
-                        0, 0, 1, 1, 0.0, 0.0, GridBagConstraints.BOTH);
-
-        Button okButton = new Button(PolicyTool.rb.getString("OK"));
-        okButton.addActionListener(new ErrorOKButtonListener(ed));
-        addNewComponent(ed, okButton, 1,
-                        0, 1, 1, 1, 0.0, 0.0, GridBagConstraints.VERTICAL);
-
-        ed.pack();
-        ed.setVisible(true);
-    }
-
-    /**
-     * displays a dialog box describing an error which occurred.
-     */
-    void displayErrorDialog(Window w, Throwable t) {
-        if (t instanceof NoDisplayException) {
-            return;
-        }
-        displayErrorDialog(w, t.toString());
-    }
-
-    /**
-     * displays a dialog box describing the status of an event
-     */
-    void displayStatusDialog(Window w, String status) {
-        ToolDialog sd = new ToolDialog
-                (PolicyTool.rb.getString("Status"), tool, this, true);
-
-        // find the location of the PolicyTool gui
-        Point location = ((w == null) ?
-                getLocationOnScreen() : w.getLocationOnScreen());
-        sd.setBounds(location.x + 50, location.y + 50, 500, 100);
-        sd.setLayout(new GridBagLayout());
-
-        Label label = new Label(status);
-        addNewComponent(sd, label, 0,
-                        0, 0, 1, 1, 0.0, 0.0, GridBagConstraints.BOTH);
-
-        Button okButton = new Button(PolicyTool.rb.getString("OK"));
-        okButton.addActionListener(new StatusOKButtonListener(sd));
-        addNewComponent(sd, okButton, 1,
-                        0, 1, 1, 1, 0.0, 0.0, GridBagConstraints.VERTICAL);
-        sd.pack();
-        sd.setVisible(true);
-    }
-
-    /**
-     * display the warning log
-     */
-    void displayWarningLog(Window w) {
-
-        ToolDialog wd = new ToolDialog
-                (PolicyTool.rb.getString("Warning"), tool, this, true);
-
-        // find the location of the PolicyTool gui
-        Point location = ((w == null) ?
-                getLocationOnScreen() : w.getLocationOnScreen());
-        wd.setBounds(location.x + 50, location.y + 50, 500, 100);
-        wd.setLayout(new GridBagLayout());
-
-        TextArea ta = new TextArea();
-        ta.setEditable(false);
-        for (int i = 0; i < tool.warnings.size(); i++) {
-            ta.append(tool.warnings.elementAt(i));
-            ta.append(PolicyTool.rb.getString("\n"));
-        }
-        addNewComponent(wd, ta, 0,
-                        0, 0, 1, 1, 0.0, 0.0, GridBagConstraints.BOTH,
-                        BOTTOM_PADDING);
-        ta.setFocusable(false);
-
-        Button okButton = new Button(PolicyTool.rb.getString("OK"));
-        okButton.addActionListener(new CancelButtonListener(wd));
-        addNewComponent(wd, okButton, 1,
-                        0, 1, 1, 1, 0.0, 0.0, GridBagConstraints.VERTICAL,
-                        LR_PADDING);
-
-        wd.pack();
-        wd.setVisible(true);
-    }
-
-    char displayYesNoDialog(Window w, String title, String prompt, String yes, String no) {
-
-        final ToolDialog tw = new ToolDialog
-                (title, tool, this, true);
-        Point location = ((w == null) ?
-                getLocationOnScreen() : w.getLocationOnScreen());
-        tw.setBounds(location.x + 75, location.y + 100, 400, 150);
-        tw.setLayout(new GridBagLayout());
-
-        TextArea ta = new TextArea(prompt, 10, 50, TextArea.SCROLLBARS_VERTICAL_ONLY);
-        ta.setEditable(false);
-        addNewComponent(tw, ta, 0,
-                0, 0, 1, 1, 0.0, 0.0, GridBagConstraints.BOTH);
-        ta.setFocusable(false);
-
-        Panel panel = new Panel();
-        panel.setLayout(new GridBagLayout());
-
-        // StringBuffer to store button press. Must be final.
-        final StringBuffer chooseResult = new StringBuffer();
-
-        Button button = new Button(yes);
-        button.addActionListener(new ActionListener() {
-            public void actionPerformed(ActionEvent e) {
-                chooseResult.append('Y');
-                tw.setVisible(false);
-                tw.dispose();
-            }
-        });
-        addNewComponent(panel, button, 0,
-                           0, 0, 1, 1, 0.0, 0.0, GridBagConstraints.VERTICAL,
-                           LR_PADDING);
-
-        button = new Button(no);
-        button.addActionListener(new ActionListener() {
-            public void actionPerformed(ActionEvent e) {
-                chooseResult.append('N');
-                tw.setVisible(false);
-                tw.dispose();
-            }
-        });
-        addNewComponent(panel, button, 1,
-                           1, 0, 1, 1, 0.0, 0.0, GridBagConstraints.VERTICAL,
-                           LR_PADDING);
-
-        addNewComponent(tw, panel, 1,
-                0, 1, 1, 1, 0.0, 0.0, GridBagConstraints.VERTICAL);
-
-        tw.pack();
-        tw.setVisible(true);
-        if (chooseResult.length() > 0) {
-            return chooseResult.charAt(0);
-        } else {
-            // I did encounter this once, don't why.
-            return 'N';
-        }
-    }
-
-}
-
-/**
- * General dialog window
- */
-class ToolDialog extends Dialog {
-    // use serialVersionUID from JDK 1.2.2 for interoperability
-    private static final long serialVersionUID = -372244357011301190L;
-
-    /* necessary constants */
-    public static final int NOACTION            = 0;
-    public static final int QUIT                = 1;
-    public static final int NEW                 = 2;
-    public static final int OPEN                = 3;
-
-    public static final String ALL_PERM_CLASS   =
-                "java.security.AllPermission";
-    public static final String FILE_PERM_CLASS  =
-                "java.io.FilePermission";
-
-    public static final String X500_PRIN_CLASS         =
-                "javax.security.auth.x500.X500Principal";
-
-    /* popup menus */
-    public static final String PERM             =
-        PolicyTool.rb.getString
-        ("Permission:                                                       ");
-
-    public static final String PRIN_TYPE        =
-        PolicyTool.rb.getString("Principal Type:");
-    public static final String PRIN_NAME        =
-        PolicyTool.rb.getString("Principal Name:");
-
-    /* more popu menus */
-    public static final String PERM_NAME        =
-        PolicyTool.rb.getString
-        ("Target Name:                                                    ");
-
-    /* and more popup menus */
-    public static final String PERM_ACTIONS             =
-      PolicyTool.rb.getString
-      ("Actions:                                                             ");
-
-    /* gridbag index for display OverWriteFile (OW) components */
-    public static final int OW_LABEL                    = 0;
-    public static final int OW_OK_BUTTON                = 1;
-    public static final int OW_CANCEL_BUTTON            = 2;
-
-    /* gridbag index for display PolicyEntry (PE) components */
-    public static final int PE_CODEBASE_LABEL           = 0;
-    public static final int PE_CODEBASE_TEXTFIELD       = 1;
-    public static final int PE_SIGNEDBY_LABEL           = 2;
-    public static final int PE_SIGNEDBY_TEXTFIELD       = 3;
-
-    public static final int PE_PANEL0                   = 4;
-    public static final int PE_ADD_PRIN_BUTTON          = 0;
-    public static final int PE_EDIT_PRIN_BUTTON         = 1;
-    public static final int PE_REMOVE_PRIN_BUTTON       = 2;
-
-    public static final int PE_PRIN_LABEL               = 5;
-    public static final int PE_PRIN_LIST                = 6;
-
-    public static final int PE_PANEL1                   = 7;
-    public static final int PE_ADD_PERM_BUTTON          = 0;
-    public static final int PE_EDIT_PERM_BUTTON         = 1;
-    public static final int PE_REMOVE_PERM_BUTTON       = 2;
-
-    public static final int PE_PERM_LIST                = 8;
-
-    public static final int PE_PANEL2                   = 9;
-    public static final int PE_CANCEL_BUTTON            = 1;
-    public static final int PE_DONE_BUTTON              = 0;
-
-    /* the gridbag index for components in the Principal Dialog (PRD) */
-    public static final int PRD_DESC_LABEL              = 0;
-    public static final int PRD_PRIN_CHOICE             = 1;
-    public static final int PRD_PRIN_TEXTFIELD          = 2;
-    public static final int PRD_NAME_LABEL              = 3;
-    public static final int PRD_NAME_TEXTFIELD          = 4;
-    public static final int PRD_CANCEL_BUTTON           = 6;
-    public static final int PRD_OK_BUTTON               = 5;
-
-    /* the gridbag index for components in the Permission Dialog (PD) */
-    public static final int PD_DESC_LABEL               = 0;
-    public static final int PD_PERM_CHOICE              = 1;
-    public static final int PD_PERM_TEXTFIELD           = 2;
-    public static final int PD_NAME_CHOICE              = 3;
-    public static final int PD_NAME_TEXTFIELD           = 4;
-    public static final int PD_ACTIONS_CHOICE           = 5;
-    public static final int PD_ACTIONS_TEXTFIELD        = 6;
-    public static final int PD_SIGNEDBY_LABEL           = 7;
-    public static final int PD_SIGNEDBY_TEXTFIELD       = 8;
-    public static final int PD_CANCEL_BUTTON            = 10;
-    public static final int PD_OK_BUTTON                = 9;
-
-    /* modes for KeyStore */
-    public static final int EDIT_KEYSTORE               = 0;
-
-    /* the gridbag index for components in the Change KeyStore Dialog (KSD) */
-    public static final int KSD_NAME_LABEL              = 0;
-    public static final int KSD_NAME_TEXTFIELD          = 1;
-    public static final int KSD_TYPE_LABEL              = 2;
-    public static final int KSD_TYPE_TEXTFIELD          = 3;
-    public static final int KSD_PROVIDER_LABEL          = 4;
-    public static final int KSD_PROVIDER_TEXTFIELD      = 5;
-    public static final int KSD_PWD_URL_LABEL           = 6;
-    public static final int KSD_PWD_URL_TEXTFIELD       = 7;
-    public static final int KSD_CANCEL_BUTTON           = 9;
-    public static final int KSD_OK_BUTTON               = 8;
-
-    /* the gridbag index for components in the User Save Changes Dialog (USC) */
-    public static final int USC_LABEL                   = 0;
-    public static final int USC_PANEL                   = 1;
-    public static final int USC_YES_BUTTON              = 0;
-    public static final int USC_NO_BUTTON               = 1;
-    public static final int USC_CANCEL_BUTTON           = 2;
-
-    /* gridbag index for the ConfirmRemovePolicyEntryDialog (CRPE) */
-    public static final int CRPE_LABEL1                 = 0;
-    public static final int CRPE_LABEL2                 = 1;
-    public static final int CRPE_PANEL                  = 2;
-    public static final int CRPE_PANEL_OK               = 0;
-    public static final int CRPE_PANEL_CANCEL           = 1;
-
-    /* some private static finals */
-    private static final int PERMISSION                 = 0;
-    private static final int PERMISSION_NAME            = 1;
-    private static final int PERMISSION_ACTIONS         = 2;
-    private static final int PERMISSION_SIGNEDBY        = 3;
-    private static final int PRINCIPAL_TYPE             = 4;
-    private static final int PRINCIPAL_NAME             = 5;
-
-    public static java.util.ArrayList<Perm> PERM_ARRAY;
-    public static java.util.ArrayList<Prin> PRIN_ARRAY;
-    PolicyTool tool;
-    ToolWindow tw;
-
-    static {
-
-        // set up permission objects
-
-        PERM_ARRAY = new java.util.ArrayList<Perm>();
-        PERM_ARRAY.add(new AllPerm());
-        PERM_ARRAY.add(new AudioPerm());
-        PERM_ARRAY.add(new AuthPerm());
-        PERM_ARRAY.add(new AWTPerm());
-        PERM_ARRAY.add(new DelegationPerm());
-        PERM_ARRAY.add(new FilePerm());
-        PERM_ARRAY.add(new InqSecContextPerm());
-        PERM_ARRAY.add(new LogPerm());
-        PERM_ARRAY.add(new MgmtPerm());
-        PERM_ARRAY.add(new MBeanPerm());
-        PERM_ARRAY.add(new MBeanSvrPerm());
-        PERM_ARRAY.add(new MBeanTrustPerm());
-        PERM_ARRAY.add(new NetPerm());
-        PERM_ARRAY.add(new PrivCredPerm());
-        PERM_ARRAY.add(new PropPerm());
-        PERM_ARRAY.add(new ReflectPerm());
-        PERM_ARRAY.add(new RuntimePerm());
-        PERM_ARRAY.add(new SecurityPerm());
-        PERM_ARRAY.add(new SerialPerm());
-        PERM_ARRAY.add(new ServicePerm());
-        PERM_ARRAY.add(new SocketPerm());
-        PERM_ARRAY.add(new SQLPerm());
-        PERM_ARRAY.add(new SSLPerm());
-        PERM_ARRAY.add(new SubjDelegPerm());
-
-        // set up principal objects
-
-        PRIN_ARRAY = new java.util.ArrayList<Prin>();
-        PRIN_ARRAY.add(new KrbPrin());
-        PRIN_ARRAY.add(new X500Prin());
-    }
-
-    ToolDialog(String title, PolicyTool tool, ToolWindow tw, boolean modal) {
-        super(tw, modal);
-        setTitle(title);
-        this.tool = tool;
-        this.tw = tw;
-        addWindowListener(new ChildWindowListener(this));
-    }
-
-    /**
-     * get the Perm instance based on either the (shortened) class name
-     * or the fully qualified class name
-     */
-    static Perm getPerm(String clazz, boolean fullClassName) {
-        for (int i = 0; i < PERM_ARRAY.size(); i++) {
-            Perm next = PERM_ARRAY.get(i);
-            if (fullClassName) {
-                if (next.FULL_CLASS.equals(clazz)) {
-                    return next;
-                }
-            } else {
-                if (next.CLASS.equals(clazz)) {
-                    return next;
-                }
-            }
-        }
-        return null;
-    }
-
-    /**
-     * get the Prin instance based on either the (shortened) class name
-     * or the fully qualified class name
-     */
-    static Prin getPrin(String clazz, boolean fullClassName) {
-        for (int i = 0; i < PRIN_ARRAY.size(); i++) {
-            Prin next = PRIN_ARRAY.get(i);
-            if (fullClassName) {
-                if (next.FULL_CLASS.equals(clazz)) {
-                    return next;
-                }
-            } else {
-                if (next.CLASS.equals(clazz)) {
-                    return next;
-                }
-            }
-        }
-        return null;
-    }
-
-    /**
-     * ask user if they want to overwrite an existing file
-     */
-    void displayOverWriteFileDialog(String filename, int nextEvent) {
-
-        // find where the PolicyTool gui is
-        Point location = tw.getLocationOnScreen();
-        setBounds(location.x + 75, location.y + 100, 400, 150);
-        setLayout(new GridBagLayout());
-
-        // ask the user if they want to over write the existing file
-        MessageFormat form = new MessageFormat(PolicyTool.rb.getString
-                ("OK to overwrite existing file filename?"));
-        Object[] source = {filename};
-        Label label = new Label(form.format(source));
-        tw.addNewComponent(this, label, OW_LABEL,
-                           0, 0, 2, 1, 0.0, 0.0, GridBagConstraints.BOTH,
-                           tw.TOP_PADDING);
-
-        // OK button
-        Button button = new Button(PolicyTool.rb.getString("OK"));
-        button.addActionListener(new OverWriteFileOKButtonListener
-                (tool, tw, this, filename, nextEvent));
-        tw.addNewComponent(this, button, OW_OK_BUTTON,
-                           0, 1, 1, 1, 0.0, 0.0, GridBagConstraints.VERTICAL,
-                           tw.TOP_PADDING);
-
-        // Cancel button
-        // -- if the user hits cancel, do NOT go on to the next event
-        button = new Button(PolicyTool.rb.getString("Cancel"));
-        button.addActionListener(new CancelButtonListener(this));
-        tw.addNewComponent(this, button, OW_CANCEL_BUTTON,
-                           1, 1, 1, 1, 0.0, 0.0, GridBagConstraints.VERTICAL,
-                           tw.TOP_PADDING);
-
-        setVisible(true);
-    }
-
-    /**
-     * pop up a dialog so the user can enter info to add a new PolicyEntry
-     * - if edit is TRUE, then the user is editing an existing entry
-     *   and we should display the original info as well.
-     *
-     * - the other reason we need the 'edit' boolean is we need to know
-     *   when we are adding a NEW policy entry.  in this case, we can
-     *   not simply update the existing entry, because it doesn't exist.
-     *   we ONLY update the GUI listing/info, and then when the user
-     *   finally clicks 'OK' or 'DONE', then we can collect that info
-     *   and add it to the policy.
-     */
-    void displayPolicyEntryDialog(boolean edit) {
-
-        int listIndex = 0;
-        PolicyEntry entries[] = null;
-        TaggedList prinList = new TaggedList(3, false);
-        prinList.getAccessibleContext().setAccessibleName(
-                PolicyTool.rb.getString("Principal List"));
-        prinList.addActionListener
-                (new EditPrinButtonListener(tool, tw, this, edit));
-        TaggedList permList = new TaggedList(10, false);
-        permList.getAccessibleContext().setAccessibleName(
-                PolicyTool.rb.getString("Permission List"));
-        permList.addActionListener
-                (new EditPermButtonListener(tool, tw, this, edit));
-
-        // find where the PolicyTool gui is
-        Point location = tw.getLocationOnScreen();
-        setBounds(location.x + 75, location.y + 200, 650, 500);
-        setLayout(new GridBagLayout());
-        setResizable(true);
-
-        if (edit) {
-            // get the selected item
-            entries = tool.getEntry();
-            List policyList = (List)tw.getComponent(tw.MW_POLICY_LIST);
-            listIndex = policyList.getSelectedIndex();
-
-            // get principal list
-            LinkedList principals =
-                entries[listIndex].getGrantEntry().principals;
-            for (int i = 0; i < principals.size(); i++) {
-                String prinString = null;
-                PolicyParser.PrincipalEntry nextPrin =
-                        (PolicyParser.PrincipalEntry)principals.get(i);
-                prinList.addTaggedItem(PrincipalEntryToUserFriendlyString(nextPrin), nextPrin);
-            }
-
-            // get permission list
-            Vector<PolicyParser.PermissionEntry> permissions =
-                entries[listIndex].getGrantEntry().permissionEntries;
-            for (int i = 0; i < permissions.size(); i++) {
-                String permString = null;
-                PolicyParser.PermissionEntry nextPerm =
-                                                permissions.elementAt(i);
-                permList.addTaggedItem(ToolDialog.PermissionEntryToUserFriendlyString(nextPerm), nextPerm);
-            }
-        }
-
-        // codebase label and textfield
-        Label label = new Label(PolicyTool.rb.getString("CodeBase:"));
-        tw.addNewComponent(this, label, PE_CODEBASE_LABEL,
-                0, 0, 1, 1, 0.0, 0.0, GridBagConstraints.BOTH);
-        TextField tf;
-        tf = (edit ?
-                new TextField(entries[listIndex].getGrantEntry().codeBase, 60) :
-                new TextField(60));
-        tf.getAccessibleContext().setAccessibleName(
-                PolicyTool.rb.getString("Code Base"));
-        tw.addNewComponent(this, tf, PE_CODEBASE_TEXTFIELD,
-                1, 0, 1, 1, 0.0, 0.0, GridBagConstraints.BOTH);
-
-        // signedby label and textfield
-        label = new Label(PolicyTool.rb.getString("SignedBy:"));
-        tw.addNewComponent(this, label, PE_SIGNEDBY_LABEL,
-                           0, 1, 1, 1, 0.0, 0.0, GridBagConstraints.BOTH);
-        tf = (edit ?
-                new TextField(entries[listIndex].getGrantEntry().signedBy, 60) :
-                new TextField(60));
-        tf.getAccessibleContext().setAccessibleName(
-                PolicyTool.rb.getString("Signed By:"));
-        tw.addNewComponent(this, tf, PE_SIGNEDBY_TEXTFIELD,
-                           1, 1, 1, 1, 0.0, 0.0, GridBagConstraints.BOTH);
-
-        // panel for principal buttons
-        Panel panel = new Panel();
-        panel.setLayout(new GridBagLayout());
-
-        Button button = new Button(PolicyTool.rb.getString("Add Principal"));
-        button.addActionListener
-                (new AddPrinButtonListener(tool, tw, this, edit));
-        tw.addNewComponent(panel, button, PE_ADD_PRIN_BUTTON,
-                0, 0, 1, 1, 100.0, 0.0, GridBagConstraints.HORIZONTAL);
-
-        button = new Button(PolicyTool.rb.getString("Edit Principal"));
-        button.addActionListener(new EditPrinButtonListener
-                                                (tool, tw, this, edit));
-        tw.addNewComponent(panel, button, PE_EDIT_PRIN_BUTTON,
-                1, 0, 1, 1, 100.0, 0.0, GridBagConstraints.HORIZONTAL);
-
-        button = new Button(PolicyTool.rb.getString("Remove Principal"));
-        button.addActionListener(new RemovePrinButtonListener
-                                        (tool, tw, this, edit));
-        tw.addNewComponent(panel, button, PE_REMOVE_PRIN_BUTTON,
-                2, 0, 1, 1, 100.0, 0.0, GridBagConstraints.HORIZONTAL);
-
-        tw.addNewComponent(this, panel, PE_PANEL0,
-                1, 2, 1, 1, 0.0, 0.0, GridBagConstraints.HORIZONTAL);
-
-        // principal label and list
-        label = new Label(PolicyTool.rb.getString("Principals:"));
-        tw.addNewComponent(this, label, PE_PRIN_LABEL,
-                           0, 3, 1, 1, 0.0, 0.0, GridBagConstraints.BOTH,
-                           tw.BOTTOM_PADDING);
-        tw.addNewComponent(this, prinList, PE_PRIN_LIST,
-                           1, 3, 3, 1, 0.0, 0.0, GridBagConstraints.BOTH,
-                           tw.BOTTOM_PADDING);
-
-        // panel for permission buttons
-        panel = new Panel();
-        panel.setLayout(new GridBagLayout());
-
-        button = new Button(PolicyTool.rb.getString("  Add Permission"));
-        button.addActionListener(new AddPermButtonListener
-                                                (tool, tw, this, edit));
-        tw.addNewComponent(panel, button, PE_ADD_PERM_BUTTON,
-                0, 0, 1, 1, 100.0, 0.0, GridBagConstraints.HORIZONTAL);
-
-        button = new Button(PolicyTool.rb.getString("  Edit Permission"));
-        button.addActionListener(new EditPermButtonListener
-                                                (tool, tw, this, edit));
-        tw.addNewComponent(panel, button, PE_EDIT_PERM_BUTTON,
-                1, 0, 1, 1, 100.0, 0.0, GridBagConstraints.HORIZONTAL);
-
-
-        button = new Button(PolicyTool.rb.getString("Remove Permission"));
-        button.addActionListener(new RemovePermButtonListener
-                                        (tool, tw, this, edit));
-        tw.addNewComponent(panel, button, PE_REMOVE_PERM_BUTTON,
-                2, 0, 1, 1, 100.0, 0.0, GridBagConstraints.HORIZONTAL);
-
-        tw.addNewComponent(this, panel, PE_PANEL1,
-                0, 4, 2, 1, 0.0, 0.0, GridBagConstraints.HORIZONTAL,
-                tw.LITE_BOTTOM_PADDING);
-
-        // permission list
-        tw.addNewComponent(this, permList, PE_PERM_LIST,
-                           0, 5, 3, 1, 0.0, 0.0, GridBagConstraints.BOTH,
-                           tw.BOTTOM_PADDING);
-
-
-        // panel for Done and Cancel buttons
-        panel = new Panel();
-        panel.setLayout(new GridBagLayout());
-
-        // Done Button
-        button = new Button(PolicyTool.rb.getString("Done"));
-        button.addActionListener
-                (new AddEntryDoneButtonListener(tool, tw, this, edit));
-        tw.addNewComponent(panel, button, PE_DONE_BUTTON,
-                           0, 0, 1, 1, 0.0, 0.0, GridBagConstraints.VERTICAL,
-                           tw.LR_PADDING);
-
-        // Cancel Button
-        button = new Button(PolicyTool.rb.getString("Cancel"));
-        button.addActionListener(new CancelButtonListener(this));
-        tw.addNewComponent(panel, button, PE_CANCEL_BUTTON,
-                           1, 0, 1, 1, 0.0, 0.0, GridBagConstraints.VERTICAL,
-                           tw.LR_PADDING);
-
-        // add the panel
-        tw.addNewComponent(this, panel, PE_PANEL2,
-                0, 6, 2, 1, 0.0, 0.0, GridBagConstraints.VERTICAL);
-
-        setVisible(true);
-    }
-
-    /**
-     * Read all the Policy information data in the dialog box
-     * and construct a PolicyEntry object with it.
-     */
-    PolicyEntry getPolicyEntryFromDialog()
-        throws InvalidParameterException, MalformedURLException,
-        NoSuchMethodException, ClassNotFoundException, InstantiationException,
-        IllegalAccessException, InvocationTargetException,
-        CertificateException, IOException, Exception {
-
-        // get the Codebase
-        TextField tf = (TextField)getComponent(PE_CODEBASE_TEXTFIELD);
-        String codebase = null;
-        if (tf.getText().trim().equals("") == false)
-                codebase = new String(tf.getText().trim());
-
-        // get the SignedBy
-        tf = (TextField)getComponent(PE_SIGNEDBY_TEXTFIELD);
-        String signedby = null;
-        if (tf.getText().trim().equals("") == false)
-                signedby = new String(tf.getText().trim());
-
-        // construct a new GrantEntry
-        PolicyParser.GrantEntry ge =
-                        new PolicyParser.GrantEntry(signedby, codebase);
-
-        // get the new Principals
-        LinkedList<PolicyParser.PrincipalEntry> prins =
-                                new LinkedList<PolicyParser.PrincipalEntry>();
-        TaggedList prinList = (TaggedList)getComponent(PE_PRIN_LIST);
-        for (int i = 0; i < prinList.getItemCount(); i++) {
-            prins.add((PolicyParser.PrincipalEntry)prinList.getObject(i));
-        }
-        ge.principals = prins;
-
-        // get the new Permissions
-        Vector<PolicyParser.PermissionEntry> perms =
-                        new Vector<PolicyParser.PermissionEntry>();
-        TaggedList permList = (TaggedList)getComponent(PE_PERM_LIST);
-        for (int i = 0; i < permList.getItemCount(); i++) {
-            perms.addElement((PolicyParser.PermissionEntry)permList.getObject(i));
-        }
-        ge.permissionEntries = perms;
-
-        // construct a new PolicyEntry object
-        PolicyEntry entry = new PolicyEntry(tool, ge);
-
-        return entry;
-    }
-
-    /**
-     * display a dialog box for the user to enter KeyStore information
-     */
-    void keyStoreDialog(int mode) {
-
-        // find where the PolicyTool gui is
-        Point location = tw.getLocationOnScreen();
-        setBounds(location.x + 25, location.y + 100, 500, 300);
-        setLayout(new GridBagLayout());
-
-        if (mode == EDIT_KEYSTORE) {
-
-            // KeyStore label and textfield
-            Label label = new Label
-                        (PolicyTool.rb.getString("KeyStore URL:"));
-            tw.addNewComponent(this, label, KSD_NAME_LABEL,
-                               0, 0, 1, 1, 0.0, 0.0, GridBagConstraints.BOTH,
-                               tw.BOTTOM_PADDING);
-            TextField tf = new TextField(tool.getKeyStoreName(), 30);
-
-            // URL to U R L, so that accessibility reader will pronounce well
-            tf.getAccessibleContext().setAccessibleName(
-                PolicyTool.rb.getString("KeyStore U R L:"));
-            tw.addNewComponent(this, tf, KSD_NAME_TEXTFIELD,
-                               1, 0, 1, 1, 0.0, 0.0, GridBagConstraints.BOTH,
-                               tw.BOTTOM_PADDING);
-
-            // KeyStore type and textfield
-            label = new Label(PolicyTool.rb.getString("KeyStore Type:"));
-            tw.addNewComponent(this, label, KSD_TYPE_LABEL,
-                               0, 1, 1, 1, 0.0, 0.0, GridBagConstraints.BOTH,
-                               tw.BOTTOM_PADDING);
-            tf = new TextField(tool.getKeyStoreType(), 30);
-            tf.getAccessibleContext().setAccessibleName(
-                PolicyTool.rb.getString("KeyStore Type:"));
-            tw.addNewComponent(this, tf, KSD_TYPE_TEXTFIELD,
-                               1, 1, 1, 1, 0.0, 0.0, GridBagConstraints.BOTH,
-                               tw.BOTTOM_PADDING);
-
-            // KeyStore provider and textfield
-            label = new Label(PolicyTool.rb.getString
-                                ("KeyStore Provider:"));
-            tw.addNewComponent(this, label, KSD_PROVIDER_LABEL,
-                               0, 2, 1, 1, 0.0, 0.0, GridBagConstraints.BOTH,
-                               tw.BOTTOM_PADDING);
-            tf = new TextField(tool.getKeyStoreProvider(), 30);
-            tf.getAccessibleContext().setAccessibleName(
-                PolicyTool.rb.getString("KeyStore Provider:"));
-            tw.addNewComponent(this, tf, KSD_PROVIDER_TEXTFIELD,
-                               1, 2, 1, 1, 0.0, 0.0, GridBagConstraints.BOTH,
-                               tw.BOTTOM_PADDING);
-
-            // KeyStore password URL and textfield
-            label = new Label(PolicyTool.rb.getString
-                                ("KeyStore Password URL:"));
-            tw.addNewComponent(this, label, KSD_PWD_URL_LABEL,
-                               0, 3, 1, 1, 0.0, 0.0, GridBagConstraints.BOTH,
-                               tw.BOTTOM_PADDING);
-            tf = new TextField(tool.getKeyStorePwdURL(), 30);
-            tf.getAccessibleContext().setAccessibleName(
-                PolicyTool.rb.getString("KeyStore Password U R L:"));
-            tw.addNewComponent(this, tf, KSD_PWD_URL_TEXTFIELD,
-                               1, 3, 1, 1, 0.0, 0.0, GridBagConstraints.BOTH,
-                               tw.BOTTOM_PADDING);
-
-            // OK button
-            Button okButton = new Button(PolicyTool.rb.getString("OK"));
-            okButton.addActionListener
-                        (new ChangeKeyStoreOKButtonListener(tool, tw, this));
-            tw.addNewComponent(this, okButton, KSD_OK_BUTTON,
-                        0, 4, 1, 1, 0.0, 0.0, GridBagConstraints.VERTICAL);
-
-            // cancel button
-            Button cancelButton = new Button(PolicyTool.rb.getString("Cancel"));
-            cancelButton.addActionListener(new CancelButtonListener(this));
-            tw.addNewComponent(this, cancelButton, KSD_CANCEL_BUTTON,
-                        1, 4, 1, 1, 0.0, 0.0, GridBagConstraints.VERTICAL);
-
-        }
-        setVisible(true);
-    }
-
-    /**
-     * display a dialog box for the user to input Principal info
-     *
-     * if editPolicyEntry is false, then we are adding Principals to
-     * a new PolicyEntry, and we only update the GUI listing
-     * with the new Principal.
-     *
-     * if edit is true, then we are editing an existing Policy entry.
-     */
-    void displayPrincipalDialog(boolean editPolicyEntry, boolean edit) {
-
-        PolicyParser.PrincipalEntry editMe = null;
-
-        // get the Principal selected from the Principal List
-        TaggedList prinList = (TaggedList)getComponent(PE_PRIN_LIST);
-        int prinIndex = prinList.getSelectedIndex();
-
-        if (edit) {
-            editMe = (PolicyParser.PrincipalEntry)prinList.getObject(prinIndex);
-        }
-
-        ToolDialog newTD = new ToolDialog
-                (PolicyTool.rb.getString("Principals"), tool, tw, true);
-        newTD.addWindowListener(new ChildWindowListener(newTD));
-
-        // find where the PolicyTool gui is
-        Point location = getLocationOnScreen();
-        newTD.setBounds(location.x + 50, location.y + 100, 650, 190);
-        newTD.setLayout(new GridBagLayout());
-        newTD.setResizable(true);
-
-        // description label
-        Label label = (edit ?
-                new Label(PolicyTool.rb.getString("  Edit Principal:")) :
-                new Label(PolicyTool.rb.getString("  Add New Principal:")));
-        tw.addNewComponent(newTD, label, PRD_DESC_LABEL,
-                           0, 0, 1, 1, 0.0, 0.0, GridBagConstraints.BOTH,
-                           tw.TOP_BOTTOM_PADDING);
-
-        // principal choice
-        Choice choice = new Choice();
-        choice.add(PRIN_TYPE);
-        choice.getAccessibleContext().setAccessibleName(PRIN_TYPE);
-        for (int i = 0; i < PRIN_ARRAY.size(); i++) {
-            Prin next = PRIN_ARRAY.get(i);
-            choice.add(next.CLASS);
-        }
-
-        choice.addItemListener(new PrincipalTypeMenuListener(newTD));
-        if (edit) {
-            if (PolicyParser.PrincipalEntry.WILDCARD_CLASS.equals
-                                (editMe.getPrincipalClass())) {
-                choice.select(PRIN_TYPE);
-            } else {
-                Prin inputPrin = getPrin(editMe.getPrincipalClass(), true);
-                if (inputPrin != null) {
-                    choice.select(inputPrin.CLASS);
-                }
-            }
-        }
-
-        tw.addNewComponent(newTD, choice, PRD_PRIN_CHOICE,
-                           0, 1, 1, 1, 0.0, 0.0, GridBagConstraints.BOTH,
-                           tw.LR_PADDING);
-
-        // principal textfield
-        TextField tf;
-        tf = (edit ?
-                new TextField(editMe.getDisplayClass(), 30) :
-                new TextField(30));
-        tf.getAccessibleContext().setAccessibleName(PRIN_TYPE);
-        tw.addNewComponent(newTD, tf, PRD_PRIN_TEXTFIELD,
-                           1, 1, 1, 1, 0.0, 0.0, GridBagConstraints.BOTH,
-                           tw.LR_PADDING);
-
-        // name label and textfield
-        label = new Label(PRIN_NAME);
-        tf = (edit ?
-                new TextField(editMe.getDisplayName(), 40) :
-                new TextField(40));
-        tf.getAccessibleContext().setAccessibleName(PRIN_NAME);
-
-        tw.addNewComponent(newTD, label, PRD_NAME_LABEL,
-                           0, 2, 1, 1, 0.0, 0.0, GridBagConstraints.BOTH,
-                           tw.LR_PADDING);
-        tw.addNewComponent(newTD, tf, PRD_NAME_TEXTFIELD,
-                           1, 2, 1, 1, 0.0, 0.0, GridBagConstraints.BOTH,
-                           tw.LR_PADDING);
-
-        // OK button
-        Button okButton = new Button(PolicyTool.rb.getString("OK"));
-        okButton.addActionListener(
-            new NewPolicyPrinOKButtonListener
-                                        (tool, tw, this, newTD, edit));
-        tw.addNewComponent(newTD, okButton, PRD_OK_BUTTON,
-                           0, 3, 1, 1, 0.0, 0.0, GridBagConstraints.VERTICAL,
-                           tw.TOP_BOTTOM_PADDING);
-        // cancel button
-        Button cancelButton = new Button(PolicyTool.rb.getString("Cancel"));
-        cancelButton.addActionListener(new CancelButtonListener(newTD));
-        tw.addNewComponent(newTD, cancelButton, PRD_CANCEL_BUTTON,
-                           1, 3, 1, 1, 0.0, 0.0, GridBagConstraints.VERTICAL,
-                           tw.TOP_BOTTOM_PADDING);
-
-        newTD.setVisible(true);
-    }
-
-    /**
-     * display a dialog box for the user to input Permission info
-     *
-     * if editPolicyEntry is false, then we are adding Permissions to
-     * a new PolicyEntry, and we only update the GUI listing
-     * with the new Permission.
-     *
-     * if edit is true, then we are editing an existing Permission entry.
-     */
-    void displayPermissionDialog(boolean editPolicyEntry, boolean edit) {
-
-        PolicyParser.PermissionEntry editMe = null;
-
-        // get the Permission selected from the Permission List
-        TaggedList permList = (TaggedList)getComponent(PE_PERM_LIST);
-        int permIndex = permList.getSelectedIndex();
-
-        if (edit) {
-            editMe = (PolicyParser.PermissionEntry)permList.getObject(permIndex);
-        }
-
-        ToolDialog newTD = new ToolDialog
-                (PolicyTool.rb.getString("Permissions"), tool, tw, true);
-        newTD.addWindowListener(new ChildWindowListener(newTD));
-
-        // find where the PolicyTool gui is
-        Point location = getLocationOnScreen();
-        newTD.setBounds(location.x + 50, location.y + 100, 700, 250);
-        newTD.setLayout(new GridBagLayout());
-        newTD.setResizable(true);
-
-        // description label
-        Label label = (edit ?
-                new Label(PolicyTool.rb.getString("  Edit Permission:")) :
-                new Label(PolicyTool.rb.getString("  Add New Permission:")));
-        tw.addNewComponent(newTD, label, PD_DESC_LABEL,
-                           0, 0, 1, 1, 0.0, 0.0, GridBagConstraints.BOTH,
-                           tw.TOP_BOTTOM_PADDING);
-
-        // permission choice (added in alphabetical order)
-        Choice choice = new Choice();
-        choice.add(PERM);
-        choice.getAccessibleContext().setAccessibleName(PERM);
-        for (int i = 0; i < PERM_ARRAY.size(); i++) {
-            Perm next = PERM_ARRAY.get(i);
-            choice.add(next.CLASS);
-        }
-        choice.addItemListener(new PermissionMenuListener(newTD));
-        tw.addNewComponent(newTD, choice, PD_PERM_CHOICE,
-                           0, 1, 1, 1, 0.0, 0.0, GridBagConstraints.BOTH,
-                           tw.LR_PADDING);
-
-        // permission textfield
-        TextField tf;
-        tf = (edit ? new TextField(editMe.permission, 30) : new TextField(30));
-        tf.getAccessibleContext().setAccessibleName(PERM);
-        if (edit) {
-            Perm inputPerm = getPerm(editMe.permission, true);
-            if (inputPerm != null) {
-                choice.select(inputPerm.CLASS);
-            }
-        }
-        tw.addNewComponent(newTD, tf, PD_PERM_TEXTFIELD,
-                           1, 1, 1, 1, 0.0, 0.0, GridBagConstraints.BOTH,
-                           tw.LR_PADDING);
-
-        // name label and textfield
-        choice = new Choice();
-        choice.add(PERM_NAME);
-        choice.getAccessibleContext().setAccessibleName(PERM_NAME);
-        choice.addItemListener(new PermissionNameMenuListener(newTD));
-        tf = (edit ? new TextField(editMe.name, 40) : new TextField(40));
-        tf.getAccessibleContext().setAccessibleName(PERM_NAME);
-        if (edit) {
-            setPermissionNames(getPerm(editMe.permission, true), choice, tf);
-        }
-        tw.addNewComponent(newTD, choice, PD_NAME_CHOICE,
-                           0, 2, 1, 1, 0.0, 0.0, GridBagConstraints.BOTH,
-                           tw.LR_PADDING);
-        tw.addNewComponent(newTD, tf, PD_NAME_TEXTFIELD,
-                           1, 2, 1, 1, 0.0, 0.0, GridBagConstraints.BOTH,
-                           tw.LR_PADDING);
-
-        // actions label and textfield
-        choice = new Choice();
-        choice.add(PERM_ACTIONS);
-        choice.getAccessibleContext().setAccessibleName(PERM_ACTIONS);
-        choice.addItemListener(new PermissionActionsMenuListener(newTD));
-        tf = (edit ? new TextField(editMe.action, 40) : new TextField(40));
-        tf.getAccessibleContext().setAccessibleName(PERM_ACTIONS);
-        if (edit) {
-            setPermissionActions(getPerm(editMe.permission, true), choice, tf);
-        }
-        tw.addNewComponent(newTD, choice, PD_ACTIONS_CHOICE,
-                           0, 3, 1, 1, 0.0, 0.0, GridBagConstraints.BOTH,
-                           tw.LR_PADDING);
-        tw.addNewComponent(newTD, tf, PD_ACTIONS_TEXTFIELD,
-                           1, 3, 1, 1, 0.0, 0.0, GridBagConstraints.BOTH,
-                           tw.LR_PADDING);
-
-        // signedby label and textfield
-        label = new Label(PolicyTool.rb.getString("Signed By:"));
-        tw.addNewComponent(newTD, label, PD_SIGNEDBY_LABEL,
-                           0, 4, 1, 1, 0.0, 0.0, GridBagConstraints.BOTH,
-                           tw.LR_PADDING);
-        tf = (edit ? new TextField(editMe.signedBy, 40) : new TextField(40));
-        tf.getAccessibleContext().setAccessibleName(
-                PolicyTool.rb.getString("Signed By:"));
-        tw.addNewComponent(newTD, tf, PD_SIGNEDBY_TEXTFIELD,
-                           1, 4, 1, 1, 0.0, 0.0, GridBagConstraints.BOTH,
-                           tw.LR_PADDING);
-
-        // OK button
-        Button okButton = new Button(PolicyTool.rb.getString("OK"));
-        okButton.addActionListener(
-            new NewPolicyPermOKButtonListener
-                                    (tool, tw, this, newTD, edit));
-        tw.addNewComponent(newTD, okButton, PD_OK_BUTTON,
-                           0, 5, 1, 1, 0.0, 0.0, GridBagConstraints.VERTICAL,
-                           tw.TOP_BOTTOM_PADDING);
-
-        // cancel button
-        Button cancelButton = new Button(PolicyTool.rb.getString("Cancel"));
-        cancelButton.addActionListener(new CancelButtonListener(newTD));
-        tw.addNewComponent(newTD, cancelButton, PD_CANCEL_BUTTON,
-                           1, 5, 1, 1, 0.0, 0.0, GridBagConstraints.VERTICAL,
-                           tw.TOP_BOTTOM_PADDING);
-
-        newTD.setVisible(true);
-    }
-
-    /**
-     * construct a Principal object from the Principal Info Dialog Box
-     */
-    PolicyParser.PrincipalEntry getPrinFromDialog() throws Exception {
-
-        TextField tf = (TextField)getComponent(PRD_PRIN_TEXTFIELD);
-        String pclass = new String(tf.getText().trim());
-        tf = (TextField)getComponent(PRD_NAME_TEXTFIELD);
-        String pname = new String(tf.getText().trim());
-        if (pclass.equals("*")) {
-            pclass = PolicyParser.PrincipalEntry.WILDCARD_CLASS;
-        }
-        if (pname.equals("*")) {
-            pname = PolicyParser.PrincipalEntry.WILDCARD_NAME;
-        }
-
-        PolicyParser.PrincipalEntry pppe = null;
-
-        if ((pclass.equals(PolicyParser.PrincipalEntry.WILDCARD_CLASS)) &&
-            (!pname.equals(PolicyParser.PrincipalEntry.WILDCARD_NAME))) {
-            throw new Exception
-                        (PolicyTool.rb.getString("Cannot Specify Principal " +
-                        "with a Wildcard Class without a Wildcard Name"));
-        } else if (pname.equals("")) {
-            throw new Exception
-                        (PolicyTool.rb.getString("Cannot Specify Principal " +
-                        "without a Name"));
-        } else if (pclass.equals("")) {
-            // make this consistent with what PolicyParser does
-            // when it sees an empty principal class
-            pclass = PolicyParser.REPLACE_NAME;
-            tool.warnings.addElement(
-                        "Warning: Principal name '" + pname +
-                                "' specified without a Principal class.\n" +
-                        "\t'" + pname + "' will be interpreted " +
-                                "as a key store alias.\n" +
-                        "\tThe final principal class will be " +
-                                ToolDialog.X500_PRIN_CLASS + ".\n" +
-                        "\tThe final principal name will be " +
-                                "determined by the following:\n" +
-                        "\n" +
-                        "\tIf the key store entry identified by '"
-                                + pname + "'\n" +
-                        "\tis a key entry, then the principal name will be\n" +
-                        "\tthe subject distinguished name from the first\n" +
-                        "\tcertificate in the entry's certificate chain.\n" +
-                        "\n" +
-                        "\tIf the key store entry identified by '" +
-                                pname + "'\n" +
-                        "\tis a trusted certificate entry, then the\n" +
-                        "\tprincipal name will be the subject distinguished\n" +
-                        "\tname from the trusted public key certificate.");
-            tw.displayStatusDialog(this,
-                        "'" + pname + "' will be interpreted as a key " +
-                        "store alias.  View Warning Log for details.");
-        }
-        return new PolicyParser.PrincipalEntry(pclass, pname);
-    }
-
-
-    /**
-     * construct a Permission object from the Permission Info Dialog Box
-     */
-    PolicyParser.PermissionEntry getPermFromDialog() {
-
-        TextField tf = (TextField)getComponent(PD_PERM_TEXTFIELD);
-        String permission = new String(tf.getText().trim());
-        tf = (TextField)getComponent(PD_NAME_TEXTFIELD);
-        String name = null;
-        if (tf.getText().trim().equals("") == false)
-            name = new String(tf.getText().trim());
-        if (permission.equals("") ||
-            (!permission.equals(ALL_PERM_CLASS) && name == null)) {
-            throw new InvalidParameterException(PolicyTool.rb.getString
-                ("Permission and Target Name must have a value"));
-        }
-
-        // When the permission is FilePermission, we need to check the name
-        // to make sure it's not escaped. We believe --
-        //
-        // String             name.lastIndexOf("\\\\")
-        // ----------------   ------------------------
-        // c:\foo\bar         -1, legal
-        // c:\\foo\\bar       2, illegal
-        // \\server\share     0, legal
-        // \\\\server\share   2, illegal
-
-        if (permission.equals(FILE_PERM_CLASS) && name.lastIndexOf("\\\\") > 0) {
-            char result = tw.displayYesNoDialog(this,
-                    PolicyTool.rb.getString("Warning"),
-                    PolicyTool.rb.getString(
-                        "Warning: File name may include escaped backslash characters. " +
-                        "It is not necessary to escape backslash characters " +
-                        "(the tool escapes characters as necessary when writing " +
-                        "the policy contents to the persistent store).\n\n" +
-                        "Click on Retain to retain the entered name, or click on " +
-                        "Edit to edit the name."),
-                    PolicyTool.rb.getString("Retain"),
-                    PolicyTool.rb.getString("Edit")
-                    );
-            if (result != 'Y') {
-                // an invisible exception
-                throw new NoDisplayException();
-            }
-        }
-        // get the Actions
-        tf = (TextField)getComponent(PD_ACTIONS_TEXTFIELD);
-        String actions = null;
-        if (tf.getText().trim().equals("") == false)
-            actions = new String(tf.getText().trim());
-
-        // get the Signed By
-        tf = (TextField)getComponent(PD_SIGNEDBY_TEXTFIELD);
-        String signedBy = null;
-        if (tf.getText().trim().equals("") == false)
-            signedBy = new String(tf.getText().trim());
-
-        PolicyParser.PermissionEntry pppe = new PolicyParser.PermissionEntry
-                                (permission, name, actions);
-        pppe.signedBy = signedBy;
-
-        // see if the signers have public keys
-        if (signedBy != null) {
-                String signers[] = tool.parseSigners(pppe.signedBy);
-                for (int i = 0; i < signers.length; i++) {
-                try {
-                    PublicKey pubKey = tool.getPublicKeyAlias(signers[i]);
-                    if (pubKey == null) {
-                        MessageFormat form = new MessageFormat
-                            (PolicyTool.rb.getString
-                            ("Warning: A public key for alias " +
-                            "'signers[i]' does not exist.  " +
-                            "Make sure a KeyStore is properly configured."));
-                        Object[] source = {signers[i]};
-                        tool.warnings.addElement(form.format(source));
-                        tw.displayStatusDialog(this, form.format(source));
-                    }
-                } catch (Exception e) {
-                    tw.displayErrorDialog(this, e);
-                }
-            }
-        }
-        return pppe;
-    }
-
-    /**
-     * confirm that the user REALLY wants to remove the Policy Entry
-     */
-    void displayConfirmRemovePolicyEntry() {
-
-        // find the entry to be removed
-        List list = (List)tw.getComponent(tw.MW_POLICY_LIST);
-        int index = list.getSelectedIndex();
-        PolicyEntry entries[] = tool.getEntry();
-
-        // find where the PolicyTool gui is
-        Point location = tw.getLocationOnScreen();
-        setBounds(location.x + 25, location.y + 100, 600, 400);
-        setLayout(new GridBagLayout());
-
-        // ask the user do they really want to do this?
-        Label label = new Label
-                (PolicyTool.rb.getString("Remove this Policy Entry?"));
-        tw.addNewComponent(this, label, CRPE_LABEL1,
-                           0, 0, 2, 1, 0.0, 0.0, GridBagConstraints.BOTH,
-                           tw.BOTTOM_PADDING);
-
-        // display the policy entry
-        label = new Label(entries[index].codebaseToString());
-        tw.addNewComponent(this, label, CRPE_LABEL2,
-                        0, 1, 2, 1, 0.0, 0.0, GridBagConstraints.BOTH);
-        label = new Label(entries[index].principalsToString().trim());
-        tw.addNewComponent(this, label, CRPE_LABEL2+1,
-                        0, 2, 2, 1, 0.0, 0.0, GridBagConstraints.BOTH);
-        Vector<PolicyParser.PermissionEntry> perms =
-                        entries[index].getGrantEntry().permissionEntries;
-        for (int i = 0; i < perms.size(); i++) {
-            PolicyParser.PermissionEntry nextPerm = perms.elementAt(i);
-            String permString = ToolDialog.PermissionEntryToUserFriendlyString(nextPerm);
-            label = new Label("    " + permString);
-            if (i == (perms.size()-1)) {
-                tw.addNewComponent(this, label, CRPE_LABEL2 + 2 + i,
-                                 1, 3 + i, 1, 1, 0.0, 0.0,
-                                 GridBagConstraints.BOTH, tw.BOTTOM_PADDING);
-            } else {
-                tw.addNewComponent(this, label, CRPE_LABEL2 + 2 + i,
-                                 1, 3 + i, 1, 1, 0.0, 0.0,
-                                 GridBagConstraints.BOTH);
-            }
-        }
-
-
-        // add OK/CANCEL buttons in a new panel
-        Panel panel = new Panel();
-        panel.setLayout(new GridBagLayout());
-
-        // OK button
-        Button okButton = new Button(PolicyTool.rb.getString("OK"));
-        okButton.addActionListener
-                (new ConfirmRemovePolicyEntryOKButtonListener(tool, tw, this));
-        tw.addNewComponent(panel, okButton, CRPE_PANEL_OK,
-                           0, 0, 1, 1, 0.0, 0.0,
-                           GridBagConstraints.VERTICAL, tw.LR_PADDING);
-
-        // cancel button
-        Button cancelButton = new Button(PolicyTool.rb.getString("Cancel"));
-        cancelButton.addActionListener(new CancelButtonListener(this));
-        tw.addNewComponent(panel, cancelButton, CRPE_PANEL_CANCEL,
-                           1, 0, 1, 1, 0.0, 0.0,
-                           GridBagConstraints.VERTICAL, tw.LR_PADDING);
-
-        tw.addNewComponent(this, panel, CRPE_LABEL2 + 2 + perms.size(),
-                           0, 3 + perms.size(), 2, 1, 0.0, 0.0,
-                           GridBagConstraints.VERTICAL, tw.TOP_BOTTOM_PADDING);
-
-        pack();
-        setVisible(true);
-    }
-
-    /**
-     * perform SAVE AS
-     */
-    void displaySaveAsDialog(int nextEvent) {
-
-        // pop up a dialog box for the user to enter a filename.
-        FileDialog fd = new FileDialog
-                (tw, PolicyTool.rb.getString("Save As"), FileDialog.SAVE);
-        fd.addWindowListener(new WindowAdapter() {
-            public void windowClosing(WindowEvent e) {
-                e.getWindow().setVisible(false);
-            }
-        });
-        fd.setVisible(true);
-
-        // see if the user hit cancel
-        if (fd.getFile() == null ||
-            fd.getFile().equals(""))
-            return;
-
-        // get the entered filename
-        String filename = new String(fd.getDirectory() + fd.getFile());
-        fd.dispose();
-
-        // see if the file already exists
-        File saveAsFile = new File(filename);
-        if (saveAsFile.exists()) {
-            // display a dialog box for the user to enter policy info
-            ToolDialog td = new ToolDialog
-                (PolicyTool.rb.getString("Overwrite File"), tool, tw, true);
-            td.displayOverWriteFileDialog(filename, nextEvent);
-        } else {
-            try {
-                // save the policy entries to a file
-                tool.savePolicy(filename);
-
-                // display status
-                MessageFormat form = new MessageFormat(PolicyTool.rb.getString
-                        ("Policy successfully written to filename"));
-                Object[] source = {filename};
-                tw.displayStatusDialog(null, form.format(source));
-
-                // display the new policy filename
-                TextField newFilename = (TextField)tw.getComponent
-                                (tw.MW_FILENAME_TEXTFIELD);
-                newFilename.setText(filename);
-                tw.setVisible(true);
-
-                // now continue with the originally requested command
-                // (QUIT, NEW, or OPEN)
-                userSaveContinue(tool, tw, this, nextEvent);
-
-            } catch (FileNotFoundException fnfe) {
-                if (filename == null || filename.equals("")) {
-                    tw.displayErrorDialog(null, new FileNotFoundException
-                                (PolicyTool.rb.getString("null filename")));
-                } else {
-                    tw.displayErrorDialog(null, fnfe);
-                }
-            } catch (Exception ee) {
-                tw.displayErrorDialog(null, ee);
-            }
-        }
-    }
-
-    /**
-     * ask user if they want to save changes
-     */
-    void displayUserSave(int select) {
-
-        if (tool.modified == true) {
-
-            // find where the PolicyTool gui is
-            Point location = tw.getLocationOnScreen();
-            setBounds(location.x + 75, location.y + 100, 400, 150);
-            setLayout(new GridBagLayout());
-
-            Label label = new Label
-                (PolicyTool.rb.getString("Save changes?"));
-            tw.addNewComponent(this, label, USC_LABEL,
-                               0, 0, 3, 1, 0.0, 0.0, GridBagConstraints.BOTH,
-                               tw.L_TOP_BOTTOM_PADDING);
-
-            Panel panel = new Panel();
-            panel.setLayout(new GridBagLayout());
-
-            Button yesButton = new Button(PolicyTool.rb.getString("Yes"));
-            yesButton.addActionListener
-                        (new UserSaveYesButtonListener(this, tool, tw, select));
-            tw.addNewComponent(panel, yesButton, USC_YES_BUTTON,
-                               0, 0, 1, 1, 0.0, 0.0,
-                               GridBagConstraints.VERTICAL,
-                               tw.LR_BOTTOM_PADDING);
-            Button noButton = new Button(PolicyTool.rb.getString("No"));
-            noButton.addActionListener
-                        (new UserSaveNoButtonListener(this, tool, tw, select));
-            tw.addNewComponent(panel, noButton, USC_NO_BUTTON,
-                               1, 0, 1, 1, 0.0, 0.0,
-                               GridBagConstraints.VERTICAL,
-                               tw.LR_BOTTOM_PADDING);
-            Button cancelButton = new Button(PolicyTool.rb.getString("Cancel"));
-            cancelButton.addActionListener
-                        (new UserSaveCancelButtonListener(this));
-            tw.addNewComponent(panel, cancelButton, USC_CANCEL_BUTTON,
-                               2, 0, 1, 1, 0.0, 0.0,
-                               GridBagConstraints.VERTICAL,
-                               tw.LR_BOTTOM_PADDING);
-
-            tw.addNewComponent(this, panel, USC_PANEL,
-                               0, 1, 1, 1, 0.0, 0.0, GridBagConstraints.BOTH);
-
-            pack();
-            setVisible(true);
-        } else {
-            // just do the original request (QUIT, NEW, or OPEN)
-            userSaveContinue(tool, tw, this, select);
-        }
-    }
-
-    /**
-     * when the user sees the 'YES', 'NO', 'CANCEL' buttons on the
-     * displayUserSave dialog, and the click on one of them,
-     * we need to continue the originally requested action
-     * (either QUITting, opening NEW policy file, or OPENing an existing
-     * policy file.  do that now.
-     */
-    void userSaveContinue(PolicyTool tool, ToolWindow tw,
-                        ToolDialog us, int select) {
-
-        // now either QUIT, open a NEW policy file, or OPEN an existing policy
-        switch(select) {
-        case ToolDialog.QUIT:
-
-            tw.setVisible(false);
-            tw.dispose();
-            System.exit(0);
-
-        case ToolDialog.NEW:
-
-            try {
-                tool.openPolicy(null);
-            } catch (Exception ee) {
-                tool.modified = false;
-                tw.displayErrorDialog(null, ee);
-            }
-
-            // display the policy entries via the policy list textarea
-            List list = new List(40, false);
-            list.addActionListener(new PolicyListListener(tool, tw));
-            tw.replacePolicyList(list);
-
-            // display null policy filename and keystore
-            TextField newFilename = (TextField)
-                                tw.getComponent(tw.MW_FILENAME_TEXTFIELD);
-            newFilename.setText("");
-            tw.setVisible(true);
-            break;
-
-        case ToolDialog.OPEN:
-
-            // pop up a dialog box for the user to enter a filename.
-            FileDialog fd = new FileDialog
-                (tw, PolicyTool.rb.getString("Open"), FileDialog.LOAD);
-            fd.addWindowListener(new WindowAdapter() {
-                public void windowClosing(WindowEvent e) {
-                    e.getWindow().setVisible(false);
-                }
-            });
-            fd.setVisible(true);
-
-            // see if the user hit 'cancel'
-            if (fd.getFile() == null ||
-                fd.getFile().equals(""))
-                return;
-
-            // get the entered filename
-            String policyFile = new String(fd.getDirectory() + fd.getFile());
-
-            try {
-                // open the policy file
-                tool.openPolicy(policyFile);
-
-                // display the policy entries via the policy list textarea
-                list = new List(40, false);
-                list.addActionListener(new PolicyListListener(tool, tw));
-                PolicyEntry entries[] = tool.getEntry();
-                if (entries != null) {
-                    for (int i = 0; i < entries.length; i++)
-                        list.add(entries[i].headerToString());
-                }
-                tw.replacePolicyList(list);
-                tool.modified = false;
-
-                // display the new policy filename
-                newFilename = (TextField)
-                                tw.getComponent(tw.MW_FILENAME_TEXTFIELD);
-                newFilename.setText(policyFile);
-                tw.setVisible(true);
-
-                // inform user of warnings
-                if (tool.newWarning == true) {
-                    tw.displayStatusDialog(null, PolicyTool.rb.getString
-                        ("Errors have occurred while opening the " +
-                        "policy configuration.  View the Warning Log " +
-                        "for more information."));
-                }
-
-            } catch (Exception e) {
-                // add blank policy listing
-                list = new List(40, false);
-                list.addActionListener(new PolicyListListener(tool, tw));
-                tw.replacePolicyList(list);
-                tool.setPolicyFileName(null);
-                tool.modified = false;
-
-                // display a null policy filename
-                newFilename = (TextField)
-                                tw.getComponent(tw.MW_FILENAME_TEXTFIELD);
-                newFilename.setText("");
-                tw.setVisible(true);
-
-                // display the error
-                MessageFormat form = new MessageFormat(PolicyTool.rb.getString
-                    ("Could not open policy file: policyFile: e.toString()"));
-                Object[] source = {policyFile, e.toString()};
-                tw.displayErrorDialog(null, form.format(source));
-            }
-            break;
-        }
-    }
-
-    /**
-     * Return a Menu list of names for a given permission
-     *
-     * If inputPerm's TARGETS are null, then this means TARGETS are
-     * not allowed to be entered (and the TextField is set to be
-     * non-editable).
-     *
-     * If TARGETS are valid but there are no standard ones
-     * (user must enter them by hand) then the TARGETS array may be empty
-     * (and of course non-null).
-     */
-    void setPermissionNames(Perm inputPerm, Choice names, TextField field) {
-        names.removeAll();
-        names.add(PERM_NAME);
-
-        if (inputPerm == null) {
-            // custom permission
-            field.setEditable(true);
-        } else if (inputPerm.TARGETS == null) {
-            // standard permission with no targets
-            field.setEditable(false);
-        } else {
-            // standard permission with standard targets
-            field.setEditable(true);
-            for (int i = 0; i < inputPerm.TARGETS.length; i++) {
-                names.add(inputPerm.TARGETS[i]);
-            }
-        }
-    }
-
-    /**
-     * Return a Menu list of actions for a given permission
-     *
-     * If inputPerm's ACTIONS are null, then this means ACTIONS are
-     * not allowed to be entered (and the TextField is set to be
-     * non-editable).  This is typically true for BasicPermissions.
-     *
-     * If ACTIONS are valid but there are no standard ones
-     * (user must enter them by hand) then the ACTIONS array may be empty
-     * (and of course non-null).
-     */
-    void setPermissionActions(Perm inputPerm, Choice actions, TextField field) {
-        actions.removeAll();
-        actions.add(PERM_ACTIONS);
-
-        if (inputPerm == null) {
-            // custom permission
-            field.setEditable(true);
-        } else if (inputPerm.ACTIONS == null) {
-            // standard permission with no actions
-            field.setEditable(false);
-        } else {
-            // standard permission with standard actions
-            field.setEditable(true);
-            for (int i = 0; i < inputPerm.ACTIONS.length; i++) {
-                actions.add(inputPerm.ACTIONS[i]);
-            }
-        }
-    }
-
-    static String PermissionEntryToUserFriendlyString(PolicyParser.PermissionEntry pppe) {
-        String result = pppe.permission;
-        if (pppe.name != null) {
-            result += " " + pppe.name;
-        }
-        if (pppe.action != null) {
-            result += ", \"" + pppe.action + "\"";
-        }
-        if (pppe.signedBy != null) {
-            result += ", signedBy " + pppe.signedBy;
-        }
-        return result;
-    }
-
-    static String PrincipalEntryToUserFriendlyString(PolicyParser.PrincipalEntry pppe) {
-        StringWriter sw = new StringWriter();
-        PrintWriter pw = new PrintWriter(sw);
-        pppe.write(pw);
-        return sw.toString();
-    }
-}
-
-/**
- * Event handler for the PolicyTool window
- */
-class ToolWindowListener implements WindowListener {
-
-    private ToolWindow tw;
-
-    ToolWindowListener(ToolWindow tw) {
-        this.tw = tw;
-    }
-
-    public void windowOpened(WindowEvent we) {
-    }
-
-    public void windowClosing(WindowEvent we) {
-
-        // XXX
-        // should we ask user if they want to save changes?
-        // (we do if they choose the Menu->Exit)
-        // seems that if they kill the application by hand,
-        // we don't have to ask.
-
-        tw.setVisible(false);
-        tw.dispose();
-        System.exit(0);
-    }
-
-    public void windowClosed(WindowEvent we) {
-        System.exit(0);
-    }
-
-    public void windowIconified(WindowEvent we) {
-    }
-
-    public void windowDeiconified(WindowEvent we) {
-    }
-
-    public void windowActivated(WindowEvent we) {
-    }
-
-    public void windowDeactivated(WindowEvent we) {
-    }
-}
-
-/**
- * Event handler for the Policy List
- */
-class PolicyListListener implements ActionListener {
-
-    private PolicyTool tool;
-    private ToolWindow tw;
-
-    PolicyListListener(PolicyTool tool, ToolWindow tw) {
-        this.tool = tool;
-        this.tw = tw;
-
-    }
-
-    public void actionPerformed(ActionEvent e) {
-
-        // display the permission list for a policy entry
-        ToolDialog td = new ToolDialog
-                (PolicyTool.rb.getString("Policy Entry"), tool, tw, true);
-        td.displayPolicyEntryDialog(true);
-    }
-}
-
-/**
- * Event handler for the File Menu
- */
-class FileMenuListener implements ActionListener {
-
-    private PolicyTool tool;
-    private ToolWindow tw;
-
-    FileMenuListener(PolicyTool tool, ToolWindow tw) {
-        this.tool = tool;
-        this.tw = tw;
-    }
-
-    public void actionPerformed(ActionEvent e) {
-
-        if (PolicyTool.collator.compare(e.getActionCommand(), tw.QUIT) == 0) {
-
-            // ask user if they want to save changes
-            ToolDialog td = new ToolDialog
-                (PolicyTool.rb.getString("Save Changes"), tool, tw, true);
-            td.displayUserSave(td.QUIT);
-
-            // the above method will perform the QUIT as long as the
-            // user does not CANCEL the request
-
-        } else if (PolicyTool.collator.compare(e.getActionCommand(),
-                                        tw.NEW_POLICY_FILE) == 0) {
-
-            // ask user if they want to save changes
-            ToolDialog td = new ToolDialog
-                (PolicyTool.rb.getString("Save Changes"), tool, tw, true);
-            td.displayUserSave(td.NEW);
-
-            // the above method will perform the NEW as long as the
-            // user does not CANCEL the request
-
-        } else if (PolicyTool.collator.compare(e.getActionCommand(),
-                                        tw.OPEN_POLICY_FILE) == 0) {
-
-            // ask user if they want to save changes
-            ToolDialog td = new ToolDialog
-                (PolicyTool.rb.getString("Save Changes"), tool, tw, true);
-            td.displayUserSave(td.OPEN);
-
-            // the above method will perform the OPEN as long as the
-            // user does not CANCEL the request
-
-        } else if (PolicyTool.collator.compare(e.getActionCommand(),
-                                        tw.SAVE_POLICY_FILE) == 0) {
-
-            // get the previously entered filename
-            String filename = ((TextField)
-                    tw.getComponent(tw.MW_FILENAME_TEXTFIELD)).getText();
-
-            // if there is no filename, do a SAVE_AS
-            if (filename == null || filename.length() == 0) {
-                // user wants to SAVE AS
-                ToolDialog td = new ToolDialog
-                        (PolicyTool.rb.getString("Save As"), tool, tw, true);
-                td.displaySaveAsDialog(td.NOACTION);
-            } else {
-                try {
-                    // save the policy entries to a file
-                    tool.savePolicy(filename);
-
-                    // display status
-                    MessageFormat form = new MessageFormat
-                        (PolicyTool.rb.getString
-                        ("Policy successfully written to filename"));
-                    Object[] source = {filename};
-                    tw.displayStatusDialog(null, form.format(source));
-                } catch (FileNotFoundException fnfe) {
-                    if (filename == null || filename.equals("")) {
-                        tw.displayErrorDialog(null, new FileNotFoundException
-                                (PolicyTool.rb.getString("null filename")));
-                    } else {
-                        tw.displayErrorDialog(null, fnfe);
-                    }
-                } catch (Exception ee) {
-                    tw.displayErrorDialog(null, ee);
-                }
-            }
-        } else if (PolicyTool.collator.compare(e.getActionCommand(),
-                                                tw.SAVE_AS_POLICY_FILE) == 0) {
-
-            // user wants to SAVE AS
-            ToolDialog td = new ToolDialog
-                (PolicyTool.rb.getString("Save As"), tool, tw, true);
-            td.displaySaveAsDialog(td.NOACTION);
-
-        } else if (PolicyTool.collator.compare(e.getActionCommand(),
-                                                tw.VIEW_WARNINGS) == 0) {
-            tw.displayWarningLog(null);
-        }
-    }
-}
-
-/**
- * Event handler for the main window buttons and Edit Menu
- */
-class MainWindowListener implements ActionListener {
-
-    private PolicyTool tool;
-    private ToolWindow tw;
-
-    MainWindowListener(PolicyTool tool, ToolWindow tw) {
-        this.tool = tool;
-        this.tw = tw;
-    }
-
-    public void actionPerformed(ActionEvent e) {
-
-        if (PolicyTool.collator.compare(e.getActionCommand(),
-                                        tw.ADD_POLICY_ENTRY) == 0) {
-
-            // display a dialog box for the user to enter policy info
-            ToolDialog td = new ToolDialog
-                (PolicyTool.rb.getString("Policy Entry"), tool, tw, true);
-            td.displayPolicyEntryDialog(false);
-
-        } else if (PolicyTool.collator.compare(e.getActionCommand(),
-                                        tw.REMOVE_POLICY_ENTRY) == 0) {
-
-            // get the selected entry
-            List list = (List)tw.getComponent(tw.MW_POLICY_LIST);
-            int index = list.getSelectedIndex();
-            if (index < 0) {
-                tw.displayErrorDialog(null, new Exception
-                        (PolicyTool.rb.getString("No Policy Entry selected")));
-                return;
-            }
-
-            // ask the user if they really want to remove the policy entry
-            ToolDialog td = new ToolDialog(PolicyTool.rb.getString
-                ("Remove Policy Entry"), tool, tw, true);
-            td.displayConfirmRemovePolicyEntry();
-
-        } else if (PolicyTool.collator.compare(e.getActionCommand(),
-                                        tw.EDIT_POLICY_ENTRY) == 0) {
-
-            // get the selected entry
-            List list = (List)tw.getComponent(tw.MW_POLICY_LIST);
-            int index = list.getSelectedIndex();
-            if (index < 0) {
-                tw.displayErrorDialog(null, new Exception
-                        (PolicyTool.rb.getString("No Policy Entry selected")));
-                return;
-            }
-
-            // display the permission list for a policy entry
-            ToolDialog td = new ToolDialog
-                (PolicyTool.rb.getString("Policy Entry"), tool, tw, true);
-            td.displayPolicyEntryDialog(true);
-
-        } else if (PolicyTool.collator.compare(e.getActionCommand(),
-                                        tw.EDIT_KEYSTORE) == 0) {
-
-            // display a dialog box for the user to enter keystore info
-            ToolDialog td = new ToolDialog
-                (PolicyTool.rb.getString("KeyStore"), tool, tw, true);
-            td.keyStoreDialog(td.EDIT_KEYSTORE);
-        }
-    }
-}
-
-/**
- * Event handler for OverWriteFileOKButton button
- */
-class OverWriteFileOKButtonListener implements ActionListener {
-
-    private PolicyTool tool;
-    private ToolWindow tw;
-    private ToolDialog td;
-    private String filename;
-    private int nextEvent;
-
-    OverWriteFileOKButtonListener(PolicyTool tool, ToolWindow tw,
-                                ToolDialog td, String filename, int nextEvent) {
-        this.tool = tool;
-        this.tw = tw;
-        this.td = td;
-        this.filename = filename;
-        this.nextEvent = nextEvent;
-    }
-
-    public void actionPerformed(ActionEvent e) {
-        try {
-            // save the policy entries to a file
-            tool.savePolicy(filename);
-
-            // display status
-            MessageFormat form = new MessageFormat
-                (PolicyTool.rb.getString
-                ("Policy successfully written to filename"));
-            Object[] source = {filename};
-            tw.displayStatusDialog(null, form.format(source));
-
-            // display the new policy filename
-            TextField newFilename = (TextField)tw.getComponent
-                                (tw.MW_FILENAME_TEXTFIELD);
-            newFilename.setText(filename);
-            tw.setVisible(true);
-
-            // now continue with the originally requested command
-            // (QUIT, NEW, or OPEN)
-            td.setVisible(false);
-            td.dispose();
-            td.userSaveContinue(tool, tw, td, nextEvent);
-
-        } catch (FileNotFoundException fnfe) {
-            if (filename == null || filename.equals("")) {
-                tw.displayErrorDialog(null, new FileNotFoundException
-                                (PolicyTool.rb.getString("null filename")));
-            } else {
-                tw.displayErrorDialog(null, fnfe);
-            }
-            td.setVisible(false);
-            td.dispose();
-        } catch (Exception ee) {
-            tw.displayErrorDialog(null, ee);
-            td.setVisible(false);
-            td.dispose();
-        }
-    }
-}
-
-/**
- * Event handler for AddEntryDoneButton button
- *
- * -- if edit is TRUE, then we are EDITing an existing PolicyEntry
- *    and we need to update both the policy and the GUI listing.
- *    if edit is FALSE, then we are ADDing a new PolicyEntry,
- *    so we only need to update the GUI listing.
- */
-class AddEntryDoneButtonListener implements ActionListener {
-
-    private PolicyTool tool;
-    private ToolWindow tw;
-    private ToolDialog td;
-    private boolean edit;
-
-    AddEntryDoneButtonListener(PolicyTool tool, ToolWindow tw,
-                                ToolDialog td, boolean edit) {
-        this.tool = tool;
-        this.tw = tw;
-        this.td = td;
-        this.edit = edit;
-    }
-
-    public void actionPerformed(ActionEvent e) {
-
-        try {
-            // get a PolicyEntry object from the dialog policy info
-            PolicyEntry newEntry = td.getPolicyEntryFromDialog();
-            PolicyParser.GrantEntry newGe = newEntry.getGrantEntry();
-
-            // see if all the signers have public keys
-            if (newGe.signedBy != null) {
-                String signers[] = tool.parseSigners(newGe.signedBy);
-                for (int i = 0; i < signers.length; i++) {
-                    PublicKey pubKey = tool.getPublicKeyAlias(signers[i]);
-                    if (pubKey == null) {
-                        MessageFormat form = new MessageFormat
-                            (PolicyTool.rb.getString
-                            ("Warning: A public key for alias " +
-                            "'signers[i]' does not exist.  " +
-                            "Make sure a KeyStore is properly configured."));
-                        Object[] source = {signers[i]};
-                        tool.warnings.addElement(form.format(source));
-                        tw.displayStatusDialog(td, form.format(source));
-                    }
-                }
-            }
-
-            // add the entry
-            List policyList = (List)tw.getComponent(tw.MW_POLICY_LIST);
-            if (edit) {
-                int listIndex = policyList.getSelectedIndex();
-                tool.addEntry(newEntry, listIndex);
-                String newCodeBaseStr = newEntry.headerToString();
-                if (PolicyTool.collator.compare
-                        (newCodeBaseStr, policyList.getItem(listIndex)) != 0)
-                    tool.modified = true;
-                policyList.replaceItem(newCodeBaseStr, listIndex);
-            } else {
-                tool.addEntry(newEntry, -1);
-                policyList.add(newEntry.headerToString());
-                tool.modified = true;
-            }
-            td.setVisible(false);
-            td.dispose();
-
-        } catch (Exception eee) {
-            tw.displayErrorDialog(td, eee);
-        }
-    }
-}
-
-/**
- * Event handler for ChangeKeyStoreOKButton button
- */
-class ChangeKeyStoreOKButtonListener implements ActionListener {
-
-    private PolicyTool tool;
-    private ToolWindow tw;
-    private ToolDialog td;
-
-    ChangeKeyStoreOKButtonListener(PolicyTool tool, ToolWindow tw,
-                ToolDialog td) {
-        this.tool = tool;
-        this.tw = tw;
-        this.td = td;
-    }
-
-    public void actionPerformed(ActionEvent e) {
-
-        String URLString = ((TextField)
-                td.getComponent(td.KSD_NAME_TEXTFIELD)).getText().trim();
-        String type = ((TextField)
-                td.getComponent(td.KSD_TYPE_TEXTFIELD)).getText().trim();
-        String provider = ((TextField)
-                td.getComponent(td.KSD_PROVIDER_TEXTFIELD)).getText().trim();
-        String pwdURL = ((TextField)
-                td.getComponent(td.KSD_PWD_URL_TEXTFIELD)).getText().trim();
-
-        try {
-            tool.openKeyStore
-                        ((URLString.length() == 0 ? null : URLString),
-                        (type.length() == 0 ? null : type),
-                        (provider.length() == 0 ? null : provider),
-                        (pwdURL.length() == 0 ? null : pwdURL));
-            tool.modified = true;
-        } catch (Exception ex) {
-            MessageFormat form = new MessageFormat(PolicyTool.rb.getString
-                ("Unable to open KeyStore: ex.toString()"));
-            Object[] source = {ex.toString()};
-            tw.displayErrorDialog(td, form.format(source));
-            return;
-        }
-
-        td.dispose();
-    }
-}
-
-/**
- * Event handler for AddPrinButton button
- */
-class AddPrinButtonListener implements ActionListener {
-
-    private PolicyTool tool;
-    private ToolWindow tw;
-    private ToolDialog td;
-    private boolean editPolicyEntry;
-
-    AddPrinButtonListener(PolicyTool tool, ToolWindow tw,
-                                ToolDialog td, boolean editPolicyEntry) {
-        this.tool = tool;
-        this.tw = tw;
-        this.td = td;
-        this.editPolicyEntry = editPolicyEntry;
-    }
-
-    public void actionPerformed(ActionEvent e) {
-
-        // display a dialog box for the user to enter principal info
-        td.displayPrincipalDialog(editPolicyEntry, false);
-    }
-}
-
-/**
- * Event handler for AddPermButton button
- */
-class AddPermButtonListener implements ActionListener {
-
-    private PolicyTool tool;
-    private ToolWindow tw;
-    private ToolDialog td;
-    private boolean editPolicyEntry;
-
-    AddPermButtonListener(PolicyTool tool, ToolWindow tw,
-                                ToolDialog td, boolean editPolicyEntry) {
-        this.tool = tool;
-        this.tw = tw;
-        this.td = td;
-        this.editPolicyEntry = editPolicyEntry;
-    }
-
-    public void actionPerformed(ActionEvent e) {
-
-        // display a dialog box for the user to enter permission info
-        td.displayPermissionDialog(editPolicyEntry, false);
-    }
-}
-
-/**
- * Event handler for AddPrinOKButton button
- */
-class NewPolicyPrinOKButtonListener implements ActionListener {
-
-    private PolicyTool tool;
-    private ToolWindow tw;
-    private ToolDialog listDialog;
-    private ToolDialog infoDialog;
-    private boolean edit;
-
-    NewPolicyPrinOKButtonListener(PolicyTool tool,
-                                ToolWindow tw,
-                                ToolDialog listDialog,
-                                ToolDialog infoDialog,
-                                boolean edit) {
-        this.tool = tool;
-        this.tw = tw;
-        this.listDialog = listDialog;
-        this.infoDialog = infoDialog;
-        this.edit = edit;
-    }
-
-    public void actionPerformed(ActionEvent e) {
-
-        try {
-            // read in the new principal info from Dialog Box
-            PolicyParser.PrincipalEntry pppe =
-                        infoDialog.getPrinFromDialog();
-            if (pppe != null) {
-                try {
-                    tool.verifyPrincipal(pppe.getPrincipalClass(),
-                                        pppe.getPrincipalName());
-                } catch (ClassNotFoundException cnfe) {
-                    MessageFormat form = new MessageFormat
-                                (PolicyTool.rb.getString
-                                ("Warning: Class not found: class"));
-                    Object[] source = {pppe.getPrincipalClass()};
-                    tool.warnings.addElement(form.format(source));
-                    tw.displayStatusDialog(infoDialog, form.format(source));
-                }
-
-                // add the principal to the GUI principal list
-                TaggedList prinList =
-                    (TaggedList)listDialog.getComponent(listDialog.PE_PRIN_LIST);
-
-                String prinString = ToolDialog.PrincipalEntryToUserFriendlyString(pppe);
-                if (edit) {
-                    // if editing, replace the original principal
-                    int index = prinList.getSelectedIndex();
-                    prinList.replaceTaggedItem(prinString, pppe, index);
-                } else {
-                    // if adding, just add it to the end
-                    prinList.addTaggedItem(prinString, pppe);
-                }
-            }
-            infoDialog.dispose();
-        } catch (Exception ee) {
-            tw.displayErrorDialog(infoDialog, ee);
-        }
-    }
-}
-
-/**
- * Event handler for AddPermOKButton button
- */
-class NewPolicyPermOKButtonListener implements ActionListener {
-
-    private PolicyTool tool;
-    private ToolWindow tw;
-    private ToolDialog listDialog;
-    private ToolDialog infoDialog;
-    private boolean edit;
-
-    NewPolicyPermOKButtonListener(PolicyTool tool,
-                                ToolWindow tw,
-                                ToolDialog listDialog,
-                                ToolDialog infoDialog,
-                                boolean edit) {
-        this.tool = tool;
-        this.tw = tw;
-        this.listDialog = listDialog;
-        this.infoDialog = infoDialog;
-        this.edit = edit;
-    }
-
-    public void actionPerformed(ActionEvent e) {
-
-        try {
-            // read in the new permission info from Dialog Box
-            PolicyParser.PermissionEntry pppe =
-                        infoDialog.getPermFromDialog();
-
-            try {
-                tool.verifyPermission(pppe.permission, pppe.name, pppe.action);
-            } catch (ClassNotFoundException cnfe) {
-                MessageFormat form = new MessageFormat(PolicyTool.rb.getString
-                                ("Warning: Class not found: class"));
-                Object[] source = {pppe.permission};
-                tool.warnings.addElement(form.format(source));
-                tw.displayStatusDialog(infoDialog, form.format(source));
-            }
-
-            // add the permission to the GUI permission list
-            TaggedList permList =
-                (TaggedList)listDialog.getComponent(listDialog.PE_PERM_LIST);
-
-            String permString = ToolDialog.PermissionEntryToUserFriendlyString(pppe);
-            if (edit) {
-                // if editing, replace the original permission
-                int which = permList.getSelectedIndex();
-                permList.replaceTaggedItem(permString, pppe, which);
-            } else {
-                // if adding, just add it to the end
-                permList.addTaggedItem(permString, pppe);
-            }
-            infoDialog.dispose();
-
-        } catch (InvocationTargetException ite) {
-            tw.displayErrorDialog(infoDialog, ite.getTargetException());
-        } catch (Exception ee) {
-            tw.displayErrorDialog(infoDialog, ee);
-        }
-    }
-}
-
-/**
- * Event handler for RemovePrinButton button
- */
-class RemovePrinButtonListener implements ActionListener {
-
-    private PolicyTool tool;
-    private ToolWindow tw;
-    private ToolDialog td;
-    private boolean edit;
-
-    RemovePrinButtonListener(PolicyTool tool, ToolWindow tw,
-                                ToolDialog td, boolean edit) {
-        this.tool = tool;
-        this.tw = tw;
-        this.td = td;
-        this.edit = edit;
-    }
-
-    public void actionPerformed(ActionEvent e) {
-
-        // get the Principal selected from the Principal List
-        TaggedList prinList = (TaggedList)td.getComponent(td.PE_PRIN_LIST);
-        int prinIndex = prinList.getSelectedIndex();
-
-        if (prinIndex < 0) {
-            tw.displayErrorDialog(td, new Exception
-                (PolicyTool.rb.getString("No principal selected")));
-            return;
-        }
-        // remove the principal from the display
-        prinList.removeTaggedItem(prinIndex);
-    }
-}
-
-/**
- * Event handler for RemovePermButton button
- */
-class RemovePermButtonListener implements ActionListener {
-
-    private PolicyTool tool;
-    private ToolWindow tw;
-    private ToolDialog td;
-    private boolean edit;
-
-    RemovePermButtonListener(PolicyTool tool, ToolWindow tw,
-                                ToolDialog td, boolean edit) {
-        this.tool = tool;
-        this.tw = tw;
-        this.td = td;
-        this.edit = edit;
-    }
-
-    public void actionPerformed(ActionEvent e) {
-
-        // get the Permission selected from the Permission List
-        TaggedList permList = (TaggedList)td.getComponent(td.PE_PERM_LIST);
-        int permIndex = permList.getSelectedIndex();
-
-        if (permIndex < 0) {
-            tw.displayErrorDialog(td, new Exception
-                (PolicyTool.rb.getString("No permission selected")));
-            return;
-        }
-        // remove the permission from the display
-        permList.removeTaggedItem(permIndex);
-
-    }
-}
-
-/**
- * Event handler for Edit Principal button
- *
- * We need the editPolicyEntry boolean to tell us if the user is
- * adding a new PolicyEntry at this time, or editing an existing entry.
- * If the user is adding a new PolicyEntry, we ONLY update the
- * GUI listing.  If the user is editing an existing PolicyEntry, we
- * update both the GUI listing and the actual PolicyEntry.
- */
-class EditPrinButtonListener implements ActionListener {
-
-    private PolicyTool tool;
-    private ToolWindow tw;
-    private ToolDialog td;
-    private boolean editPolicyEntry;
-
-    EditPrinButtonListener(PolicyTool tool, ToolWindow tw,
-                                ToolDialog td, boolean editPolicyEntry) {
-        this.tool = tool;
-        this.tw = tw;
-        this.td = td;
-        this.editPolicyEntry = editPolicyEntry;
-    }
-
-    public void actionPerformed(ActionEvent e) {
-
-        // get the Principal selected from the Principal List
-        TaggedList list = (TaggedList)td.getComponent(td.PE_PRIN_LIST);
-        int prinIndex = list.getSelectedIndex();
-
-        if (prinIndex < 0) {
-            tw.displayErrorDialog(td, new Exception
-                (PolicyTool.rb.getString("No principal selected")));
-            return;
-        }
-        td.displayPrincipalDialog(editPolicyEntry, true);
-    }
-}
-
-/**
- * Event handler for Edit Permission button
- *
- * We need the editPolicyEntry boolean to tell us if the user is
- * adding a new PolicyEntry at this time, or editing an existing entry.
- * If the user is adding a new PolicyEntry, we ONLY update the
- * GUI listing.  If the user is editing an existing PolicyEntry, we
- * update both the GUI listing and the actual PolicyEntry.
- */
-class EditPermButtonListener implements ActionListener {
-
-    private PolicyTool tool;
-    private ToolWindow tw;
-    private ToolDialog td;
-    private boolean editPolicyEntry;
-
-    EditPermButtonListener(PolicyTool tool, ToolWindow tw,
-                                ToolDialog td, boolean editPolicyEntry) {
-        this.tool = tool;
-        this.tw = tw;
-        this.td = td;
-        this.editPolicyEntry = editPolicyEntry;
-    }
-
-    public void actionPerformed(ActionEvent e) {
-
-        // get the Permission selected from the Permission List
-        List list = (List)td.getComponent(td.PE_PERM_LIST);
-        int permIndex = list.getSelectedIndex();
-
-        if (permIndex < 0) {
-            tw.displayErrorDialog(td, new Exception
-                (PolicyTool.rb.getString("No permission selected")));
-            return;
-        }
-        td.displayPermissionDialog(editPolicyEntry, true);
-    }
-}
-
-/**
- * Event handler for Principal Popup Menu
- */
-class PrincipalTypeMenuListener implements ItemListener {
-
-    private ToolDialog td;
-
-    PrincipalTypeMenuListener(ToolDialog td) {
-        this.td = td;
-    }
-
-    public void itemStateChanged(ItemEvent e) {
-
-        Choice prin = (Choice)td.getComponent(td.PRD_PRIN_CHOICE);
-        TextField prinField =
-                        (TextField)td.getComponent(td.PRD_PRIN_TEXTFIELD);
-        TextField nameField =
-                        (TextField)td.getComponent(td.PRD_NAME_TEXTFIELD);
-
-        prin.getAccessibleContext().setAccessibleName(
-            PolicyTool.splitToWords((String)e.getItem()));
-        if (((String)e.getItem()).equals(td.PRIN_TYPE)) {
-            // ignore if they choose "Principal Type:" item
-            if (prinField.getText() != null &&
-                prinField.getText().length() > 0) {
-                Prin inputPrin = td.getPrin(prinField.getText(), true);
-                prin.select(inputPrin.CLASS);
-            }
-            return;
-        }
-
-        // if you change the principal, clear the name
-        if (prinField.getText().indexOf((String)e.getItem()) == -1) {
-            nameField.setText("");
-        }
-
-        // set the text in the textfield and also modify the
-        // pull-down choice menus to reflect the correct possible
-        // set of names and actions
-        Prin inputPrin = td.getPrin((String)e.getItem(), false);
-        if (inputPrin != null) {
-            prinField.setText(inputPrin.FULL_CLASS);
-        }
-    }
-}
-
-/**
- * Event handler for Permission Popup Menu
- */
-class PermissionMenuListener implements ItemListener {
-
-    private ToolDialog td;
-
-    PermissionMenuListener(ToolDialog td) {
-        this.td = td;
-    }
-
-    public void itemStateChanged(ItemEvent e) {
-
-        Choice perms = (Choice)td.getComponent(td.PD_PERM_CHOICE);
-        Choice names = (Choice)td.getComponent(td.PD_NAME_CHOICE);
-        Choice actions = (Choice)td.getComponent(td.PD_ACTIONS_CHOICE);
-        TextField nameField =
-                        (TextField)td.getComponent(td.PD_NAME_TEXTFIELD);
-        TextField actionsField =
-                        (TextField)td.getComponent(td.PD_ACTIONS_TEXTFIELD);
-        TextField permField = (TextField)td.getComponent(td.PD_PERM_TEXTFIELD);
-        TextField signedbyField =
-                        (TextField)td.getComponent(td.PD_SIGNEDBY_TEXTFIELD);
-
-        perms.getAccessibleContext().setAccessibleName(
-            PolicyTool.splitToWords((String)e.getItem()));
-
-        // ignore if they choose the 'Permission:' item
-        if (PolicyTool.collator.compare((String)e.getItem(), td.PERM) == 0) {
-            if (permField.getText() != null &&
-                permField.getText().length() > 0) {
-
-                Perm inputPerm = td.getPerm(permField.getText(), true);
-                if (inputPerm != null) {
-                    perms.select(inputPerm.CLASS);
-                }
-            }
-            return;
-        }
-
-        // if you change the permission, clear the name, actions, and signedBy
-        if (permField.getText().indexOf((String)e.getItem()) == -1) {
-            nameField.setText("");
-            actionsField.setText("");
-            signedbyField.setText("");
-        }
-
-        // set the text in the textfield and also modify the
-        // pull-down choice menus to reflect the correct possible
-        // set of names and actions
-
-        Perm inputPerm = td.getPerm((String)e.getItem(), false);
-        if (inputPerm == null) {
-            permField.setText("");
-        } else {
-            permField.setText(inputPerm.FULL_CLASS);
-        }
-        td.setPermissionNames(inputPerm, names, nameField);
-        td.setPermissionActions(inputPerm, actions, actionsField);
-    }
-}
-
-/**
- * Event handler for Permission Name Popup Menu
- */
-class PermissionNameMenuListener implements ItemListener {
-
-    private ToolDialog td;
-
-    PermissionNameMenuListener(ToolDialog td) {
-        this.td = td;
-    }
-
-    public void itemStateChanged(ItemEvent e) {
-
-        Choice names = (Choice)td.getComponent(td.PD_NAME_CHOICE);
-        names.getAccessibleContext().setAccessibleName(
-            PolicyTool.splitToWords((String)e.getItem()));
-
-        if (((String)e.getItem()).indexOf(td.PERM_NAME) != -1)
-            return;
-
-        TextField tf = (TextField)td.getComponent(td.PD_NAME_TEXTFIELD);
-        tf.setText((String)e.getItem());
-    }
-}
-
-/**
- * Event handler for Permission Actions Popup Menu
- */
-class PermissionActionsMenuListener implements ItemListener {
-
-    private ToolDialog td;
-
-    PermissionActionsMenuListener(ToolDialog td) {
-        this.td = td;
-    }
-
-    public void itemStateChanged(ItemEvent e) {
-
-        Choice actions = (Choice)td.getComponent(td.PD_ACTIONS_CHOICE);
-        actions.getAccessibleContext().setAccessibleName((String)e.getItem());
-
-        if (((String)e.getItem()).indexOf(td.PERM_ACTIONS) != -1)
-            return;
-
-        TextField tf = (TextField)td.getComponent(td.PD_ACTIONS_TEXTFIELD);
-        if (tf.getText() == null || tf.getText().equals("")) {
-            tf.setText((String)e.getItem());
-        } else {
-            if (tf.getText().indexOf((String)e.getItem()) == -1)
-                tf.setText(tf.getText() + ", " + (String)e.getItem());
-        }
-    }
-}
-
-/**
- * Event handler for all the children dialogs/windows
- */
-class ChildWindowListener implements WindowListener {
-
-    private ToolDialog td;
-
-    ChildWindowListener(ToolDialog td) {
-        this.td = td;
-    }
-
-    public void windowOpened(WindowEvent we) {
-    }
-
-    public void windowClosing(WindowEvent we) {
-        // same as pressing the "cancel" button
-        td.setVisible(false);
-        td.dispose();
-    }
-
-    public void windowClosed(WindowEvent we) {
-    }
-
-    public void windowIconified(WindowEvent we) {
-    }
-
-    public void windowDeiconified(WindowEvent we) {
-    }
-
-    public void windowActivated(WindowEvent we) {
-    }
-
-    public void windowDeactivated(WindowEvent we) {
-    }
-}
-
-/**
- * Event handler for CancelButton button
- */
-class CancelButtonListener implements ActionListener {
-
-    private ToolDialog td;
-
-    CancelButtonListener(ToolDialog td) {
-        this.td = td;
-    }
-
-    public void actionPerformed(ActionEvent e) {
-        td.setVisible(false);
-        td.dispose();
-    }
-}
-
-/**
- * Event handler for ErrorOKButton button
- */
-class ErrorOKButtonListener implements ActionListener {
-
-    private ToolDialog ed;
-
-    ErrorOKButtonListener(ToolDialog ed) {
-        this.ed = ed;
-    }
-
-    public void actionPerformed(ActionEvent e) {
-        ed.setVisible(false);
-        ed.dispose();
-    }
-}
-
-/**
- * Event handler for StatusOKButton button
- */
-class StatusOKButtonListener implements ActionListener {
-
-    private ToolDialog sd;
-
-    StatusOKButtonListener(ToolDialog sd) {
-        this.sd = sd;
-    }
-
-    public void actionPerformed(ActionEvent e) {
-        sd.setVisible(false);
-        sd.dispose();
-    }
-}
-
-/**
- * Event handler for UserSaveYes button
- */
-class UserSaveYesButtonListener implements ActionListener {
-
-    private ToolDialog us;
-    private PolicyTool tool;
-    private ToolWindow tw;
-    private int select;
-
-    UserSaveYesButtonListener(ToolDialog us, PolicyTool tool,
-                        ToolWindow tw, int select) {
-        this.us = us;
-        this.tool = tool;
-        this.tw = tw;
-        this.select = select;
-    }
-
-    public void actionPerformed(ActionEvent e) {
-
-        // first get rid of the window
-        us.setVisible(false);
-        us.dispose();
-
-        try {
-            String filename = ((TextField)
-                    tw.getComponent(tw.MW_FILENAME_TEXTFIELD)).getText();
-            if (filename == null || filename.equals("")) {
-                us.displaySaveAsDialog(select);
-
-                // the above dialog will continue with the originally
-                // requested command if necessary
-            } else {
-                // save the policy entries to a file
-                tool.savePolicy(filename);
-
-                // display status
-                MessageFormat form = new MessageFormat
-                        (PolicyTool.rb.getString
-                        ("Policy successfully written to filename"));
-                Object[] source = {filename};
-                tw.displayStatusDialog(null, form.format(source));
-
-                // now continue with the originally requested command
-                // (QUIT, NEW, or OPEN)
-                us.userSaveContinue(tool, tw, us, select);
-            }
-        } catch (Exception ee) {
-            // error -- just report it and bail
-            tw.displayErrorDialog(null, ee);
-        }
-    }
-}
-
-/**
- * Event handler for UserSaveNoButton
- */
-class UserSaveNoButtonListener implements ActionListener {
-
-    private PolicyTool tool;
-    private ToolWindow tw;
-    private ToolDialog us;
-    private int select;
-
-    UserSaveNoButtonListener(ToolDialog us, PolicyTool tool,
-                        ToolWindow tw, int select) {
-        this.us = us;
-        this.tool = tool;
-        this.tw = tw;
-        this.select = select;
-    }
-
-    public void actionPerformed(ActionEvent e) {
-        us.setVisible(false);
-        us.dispose();
-
-        // now continue with the originally requested command
-        // (QUIT, NEW, or OPEN)
-        us.userSaveContinue(tool, tw, us, select);
-    }
-}
-
-/**
- * Event handler for UserSaveCancelButton
- */
-class UserSaveCancelButtonListener implements ActionListener {
-
-    private ToolDialog us;
-
-    UserSaveCancelButtonListener(ToolDialog us) {
-        this.us = us;
-    }
-
-    public void actionPerformed(ActionEvent e) {
-        us.setVisible(false);
-        us.dispose();
-
-        // do NOT continue with the originally requested command
-        // (QUIT, NEW, or OPEN)
-    }
-}
-
-/**
- * Event handler for ConfirmRemovePolicyEntryOKButtonListener
- */
-class ConfirmRemovePolicyEntryOKButtonListener implements ActionListener {
-
-    private PolicyTool tool;
-    private ToolWindow tw;
-    private ToolDialog us;
-
-    ConfirmRemovePolicyEntryOKButtonListener(PolicyTool tool,
-                                ToolWindow tw, ToolDialog us) {
-        this.tool = tool;
-        this.tw = tw;
-        this.us = us;
-    }
-
-    public void actionPerformed(ActionEvent e) {
-        // remove the entry
-        List list = (List)tw.getComponent(tw.MW_POLICY_LIST);
-        int index = list.getSelectedIndex();
-        PolicyEntry entries[] = tool.getEntry();
-        tool.removeEntry(entries[index]);
-
-        // redraw the window listing
-        list = new List(40, false);
-        list.addActionListener(new PolicyListListener(tool, tw));
-        entries = tool.getEntry();
-        if (entries != null) {
-                for (int i = 0; i < entries.length; i++)
-                    list.add(entries[i].headerToString());
-        }
-        tw.replacePolicyList(list);
-        us.setVisible(false);
-        us.dispose();
-    }
-}
-
-/**
- * Just a special name, so that the codes dealing with this exception knows
- * it's special, and does not pop out a warning box.
- */
-class NoDisplayException extends RuntimeException {
-
-}
-
-/**
- * This is a java.awt.List that bind an Object to each String it holds.
- */
-class TaggedList extends List {
-    private java.util.List<Object> data = new LinkedList<Object>();
-    public TaggedList(int i, boolean b) {
-        super(i, b);
-    }
-
-    public Object getObject(int index) {
-        return data.get(index);
-    }
-
-    @Override @Deprecated public void add(String string) {
-        throw new AssertionError("should not call add in TaggedList");
-    }
-    public void addTaggedItem(String string, Object object) {
-        super.add(string);
-        data.add(object);
-    }
-
-    @Override @Deprecated public void replaceItem(String string, int index) {
-        throw new AssertionError("should not call replaceItem in TaggedList");
-    }
-    public void replaceTaggedItem(String string, Object object, int index) {
-        super.replaceItem(string, index);
-        data.set(index, object);
-    }
-
-    @Override @Deprecated public void remove(int index) {
-        // Cannot throw AssertionError, because replaceItem() call remove() internally
-        super.remove(index);
-    }
-    public void removeTaggedItem(int index) {
-        super.remove(index);
-        data.remove(index);
-    }
-}
-
-/**
- * Convenience Principal Classes
- */
-
-class Prin {
-    public final String CLASS;
-    public final String FULL_CLASS;
-
-    public Prin(String clazz, String fullClass) {
-        this.CLASS = clazz;
-        this.FULL_CLASS = fullClass;
-    }
-}
-
-class KrbPrin extends Prin {
-    public KrbPrin() {
-        super("KerberosPrincipal",
-                "javax.security.auth.kerberos.KerberosPrincipal");
-    }
-}
-
-class X500Prin extends Prin {
-    public X500Prin() {
-        super("X500Principal",
-                "javax.security.auth.x500.X500Principal");
-    }
-}
-
-/**
- * Convenience Permission Classes
- */
-
-class Perm {
-    public final String CLASS;
-    public final String FULL_CLASS;
-    public final String[] TARGETS;
-    public final String[] ACTIONS;
-
-    public Perm(String clazz, String fullClass,
-                String[] targets, String[] actions) {
-
-        this.CLASS = clazz;
-        this.FULL_CLASS = fullClass;
-        this.TARGETS = targets;
-        this.ACTIONS = actions;
-    }
-}
-
-class AllPerm extends Perm {
-    public AllPerm() {
-        super("AllPermission", "java.security.AllPermission", null, null);
-    }
-}
-
-class AudioPerm extends Perm {
-    public AudioPerm() {
-        super("AudioPermission",
-        "javax.sound.sampled.AudioPermission",
-        new String[]    {
-                "play",
-                "record"
-                },
-        null);
-    }
-}
-
-class AuthPerm extends Perm {
-    public AuthPerm() {
-    super("AuthPermission",
-        "javax.security.auth.AuthPermission",
-        new String[]    {
-                "doAs",
-                "doAsPrivileged",
-                "getSubject",
-                "getSubjectFromDomainCombiner",
-                "setReadOnly",
-                "modifyPrincipals",
-                "modifyPublicCredentials",
-                "modifyPrivateCredentials",
-                "refreshCredential",
-                "destroyCredential",
-                "createLoginContext.<" + PolicyTool.rb.getString("name") + ">",
-                "getLoginConfiguration",
-                "setLoginConfiguration",
-                "createLoginConfiguration.<" +
-                        PolicyTool.rb.getString("configuration type") + ">",
-                "refreshLoginConfiguration"
-                },
-        null);
-    }
-}
-
-class AWTPerm extends Perm {
-    public AWTPerm() {
-    super("AWTPermission",
-        "java.awt.AWTPermission",
-        new String[]    {
-                "accessClipboard",
-                "accessEventQueue",
-                "accessSystemTray",
-                "createRobot",
-                "fullScreenExclusive",
-                "listenToAllAWTEvents",
-                "readDisplayPixels",
-                "replaceKeyboardFocusManager",
-                "setAppletStub",
-                "setWindowAlwaysOnTop",
-                "showWindowWithoutWarningBanner",
-                "toolkitModality",
-                "watchMousePointer"
-        },
-        null);
-    }
-}
-
-class DelegationPerm extends Perm {
-    public DelegationPerm() {
-    super("DelegationPermission",
-        "javax.security.auth.kerberos.DelegationPermission",
-        new String[]    {
-                // allow user input
-                },
-        null);
-    }
-}
-
-class FilePerm extends Perm {
-    public FilePerm() {
-    super("FilePermission",
-        "java.io.FilePermission",
-        new String[]    {
-                "<<ALL FILES>>"
-                },
-        new String[]    {
-                "read",
-                "write",
-                "delete",
-                "execute"
-                });
-    }
-}
-
-class InqSecContextPerm extends Perm {
-    public InqSecContextPerm() {
-    super("InquireSecContextPermission",
-        "com.sun.security.jgss.InquireSecContextPermission",
-        new String[]    {
-                "KRB5_GET_SESSION_KEY",
-                "KRB5_GET_TKT_FLAGS",
-                "KRB5_GET_AUTHZ_DATA",
-                "KRB5_GET_AUTHTIME"
-                },
-        null);
-    }
-}
-
-class LogPerm extends Perm {
-    public LogPerm() {
-    super("LoggingPermission",
-        "java.util.logging.LoggingPermission",
-        new String[]    {
-                "control"
-                },
-        null);
-    }
-}
-
-class MgmtPerm extends Perm {
-    public MgmtPerm() {
-    super("ManagementPermission",
-        "java.lang.management.ManagementPermission",
-        new String[]    {
-                "control",
-                "monitor"
-                },
-        null);
-    }
-}
-
-class MBeanPerm extends Perm {
-    public MBeanPerm() {
-    super("MBeanPermission",
-        "javax.management.MBeanPermission",
-        new String[]    {
-                // allow user input
-                },
-        new String[]    {
-                "addNotificationListener",
-                "getAttribute",
-                "getClassLoader",
-                "getClassLoaderFor",
-                "getClassLoaderRepository",
-                "getDomains",
-                "getMBeanInfo",
-                "getObjectInstance",
-                "instantiate",
-                "invoke",
-                "isInstanceOf",
-                "queryMBeans",
-                "queryNames",
-                "registerMBean",
-                "removeNotificationListener",
-                "setAttribute",
-                "unregisterMBean"
-                });
-    }
-}
-
-class MBeanSvrPerm extends Perm {
-    public MBeanSvrPerm() {
-    super("MBeanServerPermission",
-        "javax.management.MBeanServerPermission",
-        new String[]    {
-                "createMBeanServer",
-                "findMBeanServer",
-                "newMBeanServer",
-                "releaseMBeanServer"
-                },
-        null);
-    }
-}
-
-class MBeanTrustPerm extends Perm {
-    public MBeanTrustPerm() {
-    super("MBeanTrustPermission",
-        "javax.management.MBeanTrustPermission",
-        new String[]    {
-                "register"
-                },
-        null);
-    }
-}
-
-class NetPerm extends Perm {
-    public NetPerm() {
-    super("NetPermission",
-        "java.net.NetPermission",
-        new String[]    {
-                "setDefaultAuthenticator",
-                "requestPasswordAuthentication",
-                "specifyStreamHandler",
-                "setProxySelector",
-                "getProxySelector",
-                "setCookieHandler",
-                "getCookieHandler",
-                "setResponseCache",
-                "getResponseCache"
-                },
-        null);
-    }
-}
-
-class PrivCredPerm extends Perm {
-    public PrivCredPerm() {
-    super("PrivateCredentialPermission",
-        "javax.security.auth.PrivateCredentialPermission",
-        new String[]    {
-                // allow user input
-                },
-        new String[]    {
-                "read"
-                });
-    }
-}
-
-class PropPerm extends Perm {
-    public PropPerm() {
-    super("PropertyPermission",
-        "java.util.PropertyPermission",
-        new String[]    {
-                // allow user input
-                },
-        new String[]    {
-                "read",
-                "write"
-                });
-    }
-}
-
-class ReflectPerm extends Perm {
-    public ReflectPerm() {
-    super("ReflectPermission",
-        "java.lang.reflect.ReflectPermission",
-        new String[]    {
-                "suppressAccessChecks"
-                },
-        null);
-    }
-}
-
-class RuntimePerm extends Perm {
-    public RuntimePerm() {
-    super("RuntimePermission",
-        "java.lang.RuntimePermission",
-        new String[]    {
-                "createClassLoader",
-                "getClassLoader",
-                "setContextClassLoader",
-                "enableContextClassLoaderOverride",
-                "setSecurityManager",
-                "createSecurityManager",
-                "getenv.<" +
-                    PolicyTool.rb.getString("environment variable name") + ">",
-                "exitVM",
-                "shutdownHooks",
-                "setFactory",
-                "setIO",
-                "modifyThread",
-                "stopThread",
-                "modifyThreadGroup",
-                "getProtectionDomain",
-                "readFileDescriptor",
-                "writeFileDescriptor",
-                "loadLibrary.<" +
-                    PolicyTool.rb.getString("library name") + ">",
-                "accessClassInPackage.<" +
-                    PolicyTool.rb.getString("package name")+">",
-                "defineClassInPackage.<" +
-                    PolicyTool.rb.getString("package name")+">",
-                "accessDeclaredMembers",
-                "queuePrintJob",
-                "getStackTrace",
-                "setDefaultUncaughtExceptionHandler",
-                "preferences",
-                "usePolicy",
-                // "inheritedChannel"
-                },
-        null);
-    }
-}
-
-class SecurityPerm extends Perm {
-    public SecurityPerm() {
-    super("SecurityPermission",
-        "java.security.SecurityPermission",
-        new String[]    {
-                "createAccessControlContext",
-                "getDomainCombiner",
-                "getPolicy",
-                "setPolicy",
-                "createPolicy.<" +
-                    PolicyTool.rb.getString("policy type") + ">",
-                "getProperty.<" +
-                    PolicyTool.rb.getString("property name") + ">",
-                "setProperty.<" +
-                    PolicyTool.rb.getString("property name") + ">",
-                "insertProvider.<" +
-                    PolicyTool.rb.getString("provider name") + ">",
-                "removeProvider.<" +
-                    PolicyTool.rb.getString("provider name") + ">",
-                //"setSystemScope",
-                //"setIdentityPublicKey",
-                //"setIdentityInfo",
-                //"addIdentityCertificate",
-                //"removeIdentityCertificate",
-                //"printIdentity",
-                "clearProviderProperties.<" +
-                    PolicyTool.rb.getString("provider name") + ">",
-                "putProviderProperty.<" +
-                    PolicyTool.rb.getString("provider name") + ">",
-                "removeProviderProperty.<" +
-                    PolicyTool.rb.getString("provider name") + ">",
-                //"getSignerPrivateKey",
-                //"setSignerKeyPair"
-                },
-        null);
-    }
-}
-
-class SerialPerm extends Perm {
-    public SerialPerm() {
-    super("SerializablePermission",
-        "java.io.SerializablePermission",
-        new String[]    {
-                "enableSubclassImplementation",
-                "enableSubstitution"
-                },
-        null);
-    }
-}
-
-class ServicePerm extends Perm {
-    public ServicePerm() {
-    super("ServicePermission",
-        "javax.security.auth.kerberos.ServicePermission",
-        new String[]    {
-                // allow user input
-                },
-        new String[]    {
-                "initiate",
-                "accept"
-                });
-    }
-}
-
-class SocketPerm extends Perm {
-    public SocketPerm() {
-    super("SocketPermission",
-        "java.net.SocketPermission",
-        new String[]    {
-                // allow user input
-                },
-        new String[]    {
-                "accept",
-                "connect",
-                "listen",
-                "resolve"
-                });
-    }
-}
-
-class SQLPerm extends Perm {
-    public SQLPerm() {
-    super("SQLPermission",
-        "java.sql.SQLPermission",
-        new String[]    {
-                "setLog"
-                },
-        null);
-    }
-}
-
-class SSLPerm extends Perm {
-    public SSLPerm() {
-    super("SSLPermission",
-        "javax.net.ssl.SSLPermission",
-        new String[]    {
-                "setHostnameVerifier",
-                "getSSLSessionContext"
-                },
-        null);
-    }
-}
-
-class SubjDelegPerm extends Perm {
-    public SubjDelegPerm() {
-    super("SubjectDelegationPermission",
-        "javax.management.remote.SubjectDelegationPermission",
-        new String[]    {
-                // allow user input
-                },
-        null);
-    }
-}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/src/share/classes/sun/security/tools/policytool/PolicyTool.java	Wed Jul 21 09:57:21 2010 -0700
@@ -0,0 +1,4261 @@
+/*
+ * Copyright (c) 1997, 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.security.tools.policytool;
+
+import java.io.*;
+import java.util.LinkedList;
+import java.util.ListIterator;
+import java.util.Vector;
+import java.util.Enumeration;
+import java.net.URL;
+import java.net.MalformedURLException;
+import java.lang.reflect.*;
+import java.text.Collator;
+import java.text.MessageFormat;
+import sun.security.util.PropertyExpander;
+import sun.security.util.PropertyExpander.ExpandException;
+import java.awt.*;
+import java.awt.event.*;
+import java.security.cert.Certificate;
+import java.security.cert.CertificateException;
+import java.security.*;
+import sun.security.provider.*;
+import sun.security.util.PolicyUtil;
+import javax.security.auth.x500.X500Principal;
+
+/**
+ * PolicyTool may be used by users and administrators to configure the
+ * overall java security policy (currently stored in the policy file).
+ * Using PolicyTool administators may add and remove policies from
+ * the policy file. <p>
+ *
+ * @see java.security.Policy
+ * @since   1.2
+ */
+
+public class PolicyTool {
+
+    // for i18n
+    static final java.util.ResourceBundle rb =
+        java.util.ResourceBundle.getBundle("sun.security.util.Resources");
+    static final Collator collator = Collator.getInstance();
+    static {
+        // this is for case insensitive string comparisons
+        collator.setStrength(Collator.PRIMARY);
+    };
+
+    // anyone can add warnings
+    Vector<String> warnings;
+    boolean newWarning = false;
+
+    // set to true if policy modified.
+    // this way upon exit we know if to ask the user to save changes
+    boolean modified = false;
+
+    private static final boolean testing = false;
+    private static final Class[] TWOPARAMS = { String.class, String.class };
+    private static final Class[] ONEPARAMS = { String.class };
+    private static final Class[] NOPARAMS  = {};
+    /*
+     * All of the policy entries are read in from the
+     * policy file and stored here.  Updates to the policy entries
+     * using addEntry() and removeEntry() are made here.  To ultimately save
+     * the policy entries back to the policy file, the SavePolicy button
+     * must be clicked.
+     **/
+    private static String policyFileName = null;
+    private Vector<PolicyEntry> policyEntries = null;
+    private PolicyParser parser = null;
+
+    /* The public key alias information is stored here.  */
+    private KeyStore keyStore = null;
+    private String keyStoreName = " ";
+    private String keyStoreType = " ";
+    private String keyStoreProvider = " ";
+    private String keyStorePwdURL = " ";
+
+    /* standard PKCS11 KeyStore type */
+    private static final String P11KEYSTORE = "PKCS11";
+
+    /* reserved word for PKCS11 KeyStores */
+    private static final String NONE = "NONE";
+
+    /**
+     * default constructor
+     */
+    private PolicyTool() {
+        policyEntries = new Vector<PolicyEntry>();
+        parser = new PolicyParser();
+        warnings = new Vector<String>();
+    }
+
+    /**
+     * get the PolicyFileName
+     */
+    String getPolicyFileName() {
+        return policyFileName;
+    }
+
+    /**
+     * set the PolicyFileName
+     */
+    void setPolicyFileName(String policyFileName) {
+        this.policyFileName = policyFileName;
+    }
+
+   /**
+    * clear keyStore info
+    */
+    void clearKeyStoreInfo() {
+        this.keyStoreName = null;
+        this.keyStoreType = null;
+        this.keyStoreProvider = null;
+        this.keyStorePwdURL = null;
+
+        this.keyStore = null;
+    }
+
+    /**
+     * get the keyStore URL name
+     */
+    String getKeyStoreName() {
+        return keyStoreName;
+    }
+
+    /**
+     * get the keyStore Type
+     */
+    String getKeyStoreType() {
+        return keyStoreType;
+    }
+
+    /**
+     * get the keyStore Provider
+     */
+    String getKeyStoreProvider() {
+        return keyStoreProvider;
+    }
+
+    /**
+     * get the keyStore password URL
+     */
+    String getKeyStorePwdURL() {
+        return keyStorePwdURL;
+    }
+
+    /**
+     * Open and read a policy file
+     */
+    void openPolicy(String filename) throws FileNotFoundException,
+                                        PolicyParser.ParsingException,
+                                        KeyStoreException,
+                                        CertificateException,
+                                        InstantiationException,
+                                        MalformedURLException,
+                                        IOException,
+                                        NoSuchAlgorithmException,
+                                        IllegalAccessException,
+                                        NoSuchMethodException,
+                                        UnrecoverableKeyException,
+                                        NoSuchProviderException,
+                                        ClassNotFoundException,
+                                        PropertyExpander.ExpandException,
+                                        InvocationTargetException {
+
+        newWarning = false;
+
+        // start fresh - blow away the current state
+        policyEntries = new Vector<PolicyEntry>();
+        parser = new PolicyParser();
+        warnings = new Vector<String>();
+        setPolicyFileName(null);
+        clearKeyStoreInfo();
+
+        // see if user is opening a NEW policy file
+        if (filename == null) {
+            modified = false;
+            return;
+        }
+
+        // Read in the policy entries from the file and
+        // populate the parser vector table.  The parser vector
+        // table only holds the entries as strings, so it only
+        // guarantees that the policies are syntactically
+        // correct.
+        setPolicyFileName(filename);
+        parser.read(new FileReader(filename));
+
+        // open the keystore
+        openKeyStore(parser.getKeyStoreUrl(), parser.getKeyStoreType(),
+                parser.getKeyStoreProvider(), parser.getStorePassURL());
+
+        // Update the local vector with the same policy entries.
+        // This guarantees that the policy entries are not only
+        // syntactically correct, but semantically valid as well.
+        Enumeration<PolicyParser.GrantEntry> enum_ = parser.grantElements();
+        while (enum_.hasMoreElements()) {
+            PolicyParser.GrantEntry ge = enum_.nextElement();
+
+            // see if all the signers have public keys
+            if (ge.signedBy != null) {
+
+                String signers[] = parseSigners(ge.signedBy);
+                for (int i = 0; i < signers.length; i++) {
+                    PublicKey pubKey = getPublicKeyAlias(signers[i]);
+                    if (pubKey == null) {
+                        newWarning = true;
+                        MessageFormat form = new MessageFormat(rb.getString
+                            ("Warning: A public key for alias " +
+                            "'signers[i]' does not exist.  " +
+                            "Make sure a KeyStore is properly configured."));
+                        Object[] source = {signers[i]};
+                        warnings.addElement(form.format(source));
+                    }
+                }
+            }
+
+            // check to see if the Principals are valid
+            ListIterator<PolicyParser.PrincipalEntry> prinList =
+                                                ge.principals.listIterator(0);
+            while (prinList.hasNext()) {
+                PolicyParser.PrincipalEntry pe = prinList.next();
+                try {
+                    verifyPrincipal(pe.getPrincipalClass(),
+                                pe.getPrincipalName());
+                } catch (ClassNotFoundException fnfe) {
+                    newWarning = true;
+                    MessageFormat form = new MessageFormat(rb.getString
+                                ("Warning: Class not found: class"));
+                    Object[] source = {pe.getPrincipalClass()};
+                    warnings.addElement(form.format(source));
+                }
+            }
+
+            // check to see if the Permissions are valid
+            Enumeration<PolicyParser.PermissionEntry> perms =
+                                                ge.permissionElements();
+            while (perms.hasMoreElements()) {
+                PolicyParser.PermissionEntry pe = perms.nextElement();
+                try {
+                    verifyPermission(pe.permission, pe.name, pe.action);
+                } catch (ClassNotFoundException fnfe) {
+                    newWarning = true;
+                    MessageFormat form = new MessageFormat(rb.getString
+                                ("Warning: Class not found: class"));
+                    Object[] source = {pe.permission};
+                    warnings.addElement(form.format(source));
+                } catch (InvocationTargetException ite) {
+                    newWarning = true;
+                    MessageFormat form = new MessageFormat(rb.getString
+                        ("Warning: Invalid argument(s) for constructor: arg"));
+                    Object[] source = {pe.permission};
+                    warnings.addElement(form.format(source));
+                }
+
+                // see if all the permission signers have public keys
+                if (pe.signedBy != null) {
+
+                    String signers[] = parseSigners(pe.signedBy);
+
+                    for (int i = 0; i < signers.length; i++) {
+                        PublicKey pubKey = getPublicKeyAlias(signers[i]);
+                        if (pubKey == null) {
+                            newWarning = true;
+                            MessageFormat form = new MessageFormat(rb.getString
+                                ("Warning: A public key for alias " +
+                                "'signers[i]' does not exist.  " +
+                               "Make sure a KeyStore is properly configured."));
+                            Object[] source = {signers[i]};
+                            warnings.addElement(form.format(source));
+                        }
+                    }
+                }
+            }
+            PolicyEntry pEntry = new PolicyEntry(this, ge);
+            policyEntries.addElement(pEntry);
+        }
+
+        // just read in the policy -- nothing has been modified yet
+        modified = false;
+    }
+
+
+    /**
+     * Save a policy to a file
+     */
+    void savePolicy(String filename)
+    throws FileNotFoundException, IOException {
+        // save the policy entries to a file
+        parser.setKeyStoreUrl(keyStoreName);
+        parser.setKeyStoreType(keyStoreType);
+        parser.setKeyStoreProvider(keyStoreProvider);
+        parser.setStorePassURL(keyStorePwdURL);
+        parser.write(new FileWriter(filename));
+        modified = false;
+    }
+
+    /**
+     * Open the KeyStore
+     */
+    void openKeyStore(String name,
+                String type,
+                String provider,
+                String pwdURL) throws   KeyStoreException,
+                                        NoSuchAlgorithmException,
+                                        UnrecoverableKeyException,
+                                        IOException,
+                                        CertificateException,
+                                        NoSuchProviderException,
+                                        ExpandException {
+
+        if (name == null && type == null &&
+            provider == null && pwdURL == null) {
+
+            // policy did not specify a keystore during open
+            // or use wants to reset keystore values
+
+            this.keyStoreName = null;
+            this.keyStoreType = null;
+            this.keyStoreProvider = null;
+            this.keyStorePwdURL = null;
+
+            // caller will set (tool.modified = true) if appropriate
+
+            return;
+        }
+
+        URL policyURL = null;
+        if (policyFileName != null) {
+            File pfile = new File(policyFileName);
+            policyURL = new URL("file:" + pfile.getCanonicalPath());
+        }
+
+        // although PolicyUtil.getKeyStore may properly handle
+        // defaults and property expansion, we do it here so that
+        // if the call is successful, we can set the proper values
+        // (PolicyUtil.getKeyStore does not return expanded values)
+
+        if (name != null && name.length() > 0) {
+            name = PropertyExpander.expand(name).replace
+                                        (File.separatorChar, '/');
+        }
+        if (type == null || type.length() == 0) {
+            type = KeyStore.getDefaultType();
+        }
+        if (pwdURL != null && pwdURL.length() > 0) {
+            pwdURL = PropertyExpander.expand(pwdURL).replace
+                                        (File.separatorChar, '/');
+        }
+
+        try {
+            this.keyStore = PolicyUtil.getKeyStore(policyURL,
+                                                name,
+                                                type,
+                                                provider,
+                                                pwdURL,
+                                                null);
+        } catch (IOException ioe) {
+
+            // copied from sun.security.pkcs11.SunPKCS11
+            String MSG = "no password provided, and no callback handler " +
+                        "available for retrieving password";
+
+            Throwable cause = ioe.getCause();
+            if (cause != null &&
+                cause instanceof javax.security.auth.login.LoginException &&
+                MSG.equals(cause.getMessage())) {
+
+                // throw a more friendly exception message
+                throw new IOException(MSG);
+            } else {
+                throw ioe;
+            }
+        }
+
+        this.keyStoreName = name;
+        this.keyStoreType = type;
+        this.keyStoreProvider = provider;
+        this.keyStorePwdURL = pwdURL;
+
+        // caller will set (tool.modified = true)
+    }
+
+    /**
+     * Add a Grant entry to the overall policy at the specified index.
+     * A policy entry consists of a CodeSource.
+     */
+    boolean addEntry(PolicyEntry pe, int index) {
+
+        if (index < 0) {
+            // new entry -- just add it to the end
+            policyEntries.addElement(pe);
+            parser.add(pe.getGrantEntry());
+        } else {
+            // existing entry -- replace old one
+            PolicyEntry origPe = policyEntries.elementAt(index);
+            parser.replace(origPe.getGrantEntry(), pe.getGrantEntry());
+            policyEntries.setElementAt(pe, index);
+        }
+        return true;
+    }
+
+    /**
+     * Add a Principal entry to an existing PolicyEntry at the specified index.
+     * A Principal entry consists of a class, and name.
+     *
+     * If the principal already exists, it is not added again.
+     */
+    boolean addPrinEntry(PolicyEntry pe,
+                        PolicyParser.PrincipalEntry newPrin,
+                        int index) {
+
+        // first add the principal to the Policy Parser entry
+        PolicyParser.GrantEntry grantEntry = pe.getGrantEntry();
+        if (grantEntry.contains(newPrin) == true)
+            return false;
+
+        LinkedList<PolicyParser.PrincipalEntry> prinList =
+                                                grantEntry.principals;
+        if (index != -1)
+            prinList.set(index, newPrin);
+        else
+            prinList.add(newPrin);
+
+        modified = true;
+        return true;
+    }
+
+    /**
+     * Add a Permission entry to an existing PolicyEntry at the specified index.
+     * A Permission entry consists of a permission, name, and actions.
+     *
+     * If the permission already exists, it is not added again.
+     */
+    boolean addPermEntry(PolicyEntry pe,
+                        PolicyParser.PermissionEntry newPerm,
+                        int index) {
+
+        // first add the permission to the Policy Parser Vector
+        PolicyParser.GrantEntry grantEntry = pe.getGrantEntry();
+        if (grantEntry.contains(newPerm) == true)
+            return false;
+
+        Vector<PolicyParser.PermissionEntry> permList =
+                                                grantEntry.permissionEntries;
+        if (index != -1)
+            permList.setElementAt(newPerm, index);
+        else
+            permList.addElement(newPerm);
+
+        modified = true;
+        return true;
+    }
+
+    /**
+     * Remove a Permission entry from an existing PolicyEntry.
+     */
+    boolean removePermEntry(PolicyEntry pe,
+                        PolicyParser.PermissionEntry perm) {
+
+        // remove the Permission from the GrantEntry
+        PolicyParser.GrantEntry ppge = pe.getGrantEntry();
+        modified = ppge.remove(perm);
+        return modified;
+    }
+
+    /**
+     * remove an entry from the overall policy
+     */
+    boolean removeEntry(PolicyEntry pe) {
+
+        parser.remove(pe.getGrantEntry());
+        modified = true;
+        return (policyEntries.removeElement(pe));
+    }
+
+    /**
+     * retrieve all Policy Entries
+     */
+    PolicyEntry[] getEntry() {
+
+        if (policyEntries.size() > 0) {
+            PolicyEntry entries[] = new PolicyEntry[policyEntries.size()];
+            for (int i = 0; i < policyEntries.size(); i++)
+                entries[i] = policyEntries.elementAt(i);
+            return entries;
+        }
+        return null;
+    }
+
+    /**
+     * Retrieve the public key mapped to a particular name.
+     * If the key has expired, a KeyException is thrown.
+     */
+    PublicKey getPublicKeyAlias(String name) throws KeyStoreException {
+        if (keyStore == null) {
+            return null;
+        }
+
+        Certificate cert = keyStore.getCertificate(name);
+        if (cert == null) {
+            return null;
+        }
+        PublicKey pubKey = cert.getPublicKey();
+        return pubKey;
+    }
+
+    /**
+     * Retrieve all the alias names stored in the certificate database
+     */
+    String[] getPublicKeyAlias() throws KeyStoreException {
+
+        int numAliases = 0;
+        String aliases[] = null;
+
+        if (keyStore == null) {
+            return null;
+        }
+        Enumeration<String> enum_ = keyStore.aliases();
+
+        // first count the number of elements
+        while (enum_.hasMoreElements()) {
+            enum_.nextElement();
+            numAliases++;
+        }
+
+        if (numAliases > 0) {
+            // now copy them into an array
+            aliases = new String[numAliases];
+            numAliases = 0;
+            enum_ = keyStore.aliases();
+            while (enum_.hasMoreElements()) {
+                aliases[numAliases] = new String(enum_.nextElement());
+                numAliases++;
+            }
+        }
+        return aliases;
+    }
+
+    /**
+     * This method parses a single string of signers separated by commas
+     * ("jordan, duke, pippen") into an array of individual strings.
+     */
+    String[] parseSigners(String signedBy) {
+
+        String signers[] = null;
+        int numSigners = 1;
+        int signedByIndex = 0;
+        int commaIndex = 0;
+        int signerNum = 0;
+
+        // first pass thru "signedBy" counts the number of signers
+        while (commaIndex >= 0) {
+            commaIndex = signedBy.indexOf(',', signedByIndex);
+            if (commaIndex >= 0) {
+                numSigners++;
+                signedByIndex = commaIndex + 1;
+            }
+        }
+        signers = new String[numSigners];
+
+        // second pass thru "signedBy" transfers signers to array
+        commaIndex = 0;
+        signedByIndex = 0;
+        while (commaIndex >= 0) {
+            if ((commaIndex = signedBy.indexOf(',', signedByIndex)) >= 0) {
+                // transfer signer and ignore trailing part of the string
+                signers[signerNum] =
+                        signedBy.substring(signedByIndex, commaIndex).trim();
+                signerNum++;
+                signedByIndex = commaIndex + 1;
+            } else {
+                // we are at the end of the string -- transfer signer
+                signers[signerNum] = signedBy.substring(signedByIndex).trim();
+            }
+        }
+        return signers;
+    }
+
+    /**
+     * Check to see if the Principal contents are OK
+     */
+    void verifyPrincipal(String type, String name)
+        throws ClassNotFoundException,
+               InstantiationException
+    {
+        if (type.equals(PolicyParser.PrincipalEntry.WILDCARD_CLASS) ||
+            type.equals(PolicyParser.REPLACE_NAME)) {
+            return;
+        };
+        Class<?> PRIN = Class.forName("java.security.Principal");
+        Class<?> pc = Class.forName(type, true,
+                Thread.currentThread().getContextClassLoader());
+        if (!PRIN.isAssignableFrom(pc)) {
+            MessageFormat form = new MessageFormat(rb.getString
+                        ("Illegal Principal Type: type"));
+            Object[] source = {type};
+            throw new InstantiationException(form.format(source));
+        }
+
+        if (ToolDialog.X500_PRIN_CLASS.equals(pc.getName())) {
+            // PolicyParser checks validity of X500Principal name
+            // - PolicyTool needs to as well so that it doesn't store
+            //   an invalid name that can't be read in later
+            //
+            // this can throw an IllegalArgumentException
+            X500Principal newP = new X500Principal(name);
+        }
+    }
+
+    /**
+     * Check to see if the Permission contents are OK
+     */
+    void verifyPermission(String type,
+                                    String name,
+                                    String actions)
+        throws ClassNotFoundException,
+               InstantiationException,
+               IllegalAccessException,
+               NoSuchMethodException,
+               InvocationTargetException
+    {
+
+        //XXX we might want to keep a hash of created factories...
+        Class<?> pc = Class.forName(type, true,
+                Thread.currentThread().getContextClassLoader());
+        Constructor<?> c = null;
+        Vector<String> objects = new Vector<String>(2);
+        if (name != null) objects.add(name);
+        if (actions != null) objects.add(actions);
+        switch (objects.size()) {
+        case 0:
+            try {
+                c = pc.getConstructor(NOPARAMS);
+                break;
+            } catch (NoSuchMethodException ex) {
+                // proceed to the one-param constructor
+                objects.add(null);
+            }
+        case 1:
+            try {
+                c = pc.getConstructor(ONEPARAMS);
+                break;
+            } catch (NoSuchMethodException ex) {
+                // proceed to the two-param constructor
+                objects.add(null);
+            }
+        case 2:
+            c = pc.getConstructor(TWOPARAMS);
+            break;
+        }
+        Object parameters[] = objects.toArray();
+        Permission p = (Permission)c.newInstance(parameters);
+    }
+
+    /*
+     * Parse command line arguments.
+     */
+    static void parseArgs(String args[]) {
+        /* parse flags */
+        int n = 0;
+
+        for (n=0; (n < args.length) && args[n].startsWith("-"); n++) {
+
+            String flags = args[n];
+
+            if (collator.compare(flags, "-file") == 0) {
+                if (++n == args.length) usage();
+                policyFileName = args[n];
+            } else {
+                MessageFormat form = new MessageFormat(rb.getString
+                                ("Illegal option: option"));
+                Object[] source = { flags };
+                System.err.println(form.format(source));
+                usage();
+            }
+        }
+    }
+
+    static void usage() {
+        System.out.println(rb.getString("Usage: policytool [options]"));
+        System.out.println();
+        System.out.println(rb.getString
+                ("  [-file <file>]    policy file location"));
+        System.out.println();
+
+        System.exit(1);
+    }
+
+    /**
+     * run the PolicyTool
+     */
+    public static void main(String args[]) {
+        parseArgs(args);
+        ToolWindow tw = new ToolWindow(new PolicyTool());
+        tw.displayToolWindow(args);
+    }
+
+    // split instr to words according to capitalization,
+    // like, AWTControl -> A W T Control
+    // this method is for easy pronounciation
+    static String splitToWords(String instr) {
+        return instr.replaceAll("([A-Z])", " $1");
+    }
+
+}
+
+/**
+ * Each entry in the policy configuration file is represented by a
+ * PolicyEntry object.
+ *
+ * A PolicyEntry is a (CodeSource,Permission) pair.  The
+ * CodeSource contains the (URL, PublicKey) that together identify
+ * where the Java bytecodes come from and who (if anyone) signed
+ * them.  The URL could refer to localhost.  The URL could also be
+ * null, meaning that this policy entry is given to all comers, as
+ * long as they match the signer field.  The signer could be null,
+ * meaning the code is not signed.
+ *
+ * The Permission contains the (Type, Name, Action) triplet.
+ *
+ */
+class PolicyEntry {
+
+    private CodeSource codesource;
+    private PolicyTool tool;
+    private PolicyParser.GrantEntry grantEntry;
+    private boolean testing = false;
+
+    /**
+     * Create a PolicyEntry object from the information read in
+     * from a policy file.
+     */
+    PolicyEntry(PolicyTool tool, PolicyParser.GrantEntry ge)
+    throws MalformedURLException, NoSuchMethodException,
+    ClassNotFoundException, InstantiationException, IllegalAccessException,
+    InvocationTargetException, CertificateException,
+    IOException, NoSuchAlgorithmException, UnrecoverableKeyException {
+
+        this.tool = tool;
+
+        URL location = null;
+
+        // construct the CodeSource
+        if (ge.codeBase != null)
+            location = new URL(ge.codeBase);
+        this.codesource = new CodeSource(location,
+            (java.security.cert.Certificate[]) null);
+
+        if (testing) {
+            System.out.println("Adding Policy Entry:");
+            System.out.println("    CodeBase = " + location);
+            System.out.println("    Signers = " + ge.signedBy);
+            System.out.println("    with " + ge.principals.size() +
+                    " Principals");
+        }
+
+        this.grantEntry = ge;
+    }
+
+    /**
+     * get the codesource associated with this PolicyEntry
+     */
+    CodeSource getCodeSource() {
+        return codesource;
+    }
+
+    /**
+     * get the GrantEntry associated with this PolicyEntry
+     */
+    PolicyParser.GrantEntry getGrantEntry() {
+        return grantEntry;
+    }
+
+    /**
+     * convert the header portion, i.e. codebase, signer, principals, of
+     * this policy entry into a string
+     */
+    String headerToString() {
+        String pString = principalsToString();
+        if (pString.length() == 0) {
+            return codebaseToString();
+        } else {
+            return codebaseToString() + ", " + pString;
+        }
+    }
+
+    /**
+     * convert the Codebase/signer portion of this policy entry into a string
+     */
+    String codebaseToString() {
+
+        String stringEntry = new String();
+
+        if (grantEntry.codeBase != null &&
+            grantEntry.codeBase.equals("") == false)
+            stringEntry = stringEntry.concat
+                                ("CodeBase \"" +
+                                grantEntry.codeBase +
+                                "\"");
+
+        if (grantEntry.signedBy != null &&
+            grantEntry.signedBy.equals("") == false)
+            stringEntry = ((stringEntry.length() > 0) ?
+                stringEntry.concat(", SignedBy \"" +
+                                grantEntry.signedBy +
+                                "\"") :
+                stringEntry.concat("SignedBy \"" +
+                                grantEntry.signedBy +
+                                "\""));
+
+        if (stringEntry.length() == 0)
+            return new String("CodeBase <ALL>");
+        return stringEntry;
+    }
+
+    /**
+     * convert the Principals portion of this policy entry into a string
+     */
+    String principalsToString() {
+        String result = "";
+        if ((grantEntry.principals != null) &&
+            (!grantEntry.principals.isEmpty())) {
+            StringBuffer buffer = new StringBuffer(200);
+            ListIterator<PolicyParser.PrincipalEntry> list =
+                                grantEntry.principals.listIterator();
+            while (list.hasNext()) {
+                PolicyParser.PrincipalEntry pppe = list.next();
+                buffer.append(" Principal " + pppe.getDisplayClass() + " " +
+                    pppe.getDisplayName(true));
+                if (list.hasNext()) buffer.append(", ");
+            }
+            result = buffer.toString();
+        }
+        return result;
+    }
+
+    /**
+     * convert this policy entry into a PolicyParser.PermissionEntry
+     */
+    PolicyParser.PermissionEntry toPermissionEntry(Permission perm) {
+
+        String actions = null;
+
+        // get the actions
+        if (perm.getActions() != null &&
+            perm.getActions().trim() != "")
+                actions = perm.getActions();
+
+        PolicyParser.PermissionEntry pe = new PolicyParser.PermissionEntry
+                        (perm.getClass().getName(),
+                        perm.getName(),
+                        actions);
+        return pe;
+    }
+}
+
+/**
+ * The main window for the PolicyTool
+ */
+class ToolWindow extends Frame {
+    // use serialVersionUID from JDK 1.2.2 for interoperability
+    private static final long serialVersionUID = 5682568601210376777L;
+
+    /* external paddings */
+    public static final Insets TOP_PADDING = new Insets(25,0,0,0);
+    public static final Insets BOTTOM_PADDING = new Insets(0,0,25,0);
+    public static final Insets LITE_BOTTOM_PADDING = new Insets(0,0,10,0);
+    public static final Insets LR_PADDING = new Insets(0,10,0,10);
+    public static final Insets TOP_BOTTOM_PADDING = new Insets(15, 0, 15, 0);
+    public static final Insets L_TOP_BOTTOM_PADDING = new Insets(5,10,15,0);
+    public static final Insets LR_BOTTOM_PADDING = new Insets(0,10,5,10);
+    public static final Insets L_BOTTOM_PADDING = new Insets(0,10,5,0);
+    public static final Insets R_BOTTOM_PADDING = new Insets(0,0,5,10);
+
+    /* buttons and menus */
+    public static final String NEW_POLICY_FILE          =
+                        PolicyTool.rb.getString("New");
+    public static final String OPEN_POLICY_FILE         =
+                        PolicyTool.rb.getString("Open");
+    public static final String SAVE_POLICY_FILE         =
+                        PolicyTool.rb.getString("Save");
+    public static final String SAVE_AS_POLICY_FILE      =
+                        PolicyTool.rb.getString("Save As");
+    public static final String VIEW_WARNINGS            =
+                        PolicyTool.rb.getString("View Warning Log");
+    public static final String QUIT                     =
+                        PolicyTool.rb.getString("Exit");
+    public static final String ADD_POLICY_ENTRY         =
+                        PolicyTool.rb.getString("Add Policy Entry");
+    public static final String EDIT_POLICY_ENTRY        =
+                        PolicyTool.rb.getString("Edit Policy Entry");
+    public static final String REMOVE_POLICY_ENTRY      =
+                        PolicyTool.rb.getString("Remove Policy Entry");
+    public static final String EDIT_KEYSTORE            =
+                        PolicyTool.rb.getString("Edit");
+    public static final String ADD_PUBKEY_ALIAS         =
+                        PolicyTool.rb.getString("Add Public Key Alias");
+    public static final String REMOVE_PUBKEY_ALIAS      =
+                        PolicyTool.rb.getString("Remove Public Key Alias");
+
+    /* gridbag index for components in the main window (MW) */
+    public static final int MW_FILENAME_LABEL           = 0;
+    public static final int MW_FILENAME_TEXTFIELD       = 1;
+    public static final int MW_PANEL                    = 2;
+    public static final int MW_ADD_BUTTON               = 0;
+    public static final int MW_EDIT_BUTTON              = 1;
+    public static final int MW_REMOVE_BUTTON            = 2;
+    public static final int MW_POLICY_LIST              = 3; // follows MW_PANEL
+
+    private PolicyTool tool;
+
+    /**
+     * Constructor
+     */
+    ToolWindow(PolicyTool tool) {
+        this.tool = tool;
+    }
+
+    /**
+     * Initialize the PolicyTool window with the necessary components
+     */
+    private void initWindow() {
+
+        // create the top menu bar
+        MenuBar menuBar = new MenuBar();
+
+        // create a File menu
+        Menu menu = new Menu(PolicyTool.rb.getString("File"));
+        menu.add(NEW_POLICY_FILE);
+        menu.add(OPEN_POLICY_FILE);
+        menu.add(SAVE_POLICY_FILE);
+        menu.add(SAVE_AS_POLICY_FILE);
+        menu.add(VIEW_WARNINGS);
+        menu.add(QUIT);
+        menu.addActionListener(new FileMenuListener(tool, this));
+        menuBar.add(menu);
+        setMenuBar(menuBar);
+
+        // create a KeyStore menu
+        menu = new Menu(PolicyTool.rb.getString("KeyStore"));
+        menu.add(EDIT_KEYSTORE);
+        menu.addActionListener(new MainWindowListener(tool, this));
+        menuBar.add(menu);
+        setMenuBar(menuBar);
+
+
+        // policy entry listing
+        Label label = new Label(PolicyTool.rb.getString("Policy File:"));
+        addNewComponent(this, label, MW_FILENAME_LABEL,
+                        0, 0, 1, 1, 0.0, 0.0, GridBagConstraints.BOTH,
+                        TOP_BOTTOM_PADDING);
+        TextField tf = new TextField(50);
+        tf.getAccessibleContext().setAccessibleName(
+                PolicyTool.rb.getString("Policy File:"));
+        tf.setEditable(false);
+        addNewComponent(this, tf, MW_FILENAME_TEXTFIELD,
+                        1, 0, 1, 1, 0.0, 0.0, GridBagConstraints.BOTH,
+                        TOP_BOTTOM_PADDING);
+
+
+        // add ADD/REMOVE/EDIT buttons in a new panel
+        Panel panel = new Panel();
+        panel.setLayout(new GridBagLayout());
+
+        Button button = new Button(ADD_POLICY_ENTRY);
+        button.addActionListener(new MainWindowListener(tool, this));
+        addNewComponent(panel, button, MW_ADD_BUTTON,
+                        0, 0, 1, 1, 0.0, 0.0, GridBagConstraints.BOTH,
+                        LR_PADDING);
+
+        button = new Button(EDIT_POLICY_ENTRY);
+        button.addActionListener(new MainWindowListener(tool, this));
+        addNewComponent(panel, button, MW_EDIT_BUTTON,
+                        1, 0, 1, 1, 0.0, 0.0, GridBagConstraints.BOTH,
+                        LR_PADDING);
+
+        button = new Button(REMOVE_POLICY_ENTRY);
+        button.addActionListener(new MainWindowListener(tool, this));
+        addNewComponent(panel, button, MW_REMOVE_BUTTON,
+                        2, 0, 1, 1, 0.0, 0.0, GridBagConstraints.BOTH,
+                        LR_PADDING);
+
+        addNewComponent(this, panel, MW_PANEL,
+                        0, 2, 2, 1, 0.0, 0.0, GridBagConstraints.BOTH,
+                        BOTTOM_PADDING);
+
+
+        String policyFile = tool.getPolicyFileName();
+        if (policyFile == null) {
+            String userHome;
+            userHome = java.security.AccessController.doPrivileged(
+                    new sun.security.action.GetPropertyAction("user.home"));
+            policyFile = userHome + File.separatorChar + ".java.policy";
+        }
+
+        try {
+            // open the policy file
+            tool.openPolicy(policyFile);
+
+            // display the policy entries via the policy list textarea
+            List list = new List(40, false);
+            list.addActionListener(new PolicyListListener(tool, this));
+            PolicyEntry entries[] = tool.getEntry();
+            if (entries != null) {
+                for (int i = 0; i < entries.length; i++)
+                    list.add(entries[i].headerToString());
+            }
+            TextField newFilename = (TextField)
+                                getComponent(MW_FILENAME_TEXTFIELD);
+            newFilename.setText(policyFile);
+            initPolicyList(list);
+
+        } catch (FileNotFoundException fnfe) {
+            // add blank policy listing
+            List list = new List(40, false);
+            list.addActionListener(new PolicyListListener(tool, this));
+            initPolicyList(list);
+            tool.setPolicyFileName(null);
+            tool.modified = false;
+            setVisible(true);
+
+            // just add warning
+            tool.warnings.addElement(fnfe.toString());
+
+        } catch (Exception e) {
+            // add blank policy listing
+            List list = new List(40, false);
+            list.addActionListener(new PolicyListListener(tool, this));
+            initPolicyList(list);
+            tool.setPolicyFileName(null);
+            tool.modified = false;
+            setVisible(true);
+
+            // display the error
+            MessageFormat form = new MessageFormat(PolicyTool.rb.getString
+                ("Could not open policy file: policyFile: e.toString()"));
+            Object[] source = {policyFile, e.toString()};
+            displayErrorDialog(null, form.format(source));
+        }
+    }
+
+
+    /**
+     * Add a component to the PolicyTool window
+     */
+    void addNewComponent(Container container, Component component,
+        int index, int gridx, int gridy, int gridwidth, int gridheight,
+        double weightx, double weighty, int fill, Insets is) {
+
+        // add the component at the specified gridbag index
+        container.add(component, index);
+
+        // set the constraints
+        GridBagLayout gbl = (GridBagLayout)container.getLayout();
+        GridBagConstraints gbc = new GridBagConstraints();
+        gbc.gridx = gridx;
+        gbc.gridy = gridy;
+        gbc.gridwidth = gridwidth;
+        gbc.gridheight = gridheight;
+        gbc.weightx = weightx;
+        gbc.weighty = weighty;
+        gbc.fill = fill;
+        if (is != null) gbc.insets = is;
+        gbl.setConstraints(component, gbc);
+    }
+
+
+    /**
+     * Add a component to the PolicyTool window without external padding
+     */
+    void addNewComponent(Container container, Component component,
+        int index, int gridx, int gridy, int gridwidth, int gridheight,
+        double weightx, double weighty, int fill) {
+
+        // delegate with "null" external padding
+        addNewComponent(container, component, index, gridx, gridy,
+                        gridwidth, gridheight, weightx, weighty,
+                        fill, null);
+    }
+
+
+    /**
+     * Init the policy_entry_list TEXTAREA component in the
+     * PolicyTool window
+     */
+    void initPolicyList(List policyList) {
+
+        // add the policy list to the window
+        addNewComponent(this, policyList, MW_POLICY_LIST,
+                        0, 3, 2, 1, 1.0, 1.0, GridBagConstraints.BOTH);
+    }
+
+    /**
+     * Replace the policy_entry_list TEXTAREA component in the
+     * PolicyTool window with an updated one.
+     */
+    void replacePolicyList(List policyList) {
+
+        // remove the original list of Policy Entries
+        // and add the new list of entries
+        List list = (List)getComponent(MW_POLICY_LIST);
+        list.removeAll();
+        String newItems[] = policyList.getItems();
+        for (int i = 0; i < newItems.length; i++)
+            list.add(newItems[i]);
+    }
+
+    /**
+     * display the main PolicyTool window
+     */
+    void displayToolWindow(String args[]) {
+
+        setTitle(PolicyTool.rb.getString("Policy Tool"));
+        setResizable(true);
+        addWindowListener(new ToolWindowListener(this));
+        setBounds(135, 80, 500, 500);
+        setLayout(new GridBagLayout());
+
+        initWindow();
+
+        // display it
+        setVisible(true);
+
+        if (tool.newWarning == true) {
+            displayStatusDialog(this, PolicyTool.rb.getString
+                ("Errors have occurred while opening the " +
+                "policy configuration.  View the Warning Log " +
+                "for more information."));
+        }
+    }
+
+    /**
+     * displays a dialog box describing an error which occurred.
+     */
+    void displayErrorDialog(Window w, String error) {
+        ToolDialog ed = new ToolDialog
+                (PolicyTool.rb.getString("Error"), tool, this, true);
+
+        // find where the PolicyTool gui is
+        Point location = ((w == null) ?
+                getLocationOnScreen() : w.getLocationOnScreen());
+        ed.setBounds(location.x + 50, location.y + 50, 600, 100);
+        ed.setLayout(new GridBagLayout());
+
+        Label label = new Label(error);
+        addNewComponent(ed, label, 0,
+                        0, 0, 1, 1, 0.0, 0.0, GridBagConstraints.BOTH);
+
+        Button okButton = new Button(PolicyTool.rb.getString("OK"));
+        okButton.addActionListener(new ErrorOKButtonListener(ed));
+        addNewComponent(ed, okButton, 1,
+                        0, 1, 1, 1, 0.0, 0.0, GridBagConstraints.VERTICAL);
+
+        ed.pack();
+        ed.setVisible(true);
+    }
+
+    /**
+     * displays a dialog box describing an error which occurred.
+     */
+    void displayErrorDialog(Window w, Throwable t) {
+        if (t instanceof NoDisplayException) {
+            return;
+        }
+        displayErrorDialog(w, t.toString());
+    }
+
+    /**
+     * displays a dialog box describing the status of an event
+     */
+    void displayStatusDialog(Window w, String status) {
+        ToolDialog sd = new ToolDialog
+                (PolicyTool.rb.getString("Status"), tool, this, true);
+
+        // find the location of the PolicyTool gui
+        Point location = ((w == null) ?
+                getLocationOnScreen() : w.getLocationOnScreen());
+        sd.setBounds(location.x + 50, location.y + 50, 500, 100);
+        sd.setLayout(new GridBagLayout());
+
+        Label label = new Label(status);
+        addNewComponent(sd, label, 0,
+                        0, 0, 1, 1, 0.0, 0.0, GridBagConstraints.BOTH);
+
+        Button okButton = new Button(PolicyTool.rb.getString("OK"));
+        okButton.addActionListener(new StatusOKButtonListener(sd));
+        addNewComponent(sd, okButton, 1,
+                        0, 1, 1, 1, 0.0, 0.0, GridBagConstraints.VERTICAL);
+        sd.pack();
+        sd.setVisible(true);
+    }
+
+    /**
+     * display the warning log
+     */
+    void displayWarningLog(Window w) {
+
+        ToolDialog wd = new ToolDialog
+                (PolicyTool.rb.getString("Warning"), tool, this, true);
+
+        // find the location of the PolicyTool gui
+        Point location = ((w == null) ?
+                getLocationOnScreen() : w.getLocationOnScreen());
+        wd.setBounds(location.x + 50, location.y + 50, 500, 100);
+        wd.setLayout(new GridBagLayout());
+
+        TextArea ta = new TextArea();
+        ta.setEditable(false);
+        for (int i = 0; i < tool.warnings.size(); i++) {
+            ta.append(tool.warnings.elementAt(i));
+            ta.append(PolicyTool.rb.getString("\n"));
+        }
+        addNewComponent(wd, ta, 0,
+                        0, 0, 1, 1, 0.0, 0.0, GridBagConstraints.BOTH,
+                        BOTTOM_PADDING);
+        ta.setFocusable(false);
+
+        Button okButton = new Button(PolicyTool.rb.getString("OK"));
+        okButton.addActionListener(new CancelButtonListener(wd));
+        addNewComponent(wd, okButton, 1,
+                        0, 1, 1, 1, 0.0, 0.0, GridBagConstraints.VERTICAL,
+                        LR_PADDING);
+
+        wd.pack();
+        wd.setVisible(true);
+    }
+
+    char displayYesNoDialog(Window w, String title, String prompt, String yes, String no) {
+
+        final ToolDialog tw = new ToolDialog
+                (title, tool, this, true);
+        Point location = ((w == null) ?
+                getLocationOnScreen() : w.getLocationOnScreen());
+        tw.setBounds(location.x + 75, location.y + 100, 400, 150);
+        tw.setLayout(new GridBagLayout());
+
+        TextArea ta = new TextArea(prompt, 10, 50, TextArea.SCROLLBARS_VERTICAL_ONLY);
+        ta.setEditable(false);
+        addNewComponent(tw, ta, 0,
+                0, 0, 1, 1, 0.0, 0.0, GridBagConstraints.BOTH);
+        ta.setFocusable(false);
+
+        Panel panel = new Panel();
+        panel.setLayout(new GridBagLayout());
+
+        // StringBuffer to store button press. Must be final.
+        final StringBuffer chooseResult = new StringBuffer();
+
+        Button button = new Button(yes);
+        button.addActionListener(new ActionListener() {
+            public void actionPerformed(ActionEvent e) {
+                chooseResult.append('Y');
+                tw.setVisible(false);
+                tw.dispose();
+            }
+        });
+        addNewComponent(panel, button, 0,
+                           0, 0, 1, 1, 0.0, 0.0, GridBagConstraints.VERTICAL,
+                           LR_PADDING);
+
+        button = new Button(no);
+        button.addActionListener(new ActionListener() {
+            public void actionPerformed(ActionEvent e) {
+                chooseResult.append('N');
+                tw.setVisible(false);
+                tw.dispose();
+            }
+        });
+        addNewComponent(panel, button, 1,
+                           1, 0, 1, 1, 0.0, 0.0, GridBagConstraints.VERTICAL,
+                           LR_PADDING);
+
+        addNewComponent(tw, panel, 1,
+                0, 1, 1, 1, 0.0, 0.0, GridBagConstraints.VERTICAL);
+
+        tw.pack();
+        tw.setVisible(true);
+        if (chooseResult.length() > 0) {
+            return chooseResult.charAt(0);
+        } else {
+            // I did encounter this once, don't why.
+            return 'N';
+        }
+    }
+
+}
+
+/**
+ * General dialog window
+ */
+class ToolDialog extends Dialog {
+    // use serialVersionUID from JDK 1.2.2 for interoperability
+    private static final long serialVersionUID = -372244357011301190L;
+
+    /* necessary constants */
+    public static final int NOACTION            = 0;
+    public static final int QUIT                = 1;
+    public static final int NEW                 = 2;
+    public static final int OPEN                = 3;
+
+    public static final String ALL_PERM_CLASS   =
+                "java.security.AllPermission";
+    public static final String FILE_PERM_CLASS  =
+                "java.io.FilePermission";
+
+    public static final String X500_PRIN_CLASS         =
+                "javax.security.auth.x500.X500Principal";
+
+    /* popup menus */
+    public static final String PERM             =
+        PolicyTool.rb.getString
+        ("Permission:                                                       ");
+
+    public static final String PRIN_TYPE        =
+        PolicyTool.rb.getString("Principal Type:");
+    public static final String PRIN_NAME        =
+        PolicyTool.rb.getString("Principal Name:");
+
+    /* more popu menus */
+    public static final String PERM_NAME        =
+        PolicyTool.rb.getString
+        ("Target Name:                                                    ");
+
+    /* and more popup menus */
+    public static final String PERM_ACTIONS             =
+      PolicyTool.rb.getString
+      ("Actions:                                                             ");
+
+    /* gridbag index for display OverWriteFile (OW) components */
+    public static final int OW_LABEL                    = 0;
+    public static final int OW_OK_BUTTON                = 1;
+    public static final int OW_CANCEL_BUTTON            = 2;
+
+    /* gridbag index for display PolicyEntry (PE) components */
+    public static final int PE_CODEBASE_LABEL           = 0;
+    public static final int PE_CODEBASE_TEXTFIELD       = 1;
+    public static final int PE_SIGNEDBY_LABEL           = 2;
+    public static final int PE_SIGNEDBY_TEXTFIELD       = 3;
+
+    public static final int PE_PANEL0                   = 4;
+    public static final int PE_ADD_PRIN_BUTTON          = 0;
+    public static final int PE_EDIT_PRIN_BUTTON         = 1;
+    public static final int PE_REMOVE_PRIN_BUTTON       = 2;
+
+    public static final int PE_PRIN_LABEL               = 5;
+    public static final int PE_PRIN_LIST                = 6;
+
+    public static final int PE_PANEL1                   = 7;
+    public static final int PE_ADD_PERM_BUTTON          = 0;
+    public static final int PE_EDIT_PERM_BUTTON         = 1;
+    public static final int PE_REMOVE_PERM_BUTTON       = 2;
+
+    public static final int PE_PERM_LIST                = 8;
+
+    public static final int PE_PANEL2                   = 9;
+    public static final int PE_CANCEL_BUTTON            = 1;
+    public static final int PE_DONE_BUTTON              = 0;
+
+    /* the gridbag index for components in the Principal Dialog (PRD) */
+    public static final int PRD_DESC_LABEL              = 0;
+    public static final int PRD_PRIN_CHOICE             = 1;
+    public static final int PRD_PRIN_TEXTFIELD          = 2;
+    public static final int PRD_NAME_LABEL              = 3;
+    public static final int PRD_NAME_TEXTFIELD          = 4;
+    public static final int PRD_CANCEL_BUTTON           = 6;
+    public static final int PRD_OK_BUTTON               = 5;
+
+    /* the gridbag index for components in the Permission Dialog (PD) */
+    public static final int PD_DESC_LABEL               = 0;
+    public static final int PD_PERM_CHOICE              = 1;
+    public static final int PD_PERM_TEXTFIELD           = 2;
+    public static final int PD_NAME_CHOICE              = 3;
+    public static final int PD_NAME_TEXTFIELD           = 4;
+    public static final int PD_ACTIONS_CHOICE           = 5;
+    public static final int PD_ACTIONS_TEXTFIELD        = 6;
+    public static final int PD_SIGNEDBY_LABEL           = 7;
+    public static final int PD_SIGNEDBY_TEXTFIELD       = 8;
+    public static final int PD_CANCEL_BUTTON            = 10;
+    public static final int PD_OK_BUTTON                = 9;
+
+    /* modes for KeyStore */
+    public static final int EDIT_KEYSTORE               = 0;
+
+    /* the gridbag index for components in the Change KeyStore Dialog (KSD) */
+    public static final int KSD_NAME_LABEL              = 0;
+    public static final int KSD_NAME_TEXTFIELD          = 1;
+    public static final int KSD_TYPE_LABEL              = 2;
+    public static final int KSD_TYPE_TEXTFIELD          = 3;
+    public static final int KSD_PROVIDER_LABEL          = 4;
+    public static final int KSD_PROVIDER_TEXTFIELD      = 5;
+    public static final int KSD_PWD_URL_LABEL           = 6;
+    public static final int KSD_PWD_URL_TEXTFIELD       = 7;
+    public static final int KSD_CANCEL_BUTTON           = 9;
+    public static final int KSD_OK_BUTTON               = 8;
+
+    /* the gridbag index for components in the User Save Changes Dialog (USC) */
+    public static final int USC_LABEL                   = 0;
+    public static final int USC_PANEL                   = 1;
+    public static final int USC_YES_BUTTON              = 0;
+    public static final int USC_NO_BUTTON               = 1;
+    public static final int USC_CANCEL_BUTTON           = 2;
+
+    /* gridbag index for the ConfirmRemovePolicyEntryDialog (CRPE) */
+    public static final int CRPE_LABEL1                 = 0;
+    public static final int CRPE_LABEL2                 = 1;
+    public static final int CRPE_PANEL                  = 2;
+    public static final int CRPE_PANEL_OK               = 0;
+    public static final int CRPE_PANEL_CANCEL           = 1;
+
+    /* some private static finals */
+    private static final int PERMISSION                 = 0;
+    private static final int PERMISSION_NAME            = 1;
+    private static final int PERMISSION_ACTIONS         = 2;
+    private static final int PERMISSION_SIGNEDBY        = 3;
+    private static final int PRINCIPAL_TYPE             = 4;
+    private static final int PRINCIPAL_NAME             = 5;
+
+    public static java.util.ArrayList<Perm> PERM_ARRAY;
+    public static java.util.ArrayList<Prin> PRIN_ARRAY;
+    PolicyTool tool;
+    ToolWindow tw;
+
+    static {
+
+        // set up permission objects
+
+        PERM_ARRAY = new java.util.ArrayList<Perm>();
+        PERM_ARRAY.add(new AllPerm());
+        PERM_ARRAY.add(new AudioPerm());
+        PERM_ARRAY.add(new AuthPerm());
+        PERM_ARRAY.add(new AWTPerm());
+        PERM_ARRAY.add(new DelegationPerm());
+        PERM_ARRAY.add(new FilePerm());
+        PERM_ARRAY.add(new InqSecContextPerm());
+        PERM_ARRAY.add(new LogPerm());
+        PERM_ARRAY.add(new MgmtPerm());
+        PERM_ARRAY.add(new MBeanPerm());
+        PERM_ARRAY.add(new MBeanSvrPerm());
+        PERM_ARRAY.add(new MBeanTrustPerm());
+        PERM_ARRAY.add(new NetPerm());
+        PERM_ARRAY.add(new PrivCredPerm());
+        PERM_ARRAY.add(new PropPerm());
+        PERM_ARRAY.add(new ReflectPerm());
+        PERM_ARRAY.add(new RuntimePerm());
+        PERM_ARRAY.add(new SecurityPerm());
+        PERM_ARRAY.add(new SerialPerm());
+        PERM_ARRAY.add(new ServicePerm());
+        PERM_ARRAY.add(new SocketPerm());
+        PERM_ARRAY.add(new SQLPerm());
+        PERM_ARRAY.add(new SSLPerm());
+        PERM_ARRAY.add(new SubjDelegPerm());
+
+        // set up principal objects
+
+        PRIN_ARRAY = new java.util.ArrayList<Prin>();
+        PRIN_ARRAY.add(new KrbPrin());
+        PRIN_ARRAY.add(new X500Prin());
+    }
+
+    ToolDialog(String title, PolicyTool tool, ToolWindow tw, boolean modal) {
+        super(tw, modal);
+        setTitle(title);
+        this.tool = tool;
+        this.tw = tw;
+        addWindowListener(new ChildWindowListener(this));
+    }
+
+    /**
+     * get the Perm instance based on either the (shortened) class name
+     * or the fully qualified class name
+     */
+    static Perm getPerm(String clazz, boolean fullClassName) {
+        for (int i = 0; i < PERM_ARRAY.size(); i++) {
+            Perm next = PERM_ARRAY.get(i);
+            if (fullClassName) {
+                if (next.FULL_CLASS.equals(clazz)) {
+                    return next;
+                }
+            } else {
+                if (next.CLASS.equals(clazz)) {
+                    return next;
+                }
+            }
+        }
+        return null;
+    }
+
+    /**
+     * get the Prin instance based on either the (shortened) class name
+     * or the fully qualified class name
+     */
+    static Prin getPrin(String clazz, boolean fullClassName) {
+        for (int i = 0; i < PRIN_ARRAY.size(); i++) {
+            Prin next = PRIN_ARRAY.get(i);
+            if (fullClassName) {
+                if (next.FULL_CLASS.equals(clazz)) {
+                    return next;
+                }
+            } else {
+                if (next.CLASS.equals(clazz)) {
+                    return next;
+                }
+            }
+        }
+        return null;
+    }
+
+    /**
+     * ask user if they want to overwrite an existing file
+     */
+    void displayOverWriteFileDialog(String filename, int nextEvent) {
+
+        // find where the PolicyTool gui is
+        Point location = tw.getLocationOnScreen();
+        setBounds(location.x + 75, location.y + 100, 400, 150);
+        setLayout(new GridBagLayout());
+
+        // ask the user if they want to over write the existing file
+        MessageFormat form = new MessageFormat(PolicyTool.rb.getString
+                ("OK to overwrite existing file filename?"));
+        Object[] source = {filename};
+        Label label = new Label(form.format(source));
+        tw.addNewComponent(this, label, OW_LABEL,
+                           0, 0, 2, 1, 0.0, 0.0, GridBagConstraints.BOTH,
+                           tw.TOP_PADDING);
+
+        // OK button
+        Button button = new Button(PolicyTool.rb.getString("OK"));
+        button.addActionListener(new OverWriteFileOKButtonListener
+                (tool, tw, this, filename, nextEvent));
+        tw.addNewComponent(this, button, OW_OK_BUTTON,
+                           0, 1, 1, 1, 0.0, 0.0, GridBagConstraints.VERTICAL,
+                           tw.TOP_PADDING);
+
+        // Cancel button
+        // -- if the user hits cancel, do NOT go on to the next event
+        button = new Button(PolicyTool.rb.getString("Cancel"));
+        button.addActionListener(new CancelButtonListener(this));
+        tw.addNewComponent(this, button, OW_CANCEL_BUTTON,
+                           1, 1, 1, 1, 0.0, 0.0, GridBagConstraints.VERTICAL,
+                           tw.TOP_PADDING);
+
+        setVisible(true);
+    }
+
+    /**
+     * pop up a dialog so the user can enter info to add a new PolicyEntry
+     * - if edit is TRUE, then the user is editing an existing entry
+     *   and we should display the original info as well.
+     *
+     * - the other reason we need the 'edit' boolean is we need to know
+     *   when we are adding a NEW policy entry.  in this case, we can
+     *   not simply update the existing entry, because it doesn't exist.
+     *   we ONLY update the GUI listing/info, and then when the user
+     *   finally clicks 'OK' or 'DONE', then we can collect that info
+     *   and add it to the policy.
+     */
+    void displayPolicyEntryDialog(boolean edit) {
+
+        int listIndex = 0;
+        PolicyEntry entries[] = null;
+        TaggedList prinList = new TaggedList(3, false);
+        prinList.getAccessibleContext().setAccessibleName(
+                PolicyTool.rb.getString("Principal List"));
+        prinList.addActionListener
+                (new EditPrinButtonListener(tool, tw, this, edit));
+        TaggedList permList = new TaggedList(10, false);
+        permList.getAccessibleContext().setAccessibleName(
+                PolicyTool.rb.getString("Permission List"));
+        permList.addActionListener
+                (new EditPermButtonListener(tool, tw, this, edit));
+
+        // find where the PolicyTool gui is
+        Point location = tw.getLocationOnScreen();
+        setBounds(location.x + 75, location.y + 200, 650, 500);
+        setLayout(new GridBagLayout());
+        setResizable(true);
+
+        if (edit) {
+            // get the selected item
+            entries = tool.getEntry();
+            List policyList = (List)tw.getComponent(tw.MW_POLICY_LIST);
+            listIndex = policyList.getSelectedIndex();
+
+            // get principal list
+            LinkedList principals =
+                entries[listIndex].getGrantEntry().principals;
+            for (int i = 0; i < principals.size(); i++) {
+                String prinString = null;
+                PolicyParser.PrincipalEntry nextPrin =
+                        (PolicyParser.PrincipalEntry)principals.get(i);
+                prinList.addTaggedItem(PrincipalEntryToUserFriendlyString(nextPrin), nextPrin);
+            }
+
+            // get permission list
+            Vector<PolicyParser.PermissionEntry> permissions =
+                entries[listIndex].getGrantEntry().permissionEntries;
+            for (int i = 0; i < permissions.size(); i++) {
+                String permString = null;
+                PolicyParser.PermissionEntry nextPerm =
+                                                permissions.elementAt(i);
+                permList.addTaggedItem(ToolDialog.PermissionEntryToUserFriendlyString(nextPerm), nextPerm);
+            }
+        }
+
+        // codebase label and textfield
+        Label label = new Label(PolicyTool.rb.getString("CodeBase:"));
+        tw.addNewComponent(this, label, PE_CODEBASE_LABEL,
+                0, 0, 1, 1, 0.0, 0.0, GridBagConstraints.BOTH);
+        TextField tf;
+        tf = (edit ?
+                new TextField(entries[listIndex].getGrantEntry().codeBase, 60) :
+                new TextField(60));
+        tf.getAccessibleContext().setAccessibleName(
+                PolicyTool.rb.getString("Code Base"));
+        tw.addNewComponent(this, tf, PE_CODEBASE_TEXTFIELD,
+                1, 0, 1, 1, 0.0, 0.0, GridBagConstraints.BOTH);
+
+        // signedby label and textfield
+        label = new Label(PolicyTool.rb.getString("SignedBy:"));
+        tw.addNewComponent(this, label, PE_SIGNEDBY_LABEL,
+                           0, 1, 1, 1, 0.0, 0.0, GridBagConstraints.BOTH);
+        tf = (edit ?
+                new TextField(entries[listIndex].getGrantEntry().signedBy, 60) :
+                new TextField(60));
+        tf.getAccessibleContext().setAccessibleName(
+                PolicyTool.rb.getString("Signed By:"));
+        tw.addNewComponent(this, tf, PE_SIGNEDBY_TEXTFIELD,
+                           1, 1, 1, 1, 0.0, 0.0, GridBagConstraints.BOTH);
+
+        // panel for principal buttons
+        Panel panel = new Panel();
+        panel.setLayout(new GridBagLayout());
+
+        Button button = new Button(PolicyTool.rb.getString("Add Principal"));
+        button.addActionListener
+                (new AddPrinButtonListener(tool, tw, this, edit));
+        tw.addNewComponent(panel, button, PE_ADD_PRIN_BUTTON,
+                0, 0, 1, 1, 100.0, 0.0, GridBagConstraints.HORIZONTAL);
+
+        button = new Button(PolicyTool.rb.getString("Edit Principal"));
+        button.addActionListener(new EditPrinButtonListener
+                                                (tool, tw, this, edit));
+        tw.addNewComponent(panel, button, PE_EDIT_PRIN_BUTTON,
+                1, 0, 1, 1, 100.0, 0.0, GridBagConstraints.HORIZONTAL);
+
+        button = new Button(PolicyTool.rb.getString("Remove Principal"));
+        button.addActionListener(new RemovePrinButtonListener
+                                        (tool, tw, this, edit));
+        tw.addNewComponent(panel, button, PE_REMOVE_PRIN_BUTTON,
+                2, 0, 1, 1, 100.0, 0.0, GridBagConstraints.HORIZONTAL);
+
+        tw.addNewComponent(this, panel, PE_PANEL0,
+                1, 2, 1, 1, 0.0, 0.0, GridBagConstraints.HORIZONTAL);
+
+        // principal label and list
+        label = new Label(PolicyTool.rb.getString("Principals:"));
+        tw.addNewComponent(this, label, PE_PRIN_LABEL,
+                           0, 3, 1, 1, 0.0, 0.0, GridBagConstraints.BOTH,
+                           tw.BOTTOM_PADDING);
+        tw.addNewComponent(this, prinList, PE_PRIN_LIST,
+                           1, 3, 3, 1, 0.0, 0.0, GridBagConstraints.BOTH,
+                           tw.BOTTOM_PADDING);
+
+        // panel for permission buttons
+        panel = new Panel();
+        panel.setLayout(new GridBagLayout());
+
+        button = new Button(PolicyTool.rb.getString("  Add Permission"));
+        button.addActionListener(new AddPermButtonListener
+                                                (tool, tw, this, edit));
+        tw.addNewComponent(panel, button, PE_ADD_PERM_BUTTON,
+                0, 0, 1, 1, 100.0, 0.0, GridBagConstraints.HORIZONTAL);
+
+        button = new Button(PolicyTool.rb.getString("  Edit Permission"));
+        button.addActionListener(new EditPermButtonListener
+                                                (tool, tw, this, edit));
+        tw.addNewComponent(panel, button, PE_EDIT_PERM_BUTTON,
+                1, 0, 1, 1, 100.0, 0.0, GridBagConstraints.HORIZONTAL);
+
+
+        button = new Button(PolicyTool.rb.getString("Remove Permission"));
+        button.addActionListener(new RemovePermButtonListener
+                                        (tool, tw, this, edit));
+        tw.addNewComponent(panel, button, PE_REMOVE_PERM_BUTTON,
+                2, 0, 1, 1, 100.0, 0.0, GridBagConstraints.HORIZONTAL);
+
+        tw.addNewComponent(this, panel, PE_PANEL1,
+                0, 4, 2, 1, 0.0, 0.0, GridBagConstraints.HORIZONTAL,
+                tw.LITE_BOTTOM_PADDING);
+
+        // permission list
+        tw.addNewComponent(this, permList, PE_PERM_LIST,
+                           0, 5, 3, 1, 0.0, 0.0, GridBagConstraints.BOTH,
+                           tw.BOTTOM_PADDING);
+
+
+        // panel for Done and Cancel buttons
+        panel = new Panel();
+        panel.setLayout(new GridBagLayout());
+
+        // Done Button
+        button = new Button(PolicyTool.rb.getString("Done"));
+        button.addActionListener
+                (new AddEntryDoneButtonListener(tool, tw, this, edit));
+        tw.addNewComponent(panel, button, PE_DONE_BUTTON,
+                           0, 0, 1, 1, 0.0, 0.0, GridBagConstraints.VERTICAL,
+                           tw.LR_PADDING);
+
+        // Cancel Button
+        button = new Button(PolicyTool.rb.getString("Cancel"));
+        button.addActionListener(new CancelButtonListener(this));
+        tw.addNewComponent(panel, button, PE_CANCEL_BUTTON,
+                           1, 0, 1, 1, 0.0, 0.0, GridBagConstraints.VERTICAL,
+                           tw.LR_PADDING);
+
+        // add the panel
+        tw.addNewComponent(this, panel, PE_PANEL2,
+                0, 6, 2, 1, 0.0, 0.0, GridBagConstraints.VERTICAL);
+
+        setVisible(true);
+    }
+
+    /**
+     * Read all the Policy information data in the dialog box
+     * and construct a PolicyEntry object with it.
+     */
+    PolicyEntry getPolicyEntryFromDialog()
+        throws InvalidParameterException, MalformedURLException,
+        NoSuchMethodException, ClassNotFoundException, InstantiationException,
+        IllegalAccessException, InvocationTargetException,
+        CertificateException, IOException, Exception {
+
+        // get the Codebase
+        TextField tf = (TextField)getComponent(PE_CODEBASE_TEXTFIELD);
+        String codebase = null;
+        if (tf.getText().trim().equals("") == false)
+                codebase = new String(tf.getText().trim());
+
+        // get the SignedBy
+        tf = (TextField)getComponent(PE_SIGNEDBY_TEXTFIELD);
+        String signedby = null;
+        if (tf.getText().trim().equals("") == false)
+                signedby = new String(tf.getText().trim());
+
+        // construct a new GrantEntry
+        PolicyParser.GrantEntry ge =
+                        new PolicyParser.GrantEntry(signedby, codebase);
+
+        // get the new Principals
+        LinkedList<PolicyParser.PrincipalEntry> prins =
+                                new LinkedList<PolicyParser.PrincipalEntry>();
+        TaggedList prinList = (TaggedList)getComponent(PE_PRIN_LIST);
+        for (int i = 0; i < prinList.getItemCount(); i++) {
+            prins.add((PolicyParser.PrincipalEntry)prinList.getObject(i));
+        }
+        ge.principals = prins;
+
+        // get the new Permissions
+        Vector<PolicyParser.PermissionEntry> perms =
+                        new Vector<PolicyParser.PermissionEntry>();
+        TaggedList permList = (TaggedList)getComponent(PE_PERM_LIST);
+        for (int i = 0; i < permList.getItemCount(); i++) {
+            perms.addElement((PolicyParser.PermissionEntry)permList.getObject(i));
+        }
+        ge.permissionEntries = perms;
+
+        // construct a new PolicyEntry object
+        PolicyEntry entry = new PolicyEntry(tool, ge);
+
+        return entry;
+    }
+
+    /**
+     * display a dialog box for the user to enter KeyStore information
+     */
+    void keyStoreDialog(int mode) {
+
+        // find where the PolicyTool gui is
+        Point location = tw.getLocationOnScreen();
+        setBounds(location.x + 25, location.y + 100, 500, 300);
+        setLayout(new GridBagLayout());
+
+        if (mode == EDIT_KEYSTORE) {
+
+            // KeyStore label and textfield
+            Label label = new Label
+                        (PolicyTool.rb.getString("KeyStore URL:"));
+            tw.addNewComponent(this, label, KSD_NAME_LABEL,
+                               0, 0, 1, 1, 0.0, 0.0, GridBagConstraints.BOTH,
+                               tw.BOTTOM_PADDING);
+            TextField tf = new TextField(tool.getKeyStoreName(), 30);
+
+            // URL to U R L, so that accessibility reader will pronounce well
+            tf.getAccessibleContext().setAccessibleName(
+                PolicyTool.rb.getString("KeyStore U R L:"));
+            tw.addNewComponent(this, tf, KSD_NAME_TEXTFIELD,
+                               1, 0, 1, 1, 0.0, 0.0, GridBagConstraints.BOTH,
+                               tw.BOTTOM_PADDING);
+
+            // KeyStore type and textfield
+            label = new Label(PolicyTool.rb.getString("KeyStore Type:"));
+            tw.addNewComponent(this, label, KSD_TYPE_LABEL,
+                               0, 1, 1, 1, 0.0, 0.0, GridBagConstraints.BOTH,
+                               tw.BOTTOM_PADDING);
+            tf = new TextField(tool.getKeyStoreType(), 30);
+            tf.getAccessibleContext().setAccessibleName(
+                PolicyTool.rb.getString("KeyStore Type:"));
+            tw.addNewComponent(this, tf, KSD_TYPE_TEXTFIELD,
+                               1, 1, 1, 1, 0.0, 0.0, GridBagConstraints.BOTH,
+                               tw.BOTTOM_PADDING);
+
+            // KeyStore provider and textfield
+            label = new Label(PolicyTool.rb.getString
+                                ("KeyStore Provider:"));
+            tw.addNewComponent(this, label, KSD_PROVIDER_LABEL,
+                               0, 2, 1, 1, 0.0, 0.0, GridBagConstraints.BOTH,
+                               tw.BOTTOM_PADDING);
+            tf = new TextField(tool.getKeyStoreProvider(), 30);
+            tf.getAccessibleContext().setAccessibleName(
+                PolicyTool.rb.getString("KeyStore Provider:"));
+            tw.addNewComponent(this, tf, KSD_PROVIDER_TEXTFIELD,
+                               1, 2, 1, 1, 0.0, 0.0, GridBagConstraints.BOTH,
+                               tw.BOTTOM_PADDING);
+
+            // KeyStore password URL and textfield
+            label = new Label(PolicyTool.rb.getString
+                                ("KeyStore Password URL:"));
+            tw.addNewComponent(this, label, KSD_PWD_URL_LABEL,
+                               0, 3, 1, 1, 0.0, 0.0, GridBagConstraints.BOTH,
+                               tw.BOTTOM_PADDING);
+            tf = new TextField(tool.getKeyStorePwdURL(), 30);
+            tf.getAccessibleContext().setAccessibleName(
+                PolicyTool.rb.getString("KeyStore Password U R L:"));
+            tw.addNewComponent(this, tf, KSD_PWD_URL_TEXTFIELD,
+                               1, 3, 1, 1, 0.0, 0.0, GridBagConstraints.BOTH,
+                               tw.BOTTOM_PADDING);
+
+            // OK button
+            Button okButton = new Button(PolicyTool.rb.getString("OK"));
+            okButton.addActionListener
+                        (new ChangeKeyStoreOKButtonListener(tool, tw, this));
+            tw.addNewComponent(this, okButton, KSD_OK_BUTTON,
+                        0, 4, 1, 1, 0.0, 0.0, GridBagConstraints.VERTICAL);
+
+            // cancel button
+            Button cancelButton = new Button(PolicyTool.rb.getString("Cancel"));
+            cancelButton.addActionListener(new CancelButtonListener(this));
+            tw.addNewComponent(this, cancelButton, KSD_CANCEL_BUTTON,
+                        1, 4, 1, 1, 0.0, 0.0, GridBagConstraints.VERTICAL);
+
+        }
+        setVisible(true);
+    }
+
+    /**
+     * display a dialog box for the user to input Principal info
+     *
+     * if editPolicyEntry is false, then we are adding Principals to
+     * a new PolicyEntry, and we only update the GUI listing
+     * with the new Principal.
+     *
+     * if edit is true, then we are editing an existing Policy entry.
+     */
+    void displayPrincipalDialog(boolean editPolicyEntry, boolean edit) {
+
+        PolicyParser.PrincipalEntry editMe = null;
+
+        // get the Principal selected from the Principal List
+        TaggedList prinList = (TaggedList)getComponent(PE_PRIN_LIST);
+        int prinIndex = prinList.getSelectedIndex();
+
+        if (edit) {
+            editMe = (PolicyParser.PrincipalEntry)prinList.getObject(prinIndex);
+        }
+
+        ToolDialog newTD = new ToolDialog
+                (PolicyTool.rb.getString("Principals"), tool, tw, true);
+        newTD.addWindowListener(new ChildWindowListener(newTD));
+
+        // find where the PolicyTool gui is
+        Point location = getLocationOnScreen();
+        newTD.setBounds(location.x + 50, location.y + 100, 650, 190);
+        newTD.setLayout(new GridBagLayout());
+        newTD.setResizable(true);
+
+        // description label
+        Label label = (edit ?
+                new Label(PolicyTool.rb.getString("  Edit Principal:")) :
+                new Label(PolicyTool.rb.getString("  Add New Principal:")));
+        tw.addNewComponent(newTD, label, PRD_DESC_LABEL,
+                           0, 0, 1, 1, 0.0, 0.0, GridBagConstraints.BOTH,
+                           tw.TOP_BOTTOM_PADDING);
+
+        // principal choice
+        Choice choice = new Choice();
+        choice.add(PRIN_TYPE);
+        choice.getAccessibleContext().setAccessibleName(PRIN_TYPE);
+        for (int i = 0; i < PRIN_ARRAY.size(); i++) {
+            Prin next = PRIN_ARRAY.get(i);
+            choice.add(next.CLASS);
+        }
+
+        choice.addItemListener(new PrincipalTypeMenuListener(newTD));
+        if (edit) {
+            if (PolicyParser.PrincipalEntry.WILDCARD_CLASS.equals
+                                (editMe.getPrincipalClass())) {
+                choice.select(PRIN_TYPE);
+            } else {
+                Prin inputPrin = getPrin(editMe.getPrincipalClass(), true);
+                if (inputPrin != null) {
+                    choice.select(inputPrin.CLASS);
+                }
+            }
+        }
+
+        tw.addNewComponent(newTD, choice, PRD_PRIN_CHOICE,
+                           0, 1, 1, 1, 0.0, 0.0, GridBagConstraints.BOTH,
+                           tw.LR_PADDING);
+
+        // principal textfield
+        TextField tf;
+        tf = (edit ?
+                new TextField(editMe.getDisplayClass(), 30) :
+                new TextField(30));
+        tf.getAccessibleContext().setAccessibleName(PRIN_TYPE);
+        tw.addNewComponent(newTD, tf, PRD_PRIN_TEXTFIELD,
+                           1, 1, 1, 1, 0.0, 0.0, GridBagConstraints.BOTH,
+                           tw.LR_PADDING);
+
+        // name label and textfield
+        label = new Label(PRIN_NAME);
+        tf = (edit ?
+                new TextField(editMe.getDisplayName(), 40) :
+                new TextField(40));
+        tf.getAccessibleContext().setAccessibleName(PRIN_NAME);
+
+        tw.addNewComponent(newTD, label, PRD_NAME_LABEL,
+                           0, 2, 1, 1, 0.0, 0.0, GridBagConstraints.BOTH,
+                           tw.LR_PADDING);
+        tw.addNewComponent(newTD, tf, PRD_NAME_TEXTFIELD,
+                           1, 2, 1, 1, 0.0, 0.0, GridBagConstraints.BOTH,
+                           tw.LR_PADDING);
+
+        // OK button
+        Button okButton = new Button(PolicyTool.rb.getString("OK"));
+        okButton.addActionListener(
+            new NewPolicyPrinOKButtonListener
+                                        (tool, tw, this, newTD, edit));
+        tw.addNewComponent(newTD, okButton, PRD_OK_BUTTON,
+                           0, 3, 1, 1, 0.0, 0.0, GridBagConstraints.VERTICAL,
+                           tw.TOP_BOTTOM_PADDING);
+        // cancel button
+        Button cancelButton = new Button(PolicyTool.rb.getString("Cancel"));
+        cancelButton.addActionListener(new CancelButtonListener(newTD));
+        tw.addNewComponent(newTD, cancelButton, PRD_CANCEL_BUTTON,
+                           1, 3, 1, 1, 0.0, 0.0, GridBagConstraints.VERTICAL,
+                           tw.TOP_BOTTOM_PADDING);
+
+        newTD.setVisible(true);
+    }
+
+    /**
+     * display a dialog box for the user to input Permission info
+     *
+     * if editPolicyEntry is false, then we are adding Permissions to
+     * a new PolicyEntry, and we only update the GUI listing
+     * with the new Permission.
+     *
+     * if edit is true, then we are editing an existing Permission entry.
+     */
+    void displayPermissionDialog(boolean editPolicyEntry, boolean edit) {
+
+        PolicyParser.PermissionEntry editMe = null;
+
+        // get the Permission selected from the Permission List
+        TaggedList permList = (TaggedList)getComponent(PE_PERM_LIST);
+        int permIndex = permList.getSelectedIndex();
+
+        if (edit) {
+            editMe = (PolicyParser.PermissionEntry)permList.getObject(permIndex);
+        }
+
+        ToolDialog newTD = new ToolDialog
+                (PolicyTool.rb.getString("Permissions"), tool, tw, true);
+        newTD.addWindowListener(new ChildWindowListener(newTD));
+
+        // find where the PolicyTool gui is
+        Point location = getLocationOnScreen();
+        newTD.setBounds(location.x + 50, location.y + 100, 700, 250);
+        newTD.setLayout(new GridBagLayout());
+        newTD.setResizable(true);
+
+        // description label
+        Label label = (edit ?
+                new Label(PolicyTool.rb.getString("  Edit Permission:")) :
+                new Label(PolicyTool.rb.getString("  Add New Permission:")));
+        tw.addNewComponent(newTD, label, PD_DESC_LABEL,
+                           0, 0, 1, 1, 0.0, 0.0, GridBagConstraints.BOTH,
+                           tw.TOP_BOTTOM_PADDING);
+
+        // permission choice (added in alphabetical order)
+        Choice choice = new Choice();
+        choice.add(PERM);
+        choice.getAccessibleContext().setAccessibleName(PERM);
+        for (int i = 0; i < PERM_ARRAY.size(); i++) {
+            Perm next = PERM_ARRAY.get(i);
+            choice.add(next.CLASS);
+        }
+        choice.addItemListener(new PermissionMenuListener(newTD));
+        tw.addNewComponent(newTD, choice, PD_PERM_CHOICE,
+                           0, 1, 1, 1, 0.0, 0.0, GridBagConstraints.BOTH,
+                           tw.LR_PADDING);
+
+        // permission textfield
+        TextField tf;
+        tf = (edit ? new TextField(editMe.permission, 30) : new TextField(30));
+        tf.getAccessibleContext().setAccessibleName(PERM);
+        if (edit) {
+            Perm inputPerm = getPerm(editMe.permission, true);
+            if (inputPerm != null) {
+                choice.select(inputPerm.CLASS);
+            }
+        }
+        tw.addNewComponent(newTD, tf, PD_PERM_TEXTFIELD,
+                           1, 1, 1, 1, 0.0, 0.0, GridBagConstraints.BOTH,
+                           tw.LR_PADDING);
+
+        // name label and textfield
+        choice = new Choice();
+        choice.add(PERM_NAME);
+        choice.getAccessibleContext().setAccessibleName(PERM_NAME);
+        choice.addItemListener(new PermissionNameMenuListener(newTD));
+        tf = (edit ? new TextField(editMe.name, 40) : new TextField(40));
+        tf.getAccessibleContext().setAccessibleName(PERM_NAME);
+        if (edit) {
+            setPermissionNames(getPerm(editMe.permission, true), choice, tf);
+        }
+        tw.addNewComponent(newTD, choice, PD_NAME_CHOICE,
+                           0, 2, 1, 1, 0.0, 0.0, GridBagConstraints.BOTH,
+                           tw.LR_PADDING);
+        tw.addNewComponent(newTD, tf, PD_NAME_TEXTFIELD,
+                           1, 2, 1, 1, 0.0, 0.0, GridBagConstraints.BOTH,
+                           tw.LR_PADDING);
+
+        // actions label and textfield
+        choice = new Choice();
+        choice.add(PERM_ACTIONS);
+        choice.getAccessibleContext().setAccessibleName(PERM_ACTIONS);
+        choice.addItemListener(new PermissionActionsMenuListener(newTD));
+        tf = (edit ? new TextField(editMe.action, 40) : new TextField(40));
+        tf.getAccessibleContext().setAccessibleName(PERM_ACTIONS);
+        if (edit) {
+            setPermissionActions(getPerm(editMe.permission, true), choice, tf);
+        }
+        tw.addNewComponent(newTD, choice, PD_ACTIONS_CHOICE,
+                           0, 3, 1, 1, 0.0, 0.0, GridBagConstraints.BOTH,
+                           tw.LR_PADDING);
+        tw.addNewComponent(newTD, tf, PD_ACTIONS_TEXTFIELD,
+                           1, 3, 1, 1, 0.0, 0.0, GridBagConstraints.BOTH,
+                           tw.LR_PADDING);
+
+        // signedby label and textfield
+        label = new Label(PolicyTool.rb.getString("Signed By:"));
+        tw.addNewComponent(newTD, label, PD_SIGNEDBY_LABEL,
+                           0, 4, 1, 1, 0.0, 0.0, GridBagConstraints.BOTH,
+                           tw.LR_PADDING);
+        tf = (edit ? new TextField(editMe.signedBy, 40) : new TextField(40));
+        tf.getAccessibleContext().setAccessibleName(
+                PolicyTool.rb.getString("Signed By:"));
+        tw.addNewComponent(newTD, tf, PD_SIGNEDBY_TEXTFIELD,
+                           1, 4, 1, 1, 0.0, 0.0, GridBagConstraints.BOTH,
+                           tw.LR_PADDING);
+
+        // OK button
+        Button okButton = new Button(PolicyTool.rb.getString("OK"));
+        okButton.addActionListener(
+            new NewPolicyPermOKButtonListener
+                                    (tool, tw, this, newTD, edit));
+        tw.addNewComponent(newTD, okButton, PD_OK_BUTTON,
+                           0, 5, 1, 1, 0.0, 0.0, GridBagConstraints.VERTICAL,
+                           tw.TOP_BOTTOM_PADDING);
+
+        // cancel button
+        Button cancelButton = new Button(PolicyTool.rb.getString("Cancel"));
+        cancelButton.addActionListener(new CancelButtonListener(newTD));
+        tw.addNewComponent(newTD, cancelButton, PD_CANCEL_BUTTON,
+                           1, 5, 1, 1, 0.0, 0.0, GridBagConstraints.VERTICAL,
+                           tw.TOP_BOTTOM_PADDING);
+
+        newTD.setVisible(true);
+    }
+
+    /**
+     * construct a Principal object from the Principal Info Dialog Box
+     */
+    PolicyParser.PrincipalEntry getPrinFromDialog() throws Exception {
+
+        TextField tf = (TextField)getComponent(PRD_PRIN_TEXTFIELD);
+        String pclass = new String(tf.getText().trim());
+        tf = (TextField)getComponent(PRD_NAME_TEXTFIELD);
+        String pname = new String(tf.getText().trim());
+        if (pclass.equals("*")) {
+            pclass = PolicyParser.PrincipalEntry.WILDCARD_CLASS;
+        }
+        if (pname.equals("*")) {
+            pname = PolicyParser.PrincipalEntry.WILDCARD_NAME;
+        }
+
+        PolicyParser.PrincipalEntry pppe = null;
+
+        if ((pclass.equals(PolicyParser.PrincipalEntry.WILDCARD_CLASS)) &&
+            (!pname.equals(PolicyParser.PrincipalEntry.WILDCARD_NAME))) {
+            throw new Exception
+                        (PolicyTool.rb.getString("Cannot Specify Principal " +
+                        "with a Wildcard Class without a Wildcard Name"));
+        } else if (pname.equals("")) {
+            throw new Exception
+                        (PolicyTool.rb.getString("Cannot Specify Principal " +
+                        "without a Name"));
+        } else if (pclass.equals("")) {
+            // make this consistent with what PolicyParser does
+            // when it sees an empty principal class
+            pclass = PolicyParser.REPLACE_NAME;
+            tool.warnings.addElement(
+                        "Warning: Principal name '" + pname +
+                                "' specified without a Principal class.\n" +
+                        "\t'" + pname + "' will be interpreted " +
+                                "as a key store alias.\n" +
+                        "\tThe final principal class will be " +
+                                ToolDialog.X500_PRIN_CLASS + ".\n" +
+                        "\tThe final principal name will be " +
+                                "determined by the following:\n" +
+                        "\n" +
+                        "\tIf the key store entry identified by '"
+                                + pname + "'\n" +
+                        "\tis a key entry, then the principal name will be\n" +
+                        "\tthe subject distinguished name from the first\n" +
+                        "\tcertificate in the entry's certificate chain.\n" +
+                        "\n" +
+                        "\tIf the key store entry identified by '" +
+                                pname + "'\n" +
+                        "\tis a trusted certificate entry, then the\n" +
+                        "\tprincipal name will be the subject distinguished\n" +
+                        "\tname from the trusted public key certificate.");
+            tw.displayStatusDialog(this,
+                        "'" + pname + "' will be interpreted as a key " +
+                        "store alias.  View Warning Log for details.");
+        }
+        return new PolicyParser.PrincipalEntry(pclass, pname);
+    }
+
+
+    /**
+     * construct a Permission object from the Permission Info Dialog Box
+     */
+    PolicyParser.PermissionEntry getPermFromDialog() {
+
+        TextField tf = (TextField)getComponent(PD_PERM_TEXTFIELD);
+        String permission = new String(tf.getText().trim());
+        tf = (TextField)getComponent(PD_NAME_TEXTFIELD);
+        String name = null;
+        if (tf.getText().trim().equals("") == false)
+            name = new String(tf.getText().trim());
+        if (permission.equals("") ||
+            (!permission.equals(ALL_PERM_CLASS) && name == null)) {
+            throw new InvalidParameterException(PolicyTool.rb.getString
+                ("Permission and Target Name must have a value"));
+        }
+
+        // When the permission is FilePermission, we need to check the name
+        // to make sure it's not escaped. We believe --
+        //
+        // String             name.lastIndexOf("\\\\")
+        // ----------------   ------------------------
+        // c:\foo\bar         -1, legal
+        // c:\\foo\\bar       2, illegal
+        // \\server\share     0, legal
+        // \\\\server\share   2, illegal
+
+        if (permission.equals(FILE_PERM_CLASS) && name.lastIndexOf("\\\\") > 0) {
+            char result = tw.displayYesNoDialog(this,
+                    PolicyTool.rb.getString("Warning"),
+                    PolicyTool.rb.getString(
+                        "Warning: File name may include escaped backslash characters. " +
+                        "It is not necessary to escape backslash characters " +
+                        "(the tool escapes characters as necessary when writing " +
+                        "the policy contents to the persistent store).\n\n" +
+                        "Click on Retain to retain the entered name, or click on " +
+                        "Edit to edit the name."),
+                    PolicyTool.rb.getString("Retain"),
+                    PolicyTool.rb.getString("Edit")
+                    );
+            if (result != 'Y') {
+                // an invisible exception
+                throw new NoDisplayException();
+            }
+        }
+        // get the Actions
+        tf = (TextField)getComponent(PD_ACTIONS_TEXTFIELD);
+        String actions = null;
+        if (tf.getText().trim().equals("") == false)
+            actions = new String(tf.getText().trim());
+
+        // get the Signed By
+        tf = (TextField)getComponent(PD_SIGNEDBY_TEXTFIELD);
+        String signedBy = null;
+        if (tf.getText().trim().equals("") == false)
+            signedBy = new String(tf.getText().trim());
+
+        PolicyParser.PermissionEntry pppe = new PolicyParser.PermissionEntry
+                                (permission, name, actions);
+        pppe.signedBy = signedBy;
+
+        // see if the signers have public keys
+        if (signedBy != null) {
+                String signers[] = tool.parseSigners(pppe.signedBy);
+                for (int i = 0; i < signers.length; i++) {
+                try {
+                    PublicKey pubKey = tool.getPublicKeyAlias(signers[i]);
+                    if (pubKey == null) {
+                        MessageFormat form = new MessageFormat
+                            (PolicyTool.rb.getString
+                            ("Warning: A public key for alias " +
+                            "'signers[i]' does not exist.  " +
+                            "Make sure a KeyStore is properly configured."));
+                        Object[] source = {signers[i]};
+                        tool.warnings.addElement(form.format(source));
+                        tw.displayStatusDialog(this, form.format(source));
+                    }
+                } catch (Exception e) {
+                    tw.displayErrorDialog(this, e);
+                }
+            }
+        }
+        return pppe;
+    }
+
+    /**
+     * confirm that the user REALLY wants to remove the Policy Entry
+     */
+    void displayConfirmRemovePolicyEntry() {
+
+        // find the entry to be removed
+        List list = (List)tw.getComponent(tw.MW_POLICY_LIST);
+        int index = list.getSelectedIndex();
+        PolicyEntry entries[] = tool.getEntry();
+
+        // find where the PolicyTool gui is
+        Point location = tw.getLocationOnScreen();
+        setBounds(location.x + 25, location.y + 100, 600, 400);
+        setLayout(new GridBagLayout());
+
+        // ask the user do they really want to do this?
+        Label label = new Label
+                (PolicyTool.rb.getString("Remove this Policy Entry?"));
+        tw.addNewComponent(this, label, CRPE_LABEL1,
+                           0, 0, 2, 1, 0.0, 0.0, GridBagConstraints.BOTH,
+                           tw.BOTTOM_PADDING);
+
+        // display the policy entry
+        label = new Label(entries[index].codebaseToString());
+        tw.addNewComponent(this, label, CRPE_LABEL2,
+                        0, 1, 2, 1, 0.0, 0.0, GridBagConstraints.BOTH);
+        label = new Label(entries[index].principalsToString().trim());
+        tw.addNewComponent(this, label, CRPE_LABEL2+1,
+                        0, 2, 2, 1, 0.0, 0.0, GridBagConstraints.BOTH);
+        Vector<PolicyParser.PermissionEntry> perms =
+                        entries[index].getGrantEntry().permissionEntries;
+        for (int i = 0; i < perms.size(); i++) {
+            PolicyParser.PermissionEntry nextPerm = perms.elementAt(i);
+            String permString = ToolDialog.PermissionEntryToUserFriendlyString(nextPerm);
+            label = new Label("    " + permString);
+            if (i == (perms.size()-1)) {
+                tw.addNewComponent(this, label, CRPE_LABEL2 + 2 + i,
+                                 1, 3 + i, 1, 1, 0.0, 0.0,
+                                 GridBagConstraints.BOTH, tw.BOTTOM_PADDING);
+            } else {
+                tw.addNewComponent(this, label, CRPE_LABEL2 + 2 + i,
+                                 1, 3 + i, 1, 1, 0.0, 0.0,
+                                 GridBagConstraints.BOTH);
+            }
+        }
+
+
+        // add OK/CANCEL buttons in a new panel
+        Panel panel = new Panel();
+        panel.setLayout(new GridBagLayout());
+
+        // OK button
+        Button okButton = new Button(PolicyTool.rb.getString("OK"));
+        okButton.addActionListener
+                (new ConfirmRemovePolicyEntryOKButtonListener(tool, tw, this));
+        tw.addNewComponent(panel, okButton, CRPE_PANEL_OK,
+                           0, 0, 1, 1, 0.0, 0.0,
+                           GridBagConstraints.VERTICAL, tw.LR_PADDING);
+
+        // cancel button
+        Button cancelButton = new Button(PolicyTool.rb.getString("Cancel"));
+        cancelButton.addActionListener(new CancelButtonListener(this));
+        tw.addNewComponent(panel, cancelButton, CRPE_PANEL_CANCEL,
+                           1, 0, 1, 1, 0.0, 0.0,
+                           GridBagConstraints.VERTICAL, tw.LR_PADDING);
+
+        tw.addNewComponent(this, panel, CRPE_LABEL2 + 2 + perms.size(),
+                           0, 3 + perms.size(), 2, 1, 0.0, 0.0,
+                           GridBagConstraints.VERTICAL, tw.TOP_BOTTOM_PADDING);
+
+        pack();
+        setVisible(true);
+    }
+
+    /**
+     * perform SAVE AS
+     */
+    void displaySaveAsDialog(int nextEvent) {
+
+        // pop up a dialog box for the user to enter a filename.
+        FileDialog fd = new FileDialog
+                (tw, PolicyTool.rb.getString("Save As"), FileDialog.SAVE);
+        fd.addWindowListener(new WindowAdapter() {
+            public void windowClosing(WindowEvent e) {
+                e.getWindow().setVisible(false);
+            }
+        });
+        fd.setVisible(true);
+
+        // see if the user hit cancel
+        if (fd.getFile() == null ||
+            fd.getFile().equals(""))
+            return;
+
+        // get the entered filename
+        String filename = new String(fd.getDirectory() + fd.getFile());
+        fd.dispose();
+
+        // see if the file already exists
+        File saveAsFile = new File(filename);
+        if (saveAsFile.exists()) {
+            // display a dialog box for the user to enter policy info
+            ToolDialog td = new ToolDialog
+                (PolicyTool.rb.getString("Overwrite File"), tool, tw, true);
+            td.displayOverWriteFileDialog(filename, nextEvent);
+        } else {
+            try {
+                // save the policy entries to a file
+                tool.savePolicy(filename);
+
+                // display status
+                MessageFormat form = new MessageFormat(PolicyTool.rb.getString
+                        ("Policy successfully written to filename"));
+                Object[] source = {filename};
+                tw.displayStatusDialog(null, form.format(source));
+
+                // display the new policy filename
+                TextField newFilename = (TextField)tw.getComponent
+                                (tw.MW_FILENAME_TEXTFIELD);
+                newFilename.setText(filename);
+                tw.setVisible(true);
+
+                // now continue with the originally requested command
+                // (QUIT, NEW, or OPEN)
+                userSaveContinue(tool, tw, this, nextEvent);
+
+            } catch (FileNotFoundException fnfe) {
+                if (filename == null || filename.equals("")) {
+                    tw.displayErrorDialog(null, new FileNotFoundException
+                                (PolicyTool.rb.getString("null filename")));
+                } else {
+                    tw.displayErrorDialog(null, fnfe);
+                }
+            } catch (Exception ee) {
+                tw.displayErrorDialog(null, ee);
+            }
+        }
+    }
+
+    /**
+     * ask user if they want to save changes
+     */
+    void displayUserSave(int select) {
+
+        if (tool.modified == true) {
+
+            // find where the PolicyTool gui is
+            Point location = tw.getLocationOnScreen();
+            setBounds(location.x + 75, location.y + 100, 400, 150);
+            setLayout(new GridBagLayout());
+
+            Label label = new Label
+                (PolicyTool.rb.getString("Save changes?"));
+            tw.addNewComponent(this, label, USC_LABEL,
+                               0, 0, 3, 1, 0.0, 0.0, GridBagConstraints.BOTH,
+                               tw.L_TOP_BOTTOM_PADDING);
+
+            Panel panel = new Panel();
+            panel.setLayout(new GridBagLayout());
+
+            Button yesButton = new Button(PolicyTool.rb.getString("Yes"));
+            yesButton.addActionListener
+                        (new UserSaveYesButtonListener(this, tool, tw, select));
+            tw.addNewComponent(panel, yesButton, USC_YES_BUTTON,
+                               0, 0, 1, 1, 0.0, 0.0,
+                               GridBagConstraints.VERTICAL,
+                               tw.LR_BOTTOM_PADDING);
+            Button noButton = new Button(PolicyTool.rb.getString("No"));
+            noButton.addActionListener
+                        (new UserSaveNoButtonListener(this, tool, tw, select));
+            tw.addNewComponent(panel, noButton, USC_NO_BUTTON,
+                               1, 0, 1, 1, 0.0, 0.0,
+                               GridBagConstraints.VERTICAL,
+                               tw.LR_BOTTOM_PADDING);
+            Button cancelButton = new Button(PolicyTool.rb.getString("Cancel"));
+            cancelButton.addActionListener
+                        (new UserSaveCancelButtonListener(this));
+            tw.addNewComponent(panel, cancelButton, USC_CANCEL_BUTTON,
+                               2, 0, 1, 1, 0.0, 0.0,
+                               GridBagConstraints.VERTICAL,
+                               tw.LR_BOTTOM_PADDING);
+
+            tw.addNewComponent(this, panel, USC_PANEL,
+                               0, 1, 1, 1, 0.0, 0.0, GridBagConstraints.BOTH);
+
+            pack();
+            setVisible(true);
+        } else {
+            // just do the original request (QUIT, NEW, or OPEN)
+            userSaveContinue(tool, tw, this, select);
+        }
+    }
+
+    /**
+     * when the user sees the 'YES', 'NO', 'CANCEL' buttons on the
+     * displayUserSave dialog, and the click on one of them,
+     * we need to continue the originally requested action
+     * (either QUITting, opening NEW policy file, or OPENing an existing
+     * policy file.  do that now.
+     */
+    void userSaveContinue(PolicyTool tool, ToolWindow tw,
+                        ToolDialog us, int select) {
+
+        // now either QUIT, open a NEW policy file, or OPEN an existing policy
+        switch(select) {
+        case ToolDialog.QUIT:
+
+            tw.setVisible(false);
+            tw.dispose();
+            System.exit(0);
+
+        case ToolDialog.NEW:
+
+            try {
+                tool.openPolicy(null);
+            } catch (Exception ee) {
+                tool.modified = false;
+                tw.displayErrorDialog(null, ee);
+            }
+
+            // display the policy entries via the policy list textarea
+            List list = new List(40, false);
+            list.addActionListener(new PolicyListListener(tool, tw));
+            tw.replacePolicyList(list);
+
+            // display null policy filename and keystore
+            TextField newFilename = (TextField)
+                                tw.getComponent(tw.MW_FILENAME_TEXTFIELD);
+            newFilename.setText("");
+            tw.setVisible(true);
+            break;
+
+        case ToolDialog.OPEN:
+
+            // pop up a dialog box for the user to enter a filename.
+            FileDialog fd = new FileDialog
+                (tw, PolicyTool.rb.getString("Open"), FileDialog.LOAD);
+            fd.addWindowListener(new WindowAdapter() {
+                public void windowClosing(WindowEvent e) {
+                    e.getWindow().setVisible(false);
+                }
+            });
+            fd.setVisible(true);
+
+            // see if the user hit 'cancel'
+            if (fd.getFile() == null ||
+                fd.getFile().equals(""))
+                return;
+
+            // get the entered filename
+            String policyFile = new String(fd.getDirectory() + fd.getFile());
+
+            try {
+                // open the policy file
+                tool.openPolicy(policyFile);
+
+                // display the policy entries via the policy list textarea
+                list = new List(40, false);
+                list.addActionListener(new PolicyListListener(tool, tw));
+                PolicyEntry entries[] = tool.getEntry();
+                if (entries != null) {
+                    for (int i = 0; i < entries.length; i++)
+                        list.add(entries[i].headerToString());
+                }
+                tw.replacePolicyList(list);
+                tool.modified = false;
+
+                // display the new policy filename
+                newFilename = (TextField)
+                                tw.getComponent(tw.MW_FILENAME_TEXTFIELD);
+                newFilename.setText(policyFile);
+                tw.setVisible(true);
+
+                // inform user of warnings
+                if (tool.newWarning == true) {
+                    tw.displayStatusDialog(null, PolicyTool.rb.getString
+                        ("Errors have occurred while opening the " +
+                        "policy configuration.  View the Warning Log " +
+                        "for more information."));
+                }
+
+            } catch (Exception e) {
+                // add blank policy listing
+                list = new List(40, false);
+                list.addActionListener(new PolicyListListener(tool, tw));
+                tw.replacePolicyList(list);
+                tool.setPolicyFileName(null);
+                tool.modified = false;
+
+                // display a null policy filename
+                newFilename = (TextField)
+                                tw.getComponent(tw.MW_FILENAME_TEXTFIELD);
+                newFilename.setText("");
+                tw.setVisible(true);
+
+                // display the error
+                MessageFormat form = new MessageFormat(PolicyTool.rb.getString
+                    ("Could not open policy file: policyFile: e.toString()"));
+                Object[] source = {policyFile, e.toString()};
+                tw.displayErrorDialog(null, form.format(source));
+            }
+            break;
+        }
+    }
+
+    /**
+     * Return a Menu list of names for a given permission
+     *
+     * If inputPerm's TARGETS are null, then this means TARGETS are
+     * not allowed to be entered (and the TextField is set to be
+     * non-editable).
+     *
+     * If TARGETS are valid but there are no standard ones
+     * (user must enter them by hand) then the TARGETS array may be empty
+     * (and of course non-null).
+     */
+    void setPermissionNames(Perm inputPerm, Choice names, TextField field) {
+        names.removeAll();
+        names.add(PERM_NAME);
+
+        if (inputPerm == null) {
+            // custom permission
+            field.setEditable(true);
+        } else if (inputPerm.TARGETS == null) {
+            // standard permission with no targets
+            field.setEditable(false);
+        } else {
+            // standard permission with standard targets
+            field.setEditable(true);
+            for (int i = 0; i < inputPerm.TARGETS.length; i++) {
+                names.add(inputPerm.TARGETS[i]);
+            }
+        }
+    }
+
+    /**
+     * Return a Menu list of actions for a given permission
+     *
+     * If inputPerm's ACTIONS are null, then this means ACTIONS are
+     * not allowed to be entered (and the TextField is set to be
+     * non-editable).  This is typically true for BasicPermissions.
+     *
+     * If ACTIONS are valid but there are no standard ones
+     * (user must enter them by hand) then the ACTIONS array may be empty
+     * (and of course non-null).
+     */
+    void setPermissionActions(Perm inputPerm, Choice actions, TextField field) {
+        actions.removeAll();
+        actions.add(PERM_ACTIONS);
+
+        if (inputPerm == null) {
+            // custom permission
+            field.setEditable(true);
+        } else if (inputPerm.ACTIONS == null) {
+            // standard permission with no actions
+            field.setEditable(false);
+        } else {
+            // standard permission with standard actions
+            field.setEditable(true);
+            for (int i = 0; i < inputPerm.ACTIONS.length; i++) {
+                actions.add(inputPerm.ACTIONS[i]);
+            }
+        }
+    }
+
+    static String PermissionEntryToUserFriendlyString(PolicyParser.PermissionEntry pppe) {
+        String result = pppe.permission;
+        if (pppe.name != null) {
+            result += " " + pppe.name;
+        }
+        if (pppe.action != null) {
+            result += ", \"" + pppe.action + "\"";
+        }
+        if (pppe.signedBy != null) {
+            result += ", signedBy " + pppe.signedBy;
+        }
+        return result;
+    }
+
+    static String PrincipalEntryToUserFriendlyString(PolicyParser.PrincipalEntry pppe) {
+        StringWriter sw = new StringWriter();
+        PrintWriter pw = new PrintWriter(sw);
+        pppe.write(pw);
+        return sw.toString();
+    }
+}
+
+/**
+ * Event handler for the PolicyTool window
+ */
+class ToolWindowListener implements WindowListener {
+
+    private ToolWindow tw;
+
+    ToolWindowListener(ToolWindow tw) {
+        this.tw = tw;
+    }
+
+    public void windowOpened(WindowEvent we) {
+    }
+
+    public void windowClosing(WindowEvent we) {
+
+        // XXX
+        // should we ask user if they want to save changes?
+        // (we do if they choose the Menu->Exit)
+        // seems that if they kill the application by hand,
+        // we don't have to ask.
+
+        tw.setVisible(false);
+        tw.dispose();
+        System.exit(0);
+    }
+
+    public void windowClosed(WindowEvent we) {
+        System.exit(0);
+    }
+
+    public void windowIconified(WindowEvent we) {
+    }
+
+    public void windowDeiconified(WindowEvent we) {
+    }
+
+    public void windowActivated(WindowEvent we) {
+    }
+
+    public void windowDeactivated(WindowEvent we) {
+    }
+}
+
+/**
+ * Event handler for the Policy List
+ */
+class PolicyListListener implements ActionListener {
+
+    private PolicyTool tool;
+    private ToolWindow tw;
+
+    PolicyListListener(PolicyTool tool, ToolWindow tw) {
+        this.tool = tool;
+        this.tw = tw;
+
+    }
+
+    public void actionPerformed(ActionEvent e) {
+
+        // display the permission list for a policy entry
+        ToolDialog td = new ToolDialog
+                (PolicyTool.rb.getString("Policy Entry"), tool, tw, true);
+        td.displayPolicyEntryDialog(true);
+    }
+}
+
+/**
+ * Event handler for the File Menu
+ */
+class FileMenuListener implements ActionListener {
+
+    private PolicyTool tool;
+    private ToolWindow tw;
+
+    FileMenuListener(PolicyTool tool, ToolWindow tw) {
+        this.tool = tool;
+        this.tw = tw;
+    }
+
+    public void actionPerformed(ActionEvent e) {
+
+        if (PolicyTool.collator.compare(e.getActionCommand(), tw.QUIT) == 0) {
+
+            // ask user if they want to save changes
+            ToolDialog td = new ToolDialog
+                (PolicyTool.rb.getString("Save Changes"), tool, tw, true);
+            td.displayUserSave(td.QUIT);
+
+            // the above method will perform the QUIT as long as the
+            // user does not CANCEL the request
+
+        } else if (PolicyTool.collator.compare(e.getActionCommand(),
+                                        tw.NEW_POLICY_FILE) == 0) {
+
+            // ask user if they want to save changes
+            ToolDialog td = new ToolDialog
+                (PolicyTool.rb.getString("Save Changes"), tool, tw, true);
+            td.displayUserSave(td.NEW);
+
+            // the above method will perform the NEW as long as the
+            // user does not CANCEL the request
+
+        } else if (PolicyTool.collator.compare(e.getActionCommand(),
+                                        tw.OPEN_POLICY_FILE) == 0) {
+
+            // ask user if they want to save changes
+            ToolDialog td = new ToolDialog
+                (PolicyTool.rb.getString("Save Changes"), tool, tw, true);
+            td.displayUserSave(td.OPEN);
+
+            // the above method will perform the OPEN as long as the
+            // user does not CANCEL the request
+
+        } else if (PolicyTool.collator.compare(e.getActionCommand(),
+                                        tw.SAVE_POLICY_FILE) == 0) {
+
+            // get the previously entered filename
+            String filename = ((TextField)
+                    tw.getComponent(tw.MW_FILENAME_TEXTFIELD)).getText();
+
+            // if there is no filename, do a SAVE_AS
+            if (filename == null || filename.length() == 0) {
+                // user wants to SAVE AS
+                ToolDialog td = new ToolDialog
+                        (PolicyTool.rb.getString("Save As"), tool, tw, true);
+                td.displaySaveAsDialog(td.NOACTION);
+            } else {
+                try {
+                    // save the policy entries to a file
+                    tool.savePolicy(filename);
+
+                    // display status
+                    MessageFormat form = new MessageFormat
+                        (PolicyTool.rb.getString
+                        ("Policy successfully written to filename"));
+                    Object[] source = {filename};
+                    tw.displayStatusDialog(null, form.format(source));
+                } catch (FileNotFoundException fnfe) {
+                    if (filename == null || filename.equals("")) {
+                        tw.displayErrorDialog(null, new FileNotFoundException
+                                (PolicyTool.rb.getString("null filename")));
+                    } else {
+                        tw.displayErrorDialog(null, fnfe);
+                    }
+                } catch (Exception ee) {
+                    tw.displayErrorDialog(null, ee);
+                }
+            }
+        } else if (PolicyTool.collator.compare(e.getActionCommand(),
+                                                tw.SAVE_AS_POLICY_FILE) == 0) {
+
+            // user wants to SAVE AS
+            ToolDialog td = new ToolDialog
+                (PolicyTool.rb.getString("Save As"), tool, tw, true);
+            td.displaySaveAsDialog(td.NOACTION);
+
+        } else if (PolicyTool.collator.compare(e.getActionCommand(),
+                                                tw.VIEW_WARNINGS) == 0) {
+            tw.displayWarningLog(null);
+        }
+    }
+}
+
+/**
+ * Event handler for the main window buttons and Edit Menu
+ */
+class MainWindowListener implements ActionListener {
+
+    private PolicyTool tool;
+    private ToolWindow tw;
+
+    MainWindowListener(PolicyTool tool, ToolWindow tw) {
+        this.tool = tool;
+        this.tw = tw;
+    }
+
+    public void actionPerformed(ActionEvent e) {
+
+        if (PolicyTool.collator.compare(e.getActionCommand(),
+                                        tw.ADD_POLICY_ENTRY) == 0) {
+
+            // display a dialog box for the user to enter policy info
+            ToolDialog td = new ToolDialog
+                (PolicyTool.rb.getString("Policy Entry"), tool, tw, true);
+            td.displayPolicyEntryDialog(false);
+
+        } else if (PolicyTool.collator.compare(e.getActionCommand(),
+                                        tw.REMOVE_POLICY_ENTRY) == 0) {
+
+            // get the selected entry
+            List list = (List)tw.getComponent(tw.MW_POLICY_LIST);
+            int index = list.getSelectedIndex();
+            if (index < 0) {
+                tw.displayErrorDialog(null, new Exception
+                        (PolicyTool.rb.getString("No Policy Entry selected")));
+                return;
+            }
+
+            // ask the user if they really want to remove the policy entry
+            ToolDialog td = new ToolDialog(PolicyTool.rb.getString
+                ("Remove Policy Entry"), tool, tw, true);
+            td.displayConfirmRemovePolicyEntry();
+
+        } else if (PolicyTool.collator.compare(e.getActionCommand(),
+                                        tw.EDIT_POLICY_ENTRY) == 0) {
+
+            // get the selected entry
+            List list = (List)tw.getComponent(tw.MW_POLICY_LIST);
+            int index = list.getSelectedIndex();
+            if (index < 0) {
+                tw.displayErrorDialog(null, new Exception
+                        (PolicyTool.rb.getString("No Policy Entry selected")));
+                return;
+            }
+
+            // display the permission list for a policy entry
+            ToolDialog td = new ToolDialog
+                (PolicyTool.rb.getString("Policy Entry"), tool, tw, true);
+            td.displayPolicyEntryDialog(true);
+
+        } else if (PolicyTool.collator.compare(e.getActionCommand(),
+                                        tw.EDIT_KEYSTORE) == 0) {
+
+            // display a dialog box for the user to enter keystore info
+            ToolDialog td = new ToolDialog
+                (PolicyTool.rb.getString("KeyStore"), tool, tw, true);
+            td.keyStoreDialog(td.EDIT_KEYSTORE);
+        }
+    }
+}
+
+/**
+ * Event handler for OverWriteFileOKButton button
+ */
+class OverWriteFileOKButtonListener implements ActionListener {
+
+    private PolicyTool tool;
+    private ToolWindow tw;
+    private ToolDialog td;
+    private String filename;
+    private int nextEvent;
+
+    OverWriteFileOKButtonListener(PolicyTool tool, ToolWindow tw,
+                                ToolDialog td, String filename, int nextEvent) {
+        this.tool = tool;
+        this.tw = tw;
+        this.td = td;
+        this.filename = filename;
+        this.nextEvent = nextEvent;
+    }
+
+    public void actionPerformed(ActionEvent e) {
+        try {
+            // save the policy entries to a file
+            tool.savePolicy(filename);
+
+            // display status
+            MessageFormat form = new MessageFormat
+                (PolicyTool.rb.getString
+                ("Policy successfully written to filename"));
+            Object[] source = {filename};
+            tw.displayStatusDialog(null, form.format(source));
+
+            // display the new policy filename
+            TextField newFilename = (TextField)tw.getComponent
+                                (tw.MW_FILENAME_TEXTFIELD);
+            newFilename.setText(filename);
+            tw.setVisible(true);
+
+            // now continue with the originally requested command
+            // (QUIT, NEW, or OPEN)
+            td.setVisible(false);
+            td.dispose();
+            td.userSaveContinue(tool, tw, td, nextEvent);
+
+        } catch (FileNotFoundException fnfe) {
+            if (filename == null || filename.equals("")) {
+                tw.displayErrorDialog(null, new FileNotFoundException
+                                (PolicyTool.rb.getString("null filename")));
+            } else {
+                tw.displayErrorDialog(null, fnfe);
+            }
+            td.setVisible(false);
+            td.dispose();
+        } catch (Exception ee) {
+            tw.displayErrorDialog(null, ee);
+            td.setVisible(false);
+            td.dispose();
+        }
+    }
+}
+
+/**
+ * Event handler for AddEntryDoneButton button
+ *
+ * -- if edit is TRUE, then we are EDITing an existing PolicyEntry
+ *    and we need to update both the policy and the GUI listing.
+ *    if edit is FALSE, then we are ADDing a new PolicyEntry,
+ *    so we only need to update the GUI listing.
+ */
+class AddEntryDoneButtonListener implements ActionListener {
+
+    private PolicyTool tool;
+    private ToolWindow tw;
+    private ToolDialog td;
+    private boolean edit;
+
+    AddEntryDoneButtonListener(PolicyTool tool, ToolWindow tw,
+                                ToolDialog td, boolean edit) {
+        this.tool = tool;
+        this.tw = tw;
+        this.td = td;
+        this.edit = edit;
+    }
+
+    public void actionPerformed(ActionEvent e) {
+
+        try {
+            // get a PolicyEntry object from the dialog policy info
+            PolicyEntry newEntry = td.getPolicyEntryFromDialog();
+            PolicyParser.GrantEntry newGe = newEntry.getGrantEntry();
+
+            // see if all the signers have public keys
+            if (newGe.signedBy != null) {
+                String signers[] = tool.parseSigners(newGe.signedBy);
+                for (int i = 0; i < signers.length; i++) {
+                    PublicKey pubKey = tool.getPublicKeyAlias(signers[i]);
+                    if (pubKey == null) {
+                        MessageFormat form = new MessageFormat
+                            (PolicyTool.rb.getString
+                            ("Warning: A public key for alias " +
+                            "'signers[i]' does not exist.  " +
+                            "Make sure a KeyStore is properly configured."));
+                        Object[] source = {signers[i]};
+                        tool.warnings.addElement(form.format(source));
+                        tw.displayStatusDialog(td, form.format(source));
+                    }
+                }
+            }
+
+            // add the entry
+            List policyList = (List)tw.getComponent(tw.MW_POLICY_LIST);
+            if (edit) {
+                int listIndex = policyList.getSelectedIndex();
+                tool.addEntry(newEntry, listIndex);
+                String newCodeBaseStr = newEntry.headerToString();
+                if (PolicyTool.collator.compare
+                        (newCodeBaseStr, policyList.getItem(listIndex)) != 0)
+                    tool.modified = true;
+                policyList.replaceItem(newCodeBaseStr, listIndex);
+            } else {
+                tool.addEntry(newEntry, -1);
+                policyList.add(newEntry.headerToString());
+                tool.modified = true;
+            }
+            td.setVisible(false);
+            td.dispose();
+
+        } catch (Exception eee) {
+            tw.displayErrorDialog(td, eee);
+        }
+    }
+}
+
+/**
+ * Event handler for ChangeKeyStoreOKButton button
+ */
+class ChangeKeyStoreOKButtonListener implements ActionListener {
+
+    private PolicyTool tool;
+    private ToolWindow tw;
+    private ToolDialog td;
+
+    ChangeKeyStoreOKButtonListener(PolicyTool tool, ToolWindow tw,
+                ToolDialog td) {
+        this.tool = tool;
+        this.tw = tw;
+        this.td = td;
+    }
+
+    public void actionPerformed(ActionEvent e) {
+
+        String URLString = ((TextField)
+                td.getComponent(td.KSD_NAME_TEXTFIELD)).getText().trim();
+        String type = ((TextField)
+                td.getComponent(td.KSD_TYPE_TEXTFIELD)).getText().trim();
+        String provider = ((TextField)
+                td.getComponent(td.KSD_PROVIDER_TEXTFIELD)).getText().trim();
+        String pwdURL = ((TextField)
+                td.getComponent(td.KSD_PWD_URL_TEXTFIELD)).getText().trim();
+
+        try {
+            tool.openKeyStore
+                        ((URLString.length() == 0 ? null : URLString),
+                        (type.length() == 0 ? null : type),
+                        (provider.length() == 0 ? null : provider),
+                        (pwdURL.length() == 0 ? null : pwdURL));
+            tool.modified = true;
+        } catch (Exception ex) {
+            MessageFormat form = new MessageFormat(PolicyTool.rb.getString
+                ("Unable to open KeyStore: ex.toString()"));
+            Object[] source = {ex.toString()};
+            tw.displayErrorDialog(td, form.format(source));
+            return;
+        }
+
+        td.dispose();
+    }
+}
+
+/**
+ * Event handler for AddPrinButton button
+ */
+class AddPrinButtonListener implements ActionListener {
+
+    private PolicyTool tool;
+    private ToolWindow tw;
+    private ToolDialog td;
+    private boolean editPolicyEntry;
+
+    AddPrinButtonListener(PolicyTool tool, ToolWindow tw,
+                                ToolDialog td, boolean editPolicyEntry) {
+        this.tool = tool;
+        this.tw = tw;
+        this.td = td;
+        this.editPolicyEntry = editPolicyEntry;
+    }
+
+    public void actionPerformed(ActionEvent e) {
+
+        // display a dialog box for the user to enter principal info
+        td.displayPrincipalDialog(editPolicyEntry, false);
+    }
+}
+
+/**
+ * Event handler for AddPermButton button
+ */
+class AddPermButtonListener implements ActionListener {
+
+    private PolicyTool tool;
+    private ToolWindow tw;
+    private ToolDialog td;
+    private boolean editPolicyEntry;
+
+    AddPermButtonListener(PolicyTool tool, ToolWindow tw,
+                                ToolDialog td, boolean editPolicyEntry) {
+        this.tool = tool;
+        this.tw = tw;
+        this.td = td;
+        this.editPolicyEntry = editPolicyEntry;
+    }
+
+    public void actionPerformed(ActionEvent e) {
+
+        // display a dialog box for the user to enter permission info
+        td.displayPermissionDialog(editPolicyEntry, false);
+    }
+}
+
+/**
+ * Event handler for AddPrinOKButton button
+ */
+class NewPolicyPrinOKButtonListener implements ActionListener {
+
+    private PolicyTool tool;
+    private ToolWindow tw;
+    private ToolDialog listDialog;
+    private ToolDialog infoDialog;
+    private boolean edit;
+
+    NewPolicyPrinOKButtonListener(PolicyTool tool,
+                                ToolWindow tw,
+                                ToolDialog listDialog,
+                                ToolDialog infoDialog,
+                                boolean edit) {
+        this.tool = tool;
+        this.tw = tw;
+        this.listDialog = listDialog;
+        this.infoDialog = infoDialog;
+        this.edit = edit;
+    }
+
+    public void actionPerformed(ActionEvent e) {
+
+        try {
+            // read in the new principal info from Dialog Box
+            PolicyParser.PrincipalEntry pppe =
+                        infoDialog.getPrinFromDialog();
+            if (pppe != null) {
+                try {
+                    tool.verifyPrincipal(pppe.getPrincipalClass(),
+                                        pppe.getPrincipalName());
+                } catch (ClassNotFoundException cnfe) {
+                    MessageFormat form = new MessageFormat
+                                (PolicyTool.rb.getString
+                                ("Warning: Class not found: class"));
+                    Object[] source = {pppe.getPrincipalClass()};
+                    tool.warnings.addElement(form.format(source));
+                    tw.displayStatusDialog(infoDialog, form.format(source));
+                }
+
+                // add the principal to the GUI principal list
+                TaggedList prinList =
+                    (TaggedList)listDialog.getComponent(listDialog.PE_PRIN_LIST);
+
+                String prinString = ToolDialog.PrincipalEntryToUserFriendlyString(pppe);
+                if (edit) {
+                    // if editing, replace the original principal
+                    int index = prinList.getSelectedIndex();
+                    prinList.replaceTaggedItem(prinString, pppe, index);
+                } else {
+                    // if adding, just add it to the end
+                    prinList.addTaggedItem(prinString, pppe);
+                }
+            }
+            infoDialog.dispose();
+        } catch (Exception ee) {
+            tw.displayErrorDialog(infoDialog, ee);
+        }
+    }
+}
+
+/**
+ * Event handler for AddPermOKButton button
+ */
+class NewPolicyPermOKButtonListener implements ActionListener {
+
+    private PolicyTool tool;
+    private ToolWindow tw;
+    private ToolDialog listDialog;
+    private ToolDialog infoDialog;
+    private boolean edit;
+
+    NewPolicyPermOKButtonListener(PolicyTool tool,
+                                ToolWindow tw,
+                                ToolDialog listDialog,
+                                ToolDialog infoDialog,
+                                boolean edit) {
+        this.tool = tool;
+        this.tw = tw;
+        this.listDialog = listDialog;
+        this.infoDialog = infoDialog;
+        this.edit = edit;
+    }
+
+    public void actionPerformed(ActionEvent e) {
+
+        try {
+            // read in the new permission info from Dialog Box
+            PolicyParser.PermissionEntry pppe =
+                        infoDialog.getPermFromDialog();
+
+            try {
+                tool.verifyPermission(pppe.permission, pppe.name, pppe.action);
+            } catch (ClassNotFoundException cnfe) {
+                MessageFormat form = new MessageFormat(PolicyTool.rb.getString
+                                ("Warning: Class not found: class"));
+                Object[] source = {pppe.permission};
+                tool.warnings.addElement(form.format(source));
+                tw.displayStatusDialog(infoDialog, form.format(source));
+            }
+
+            // add the permission to the GUI permission list
+            TaggedList permList =
+                (TaggedList)listDialog.getComponent(listDialog.PE_PERM_LIST);
+
+            String permString = ToolDialog.PermissionEntryToUserFriendlyString(pppe);
+            if (edit) {
+                // if editing, replace the original permission
+                int which = permList.getSelectedIndex();
+                permList.replaceTaggedItem(permString, pppe, which);
+            } else {
+                // if adding, just add it to the end
+                permList.addTaggedItem(permString, pppe);
+            }
+            infoDialog.dispose();
+
+        } catch (InvocationTargetException ite) {
+            tw.displayErrorDialog(infoDialog, ite.getTargetException());
+        } catch (Exception ee) {
+            tw.displayErrorDialog(infoDialog, ee);
+        }
+    }
+}
+
+/**
+ * Event handler for RemovePrinButton button
+ */
+class RemovePrinButtonListener implements ActionListener {
+
+    private PolicyTool tool;
+    private ToolWindow tw;
+    private ToolDialog td;
+    private boolean edit;
+
+    RemovePrinButtonListener(PolicyTool tool, ToolWindow tw,
+                                ToolDialog td, boolean edit) {
+        this.tool = tool;
+        this.tw = tw;
+        this.td = td;
+        this.edit = edit;
+    }
+
+    public void actionPerformed(ActionEvent e) {
+
+        // get the Principal selected from the Principal List
+        TaggedList prinList = (TaggedList)td.getComponent(td.PE_PRIN_LIST);
+        int prinIndex = prinList.getSelectedIndex();
+
+        if (prinIndex < 0) {
+            tw.displayErrorDialog(td, new Exception
+                (PolicyTool.rb.getString("No principal selected")));
+            return;
+        }
+        // remove the principal from the display
+        prinList.removeTaggedItem(prinIndex);
+    }
+}
+
+/**
+ * Event handler for RemovePermButton button
+ */
+class RemovePermButtonListener implements ActionListener {
+
+    private PolicyTool tool;
+    private ToolWindow tw;
+    private ToolDialog td;
+    private boolean edit;
+
+    RemovePermButtonListener(PolicyTool tool, ToolWindow tw,
+                                ToolDialog td, boolean edit) {
+        this.tool = tool;
+        this.tw = tw;
+        this.td = td;
+        this.edit = edit;
+    }
+
+    public void actionPerformed(ActionEvent e) {
+
+        // get the Permission selected from the Permission List
+        TaggedList permList = (TaggedList)td.getComponent(td.PE_PERM_LIST);
+        int permIndex = permList.getSelectedIndex();
+
+        if (permIndex < 0) {
+            tw.displayErrorDialog(td, new Exception
+                (PolicyTool.rb.getString("No permission selected")));
+            return;
+        }
+        // remove the permission from the display
+        permList.removeTaggedItem(permIndex);
+
+    }
+}
+
+/**
+ * Event handler for Edit Principal button
+ *
+ * We need the editPolicyEntry boolean to tell us if the user is
+ * adding a new PolicyEntry at this time, or editing an existing entry.
+ * If the user is adding a new PolicyEntry, we ONLY update the
+ * GUI listing.  If the user is editing an existing PolicyEntry, we
+ * update both the GUI listing and the actual PolicyEntry.
+ */
+class EditPrinButtonListener implements ActionListener {
+
+    private PolicyTool tool;
+    private ToolWindow tw;
+    private ToolDialog td;
+    private boolean editPolicyEntry;
+
+    EditPrinButtonListener(PolicyTool tool, ToolWindow tw,
+                                ToolDialog td, boolean editPolicyEntry) {
+        this.tool = tool;
+        this.tw = tw;
+        this.td = td;
+        this.editPolicyEntry = editPolicyEntry;
+    }
+
+    public void actionPerformed(ActionEvent e) {
+
+        // get the Principal selected from the Principal List
+        TaggedList list = (TaggedList)td.getComponent(td.PE_PRIN_LIST);
+        int prinIndex = list.getSelectedIndex();
+
+        if (prinIndex < 0) {
+            tw.displayErrorDialog(td, new Exception
+                (PolicyTool.rb.getString("No principal selected")));
+            return;
+        }
+        td.displayPrincipalDialog(editPolicyEntry, true);
+    }
+}
+
+/**
+ * Event handler for Edit Permission button
+ *
+ * We need the editPolicyEntry boolean to tell us if the user is
+ * adding a new PolicyEntry at this time, or editing an existing entry.
+ * If the user is adding a new PolicyEntry, we ONLY update the
+ * GUI listing.  If the user is editing an existing PolicyEntry, we
+ * update both the GUI listing and the actual PolicyEntry.
+ */
+class EditPermButtonListener implements ActionListener {
+
+    private PolicyTool tool;
+    private ToolWindow tw;
+    private ToolDialog td;
+    private boolean editPolicyEntry;
+
+    EditPermButtonListener(PolicyTool tool, ToolWindow tw,
+                                ToolDialog td, boolean editPolicyEntry) {
+        this.tool = tool;
+        this.tw = tw;
+        this.td = td;
+        this.editPolicyEntry = editPolicyEntry;
+    }
+
+    public void actionPerformed(ActionEvent e) {
+
+        // get the Permission selected from the Permission List
+        List list = (List)td.getComponent(td.PE_PERM_LIST);
+        int permIndex = list.getSelectedIndex();
+
+        if (permIndex < 0) {
+            tw.displayErrorDialog(td, new Exception
+                (PolicyTool.rb.getString("No permission selected")));
+            return;
+        }
+        td.displayPermissionDialog(editPolicyEntry, true);
+    }
+}
+
+/**
+ * Event handler for Principal Popup Menu
+ */
+class PrincipalTypeMenuListener implements ItemListener {
+
+    private ToolDialog td;
+
+    PrincipalTypeMenuListener(ToolDialog td) {
+        this.td = td;
+    }
+
+    public void itemStateChanged(ItemEvent e) {
+
+        Choice prin = (Choice)td.getComponent(td.PRD_PRIN_CHOICE);
+        TextField prinField =
+                        (TextField)td.getComponent(td.PRD_PRIN_TEXTFIELD);
+        TextField nameField =
+                        (TextField)td.getComponent(td.PRD_NAME_TEXTFIELD);
+
+        prin.getAccessibleContext().setAccessibleName(
+            PolicyTool.splitToWords((String)e.getItem()));
+        if (((String)e.getItem()).equals(td.PRIN_TYPE)) {
+            // ignore if they choose "Principal Type:" item
+            if (prinField.getText() != null &&
+                prinField.getText().length() > 0) {
+                Prin inputPrin = td.getPrin(prinField.getText(), true);
+                prin.select(inputPrin.CLASS);
+            }
+            return;
+        }
+
+        // if you change the principal, clear the name
+        if (prinField.getText().indexOf((String)e.getItem()) == -1) {
+            nameField.setText("");
+        }
+
+        // set the text in the textfield and also modify the
+        // pull-down choice menus to reflect the correct possible
+        // set of names and actions
+        Prin inputPrin = td.getPrin((String)e.getItem(), false);
+        if (inputPrin != null) {
+            prinField.setText(inputPrin.FULL_CLASS);
+        }
+    }
+}
+
+/**
+ * Event handler for Permission Popup Menu
+ */
+class PermissionMenuListener implements ItemListener {
+
+    private ToolDialog td;
+
+    PermissionMenuListener(ToolDialog td) {
+        this.td = td;
+    }
+
+    public void itemStateChanged(ItemEvent e) {
+
+        Choice perms = (Choice)td.getComponent(td.PD_PERM_CHOICE);
+        Choice names = (Choice)td.getComponent(td.PD_NAME_CHOICE);
+        Choice actions = (Choice)td.getComponent(td.PD_ACTIONS_CHOICE);
+        TextField nameField =
+                        (TextField)td.getComponent(td.PD_NAME_TEXTFIELD);
+        TextField actionsField =
+                        (TextField)td.getComponent(td.PD_ACTIONS_TEXTFIELD);
+        TextField permField = (TextField)td.getComponent(td.PD_PERM_TEXTFIELD);
+        TextField signedbyField =
+                        (TextField)td.getComponent(td.PD_SIGNEDBY_TEXTFIELD);
+
+        perms.getAccessibleContext().setAccessibleName(
+            PolicyTool.splitToWords((String)e.getItem()));
+
+        // ignore if they choose the 'Permission:' item
+        if (PolicyTool.collator.compare((String)e.getItem(), td.PERM) == 0) {
+            if (permField.getText() != null &&
+                permField.getText().length() > 0) {
+
+                Perm inputPerm = td.getPerm(permField.getText(), true);
+                if (inputPerm != null) {
+                    perms.select(inputPerm.CLASS);
+                }
+            }
+            return;
+        }
+
+        // if you change the permission, clear the name, actions, and signedBy
+        if (permField.getText().indexOf((String)e.getItem()) == -1) {
+            nameField.setText("");
+            actionsField.setText("");
+            signedbyField.setText("");
+        }
+
+        // set the text in the textfield and also modify the
+        // pull-down choice menus to reflect the correct possible
+        // set of names and actions
+
+        Perm inputPerm = td.getPerm((String)e.getItem(), false);
+        if (inputPerm == null) {
+            permField.setText("");
+        } else {
+            permField.setText(inputPerm.FULL_CLASS);
+        }
+        td.setPermissionNames(inputPerm, names, nameField);
+        td.setPermissionActions(inputPerm, actions, actionsField);
+    }
+}
+
+/**
+ * Event handler for Permission Name Popup Menu
+ */
+class PermissionNameMenuListener implements ItemListener {
+
+    private ToolDialog td;
+
+    PermissionNameMenuListener(ToolDialog td) {
+        this.td = td;
+    }
+
+    public void itemStateChanged(ItemEvent e) {
+
+        Choice names = (Choice)td.getComponent(td.PD_NAME_CHOICE);
+        names.getAccessibleContext().setAccessibleName(
+            PolicyTool.splitToWords((String)e.getItem()));
+
+        if (((String)e.getItem()).indexOf(td.PERM_NAME) != -1)
+            return;
+
+        TextField tf = (TextField)td.getComponent(td.PD_NAME_TEXTFIELD);
+        tf.setText((String)e.getItem());
+    }
+}
+
+/**
+ * Event handler for Permission Actions Popup Menu
+ */
+class PermissionActionsMenuListener implements ItemListener {
+
+    private ToolDialog td;
+
+    PermissionActionsMenuListener(ToolDialog td) {
+        this.td = td;
+    }
+
+    public void itemStateChanged(ItemEvent e) {
+
+        Choice actions = (Choice)td.getComponent(td.PD_ACTIONS_CHOICE);
+        actions.getAccessibleContext().setAccessibleName((String)e.getItem());
+
+        if (((String)e.getItem()).indexOf(td.PERM_ACTIONS) != -1)
+            return;
+
+        TextField tf = (TextField)td.getComponent(td.PD_ACTIONS_TEXTFIELD);
+        if (tf.getText() == null || tf.getText().equals("")) {
+            tf.setText((String)e.getItem());
+        } else {
+            if (tf.getText().indexOf((String)e.getItem()) == -1)
+                tf.setText(tf.getText() + ", " + (String)e.getItem());
+        }
+    }
+}
+
+/**
+ * Event handler for all the children dialogs/windows
+ */
+class ChildWindowListener implements WindowListener {
+
+    private ToolDialog td;
+
+    ChildWindowListener(ToolDialog td) {
+        this.td = td;
+    }
+
+    public void windowOpened(WindowEvent we) {
+    }
+
+    public void windowClosing(WindowEvent we) {
+        // same as pressing the "cancel" button
+        td.setVisible(false);
+        td.dispose();
+    }
+
+    public void windowClosed(WindowEvent we) {
+    }
+
+    public void windowIconified(WindowEvent we) {
+    }
+
+    public void windowDeiconified(WindowEvent we) {
+    }
+
+    public void windowActivated(WindowEvent we) {
+    }
+
+    public void windowDeactivated(WindowEvent we) {
+    }
+}
+
+/**
+ * Event handler for CancelButton button
+ */
+class CancelButtonListener implements ActionListener {
+
+    private ToolDialog td;
+
+    CancelButtonListener(ToolDialog td) {
+        this.td = td;
+    }
+
+    public void actionPerformed(ActionEvent e) {
+        td.setVisible(false);
+        td.dispose();
+    }
+}
+
+/**
+ * Event handler for ErrorOKButton button
+ */
+class ErrorOKButtonListener implements ActionListener {
+
+    private ToolDialog ed;
+
+    ErrorOKButtonListener(ToolDialog ed) {
+        this.ed = ed;
+    }
+
+    public void actionPerformed(ActionEvent e) {
+        ed.setVisible(false);
+        ed.dispose();
+    }
+}
+
+/**
+ * Event handler for StatusOKButton button
+ */
+class StatusOKButtonListener implements ActionListener {
+
+    private ToolDialog sd;
+
+    StatusOKButtonListener(ToolDialog sd) {
+        this.sd = sd;
+    }
+
+    public void actionPerformed(ActionEvent e) {
+        sd.setVisible(false);
+        sd.dispose();
+    }
+}
+
+/**
+ * Event handler for UserSaveYes button
+ */
+class UserSaveYesButtonListener implements ActionListener {
+
+    private ToolDialog us;
+    private PolicyTool tool;
+    private ToolWindow tw;
+    private int select;
+
+    UserSaveYesButtonListener(ToolDialog us, PolicyTool tool,
+                        ToolWindow tw, int select) {
+        this.us = us;
+        this.tool = tool;
+        this.tw = tw;
+        this.select = select;
+    }
+
+    public void actionPerformed(ActionEvent e) {
+
+        // first get rid of the window
+        us.setVisible(false);
+        us.dispose();
+
+        try {
+            String filename = ((TextField)
+                    tw.getComponent(tw.MW_FILENAME_TEXTFIELD)).getText();
+            if (filename == null || filename.equals("")) {
+                us.displaySaveAsDialog(select);
+
+                // the above dialog will continue with the originally
+                // requested command if necessary
+            } else {
+                // save the policy entries to a file
+                tool.savePolicy(filename);
+
+                // display status
+                MessageFormat form = new MessageFormat
+                        (PolicyTool.rb.getString
+                        ("Policy successfully written to filename"));
+                Object[] source = {filename};
+                tw.displayStatusDialog(null, form.format(source));
+
+                // now continue with the originally requested command
+                // (QUIT, NEW, or OPEN)
+                us.userSaveContinue(tool, tw, us, select);
+            }
+        } catch (Exception ee) {
+            // error -- just report it and bail
+            tw.displayErrorDialog(null, ee);
+        }
+    }
+}
+
+/**
+ * Event handler for UserSaveNoButton
+ */
+class UserSaveNoButtonListener implements ActionListener {
+
+    private PolicyTool tool;
+    private ToolWindow tw;
+    private ToolDialog us;
+    private int select;
+
+    UserSaveNoButtonListener(ToolDialog us, PolicyTool tool,
+                        ToolWindow tw, int select) {
+        this.us = us;
+        this.tool = tool;
+        this.tw = tw;
+        this.select = select;
+    }
+
+    public void actionPerformed(ActionEvent e) {
+        us.setVisible(false);
+        us.dispose();
+
+        // now continue with the originally requested command
+        // (QUIT, NEW, or OPEN)
+        us.userSaveContinue(tool, tw, us, select);
+    }
+}
+
+/**
+ * Event handler for UserSaveCancelButton
+ */
+class UserSaveCancelButtonListener implements ActionListener {
+
+    private ToolDialog us;
+
+    UserSaveCancelButtonListener(ToolDialog us) {
+        this.us = us;
+    }
+
+    public void actionPerformed(ActionEvent e) {
+        us.setVisible(false);
+        us.dispose();
+
+        // do NOT continue with the originally requested command
+        // (QUIT, NEW, or OPEN)
+    }
+}
+
+/**
+ * Event handler for ConfirmRemovePolicyEntryOKButtonListener
+ */
+class ConfirmRemovePolicyEntryOKButtonListener implements ActionListener {
+
+    private PolicyTool tool;
+    private ToolWindow tw;
+    private ToolDialog us;
+
+    ConfirmRemovePolicyEntryOKButtonListener(PolicyTool tool,
+                                ToolWindow tw, ToolDialog us) {
+        this.tool = tool;
+        this.tw = tw;
+        this.us = us;
+    }
+
+    public void actionPerformed(ActionEvent e) {
+        // remove the entry
+        List list = (List)tw.getComponent(tw.MW_POLICY_LIST);
+        int index = list.getSelectedIndex();
+        PolicyEntry entries[] = tool.getEntry();
+        tool.removeEntry(entries[index]);
+
+        // redraw the window listing
+        list = new List(40, false);
+        list.addActionListener(new PolicyListListener(tool, tw));
+        entries = tool.getEntry();
+        if (entries != null) {
+                for (int i = 0; i < entries.length; i++)
+                    list.add(entries[i].headerToString());
+        }
+        tw.replacePolicyList(list);
+        us.setVisible(false);
+        us.dispose();
+    }
+}
+
+/**
+ * Just a special name, so that the codes dealing with this exception knows
+ * it's special, and does not pop out a warning box.
+ */
+class NoDisplayException extends RuntimeException {
+
+}
+
+/**
+ * This is a java.awt.List that bind an Object to each String it holds.
+ */
+class TaggedList extends List {
+    private java.util.List<Object> data = new LinkedList<Object>();
+    public TaggedList(int i, boolean b) {
+        super(i, b);
+    }
+
+    public Object getObject(int index) {
+        return data.get(index);
+    }
+
+    @Override @Deprecated public void add(String string) {
+        throw new AssertionError("should not call add in TaggedList");
+    }
+    public void addTaggedItem(String string, Object object) {
+        super.add(string);
+        data.add(object);
+    }
+
+    @Override @Deprecated public void replaceItem(String string, int index) {
+        throw new AssertionError("should not call replaceItem in TaggedList");
+    }
+    public void replaceTaggedItem(String string, Object object, int index) {
+        super.replaceItem(string, index);
+        data.set(index, object);
+    }
+
+    @Override @Deprecated public void remove(int index) {
+        // Cannot throw AssertionError, because replaceItem() call remove() internally
+        super.remove(index);
+    }
+    public void removeTaggedItem(int index) {
+        super.remove(index);
+        data.remove(index);
+    }
+}
+
+/**
+ * Convenience Principal Classes
+ */
+
+class Prin {
+    public final String CLASS;
+    public final String FULL_CLASS;
+
+    public Prin(String clazz, String fullClass) {
+        this.CLASS = clazz;
+        this.FULL_CLASS = fullClass;
+    }
+}
+
+class KrbPrin extends Prin {
+    public KrbPrin() {
+        super("KerberosPrincipal",
+                "javax.security.auth.kerberos.KerberosPrincipal");
+    }
+}
+
+class X500Prin extends Prin {
+    public X500Prin() {
+        super("X500Principal",
+                "javax.security.auth.x500.X500Principal");
+    }
+}
+
+/**
+ * Convenience Permission Classes
+ */
+
+class Perm {
+    public final String CLASS;
+    public final String FULL_CLASS;
+    public final String[] TARGETS;
+    public final String[] ACTIONS;
+
+    public Perm(String clazz, String fullClass,
+                String[] targets, String[] actions) {
+
+        this.CLASS = clazz;
+        this.FULL_CLASS = fullClass;
+        this.TARGETS = targets;
+        this.ACTIONS = actions;
+    }
+}
+
+class AllPerm extends Perm {
+    public AllPerm() {
+        super("AllPermission", "java.security.AllPermission", null, null);
+    }
+}
+
+class AudioPerm extends Perm {
+    public AudioPerm() {
+        super("AudioPermission",
+        "javax.sound.sampled.AudioPermission",
+        new String[]    {
+                "play",
+                "record"
+                },
+        null);
+    }
+}
+
+class AuthPerm extends Perm {
+    public AuthPerm() {
+    super("AuthPermission",
+        "javax.security.auth.AuthPermission",
+        new String[]    {
+                "doAs",
+                "doAsPrivileged",
+                "getSubject",
+                "getSubjectFromDomainCombiner",
+                "setReadOnly",
+                "modifyPrincipals",
+                "modifyPublicCredentials",
+                "modifyPrivateCredentials",
+                "refreshCredential",
+                "destroyCredential",
+                "createLoginContext.<" + PolicyTool.rb.getString("name") + ">",
+                "getLoginConfiguration",
+                "setLoginConfiguration",
+                "createLoginConfiguration.<" +
+                        PolicyTool.rb.getString("configuration type") + ">",
+                "refreshLoginConfiguration"
+                },
+        null);
+    }
+}
+
+class AWTPerm extends Perm {
+    public AWTPerm() {
+    super("AWTPermission",
+        "java.awt.AWTPermission",
+        new String[]    {
+                "accessClipboard",
+                "accessEventQueue",
+                "accessSystemTray",
+                "createRobot",
+                "fullScreenExclusive",
+                "listenToAllAWTEvents",
+                "readDisplayPixels",
+                "replaceKeyboardFocusManager",
+                "setAppletStub",
+                "setWindowAlwaysOnTop",
+                "showWindowWithoutWarningBanner",
+                "toolkitModality",
+                "watchMousePointer"
+        },
+        null);
+    }
+}
+
+class DelegationPerm extends Perm {
+    public DelegationPerm() {
+    super("DelegationPermission",
+        "javax.security.auth.kerberos.DelegationPermission",
+        new String[]    {
+                // allow user input
+                },
+        null);
+    }
+}
+
+class FilePerm extends Perm {
+    public FilePerm() {
+    super("FilePermission",
+        "java.io.FilePermission",
+        new String[]    {
+                "<<ALL FILES>>"
+                },
+        new String[]    {
+                "read",
+                "write",
+                "delete",
+                "execute"
+                });
+    }
+}
+
+class InqSecContextPerm extends Perm {
+    public InqSecContextPerm() {
+    super("InquireSecContextPermission",
+        "com.sun.security.jgss.InquireSecContextPermission",
+        new String[]    {
+                "KRB5_GET_SESSION_KEY",
+                "KRB5_GET_TKT_FLAGS",
+                "KRB5_GET_AUTHZ_DATA",
+                "KRB5_GET_AUTHTIME"
+                },
+        null);
+    }
+}
+
+class LogPerm extends Perm {
+    public LogPerm() {
+    super("LoggingPermission",
+        "java.util.logging.LoggingPermission",
+        new String[]    {
+                "control"
+                },
+        null);
+    }
+}
+
+class MgmtPerm extends Perm {
+    public MgmtPerm() {
+    super("ManagementPermission",
+        "java.lang.management.ManagementPermission",
+        new String[]    {
+                "control",
+                "monitor"
+                },
+        null);
+    }
+}
+
+class MBeanPerm extends Perm {
+    public MBeanPerm() {
+    super("MBeanPermission",
+        "javax.management.MBeanPermission",
+        new String[]    {
+                // allow user input
+                },
+        new String[]    {
+                "addNotificationListener",
+                "getAttribute",
+                "getClassLoader",
+                "getClassLoaderFor",
+                "getClassLoaderRepository",
+                "getDomains",
+                "getMBeanInfo",
+                "getObjectInstance",
+                "instantiate",
+                "invoke",
+                "isInstanceOf",
+                "queryMBeans",
+                "queryNames",
+                "registerMBean",
+                "removeNotificationListener",
+                "setAttribute",
+                "unregisterMBean"
+                });
+    }
+}
+
+class MBeanSvrPerm extends Perm {
+    public MBeanSvrPerm() {
+    super("MBeanServerPermission",
+        "javax.management.MBeanServerPermission",
+        new String[]    {
+                "createMBeanServer",
+                "findMBeanServer",
+                "newMBeanServer",
+                "releaseMBeanServer"
+                },
+        null);
+    }
+}
+
+class MBeanTrustPerm extends Perm {
+    public MBeanTrustPerm() {
+    super("MBeanTrustPermission",
+        "javax.management.MBeanTrustPermission",
+        new String[]    {
+                "register"
+                },
+        null);
+    }
+}
+
+class NetPerm extends Perm {
+    public NetPerm() {
+    super("NetPermission",
+        "java.net.NetPermission",
+        new String[]    {
+                "setDefaultAuthenticator",
+                "requestPasswordAuthentication",
+                "specifyStreamHandler",
+                "setProxySelector",
+                "getProxySelector",
+                "setCookieHandler",
+                "getCookieHandler",
+                "setResponseCache",
+                "getResponseCache"
+                },
+        null);
+    }
+}
+
+class PrivCredPerm extends Perm {
+    public PrivCredPerm() {
+    super("PrivateCredentialPermission",
+        "javax.security.auth.PrivateCredentialPermission",
+        new String[]    {
+                // allow user input
+                },
+        new String[]    {
+                "read"
+                });
+    }
+}
+
+class PropPerm extends Perm {
+    public PropPerm() {
+    super("PropertyPermission",
+        "java.util.PropertyPermission",
+        new String[]    {
+                // allow user input
+                },
+        new String[]    {
+                "read",
+                "write"
+                });
+    }
+}
+
+class ReflectPerm extends Perm {
+    public ReflectPerm() {
+    super("ReflectPermission",
+        "java.lang.reflect.ReflectPermission",
+        new String[]    {
+                "suppressAccessChecks"
+                },
+        null);
+    }
+}
+
+class RuntimePerm extends Perm {
+    public RuntimePerm() {
+    super("RuntimePermission",
+        "java.lang.RuntimePermission",
+        new String[]    {
+                "createClassLoader",
+                "getClassLoader",
+                "setContextClassLoader",
+                "enableContextClassLoaderOverride",
+                "setSecurityManager",
+                "createSecurityManager",
+                "getenv.<" +
+                    PolicyTool.rb.getString("environment variable name") + ">",
+                "exitVM",
+                "shutdownHooks",
+                "setFactory",
+                "setIO",
+                "modifyThread",
+                "stopThread",
+                "modifyThreadGroup",
+                "getProtectionDomain",
+                "readFileDescriptor",
+                "writeFileDescriptor",
+                "loadLibrary.<" +
+                    PolicyTool.rb.getString("library name") + ">",
+                "accessClassInPackage.<" +
+                    PolicyTool.rb.getString("package name")+">",
+                "defineClassInPackage.<" +
+                    PolicyTool.rb.getString("package name")+">",
+                "accessDeclaredMembers",
+                "queuePrintJob",
+                "getStackTrace",
+                "setDefaultUncaughtExceptionHandler",
+                "preferences",
+                "usePolicy",
+                // "inheritedChannel"
+                },
+        null);
+    }
+}
+
+class SecurityPerm extends Perm {
+    public SecurityPerm() {
+    super("SecurityPermission",
+        "java.security.SecurityPermission",
+        new String[]    {
+                "createAccessControlContext",
+                "getDomainCombiner",
+                "getPolicy",
+                "setPolicy",
+                "createPolicy.<" +
+                    PolicyTool.rb.getString("policy type") + ">",
+                "getProperty.<" +
+                    PolicyTool.rb.getString("property name") + ">",
+                "setProperty.<" +
+                    PolicyTool.rb.getString("property name") + ">",
+                "insertProvider.<" +
+                    PolicyTool.rb.getString("provider name") + ">",
+                "removeProvider.<" +
+                    PolicyTool.rb.getString("provider name") + ">",
+                //"setSystemScope",
+                //"setIdentityPublicKey",
+                //"setIdentityInfo",
+                //"addIdentityCertificate",
+                //"removeIdentityCertificate",
+                //"printIdentity",
+                "clearProviderProperties.<" +
+                    PolicyTool.rb.getString("provider name") + ">",
+                "putProviderProperty.<" +
+                    PolicyTool.rb.getString("provider name") + ">",
+                "removeProviderProperty.<" +
+                    PolicyTool.rb.getString("provider name") + ">",
+                //"getSignerPrivateKey",
+                //"setSignerKeyPair"
+                },
+        null);
+    }
+}
+
+class SerialPerm extends Perm {
+    public SerialPerm() {
+    super("SerializablePermission",
+        "java.io.SerializablePermission",
+        new String[]    {
+                "enableSubclassImplementation",
+                "enableSubstitution"
+                },
+        null);
+    }
+}
+
+class ServicePerm extends Perm {
+    public ServicePerm() {
+    super("ServicePermission",
+        "javax.security.auth.kerberos.ServicePermission",
+        new String[]    {
+                // allow user input
+                },
+        new String[]    {
+                "initiate",
+                "accept"
+                });
+    }
+}
+
+class SocketPerm extends Perm {
+    public SocketPerm() {
+    super("SocketPermission",
+        "java.net.SocketPermission",
+        new String[]    {
+                // allow user input
+                },
+        new String[]    {
+                "accept",
+                "connect",
+                "listen",
+                "resolve"
+                });
+    }
+}
+
+class SQLPerm extends Perm {
+    public SQLPerm() {
+    super("SQLPermission",
+        "java.sql.SQLPermission",
+        new String[]    {
+                "setLog"
+                },
+        null);
+    }
+}
+
+class SSLPerm extends Perm {
+    public SSLPerm() {
+    super("SSLPermission",
+        "javax.net.ssl.SSLPermission",
+        new String[]    {
+                "setHostnameVerifier",
+                "getSSLSessionContext"
+                },
+        null);
+    }
+}
+
+class SubjDelegPerm extends Perm {
+    public SubjDelegPerm() {
+    super("SubjectDelegationPermission",
+        "javax.management.remote.SubjectDelegationPermission",
+        new String[]    {
+                // allow user input
+                },
+        null);
+    }
+}
--- a/jdk/src/share/classes/sun/security/validator/PKIXValidator.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/share/classes/sun/security/validator/PKIXValidator.java	Wed Jul 21 09:57:21 2010 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2002, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -53,7 +53,7 @@
     private int certPathLength = -1;
 
     // needed only for the validator
-    private Map<X500Principal, X509Certificate> trustedSubjects;
+    private Map<X500Principal, List<PublicKey>> trustedSubjects;
     private CertificateFactory factory;
 
     private boolean plugin = false;
@@ -95,9 +95,17 @@
         if (TRY_VALIDATOR == false) {
             return;
         }
-        trustedSubjects = new HashMap<X500Principal, X509Certificate>();
+        trustedSubjects = new HashMap<X500Principal, List<PublicKey>>();
         for (X509Certificate cert : trustedCerts) {
-            trustedSubjects.put(cert.getSubjectX500Principal(), cert);
+            X500Principal dn = cert.getSubjectX500Principal();
+            List<PublicKey> keys;
+            if (trustedSubjects.containsKey(dn)) {
+                keys = trustedSubjects.get(dn);
+            } else {
+                keys = new ArrayList<PublicKey>();
+                trustedSubjects.put(dn, keys);
+            }
+            keys.add(cert.getPublicKey());
         }
         try {
             factory = CertificateFactory.getInstance("X.509");
@@ -155,16 +163,27 @@
             X500Principal prevIssuer = null;
             for (int i = 0; i < chain.length; i++) {
                 X509Certificate cert = chain[i];
+                X500Principal dn = cert.getSubjectX500Principal();
                 if (i != 0 &&
-                    !cert.getSubjectX500Principal().equals(prevIssuer)) {
+                    !dn.equals(prevIssuer)) {
                     // chain is not ordered correctly, call builder instead
                     return doBuild(chain, otherCerts);
                 }
-                if (trustedCerts.contains(cert)) {
+
+                // Check if chain[i] is already trusted. It may be inside
+                // trustedCerts, or has the same dn and public key as a cert
+                // inside trustedCerts. The latter happens when a CA has
+                // updated its cert with a stronger signature algorithm in JRE
+                // but the weak one is still in circulation.
+
+                if (trustedCerts.contains(cert) ||          // trusted cert
+                        (trustedSubjects.containsKey(dn) && // replacing ...
+                         trustedSubjects.get(dn).contains(  // ... weak cert
+                            cert.getPublicKey()))) {
                     if (i == 0) {
                         return new X509Certificate[] {chain[0]};
                     }
-                    // Remove and call validator
+                    // Remove and call validator on partial chain [0 .. i-1]
                     X509Certificate[] newChain = new X509Certificate[i];
                     System.arraycopy(chain, 0, newChain, 0, i);
                     return doValidate(newChain);
@@ -214,14 +233,17 @@
         return doBuild(chain, otherCerts);
     }
 
-    private boolean isSignatureValid(X509Certificate iss, X509Certificate sub) {
+    private boolean isSignatureValid(List<PublicKey> keys, X509Certificate sub) {
         if (plugin) {
-            try {
-                sub.verify(iss.getPublicKey());
-            } catch (Exception ex) {
-                return false;
+            for (PublicKey key: keys) {
+                try {
+                    sub.verify(key);
+                    return true;
+                } catch (Exception ex) {
+                    continue;
+                }
             }
-            return true;
+            return false;
         }
         return true; // only check if PLUGIN is set
     }
--- a/jdk/src/share/classes/sun/swing/SwingUtilities2.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/share/classes/sun/swing/SwingUtilities2.java	Wed Jul 21 09:57:21 2010 -0700
@@ -44,6 +44,8 @@
 import javax.swing.text.DefaultHighlighter;
 import javax.swing.text.DefaultCaret;
 import javax.swing.table.TableCellRenderer;
+import javax.swing.table.TableColumnModel;
+
 import sun.swing.PrintColorUIResource;
 import sun.swing.ImageIconUIResource;
 import sun.print.ProxyPrintGraphics;
@@ -107,6 +109,12 @@
                           new StringBuffer("AATextInfoPropertyKey");
 
     /**
+     * Attribute key for the content elements.  If it is set on an element, the
+     * element is considered to be a line break.
+     */
+    public static final String IMPLIED_CR = "CR";
+
+    /**
      * Used to tell a text component, being used as an editor for table
      * or tree, how many clicks it took to start editing.
      */
@@ -430,8 +438,12 @@
         // c may be null here.
         String clipString = "...";
         availTextWidth -= SwingUtilities2.stringWidth(c, fm, clipString);
+        if (availTextWidth <= 0) {
+            //can not fit any characters
+            return clipString;
+        }
+
         boolean needsTextLayout;
-
         synchronized (charsBufferLock) {
             int stringLength = syncCharsBuffer(string);
             needsTextLayout =
@@ -1807,4 +1819,54 @@
                                          boolean three) {
         return liesIn(rect, p, false, false, three);
     }
+
+    /**
+     * Maps the index of the column in the view at
+     * {@code viewColumnIndex} to the index of the column
+     * in the table model.  Returns the index of the corresponding
+     * column in the model.  If {@code viewColumnIndex}
+     * is less than zero, returns {@code viewColumnIndex}.
+     *
+     * @param cm the table model
+     * @param   viewColumnIndex     the index of the column in the view
+     * @return  the index of the corresponding column in the model
+     *
+     * @see JTable#convertColumnIndexToModel(int)
+     * @see javax.swing.plaf.basic.BasicTableHeaderUI
+     */
+    public static int convertColumnIndexToModel(TableColumnModel cm,
+                                                int viewColumnIndex) {
+        if (viewColumnIndex < 0) {
+            return viewColumnIndex;
+        }
+        return cm.getColumn(viewColumnIndex).getModelIndex();
+    }
+
+    /**
+     * Maps the index of the column in the {@code cm} at
+     * {@code modelColumnIndex} to the index of the column
+     * in the view.  Returns the index of the
+     * corresponding column in the view; returns {@code -1} if this column
+     * is not being displayed. If {@code modelColumnIndex} is less than zero,
+     * returns {@code modelColumnIndex}.
+     *
+     * @param cm the table model
+     * @param modelColumnIndex the index of the column in the model
+     * @return the index of the corresponding column in the view
+     *
+     * @see JTable#convertColumnIndexToView(int)
+     * @see javax.swing.plaf.basic.BasicTableHeaderUI
+     */
+    public static int convertColumnIndexToView(TableColumnModel cm,
+                                        int modelColumnIndex) {
+        if (modelColumnIndex < 0) {
+            return modelColumnIndex;
+        }
+        for (int column = 0; column < cm.getColumnCount(); column++) {
+            if (cm.getColumn(column).getModelIndex() == modelColumnIndex) {
+                return column;
+            }
+        }
+        return -1;
+    }
 }
--- a/jdk/src/share/classes/sun/swing/plaf/synth/SynthFileChooserUIImpl.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/share/classes/sun/swing/plaf/synth/SynthFileChooserUIImpl.java	Wed Jul 21 09:57:21 2010 -0700
@@ -788,7 +788,7 @@
             // for example /foo/bar/ becomes /foo/bar
             File canonical;
             try {
-                canonical = directory.getCanonicalFile();
+                canonical = ShellFolder.getNormalizedFile(directory);
             } catch (IOException e) {
                 // Maybe drive is not ready. Can't abort here.
                 canonical = directory;
--- a/jdk/src/share/classes/sun/swing/table/DefaultTableCellHeaderRenderer.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/share/classes/sun/swing/table/DefaultTableCellHeaderRenderer.java	Wed Jul 21 09:57:21 2010 -0700
@@ -24,6 +24,8 @@
  */
 package sun.swing.table;
 
+import sun.swing.DefaultLookup;
+
 import java.awt.Component;
 import java.awt.Color;
 import java.awt.FontMetrics;
@@ -31,12 +33,11 @@
 import java.awt.Insets;
 import java.awt.Point;
 import java.awt.Rectangle;
+import java.io.Serializable;
 import javax.swing.*;
 import javax.swing.plaf.UIResource;
 import javax.swing.border.Border;
 import javax.swing.table.*;
-import sun.swing.DefaultLookup;
-
 
 public class DefaultTableCellHeaderRenderer extends DefaultTableCellRenderer
         implements UIResource {
@@ -126,7 +127,7 @@
 
     public static SortOrder getColumnSortOrder(JTable table, int column) {
         SortOrder rv = null;
-        if (table.getRowSorter() == null) {
+        if (table == null || table.getRowSorter() == null) {
             return rv;
         }
         java.util.List<? extends RowSorter.SortKey> sortKeys =
@@ -186,7 +187,7 @@
         return new Point(x, y);
     }
 
-    private class EmptyIcon implements Icon {
+    private class EmptyIcon implements Icon, Serializable {
         int width = 0;
         int height = 0;
         public void paintIcon(Component c, Graphics g, int x, int y) {}
--- a/jdk/src/share/classes/sun/tools/jar/Main.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/share/classes/sun/tools/jar/Main.java	Wed Jul 21 09:57:21 2010 -0700
@@ -306,28 +306,28 @@
             for (int i = 0; i < flags.length(); i++) {
                 switch (flags.charAt(i)) {
                 case 'c':
-                    if (xflag || tflag || uflag) {
+                    if (xflag || tflag || uflag || iflag) {
                         usageError();
                         return false;
                     }
                     cflag = true;
                     break;
                 case 'u':
-                    if (cflag || xflag || tflag) {
+                    if (cflag || xflag || tflag || iflag) {
                         usageError();
                         return false;
                     }
                     uflag = true;
                     break;
                 case 'x':
-                    if (cflag || uflag || tflag) {
+                    if (cflag || uflag || tflag || iflag) {
                         usageError();
                         return false;
                     }
                     xflag = true;
                     break;
                 case 't':
-                    if (cflag || uflag || xflag) {
+                    if (cflag || uflag || xflag || iflag) {
                         usageError();
                         return false;
                     }
@@ -349,6 +349,10 @@
                     flag0 = true;
                     break;
                 case 'i':
+                    if (cflag || uflag || xflag || tflag) {
+                        usageError();
+                        return false;
+                    }
                     // do not increase the counter, files will contain rootjar
                     rootjar = args[count++];
                     iflag = true;
--- a/jdk/src/share/classes/sun/tools/jstat/Arguments.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/share/classes/sun/tools/jstat/Arguments.java	Wed Jul 21 09:57:21 2010 -0700
@@ -47,6 +47,7 @@
 
     private static final String JVMSTAT_USERDIR = ".jvmstat";
     private static final String OPTIONS_FILENAME = "jstat_options";
+    private static final String UNSUPPORTED_OPTIONS_FILENAME = "jstat_unsupported_options";
     private static final String ALL_NAMES = "\\w*";
 
     private Comparator<Monitor> comparator;
@@ -411,8 +412,8 @@
         return optionFormat;
     }
 
-    public URL[] optionsSources() {
-        URL[] sources = new URL[2];
+    public List<URL> optionsSources() {
+        List<URL> sources = new ArrayList<URL>();
         int i = 0;
 
         String filename = OPTIONS_FILENAME;
@@ -421,7 +422,7 @@
             String userHome = System.getProperty("user.home");
             String userDir = userHome + "/" + JVMSTAT_USERDIR;
             File home = new File(userDir + "/" + filename);
-            sources[i++] = home.toURL();
+            sources.add(home.toURI().toURL());
         } catch (Exception e) {
             if (debug) {
                 System.err.println(e.getMessage());
@@ -430,8 +431,15 @@
             throw new IllegalArgumentException("Internal Error: Bad URL: "
                                                + e.getMessage());
         }
-        sources[i] = this.getClass().getResource("resources/" + filename);
-        assert sources[i] != null;
+        URL u = this.getClass().getResource("resources/" + filename);
+        assert u != null;
+        sources.add(u);
+
+        if (showUnsupported) {
+            u = this.getClass().getResource("resources/" +  UNSUPPORTED_OPTIONS_FILENAME);
+            assert u != null;
+            sources.add(u);
+        }
         return sources;
     }
 }
--- a/jdk/src/share/classes/sun/tools/jstat/ExpressionResolver.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/share/classes/sun/tools/jstat/ExpressionResolver.java	Wed Jul 21 09:57:21 2010 -0700
@@ -26,7 +26,6 @@
 package sun.tools.jstat;
 
 import sun.jvmstat.monitor.*;
-import sun.management.counter.Variability;
 
 /**
  * A class implementing the ExpressionEvaluator to resolve unresolved
--- a/jdk/src/share/classes/sun/tools/jstat/JStatLogger.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/share/classes/sun/tools/jstat/JStatLogger.java	Wed Jul 21 09:57:21 2010 -0700
@@ -29,8 +29,6 @@
 import java.io.*;
 import sun.jvmstat.monitor.*;
 import sun.jvmstat.monitor.event.*;
-import sun.management.counter.Units;
-import sun.management.counter.Variability;
 import java.util.regex.PatternSyntaxException;
 
 /**
--- a/jdk/src/share/classes/sun/tools/jstat/Jstat.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/share/classes/sun/tools/jstat/Jstat.java	Wed Jul 21 09:57:21 2010 -0700
@@ -28,8 +28,6 @@
 import java.util.*;
 import sun.jvmstat.monitor.*;
 import sun.jvmstat.monitor.event.*;
-import sun.management.counter.Variability;
-import sun.management.counter.Units;
 
 /**
  * Application to output jvmstat statistics exported by a target Java
--- a/jdk/src/share/classes/sun/tools/jstat/OptionFinder.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/share/classes/sun/tools/jstat/OptionFinder.java	Wed Jul 21 09:57:21 2010 -0700
@@ -39,9 +39,9 @@
 
     private static final boolean debug = false;
 
-    URL[] optionsSources;
+    List<URL> optionsSources;
 
-    public OptionFinder(URL[] optionsSources) {
+    public OptionFinder(List<URL> optionsSources) {
         this.optionsSources = optionsSources;
     }
 
@@ -59,24 +59,25 @@
         return of;
     }
 
-    protected OptionFormat getOptionFormat(String option, URL[] sources) {
+    protected OptionFormat getOptionFormat(String option, List<URL> sources) {
         OptionFormat of = null;
-        for (int i = 0; (i < sources.length) && (of == null); i++) {
+        for (URL u : sources) {
             try {
-                URL u = sources[i];
                 Reader r = new BufferedReader(
                         new InputStreamReader(u.openStream()));
                 of = new Parser(r).parse(option);
+                if (of != null)
+                    break;
             } catch (IOException e) {
                 if (debug) {
-                    System.err.println("Error processing " + sources[i]
+                    System.err.println("Error processing " + u
                                        + " : " + e.getMessage());
                     e.printStackTrace();
                 }
             } catch (ParserException e) {
                 // Exception in parsing the options file.
-                System.err.println(sources[i] + ": " + e.getMessage());
-                System.err.println("Parsing of " + sources[i] + " aborted");
+                System.err.println(u + ": " + e.getMessage());
+                System.err.println("Parsing of " + u + " aborted");
             }
         }
         return of;
--- a/jdk/src/share/classes/sun/tools/jstat/OptionLister.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/share/classes/sun/tools/jstat/OptionLister.java	Wed Jul 21 09:57:21 2010 -0700
@@ -37,9 +37,9 @@
  */
 public class OptionLister {
     private static final boolean debug = false;
-    private URL[] sources;
+    private List<URL> sources;
 
-    public OptionLister(URL[] sources) {
+    public OptionLister(List<URL> sources) {
         this.sources = sources;
     }
 
@@ -54,9 +54,8 @@
 
         Set<OptionFormat> options = new TreeSet<OptionFormat>(c);
 
-        for (int i = 0; i < sources.length; i++) {
+        for (URL u : sources) {
             try {
-                URL u = sources[i];
                 Reader r = new BufferedReader(
                         new InputStreamReader(u.openStream()));
                 Set<OptionFormat> s = new Parser(r).parseOptions();
@@ -68,8 +67,8 @@
                 }
             } catch (ParserException e) {
                 // Exception in parsing the options file.
-                System.err.println(sources[i] + ": " + e.getMessage());
-                System.err.println("Parsing of " + sources[i] + " aborted");
+                System.err.println(u + ": " + e.getMessage());
+                System.err.println("Parsing of " + u + " aborted");
             }
         }
 
--- a/jdk/src/share/classes/sun/tools/jstat/resources/jstat_options	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/share/classes/sun/tools/jstat/resources/jstat_options	Wed Jul 21 09:57:21 2010 -0700
@@ -37,7 +37,7 @@
 option class {
   column {
     header "^Loaded^"	/* Number of classes loaded */
-    data java.cls.loadedClasses
+    data (java.cls.loadedClasses + java.cls.sharedLoadedClasses)
     align right
     scale raw
     width 5
@@ -45,7 +45,7 @@
   }
   column {
     header "^Bytes^"	/* Accumulated Size of classes loaded */
-    data sun.cls.loadedBytes
+    data (sun.cls.loadedBytes + sun.cls.sharedLoadedBytes)
     align right
     scale K
     width 7
@@ -53,7 +53,7 @@
   }
   column {
     header "^Unloaded^"	/* Number of classes unloaded */
-    data java.cls.unloadedClasses
+    data (java.cls.unloadedClasses + java.cls.sharedUnloadedClasses)
     align right
     width 5
     scale raw
@@ -61,7 +61,7 @@
   }
   column {
     header "^Bytes^"	/* Accumulated size of classes unloaded */
-    data sun.cls.unloadedBytes
+    data (sun.cls.unloadedBytes + sun.cls.sharedUnloadedBytes)
     align right
     scale K
     width 7
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/src/share/classes/sun/tools/jstat/resources/jstat_unsupported_options	Wed Jul 21 09:57:21 2010 -0700
@@ -0,0 +1,228 @@
+/*
+ * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+option classload {
+  column {
+    header "^Loaded^"	/* Number of classes loaded */
+    data (java.cls.loadedClasses + java.cls.sharedLoadedClasses)
+    align right
+    scale raw
+    width 5
+    format "0"
+  }
+  column {
+    header "Time^"	/* Accumulated time for class loading */
+    data sun.cls.time/sun.os.hrt.frequency
+    scale sec
+    align right
+    width 10
+    format "0.000"
+  }
+  column {
+    header "^Inited^"	/* Number of initialized classes */
+    data sun.cls.initializedClasses
+    align right
+    scale raw
+    width 5
+    format "0"
+  }
+  column {
+    header "Time^"	/* Accumulated time for class initialization */
+    data sun.cls.classInitTime.self/sun.os.hrt.frequency
+    scale raw
+    align right
+    width 10
+    format "0.000"
+  }
+  column {
+    header "Shared^"	/* Number of system classes loaded from shared archive */
+    data java.cls.sharedLoadedClasses
+    align right
+    scale raw
+    width 5
+    format "0"
+  }
+  column {
+    header "Kbytes^"	/* Accumulated Size of classes loaded */
+    data sun.cls.sharedLoadedBytes
+    align right
+    scale K
+    width 7
+    format "0.0"
+  }
+  column {
+    header "LoadTime^"	/* Accumulated time for loading classes from shared archive */
+    data sun.cls.sharedClassLoadTime/sun.os.hrt.frequency
+    scale raw
+    align right
+    width 10
+    format "0.000"
+  }
+  column {
+    header "^SysClass^"	/* Number of system classes loaded */
+    data java.cls.loadedClasses
+    align right
+    scale raw
+    width 5
+    format "0"
+  }
+  column {
+    header "Kbytes^"	/* Bytes read from system class files */
+    data sun.cls.sysClassBytes
+    align right
+    scale K
+    width 7
+    format "0.0"
+  }
+  column {
+    header "LoadTime^"	/* Accumulated time for loading non-shared system classes */
+    data sun.cls.sysClassLoadTime/sun.os.hrt.frequency
+    scale raw
+    align right
+    width 10
+    format "0.000"
+  }
+  column {
+    header "Lookup^"	/* Time spent in looking up/reading of system classes */
+    data sun.cls.lookupSysClassTime/sun.os.hrt.frequency
+    scale raw
+    align right
+    width 10
+    format "0.000"
+  }
+  column {
+    header "Parse^"	/* Time spent in parsing system classes */
+    data sun.cls.parseClassTime.self/sun.os.hrt.frequency
+    scale raw
+    align right
+    width 10
+    format "0.000"
+  }
+  column {
+    header "^Linked^"	/* Number of linked classes */
+    data sun.cls.linkedClasses
+    align right
+    scale raw
+    width 5
+    format "0"
+  }
+  column {
+    header "Time^"	/* Accumulated time for class linking */
+    data sun.cls.classInitTime.self/sun.os.hrt.frequency
+    scale raw
+    align right
+    width 10
+    format "0.000"
+  }
+  column {
+    header "^Verified^"	/* Number of verified classes */
+    data sun.cls.verifiedClasses
+    align right
+    scale raw
+    width 5
+    format "0"
+  }
+  column {
+    header "Time^"	/* Accumulated time for class verification */
+    data sun.cls.classVerifyTime.self/sun.os.hrt.frequency
+    scale raw
+    align right
+    width 10
+    format "0.000"
+  }
+  column {
+    header "AppClass^"	/* Number of loaded application classes */
+    data sun.cls.appClassLoadCount
+    align right
+    scale raw
+    width 5
+    format "0"
+  }
+  column {
+    header "Kbytes^"	/* Bytes read from app class files */
+    data sun.cls.appClassBytes
+    align right
+    scale K
+    width 7
+    format "0.0"
+  }
+  column {
+    header "AppCL^"	/* Accumulated time for loading app classes */
+    data sun.cls.appClassLoadTime/sun.os.hrt.frequency
+    scale raw
+    align right
+    width 10
+    format "0.000"
+  }
+  column {
+    header "^DefineClass^"	/* Number of defineClass calls */
+    data sun.cls.defineAppClasses
+    align right
+    scale raw
+    width 5
+    format "0"
+  }
+  column {
+    header "Time^"	/* Accumulated time for defineClass */
+    data sun.cls.defineAppClassTime.self/sun.os.hrt.frequency
+    scale raw
+    align right
+    width 10
+    format "0.000"
+  }
+  column {
+    header "^FindClass^"	/* Number of findClass calls */
+    data sun.classloader.findClasses
+    align right
+    scale raw
+    width 5
+    format "0"
+  }
+  column {
+    header "Time^"	/* Accumulated time for findClass */
+    data sun.classloader.findClassTime/1000000000
+    scale raw
+    align right
+    width 10
+    format "0.000"
+  }
+  column {
+    header "Delegation^"	/* Parent class loader delegation time */
+    data sun.classloader.parentDelegationTime/1000000000
+    scale raw 
+    align right
+    width 10
+    format "0.000"
+  }
+  column {
+    header "URLCL Read^"	/* Accumulated time for URLClassLoader reading bytes */
+    data sun.urlClassLoader.readClassBytesTime/1000000000
+    scale raw
+    align right
+    width 10
+    format "0.000"
+  }
+}
+
--- a/jdk/src/share/demo/jvmti/hprof/sample.makefile.txt	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/share/demo/jvmti/hprof/sample.makefile.txt	Wed Jul 21 09:57:21 2010 -0700
@@ -132,7 +132,7 @@
     LIBRARY=lib$(LIBNAME).so
     LDFLAGS=-Wl,-soname=$(LIBRARY) -static-libgcc -mimpure-text
     # Libraries we are dependent on
-    LIBRARIES= -lnsl -ldl -lc
+    LIBRARIES= -ldl -lc
     # Building a shared library
     LINK_SHARED=$(LINK.c) -shared -o $@
 endif
--- a/jdk/src/share/javavm/export/classfile_constants.h	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/share/javavm/export/classfile_constants.h	Wed Jul 21 09:57:21 2010 -0700
@@ -84,7 +84,22 @@
     JVM_CONSTANT_Fieldref               = 9,
     JVM_CONSTANT_Methodref              = 10,
     JVM_CONSTANT_InterfaceMethodref     = 11,
-    JVM_CONSTANT_NameAndType            = 12
+    JVM_CONSTANT_NameAndType            = 12,
+    JVM_CONSTANT_MethodHandle           = 15,  // JSR 292
+    JVM_CONSTANT_MethodType             = 16   // JSR 292
+};
+
+/* JVM_CONSTANT_MethodHandle subtypes */
+enum {
+    JVM_REF_getField                = 1,
+    JVM_REF_getStatic               = 2,
+    JVM_REF_putField                = 3,
+    JVM_REF_putStatic               = 4,
+    JVM_REF_invokeVirtual           = 5,
+    JVM_REF_invokeStatic            = 6,
+    JVM_REF_invokeSpecial           = 7,
+    JVM_REF_newInvokeSpecial        = 8,
+    JVM_REF_invokeInterface         = 9
 };
 
 /* StackMapTable type item numbers */
--- a/jdk/src/share/native/common/check_code.c	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/share/native/common/check_code.c	Wed Jul 21 09:57:21 2010 -0700
@@ -204,6 +204,8 @@
 
 #define LDC_CLASS_MAJOR_VERSION 49
 
+#define LDC_METHOD_HANDLE_MAJOR_VERSION 51
+
 #define ALLOC_STACK_SIZE 16 /* big enough */
 
 typedef struct alloc_stack_type {
@@ -1181,6 +1183,10 @@
         if (context->major_version >= LDC_CLASS_MAJOR_VERSION) {
             types |= 1 << JVM_CONSTANT_Class;
         }
+        if (context->major_version >= LDC_METHOD_HANDLE_MAJOR_VERSION) {
+            types |= (1 << JVM_CONSTANT_MethodHandle) |
+                     (1 << JVM_CONSTANT_MethodType);
+        }
         this_idata->operand.i = key;
         verify_constant_pool_type(context, key, types);
         break;
@@ -1194,6 +1200,10 @@
         if (context->major_version >= LDC_CLASS_MAJOR_VERSION) {
             types |= 1 << JVM_CONSTANT_Class;
         }
+        if (context->major_version >= LDC_METHOD_HANDLE_MAJOR_VERSION) {
+            types |= (1 << JVM_CONSTANT_MethodHandle) |
+                     (1 << JVM_CONSTANT_MethodType);
+        }
         this_idata->operand.i = key;
         verify_constant_pool_type(context, key, types);
         break;
@@ -2667,6 +2677,22 @@
                     full_info = make_class_info_from_name(context,
                                                           "java/lang/Class");
                     break;
+                case JVM_CONSTANT_MethodHandle:
+                case JVM_CONSTANT_MethodType:
+                    if (context->major_version < LDC_METHOD_HANDLE_MAJOR_VERSION)
+                        CCerror(context, "Internal error #3");
+                    stack_results = "A";
+                    switch (type_table[operand]) {
+                    case JVM_CONSTANT_MethodType:
+                      full_info = make_class_info_from_name(context,
+                                                            "java/dyn/MethodType");
+                      break;
+                    default: //JVM_CONSTANT_MethodHandle
+                      full_info = make_class_info_from_name(context,
+                                                            "java/dyn/MethodHandle");
+                      break;
+                    }
+                    break;
                 default:
                     CCerror(context, "Internal error #3");
                     stack_results = ""; /* Never reached: keep lint happy */
--- a/jdk/src/share/native/sun/awt/image/BufImgSurfaceData.c	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/share/native/sun/awt/image/BufImgSurfaceData.c	Wed Jul 21 09:57:21 2010 -0700
@@ -111,6 +111,10 @@
 {
     BufImgSDOps *bisdo =
         (BufImgSDOps*)SurfaceData_InitOps(env, bisd, sizeof(BufImgSDOps));
+    if (bisdo == NULL) {
+        JNU_ThrowOutOfMemoryError(env, "Initialization of SurfaceData failed.");
+        return;
+    }
     bisdo->sdOps.Lock = BufImg_Lock;
     bisdo->sdOps.GetRasInfo = BufImg_GetRasInfo;
     bisdo->sdOps.Release = BufImg_Release;
--- a/jdk/src/share/native/sun/awt/splashscreen/splashscreen_png.c	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/share/native/sun/awt/splashscreen/splashscreen_png.c	Wed Jul 21 09:57:21 2010 -0700
@@ -182,7 +182,7 @@
     int success = 0;
 
     stream->read(stream, sig, SIG_BYTES);
-    if (!png_check_sig(sig, SIG_BYTES)) {
+    if (png_sig_cmp(sig, 0, SIG_BYTES)) {
         goto done;
     }
     success = SplashDecodePng(splash, my_png_read_stream, stream);
--- a/jdk/src/share/native/sun/font/AccelGlyphCache.c	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/share/native/sun/font/AccelGlyphCache.c	Wed Jul 21 09:57:21 2010 -0700
@@ -325,6 +325,7 @@
     cellInfo->glyphInfo = glyph;
     cellInfo->nextGCI = glyph->cellInfo;
     glyph->cellInfo = cellInfo;
+    glyph->managed = MANAGED_GLYPH;
 }
 
 /**
--- a/jdk/src/share/native/sun/font/fontscalerdefs.h	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/share/native/sun/font/fontscalerdefs.h	Wed Jul 21 09:57:21 2010 -0700
@@ -84,15 +84,26 @@
 
 #define t2kScalarAverage(a, b) (((a) + (b)) / (t2kScalar)(2))
 
+  /* managed: 1 means the glyph has a hardware cached
+   * copy, and its freeing is managed by the the usual
+   * 2D disposer code.
+   * A value of 0 means its either unaccelerated (and so has no cellInfos)
+   * or we want to free this in a different way.
+   * The field uses previously unused padding, so doesn't enlarge
+   * the structure.
+   */
+#define UNMANAGED_GLYPH 0
+#define MANAGED_GLYPH   1
 typedef struct GlyphInfo {
     float        advanceX;
     float        advanceY;
     UInt16       width;
     UInt16       height;
     UInt16       rowBytes;
+    UInt8         managed;
     float        topLeftX;
     float        topLeftY;
-    struct _CacheCellInfo *cellInfo;
+    void         *cellInfo;
     UInt8        *image;
 } GlyphInfo;
 
--- a/jdk/src/share/native/sun/font/freetypeScaler.c	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/share/native/sun/font/freetypeScaler.c	Wed Jul 21 09:57:21 2010 -0700
@@ -490,22 +490,23 @@
 
     /* ascent */
     ax = 0;
-    ay = -(jfloat) FT26Dot6ToFloat(
-                       scalerInfo->face->size->metrics.ascender +
-                       bmodifier/2);
+    ay = -(jfloat) FT26Dot6ToFloat(FT_MulFix(
+                       ((jlong) scalerInfo->face->ascender + bmodifier/2),
+                       (jlong) scalerInfo->face->size->metrics.y_scale));
     /* descent */
     dx = 0;
-    dy = -(jfloat) FT26Dot6ToFloat(
-                       scalerInfo->face->size->metrics.descender +
-                       bmodifier/2);
+    dy = -(jfloat) FT26Dot6ToFloat(FT_MulFix(
+                       ((jlong) scalerInfo->face->descender + bmodifier/2),
+                       (jlong) scalerInfo->face->size->metrics.y_scale));
     /* baseline */
     bx = by = 0;
 
     /* leading */
     lx = 0;
-    ly = (jfloat) FT26Dot6ToFloat(
-                      scalerInfo->face->size->metrics.height +
-                      bmodifier) + ay - dy;
+    ly = (jfloat) FT26Dot6ToFloat(FT_MulFix(
+                      (jlong) scalerInfo->face->height + bmodifier,
+                      (jlong) scalerInfo->face->size->metrics.y_scale))
+                  + ay - dy;
     /* max advance */
     mx = (jfloat) FT26Dot6ToFloat(
                      scalerInfo->face->size->metrics.max_advance +
@@ -782,6 +783,7 @@
         return ptr_to_jlong(glyphInfo);
     }
     glyphInfo->cellInfo  = NULL;
+    glyphInfo->managed   = UNMANAGED_GLYPH;
     glyphInfo->rowBytes  = width;
     glyphInfo->width     = width;
     glyphInfo->height    = height;
@@ -1130,7 +1132,7 @@
                     current_type = SEG_LINETO;
                 }
             } else if (FT_CURVE_TAG(outline->tags[i]) == FT_CURVE_TAG_CUBIC) {
-                /* Bit 1 is meaningful for ‘off’ points only.
+                /* Bit 1 is meaningful for 'off' points only.
                    If set, it indicates a third-order Bezier arc control
                    point; and a second-order control point if unset.  */
                 current_type = SEG_CUBICTO;
--- a/jdk/src/share/native/sun/font/sunFont.c	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/share/native/sun/font/sunFont.c	Wed Jul 21 09:57:21 2010 -0700
@@ -233,7 +233,8 @@
         for (i=0; i< len; i++) {
             if (ptrs[i] != 0) {
                 GlyphInfo *ginfo = (GlyphInfo *)ptrs[i];
-                if (ginfo->cellInfo != NULL) {
+                if (ginfo->cellInfo != NULL &&
+                    ginfo->managed == MANAGED_GLYPH) {
                     // invalidate this glyph's accelerated cache cell
                     AccelGlyphCache_RemoveAllCellInfos(ginfo);
                 }
@@ -264,7 +265,8 @@
         for (i=0; i< len; i++) {
             if (ptrs[i] != 0L) {
                 GlyphInfo *ginfo = (GlyphInfo *) jlong_to_ptr(ptrs[i]);
-                if (ginfo->cellInfo != NULL) {
+                if (ginfo->cellInfo != NULL &&
+                    ginfo->managed == MANAGED_GLYPH) {
                     AccelGlyphCache_RemoveAllCellInfos(ginfo);
                 }
                 free((void*)ginfo);
@@ -285,7 +287,7 @@
     GlyphInfo *info;
     size_t baseAddr;
 
-    if ((*env)->GetArrayLength(env, results) < 10) {
+    if ((*env)->GetArrayLength(env, results) < 13) {
         return;
     }
 
@@ -310,6 +312,9 @@
     nresults[8] = (size_t)&(info->topLeftY)-baseAddr;
     nresults[9] = (size_t)&(info->image)-baseAddr;
     nresults[10] = (jlong)(uintptr_t)info; /* invisible glyph */
+    nresults[11] = (size_t)&(info->cellInfo)-baseAddr;
+    nresults[12] = (size_t)&(info->managed)-baseAddr;
+
     (*env)->ReleasePrimitiveArrayCritical(env, results, nresults, 0);
 }
 
--- a/jdk/src/share/native/sun/java2d/opengl/OGLTextRenderer.c	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/share/native/sun/java2d/opengl/OGLTextRenderer.c	Wed Jul 21 09:57:21 2010 -0700
@@ -244,6 +244,7 @@
 OGLTR_AddToGlyphCache(GlyphInfo *glyph, jboolean rgbOrder)
 {
     GLenum pixelFormat;
+    CacheCellInfo *ccinfo;
 
     J2dTraceLn(J2D_TRACE_INFO, "OGLTR_AddToGlyphCache");
 
@@ -258,11 +259,12 @@
     }
 
     AccelGlyphCache_AddGlyph(glyphCache, glyph);
+    ccinfo = (CacheCellInfo *) glyph->cellInfo;
 
-    if (glyph->cellInfo != NULL) {
+    if (ccinfo != NULL) {
         // store glyph image in texture cell
         j2d_glTexSubImage2D(GL_TEXTURE_2D, 0,
-                            glyph->cellInfo->x, glyph->cellInfo->y,
+                            ccinfo->x, ccinfo->y,
                             glyph->width, glyph->height,
                             pixelFormat, GL_UNSIGNED_BYTE, glyph->image);
     }
@@ -668,7 +670,7 @@
         }
     }
 
-    cell = ginfo->cellInfo;
+    cell = (CacheCellInfo *) (ginfo->cellInfo);
     cell->timesRendered++;
 
     x1 = (jfloat)x;
@@ -871,7 +873,7 @@
         }
     }
 
-    cell = ginfo->cellInfo;
+    cell = (CacheCellInfo *) (ginfo->cellInfo);
     cell->timesRendered++;
 
     // location of the glyph in the destination's coordinate space
--- a/jdk/src/solaris/bin/java_md.c	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/solaris/bin/java_md.c	Wed Jul 21 09:57:21 2010 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 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
@@ -183,13 +183,9 @@
 }
 
 void
-CreateExecutionEnvironment(int *_argcp,
-                           char ***_argvp,
-                           char jrepath[],
-                           jint so_jrepath,
-                           char jvmpath[],
-                           jint so_jvmpath,
-                           char **original_argv) {
+CreateExecutionEnvironment(int *pargc, char ***pargv,
+                           char jrepath[], jint so_jrepath,
+                           char jvmpath[], jint so_jvmpath) {
   /*
    * First, determine if we are running the desired data model.  If we
    * are running the desired data model, all the error messages
@@ -200,18 +196,17 @@
    * os/processor combination has dual mode capabilities.
    */
 
-    int original_argc = *_argcp;
     jboolean jvmpathExists;
 
     /* Compute/set the name of the executable */
-    SetExecname(*_argvp);
+    SetExecname(*pargv);
 
     /* Check data model flags, and exec process, if needed */
     {
       char *arch        = (char *)GetArch(); /* like sparc or sparcv9 */
       char * jvmtype    = NULL;
-      int argc          = *_argcp;
-      char **argv       = original_argv;
+      int  argc         = *pargc;
+      char **argv       = *pargv;
 
       int running       = CURRENT_DATA_MODEL;
 
@@ -233,7 +228,7 @@
       { /* open new scope to declare local variables */
         int i;
 
-        newargv = (char **)JLI_MemAlloc((argc+1) * sizeof(*newargv));
+        newargv = (char **)JLI_MemAlloc((argc+1) * sizeof(char*));
         newargv[newargc++] = argv[0];
 
         /* scan for data model arguments and remove from argument list;
@@ -293,7 +288,11 @@
         }
 
         jvmpath[0] = '\0';
-        jvmtype = CheckJvmType(_argcp, _argvp, JNI_FALSE);
+        jvmtype = CheckJvmType(pargc, pargv, JNI_FALSE);
+        if (JLI_StrCmp(jvmtype, "ERROR") == 0) {
+            JLI_ReportErrorMessage(CFG_ERROR9);
+            exit(4);
+        }
 
         if (!GetJVMPath(jrepath, jvmtype, jvmpath, so_jvmpath, arch )) {
           JLI_ReportErrorMessage(CFG_ERROR8, jvmtype, jvmpath);
@@ -309,7 +308,9 @@
         if (running != wanted) {
           /* Find out where the JRE is that we will be using. */
           if (!GetJREPath(jrepath, so_jrepath, GetArchPath(wanted), JNI_TRUE)) {
-            goto EndDataModelSpeculate;
+            /* give up and let other code report error message */
+            JLI_ReportErrorMessage(JRE_ERROR2, wanted);
+            exit(1);
           }
 
           /*
@@ -317,16 +318,21 @@
            * selection options.
            */
           if (ReadKnownVMs(jrepath, GetArchPath(wanted), JNI_TRUE) < 1) {
-            goto EndDataModelSpeculate;
+            /* give up and let other code report error message */
+            JLI_ReportErrorMessage(JRE_ERROR2, wanted);
+            exit(1);
           }
           jvmpath[0] = '\0';
-          jvmtype = CheckJvmType(_argcp, _argvp, JNI_TRUE);
+          jvmtype = CheckJvmType(pargc, pargv, JNI_TRUE);
+          if (JLI_StrCmp(jvmtype, "ERROR") == 0) {
+            JLI_ReportErrorMessage(CFG_ERROR9);
+            exit(4);
+          }
+
           /* exec child can do error checking on the existence of the path */
           jvmpathExists = GetJVMPath(jrepath, jvmtype, jvmpath, so_jvmpath, GetArchPath(wanted));
 
         }
-      EndDataModelSpeculate: /* give up and let other code report error message */
-        ;
 #else
         JLI_ReportErrorMessage(JRE_ERROR2, wanted);
         exit(1);
@@ -398,9 +404,9 @@
     struct stat s;
 
     if (JLI_StrChr(jvmtype, '/')) {
-        sprintf(jvmpath, "%s/" JVM_DLL, jvmtype);
+        JLI_Snprintf(jvmpath, jvmpathsize, "%s/" JVM_DLL, jvmtype);
     } else {
-        sprintf(jvmpath, "%s/lib/%s/%s/" JVM_DLL, jrepath, arch, jvmtype);
+        JLI_Snprintf(jvmpath, jvmpathsize, "%s/lib/%s/%s/" JVM_DLL, jrepath, arch, jvmtype);
     }
 
     JLI_TraceLauncher("Does `%s' exist ... ", jvmpath);
@@ -424,26 +430,24 @@
 
     if (GetApplicationHome(path, pathsize)) {
         /* Is JRE co-located with the application? */
-        sprintf(libjava, "%s/lib/%s/" JAVA_DLL, path, arch);
+        JLI_Snprintf(libjava, sizeof(libjava), "%s/lib/%s/" JAVA_DLL, path, arch);
         if (access(libjava, F_OK) == 0) {
-            goto found;
+            JLI_TraceLauncher("JRE path is %s\n", path);
+            return JNI_TRUE;
         }
 
         /* Does the app ship a private JRE in <apphome>/jre directory? */
-        sprintf(libjava, "%s/jre/lib/%s/" JAVA_DLL, path, arch);
+        JLI_Snprintf(libjava, sizeof(libjava), "%s/jre/lib/%s/" JAVA_DLL, path, arch);
         if (access(libjava, F_OK) == 0) {
             JLI_StrCat(path, "/jre");
-            goto found;
+            JLI_TraceLauncher("JRE path is %s\n", path);
+            return JNI_TRUE;
         }
     }
 
     if (!speculative)
       JLI_ReportErrorMessage(JRE_ERROR8 JAVA_DLL);
     return JNI_FALSE;
-
- found:
-    JLI_TraceLauncher("JRE path is %s\n", path);
-    return JNI_TRUE;
 }
 
 jboolean
@@ -463,14 +467,18 @@
       int location;
 
       fp = fopen(jvmpath, "r");
-      if(fp == NULL)
-        goto error;
+      if (fp == NULL) {
+        JLI_ReportErrorMessage(DLL_ERROR2, jvmpath, dlerror());
+        return JNI_FALSE;
+      }
 
       /* read in elf header */
       count = fread((void*)(&elf_head), sizeof(Elf32_Ehdr), 1, fp);
       fclose(fp);
-      if(count < 1)
-        goto error;
+      if (count < 1) {
+        JLI_ReportErrorMessage(DLL_ERROR2, jvmpath, dlerror());
+        return JNI_FALSE;
+      }
 
       /*
        * Check for running a server vm (compiled with -xarch=v8plus)
@@ -481,41 +489,42 @@
        * does not have to be checked for in binaries with an LP64 data
        * model.
        */
-      if(elf_head.e_machine == EM_SPARC32PLUS) {
+      if (elf_head.e_machine == EM_SPARC32PLUS) {
         char buf[257];  /* recommended buffer size from sysinfo man
                            page */
         long length;
         char* location;
 
         length = sysinfo(SI_ISALIST, buf, 257);
-        if(length > 0) {
-          location = JLI_StrStr(buf, "sparcv8plus ");
-          if(location == NULL) {
+        if (length > 0) {
+            location = JLI_StrStr(buf, "sparcv8plus ");
+          if (location == NULL) {
             JLI_ReportErrorMessage(JVM_ERROR3);
             return JNI_FALSE;
           }
         }
       }
 #endif
-      JLI_ReportErrorMessage(DLL_ERROR1, __LINE__);
-      goto error;
+        JLI_ReportErrorMessage(DLL_ERROR1, __LINE__);
+        JLI_ReportErrorMessage(DLL_ERROR2, jvmpath, dlerror());
+        return JNI_FALSE;
     }
 
     ifn->CreateJavaVM = (CreateJavaVM_t)
-      dlsym(libjvm, "JNI_CreateJavaVM");
-    if (ifn->CreateJavaVM == NULL)
-        goto error;
+        dlsym(libjvm, "JNI_CreateJavaVM");
+    if (ifn->CreateJavaVM == NULL) {
+        JLI_ReportErrorMessage(DLL_ERROR2, jvmpath, dlerror());
+        return JNI_FALSE;
+    }
 
     ifn->GetDefaultJavaVMInitArgs = (GetDefaultJavaVMInitArgs_t)
         dlsym(libjvm, "JNI_GetDefaultJavaVMInitArgs");
-    if (ifn->GetDefaultJavaVMInitArgs == NULL)
-      goto error;
+    if (ifn->GetDefaultJavaVMInitArgs == NULL) {
+        JLI_ReportErrorMessage(DLL_ERROR2, jvmpath, dlerror());
+        return JNI_FALSE;
+    }
 
     return JNI_TRUE;
-
-error:
-    JLI_ReportErrorMessage(DLL_ERROR2, jvmpath, dlerror());
-    return JNI_FALSE;
 }
 
 /*
@@ -575,7 +584,7 @@
     char name[PATH_MAX + 2], *real;
 
     if ((JLI_StrLen(indir) + JLI_StrLen(cmd) + 1)  > PATH_MAX) return 0;
-    sprintf(name, "%s%c%s", indir, FILE_SEPARATOR, cmd);
+    JLI_Snprintf(name, sizeof(name), "%s%c%s", indir, FILE_SEPARATOR, cmd);
     if (!ProgramExists(name)) return 0;
     real = JLI_MemAlloc(PATH_MAX + 2);
     if (!realpath(name, real))
@@ -622,7 +631,7 @@
         else {
             /* relative path element */
             char dir[2*PATH_MAX];
-            sprintf(dir, "%s%c%s", getcwd(cwdbuf, sizeof(cwdbuf)),
+            JLI_Snprintf(dir, sizeof(dir), "%s%c%s", getcwd(cwdbuf, sizeof(cwdbuf)),
                     FILE_SEPARATOR, s);
             result = Resolve(dir, program);
         }
@@ -746,7 +755,7 @@
     if (JLI_StrLen(path) + JLI_StrLen(dir) + 11 > PATH_MAX)
         return (0);     /* Silently reject "impossibly" long paths */
 
-    sprintf(buffer, "%s/%s/bin/java", path, dir);
+    JLI_Snprintf(buffer, sizeof(buffer), "%s/%s/bin/java", path, dir);
     return ((access(buffer, X_OK) == 0) ? 1 : 0);
 }
 
--- a/jdk/src/solaris/classes/java/lang/UNIXProcess.java.linux	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/solaris/classes/java/lang/UNIXProcess.java.linux	Wed Jul 21 09:57:21 2010 -0700
@@ -25,25 +25,42 @@
 
 package java.lang;
 
-import java.io.*;
+import java.io.BufferedInputStream;
+import java.io.BufferedOutputStream;
+import java.io.ByteArrayInputStream;
+import java.io.FileDescriptor;
+import java.io.FileInputStream;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.util.Arrays;
+import java.util.concurrent.Executors;
+import java.util.concurrent.Executor;
+import java.util.concurrent.ThreadFactory;
+import java.security.AccessController;
+import java.security.PrivilegedAction;
+import java.security.PrivilegedActionException;
+import java.security.PrivilegedExceptionAction;
 
-/* java.lang.Process subclass in the UNIX environment.
+/**
+ * java.lang.Process subclass in the UNIX environment.
  *
  * @author Mario Wolczko and Ross Knippel.
  * @author Konstantin Kladko (ported to Linux)
+ * @author Martin Buchholz
  */
-
 final class UNIXProcess extends Process {
     private static final sun.misc.JavaIOFileDescriptorAccess fdAccess
         = sun.misc.SharedSecrets.getJavaIOFileDescriptorAccess();
 
-    private int pid;
+    private final int pid;
     private int exitcode;
     private boolean hasExited;
 
-    private OutputStream stdin_stream;
-    private InputStream  stdout_stream;
-    private InputStream  stderr_stream;
+    private /* final */ OutputStream stdin;
+    private /* final */ InputStream  stdout;
+    private /* final */ InputStream  stderr;
 
     /* this is for the reaping thread */
     private native int waitForProcessExit(int pid);
@@ -51,155 +68,136 @@
     /**
      * Create a process using fork(2) and exec(2).
      *
-     * @param std_fds array of file descriptors.  Indexes 0, 1, and
-     *        2 correspond to standard input, standard output and
-     *        standard error, respectively.  On input, a value of -1
-     *        means to create a pipe to connect child and parent
-     *        processes.  On output, a value which is not -1 is the
-     *        parent pipe fd corresponding to the pipe which has
-     *        been created.  An element of this array is -1 on input
-     *        if and only if it is <em>not</em> -1 on output.
+     * @param fds an array of three file descriptors.
+     *        Indexes 0, 1, and 2 correspond to standard input,
+     *        standard output and standard error, respectively.  On
+     *        input, a value of -1 means to create a pipe to connect
+     *        child and parent processes.  On output, a value which
+     *        is not -1 is the parent pipe fd corresponding to the
+     *        pipe which has been created.  An element of this array
+     *        is -1 on input if and only if it is <em>not</em> -1 on
+     *        output.
      * @return the pid of the subprocess
      */
     private native int forkAndExec(byte[] prog,
                                    byte[] argBlock, int argc,
                                    byte[] envBlock, int envc,
                                    byte[] dir,
-                                   int[] std_fds,
+                                   int[] fds,
                                    boolean redirectErrorStream)
         throws IOException;
 
-    /* In the process constructor we wait on this gate until the process    */
-    /* has been created. Then we return from the constructor.               */
-    /* fork() is called by the same thread which later waits for the process */
-    /* to terminate */
-
-    private static class Gate {
+    /**
+     * The thread factory used to create "process reaper" daemon threads.
+     */
+    private static class ProcessReaperThreadFactory implements ThreadFactory {
+        private final static ThreadGroup group = getRootThreadGroup();
 
-        private boolean exited = false;
-        private IOException savedException;
-
-        synchronized void exit() { /* Opens the gate */
-           exited = true;
-           this.notify();
+        private static ThreadGroup getRootThreadGroup() {
+            return AccessController.doPrivileged
+            (new PrivilegedAction<ThreadGroup> () {
+            public ThreadGroup run() {
+                ThreadGroup root = Thread.currentThread().getThreadGroup();
+                while (root.getParent() != null)
+                    root = root.getParent();
+                return root;
+            }});
         }
 
-        synchronized void waitForExit() { /* wait until the gate is open */
-            boolean interrupted = false;
-            while (!exited) {
-                try {
-                    this.wait();
-                } catch (InterruptedException e) {
-                    interrupted = true;
-                }
-            }
-            if (interrupted) {
-                Thread.currentThread().interrupt();
-            }
-        }
-
-        void setException (IOException e) {
-            savedException = e;
-        }
-
-        IOException getException() {
-            return savedException;
+        public Thread newThread(Runnable grimReaper) {
+            // Our thread stack requirement is quite modest.
+            Thread t = new Thread(group, grimReaper, "process reaper", 32768);
+            t.setDaemon(true);
+            // A small attempt (probably futile) to avoid priority inversion
+            t.setPriority(Thread.MAX_PRIORITY);
+            return t;
         }
     }
 
+    /**
+     * The thread pool of "process reaper" daemon threads.
+     */
+    private static final Executor processReaperExecutor
+        = Executors.newCachedThreadPool(new ProcessReaperThreadFactory());
+
     UNIXProcess(final byte[] prog,
                 final byte[] argBlock, final int argc,
                 final byte[] envBlock, final int envc,
                 final byte[] dir,
-                final int[] std_fds,
+                final int[] fds,
                 final boolean redirectErrorStream)
-    throws IOException {
+            throws IOException {
+
+        pid = forkAndExec(prog,
+                          argBlock, argc,
+                          envBlock, envc,
+                          dir,
+                          fds,
+                          redirectErrorStream);
 
-        final Gate gate = new Gate();
-        /*
-         * For each subprocess forked a corresponding reaper thread
-         * is started.  That thread is the only thread which waits
-         * for the subprocess to terminate and it doesn't hold any
-         * locks while doing so.  This design allows waitFor() and
-         * exitStatus() to be safely executed in parallel (and they
-         * need no native code).
-         */
+        try {
+            AccessController.doPrivileged
+            (new PrivilegedExceptionAction<Void>() {
+                public Void run() throws IOException {
+                    initStreams(fds);
+                    return null;
+                }});
+        } catch (PrivilegedActionException ex) {
+            throw (IOException) ex.getException();
+        }
+    }
+
+    static FileDescriptor newFileDescriptor(int fd) {
+        FileDescriptor fileDescriptor = new FileDescriptor();
+        fdAccess.set(fileDescriptor, fd);
+        return fileDescriptor;
+    }
 
-        java.security.AccessController.doPrivileged(
-        new java.security.PrivilegedAction<Void>() {
-        public Void run() {
-            Thread t = new Thread("process reaper") {
-                    public void run() {
-                        try {
-                            pid = forkAndExec(prog,
-                                              argBlock, argc,
-                                              envBlock, envc,
-                                              dir,
-                                              std_fds,
-                                              redirectErrorStream);
-                        } catch (IOException e) {
-                            gate.setException(e); /*remember to rethrow later*/
-                            gate.exit();
-                            return;
-                        }
-                        java.security.AccessController.doPrivileged(
-                    new java.security.PrivilegedAction<Void>() {
-                    public Void run() {
-                        if (std_fds[0] == -1)
-                            stdin_stream = new ProcessBuilder.NullOutputStream();
-                        else {
-                            FileDescriptor stdin_fd = new FileDescriptor();
-                            fdAccess.set(stdin_fd, std_fds[0]);
-                            stdin_stream = new BufferedOutputStream(
-                                new FileOutputStream(stdin_fd));
-                        }
+    void initStreams(int[] fds) throws IOException {
+        stdin = (fds[0] == -1) ?
+            ProcessBuilder.NullOutputStream.INSTANCE :
+            new ProcessPipeOutputStream(fds[0]);
+
+        stdout = (fds[1] == -1) ?
+            ProcessBuilder.NullInputStream.INSTANCE :
+            new ProcessPipeInputStream(fds[1]);
+
+        stderr = (fds[2] == -1) ?
+            ProcessBuilder.NullInputStream.INSTANCE :
+            new ProcessPipeInputStream(fds[2]);
 
-                        if (std_fds[1] == -1)
-                            stdout_stream = new ProcessBuilder.NullInputStream();
-                        else {
-                            FileDescriptor stdout_fd = new FileDescriptor();
-                            fdAccess.set(stdout_fd, std_fds[1]);
-                            stdout_stream = new BufferedInputStream(
-                                new FileInputStream(stdout_fd));
-                        }
-
-                        if (std_fds[2] == -1)
-                            stderr_stream = new ProcessBuilder.NullInputStream();
-                        else {
-                            FileDescriptor stderr_fd = new FileDescriptor();
-                            fdAccess.set(stderr_fd, std_fds[2]);
-                            stderr_stream = new FileInputStream(stderr_fd);
-                        }
+        processReaperExecutor.execute(new Runnable() {
+            public void run() {
+                int exitcode = waitForProcessExit(pid);
+                UNIXProcess.this.processExited(exitcode);
+            }});
+    }
 
-                        return null; }});
-                        gate.exit(); /* exit from constructor */
-                        int res = waitForProcessExit(pid);
-                        synchronized (UNIXProcess.this) {
-                            hasExited = true;
-                            exitcode = res;
-                            UNIXProcess.this.notifyAll();
-                        }
-                    }
-                };
-                t.setDaemon(true);
-                t.start();
-                return null; }});
-        gate.waitForExit();
-        IOException e = gate.getException();
-        if (e != null)
-            throw new IOException(e.toString());
+    synchronized void processExited(int exitcode) {
+        if (stdout instanceof ProcessPipeInputStream)
+            ((ProcessPipeInputStream) stdout).processExited();
+
+        if (stderr instanceof ProcessPipeInputStream)
+            ((ProcessPipeInputStream) stderr).processExited();
+
+        if (stdin instanceof ProcessPipeOutputStream)
+            ((ProcessPipeOutputStream) stdin).processExited();
+
+        this.exitcode = exitcode;
+        hasExited = true;
+        notifyAll();
     }
 
     public OutputStream getOutputStream() {
-        return stdin_stream;
+        return stdin;
     }
 
     public InputStream getInputStream() {
-        return stdout_stream;
+        return stdout;
     }
 
     public InputStream getErrorStream() {
-        return stderr_stream;
+        return stderr;
     }
 
     public synchronized int waitFor() throws InterruptedException {
@@ -228,13 +226,9 @@
             if (!hasExited)
                 destroyProcess(pid);
         }
-        try {
-            stdin_stream.close();
-            stdout_stream.close();
-            stderr_stream.close();
-        } catch (IOException e) {
-            // ignore
-        }
+        try { stdin.close();  } catch (IOException ignored) {}
+        try { stdout.close(); } catch (IOException ignored) {}
+        try { stderr.close(); } catch (IOException ignored) {}
     }
 
     /* This routine initializes JNI field offsets for the class */
@@ -243,4 +237,77 @@
     static {
         initIDs();
     }
+
+    /**
+     * A buffered input stream for a subprocess pipe file descriptor
+     * that allows the underlying file descriptor to be reclaimed when
+     * the process exits, via the processExited hook.
+     *
+     * This is tricky because we do not want the user-level InputStream to be
+     * closed until the user invokes close(), and we need to continue to be
+     * able to read any buffered data lingering in the OS pipe buffer.
+     */
+    static class ProcessPipeInputStream extends BufferedInputStream {
+        ProcessPipeInputStream(int fd) {
+            super(new FileInputStream(newFileDescriptor(fd)));
+        }
+
+        private static byte[] drainInputStream(InputStream in)
+                throws IOException {
+            if (in == null) return null;
+            int n = 0;
+            int j;
+            byte[] a = null;
+            while ((j = in.available()) > 0) {
+                a = (a == null) ? new byte[j] : Arrays.copyOf(a, n + j);
+                n += in.read(a, n, j);
+            }
+            return (a == null || n == a.length) ? a : Arrays.copyOf(a, n);
+        }
+
+        /** Called by the process reaper thread when the process exits. */
+        synchronized void processExited() {
+            // Most BufferedInputStream methods are synchronized, but close()
+            // is not, and so we have to handle concurrent racing close().
+            try {
+                InputStream in = this.in;
+                if (in != null) {
+                    byte[] stragglers = drainInputStream(in);
+                    in.close();
+                    this.in = (stragglers == null) ?
+                        ProcessBuilder.NullInputStream.INSTANCE :
+                        new ByteArrayInputStream(stragglers);
+                    if (buf == null) // asynchronous close()?
+                        this.in = null;
+                }
+            } catch (IOException ignored) {
+                // probably an asynchronous close().
+            }
+        }
+    }
+
+    /**
+     * A buffered output stream for a subprocess pipe file descriptor
+     * that allows the underlying file descriptor to be reclaimed when
+     * the process exits, via the processExited hook.
+     */
+    static class ProcessPipeOutputStream extends BufferedOutputStream {
+        ProcessPipeOutputStream(int fd) {
+            super(new FileOutputStream(newFileDescriptor(fd)));
+        }
+
+        /** Called by the process reaper thread when the process exits. */
+        synchronized void processExited() {
+            OutputStream out = this.out;
+            if (out != null) {
+                try {
+                    out.close();
+                } catch (IOException ignored) {
+                    // We know of no reason to get an IOException, but if
+                    // we do, there's nothing else to do but carry on.
+                }
+                this.out = ProcessBuilder.NullOutputStream.INSTANCE;
+            }
+        }
+    }
 }
--- a/jdk/src/solaris/classes/java/lang/UNIXProcess.java.solaris	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/solaris/classes/java/lang/UNIXProcess.java.solaris	Wed Jul 21 09:57:21 2010 -0700
@@ -86,7 +86,7 @@
         java.security.AccessController.doPrivileged(
         new java.security.PrivilegedAction<Void>() { public Void run() {
             if (std_fds[0] == -1)
-                stdin_stream = new ProcessBuilder.NullOutputStream();
+                stdin_stream = ProcessBuilder.NullOutputStream.INSTANCE;
             else {
                 FileDescriptor stdin_fd = new FileDescriptor();
                 fdAccess.set(stdin_fd, std_fds[0]);
@@ -95,7 +95,7 @@
             }
 
             if (std_fds[1] == -1)
-                stdout_stream = new ProcessBuilder.NullInputStream();
+                stdout_stream = ProcessBuilder.NullInputStream.INSTANCE;
             else {
                 FileDescriptor stdout_fd = new FileDescriptor();
                 fdAccess.set(stdout_fd, std_fds[1]);
@@ -104,7 +104,7 @@
             }
 
             if (std_fds[2] == -1)
-                stderr_stream = new ProcessBuilder.NullInputStream();
+                stderr_stream = ProcessBuilder.NullInputStream.INSTANCE;
             else {
                 FileDescriptor stderr_fd = new FileDescriptor();
                 fdAccess.set(stderr_fd, std_fds[2]);
--- a/jdk/src/solaris/classes/sun/awt/X11/XEmbeddedFramePeer.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/solaris/classes/sun/awt/X11/XEmbeddedFramePeer.java	Wed Jul 21 09:57:21 2010 -0700
@@ -275,7 +275,7 @@
         Point absoluteLoc = XlibUtil.translateCoordinates(getWindow(),
                                                           XToolkit.getDefaultRootWindow(),
                                                           new Point(0, 0));
-        return absoluteLoc.x;
+        return absoluteLoc != null ? absoluteLoc.x : 0;
     }
 
     public int getAbsoluteY()
@@ -283,7 +283,7 @@
         Point absoluteLoc = XlibUtil.translateCoordinates(getWindow(),
                                                           XToolkit.getDefaultRootWindow(),
                                                           new Point(0, 0));
-        return absoluteLoc.y;
+        return absoluteLoc != null ? absoluteLoc.y : 0;
     }
 
     public int getWidth() {
--- a/jdk/src/solaris/classes/sun/awt/X11/XToolkit.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/solaris/classes/sun/awt/X11/XToolkit.java	Wed Jul 21 09:57:21 2010 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2002, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -849,7 +849,7 @@
                     // if _NET_WM_STRUT_PARTIAL is present, we should use its values to detect
                     // if the struts area intersects with screenBounds, however some window
                     // managers don't set this hint correctly, so we just get intersection with windowBounds
-                    if (windowBounds.intersects(screenBounds))
+                    if (windowBounds != null && windowBounds.intersects(screenBounds))
                     {
                         insets.left = Math.max((int)Native.getLong(native_ptr, 0), insets.left);
                         insets.right = Math.max((int)Native.getLong(native_ptr, 1), insets.right);
@@ -1053,10 +1053,28 @@
         return peer;
     }
 
+    private static Boolean sunAwtDisableGtkFileDialogs = null;
+
+    /**
+     * Returns the value of "sun.awt.disableGtkFileDialogs" property. Default
+     * value is {@code false}.
+     */
+    public synchronized static boolean getSunAwtDisableGtkFileDialogs() {
+        if (sunAwtDisableGtkFileDialogs == null) {
+            sunAwtDisableGtkFileDialogs =
+                getBooleanSystemProperty("sun.awt.disableGtkFileDialogs");
+        }
+        return sunAwtDisableGtkFileDialogs.booleanValue();
+    }
+
     public FileDialogPeer createFileDialog(FileDialog target) {
+        FileDialogPeer peer = null;
         // The current GtkFileChooser is available from GTK+ 2.4
-        FileDialogPeer peer = checkGtkVersion(2, 4, 0) ? new GtkFileDialogPeer(
-                target) : new XFileDialogPeer(target);
+        if (!getSunAwtDisableGtkFileDialogs() && checkGtkVersion(2, 4, 0)) {
+            peer = new GtkFileDialogPeer(target);
+        } else {
+            peer = new XFileDialogPeer(target);
+        }
         targetCreatedPeer(target, peer);
         return peer;
     }
@@ -1201,14 +1219,6 @@
         }
     }
 
-    static String getSystemProperty(final String name) {
-        return (String)AccessController.doPrivileged(new PrivilegedAction() {
-                public Object run() {
-                    return System.getProperty(name);
-                }
-            });
-    }
-
     public PrintJob getPrintJob(final Frame frame, final String doctitle,
                                 final Properties props) {
 
@@ -1961,7 +1971,7 @@
     }
 
     static long reset_time_utc;
-    static final long WRAP_TIME_MILLIS = Integer.MAX_VALUE;
+    static final long WRAP_TIME_MILLIS = 0x00000000FFFFFFFFL;
 
     /*
      * This function converts between the X server time (number of milliseconds
--- a/jdk/src/solaris/classes/sun/awt/X11/XWindow.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/solaris/classes/sun/awt/X11/XWindow.java	Wed Jul 21 09:57:21 2010 -0700
@@ -778,8 +778,8 @@
                                                           x, y,
                                                           xbe.get_x_root(),
                                                           xbe.get_y_root(),
-                                                          clickCount,false,MouseWheelEvent.WHEEL_UNIT_SCROLL,
-                                                          3,button==4 ?  -1 : 1);
+                                                          1,false,MouseWheelEvent.WHEEL_UNIT_SCROLL,
+                                                          3,button==4 ?  -1*clickCount : 1*clickCount);
                 postEventToEventQueue(mwe);
             }
         }
--- a/jdk/src/solaris/classes/sun/awt/X11GraphicsDevice.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/solaris/classes/sun/awt/X11GraphicsDevice.java	Wed Jul 21 09:57:21 2010 -0700
@@ -39,6 +39,7 @@
 import java.util.HashMap;
 
 import sun.java2d.opengl.GLXGraphicsConfig;
+import sun.java2d.xr.XRGraphicsConfig;
 import sun.java2d.loops.SurfaceType;
 
 /**
@@ -152,6 +153,8 @@
             }
 
             boolean glxSupported = X11GraphicsEnvironment.isGLXAvailable();
+            boolean xrenderSupported = X11GraphicsEnvironment.isXRenderAvailable();
+
             boolean dbeSupported = isDBESupported();
             if (dbeSupported && doubleBufferVisuals == null) {
                 doubleBufferVisuals = new HashSet();
@@ -167,9 +170,15 @@
                     boolean doubleBuffer =
                         (dbeSupported &&
                          doubleBufferVisuals.contains(Integer.valueOf(visNum)));
-                    ret[i] = X11GraphicsConfig.getConfig(this, visNum, depth,
-                            getConfigColormap(i, screen),
-                            doubleBuffer);
+
+                    if (xrenderSupported) {
+                        ret[i] = XRGraphicsConfig.getConfig(this, visNum, depth,                                getConfigColormap(i, screen),
+                                doubleBuffer);
+                    } else {
+                       ret[i] = X11GraphicsConfig.getConfig(this, visNum, depth,
+                              getConfigColormap(i, screen),
+                              doubleBuffer);
+                    }
                 }
             }
             configs = ret;
@@ -243,9 +252,19 @@
                     doubleBuffer =
                         doubleBufferVisuals.contains(Integer.valueOf(visNum));
                 }
-                defaultConfig = X11GraphicsConfig.getConfig(this, visNum,
-                                                            depth, getConfigColormap(0, screen),
-                                                            doubleBuffer);
+
+                if (X11GraphicsEnvironment.isXRenderAvailable()) {
+                    if (X11GraphicsEnvironment.isXRenderVerbose()) {
+                        System.out.println("XRender pipeline enabled");
+                    }
+                    defaultConfig = XRGraphicsConfig.getConfig(this, visNum,
+                            depth, getConfigColormap(0, screen),
+                            doubleBuffer);
+                } else {
+                    defaultConfig = X11GraphicsConfig.getConfig(this, visNum,
+                                        depth, getConfigColormap(0, screen),
+                                        doubleBuffer);
+                }
             }
         }
     }
--- a/jdk/src/solaris/classes/sun/awt/X11GraphicsEnvironment.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/solaris/classes/sun/awt/X11GraphicsEnvironment.java	Wed Jul 21 09:57:21 2010 -0700
@@ -26,6 +26,7 @@
 package sun.awt;
 
 import java.awt.GraphicsDevice;
+
 import java.awt.Point;
 import java.awt.Rectangle;
 import java.io.BufferedReader;
@@ -51,6 +52,7 @@
 import sun.java2d.SurfaceManagerFactory;
 import sun.java2d.UnixSurfaceManagerFactory;
 import sun.util.logging.PlatformLogger;
+import sun.java2d.xr.XRSurfaceData;
 
 /**
  * This is an implementation of a GraphicsEnvironment object for the
@@ -92,6 +94,18 @@
                         }
                     }
 
+                    // Now check for XRender system property
+                    boolean xRenderRequested = false;
+                    String xProp = System.getProperty("sun.java2d.xrender");
+                        if (xProp != null) {
+                        if (xProp.equals("true") || xProp.equals("t")) {
+                            xRenderRequested = true;
+                        } else if (xProp.equals("True") || xProp.equals("T")) {
+                            xRenderRequested = true;
+                            xRenderVerbose = true;
+                        }
+                    }
+
                     // initialize the X11 display connection
                     initDisplay(glxRequested);
 
@@ -104,6 +118,19 @@
                                 "pipeline (GLX 1.3 not available)");
                         }
                     }
+
+                    // only attempt to initialize Xrender if it was requested
+                    if (xRenderRequested) {
+                        xRenderAvailable = initXRender();
+                        if (xRenderVerbose && !xRenderAvailable) {
+                            System.out.println(
+                                         "Could not enable XRender pipeline");
+                        }
+                    }
+
+                    if (xRenderAvailable) {
+                        XRSurfaceData.initXRSurfaceData();
+                    }
                 }
 
                 return null;
@@ -115,6 +142,7 @@
 
     }
 
+
     private static boolean glxAvailable;
     private static boolean glxVerbose;
 
@@ -128,6 +156,18 @@
         return glxVerbose;
     }
 
+    private static boolean xRenderVerbose;
+    private static boolean xRenderAvailable;
+
+    private static native boolean initXRender();
+    public static boolean isXRenderAvailable() {
+        return xRenderAvailable;
+    }
+
+    public static boolean isXRenderVerbose() {
+        return xRenderVerbose;
+    }
+
     /**
      * Checks if Shared Memory extension can be used.
      * Returns:
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/src/solaris/classes/sun/font/XRGlyphCache.java	Wed Jul 21 09:57:21 2010 -0700
@@ -0,0 +1,301 @@
+/*
+ * Copyright 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 sun.font;
+
+import java.io.*;
+import java.util.*;
+
+import sun.awt.*;
+import sun.java2d.xr.*;
+
+/**
+ * Glyph cache used by the XRender pipeline.
+ *
+ * @author Clemens Eisserer
+ */
+
+public class XRGlyphCache implements GlyphDisposedListener {
+    XRBackend con;
+    XRCompositeManager maskBuffer;
+    HashMap<MutableInteger, XRGlyphCacheEntry> cacheMap = new HashMap<MutableInteger, XRGlyphCacheEntry>(256);
+
+    int nextID = 1;
+    MutableInteger tmp = new MutableInteger(0);
+
+    int grayGlyphSet;
+    int lcdGlyphSet;
+
+    int time = 0;
+    int cachedPixels = 0;
+    static final int MAX_CACHED_PIXELS = 100000;
+
+    ArrayList<Integer> freeGlyphIDs = new ArrayList<Integer>(255);
+
+    static final boolean batchGlyphUpload = true; // Boolean.parseBoolean(System.getProperty("sun.java2d.xrender.batchGlyphUpload"));
+
+    public XRGlyphCache(XRCompositeManager maskBuf) {
+        this.con = maskBuf.getBackend();
+        this.maskBuffer = maskBuf;
+
+        grayGlyphSet = con.XRenderCreateGlyphSet(XRUtils.PictStandardA8);
+        lcdGlyphSet = con.XRenderCreateGlyphSet(XRUtils.PictStandardARGB32);
+
+        StrikeCache.addGlyphDisposedListener(this);
+    }
+
+    public void glyphDisposed(ArrayList<Long> glyphPtrList) {
+        try {
+            SunToolkit.awtLock();
+
+            ArrayList<Integer> glyphIDList = new ArrayList<Integer>(glyphPtrList.size());
+            for (long glyphPtr : glyphPtrList) {
+                glyphIDList.add(XRGlyphCacheEntry.getGlyphID(glyphPtr));
+            }
+            freeGlyphs(glyphIDList);
+        } finally {
+            SunToolkit.awtUnlock();
+        }
+    }
+
+    protected int getFreeGlyphID() {
+        if (freeGlyphIDs.size() > 0) {
+            int newID = freeGlyphIDs.remove(freeGlyphIDs.size() - 1);
+            ;
+            return newID;
+        }
+        return nextID++;
+    }
+
+    protected XRGlyphCacheEntry getEntryForPointer(long imgPtr) {
+        int id = XRGlyphCacheEntry.getGlyphID(imgPtr);
+
+        if (id == 0) {
+            return null;
+        }
+
+        tmp.setValue(id);
+        return cacheMap.get(tmp);
+    }
+
+    public XRGlyphCacheEntry[] cacheGlyphs(GlyphList glyphList) {
+        time++;
+
+        XRGlyphCacheEntry[] entries = new XRGlyphCacheEntry[glyphList.getNumGlyphs()];
+        long[] imgPtrs = glyphList.getImages();
+        ArrayList<XRGlyphCacheEntry> uncachedGlyphs = null;
+
+        for (int i = 0; i < glyphList.getNumGlyphs(); i++) {
+            XRGlyphCacheEntry glyph;
+
+            // Find uncached glyphs and queue them for upload
+            if ((glyph = getEntryForPointer(imgPtrs[i])) == null) {
+                glyph = new XRGlyphCacheEntry(imgPtrs[i], glyphList);
+                glyph.setGlyphID(getFreeGlyphID());
+                cacheMap.put(new MutableInteger(glyph.getGlyphID()), glyph);
+
+                if (uncachedGlyphs == null) {
+                    uncachedGlyphs = new ArrayList<XRGlyphCacheEntry>();
+                }
+                uncachedGlyphs.add(glyph);
+            }
+            glyph.setLastUsed(time);
+            entries[i] = glyph;
+        }
+
+        // Add glyphs to cache
+        if (uncachedGlyphs != null) {
+            uploadGlyphs(entries, uncachedGlyphs, glyphList, null);
+        }
+
+        return entries;
+    }
+
+    protected void uploadGlyphs(XRGlyphCacheEntry[] glyphs, ArrayList<XRGlyphCacheEntry> uncachedGlyphs, GlyphList gl, int[] glIndices) {
+        for (XRGlyphCacheEntry glyph : uncachedGlyphs) {
+            cachedPixels += glyph.getPixelCnt();
+        }
+
+        if (cachedPixels > MAX_CACHED_PIXELS) {
+            clearCache(glyphs);
+        }
+
+        boolean containsLCDGlyphs = containsLCDGlyphs(uncachedGlyphs);
+        List<XRGlyphCacheEntry>[] seperatedGlyphList = seperateGlyphTypes(uncachedGlyphs, containsLCDGlyphs);
+        List<XRGlyphCacheEntry> grayGlyphList = seperatedGlyphList[0];
+        List<XRGlyphCacheEntry> lcdGlyphList = seperatedGlyphList[1];
+
+        /*
+         * Some XServers crash when uploading multiple glyphs at once. TODO:
+         * Implement build-switch in local case for distributors who know their
+         * XServer is fixed
+         */
+        if (batchGlyphUpload) {
+            if (grayGlyphList != null && grayGlyphList.size() > 0) {
+                con.XRenderAddGlyphs(grayGlyphSet, gl, grayGlyphList, generateGlyphImageStream(grayGlyphList));
+            }
+            if (lcdGlyphList != null && lcdGlyphList.size() > 0) {
+                con.XRenderAddGlyphs(lcdGlyphSet, gl, lcdGlyphList, generateGlyphImageStream(lcdGlyphList));
+            }
+        } else {
+            ArrayList<XRGlyphCacheEntry> tmpList = new ArrayList<XRGlyphCacheEntry>(1);
+            tmpList.add(null);
+
+            for (XRGlyphCacheEntry entry : uncachedGlyphs) {
+                tmpList.set(0, entry);
+
+                if (entry.getGlyphSet() == grayGlyphSet) {
+                    con.XRenderAddGlyphs(grayGlyphSet, gl, tmpList, generateGlyphImageStream(tmpList));
+                } else {
+                    con.XRenderAddGlyphs(lcdGlyphSet, gl, tmpList, generateGlyphImageStream(tmpList));
+                }
+            }
+        }
+    }
+
+    /**
+     * Seperates lcd and grayscale glyphs queued for upload, and sets the
+     * appropriate glyphset for the cache entries.
+     */
+    protected List<XRGlyphCacheEntry>[] seperateGlyphTypes(List<XRGlyphCacheEntry> glyphList, boolean containsLCDGlyphs) {
+        ArrayList<XRGlyphCacheEntry> lcdGlyphs = null;
+        ArrayList<XRGlyphCacheEntry> grayGlyphs = null;
+
+        for (XRGlyphCacheEntry cacheEntry : glyphList) {
+            if (cacheEntry.isGrayscale(containsLCDGlyphs)) {
+                if (grayGlyphs == null) {
+                    grayGlyphs = new ArrayList<XRGlyphCacheEntry>(glyphList.size());
+                }
+                cacheEntry.setGlyphSet(grayGlyphSet);
+                grayGlyphs.add(cacheEntry);
+            } else {
+                if (lcdGlyphs == null) {
+                    lcdGlyphs = new ArrayList<XRGlyphCacheEntry>(glyphList.size());
+                }
+                cacheEntry.setGlyphSet(lcdGlyphSet);
+                lcdGlyphs.add(cacheEntry);
+            }
+        }
+
+        return new List[] { grayGlyphs, lcdGlyphs };
+    }
+
+    /**
+     * Copies the glyph-images into a continous buffer, required for uploading.
+     */
+    protected byte[] generateGlyphImageStream(List<XRGlyphCacheEntry> glyphList) {
+        boolean isLCDGlyph = glyphList.get(0).getGlyphSet() == lcdGlyphSet;
+
+        ByteArrayOutputStream stream = new ByteArrayOutputStream((isLCDGlyph ? 4 : 1) * 48 * glyphList.size());
+        for (XRGlyphCacheEntry cacheEntry : glyphList) {
+            cacheEntry.writePixelData(stream, isLCDGlyph);
+        }
+
+        return stream.toByteArray();
+    }
+
+    protected boolean containsLCDGlyphs(List<XRGlyphCacheEntry> entries) {
+        boolean containsLCDGlyphs = false;
+
+        for (XRGlyphCacheEntry entry : entries) {
+            containsLCDGlyphs = !(entry.getSourceRowBytes() == entry.getWidth());
+
+            if (containsLCDGlyphs) {
+                return true;
+            }
+        }
+        return false;
+    }
+
+    protected void clearCache(XRGlyphCacheEntry[] glyps) {
+        /*
+         * Glyph uploading is so slow anyway, we can afford some inefficiency
+         * here, as the cache should usually be quite small. TODO: Implement
+         * something not that stupid ;)
+         */
+        ArrayList<XRGlyphCacheEntry> cacheList = new ArrayList<XRGlyphCacheEntry>(cacheMap.values());
+        Collections.sort(cacheList, new Comparator<XRGlyphCacheEntry>() {
+            public int compare(XRGlyphCacheEntry e1, XRGlyphCacheEntry e2) {
+                return e2.getLastUsed() - e1.getLastUsed();
+            }
+        });
+
+        for (XRGlyphCacheEntry glyph : glyps) {
+            glyph.setPinned();
+        }
+
+        ArrayList<Integer> deleteGlyphList = new ArrayList<Integer>();
+        int pixelsToRelease = cachedPixels - MAX_CACHED_PIXELS;
+
+        for (int i = cacheList.size() - 1; i >= 0 && pixelsToRelease > 0; i--) {
+            XRGlyphCacheEntry entry = cacheList.get(i);
+
+            if (!entry.isPinned()) {
+                pixelsToRelease -= entry.getPixelCnt();
+                deleteGlyphList.add(new Integer(entry.getGlyphID()));
+            }
+        }
+
+        for (XRGlyphCacheEntry glyph : glyps) {
+            glyph.setUnpinned();
+        }
+
+        freeGlyphs(deleteGlyphList);
+    }
+
+    private void freeGlyphs(List<Integer> glyphIdList) {
+
+        freeGlyphIDs.addAll(glyphIdList);
+
+        GrowableIntArray removedLCDGlyphs = new GrowableIntArray(1, 1);
+        GrowableIntArray removedGrayscaleGlyphs = new GrowableIntArray(1, 1);
+
+        for (Integer glyphId : glyphIdList) {
+            tmp.setValue(glyphId.intValue());
+            XRGlyphCacheEntry entry = cacheMap.get(tmp);
+            cachedPixels -= entry.getPixelCnt();
+
+            int removedGlyphID = entry.getGlyphID();
+            tmp.setValue(removedGlyphID);
+            cacheMap.remove(tmp);
+
+            if (entry.getGlyphSet() == grayGlyphSet) {
+                removedGrayscaleGlyphs.addInt(removedGlyphID);
+            } else {
+                removedLCDGlyphs.addInt(removedGlyphID);
+            }
+
+            entry.setGlyphID(0);
+        }
+
+        if (removedGrayscaleGlyphs.getSize() > 0) {
+            con.XRenderFreeGlyphs(grayGlyphSet, removedGrayscaleGlyphs.getSizedArray());
+        }
+
+        if (removedLCDGlyphs.getSize() > 0) {
+            con.XRenderFreeGlyphs(lcdGlyphSet, removedLCDGlyphs.getSizedArray());
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/src/solaris/classes/sun/font/XRGlyphCacheEntry.java	Wed Jul 21 09:57:21 2010 -0700
@@ -0,0 +1,206 @@
+/*
+ * Copyright 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 sun.font;
+
+import java.io.*;
+
+/**
+ * Stores glyph-related data, used in the pure-java glyphcache.
+ *
+ * @author Clemens Eisserer
+ */
+
+public class XRGlyphCacheEntry {
+    long glyphInfoPtr;
+
+    int lastUsed;
+    boolean pinned;
+
+    int xOff;
+    int yOff;
+
+    int glyphSet;
+
+    public XRGlyphCacheEntry(long glyphInfoPtr, GlyphList gl) {
+        this.glyphInfoPtr = glyphInfoPtr;
+
+        /* TODO: Does it make sence to cache results? */
+        xOff = (int) Math.round(getXAdvance());
+        yOff = (int) Math.round(getYAdvance());
+    }
+
+    public int getXOff() {
+        return xOff;
+    }
+
+    public int getYOff() {
+        return yOff;
+    }
+
+    public void setGlyphSet(int glyphSet) {
+        this.glyphSet = glyphSet;
+    }
+
+    public int getGlyphSet() {
+        return glyphSet;
+    }
+
+    public static int getGlyphID(long glyphInfoPtr) {
+        return (int) StrikeCache.unsafe.getInt(glyphInfoPtr + StrikeCache.cacheCellOffset);
+    }
+
+    public static void setGlyphID(long glyphInfoPtr, int id) {
+        StrikeCache.unsafe.putInt(glyphInfoPtr + StrikeCache.cacheCellOffset, id);
+    }
+
+    public int getGlyphID() {
+        return getGlyphID(glyphInfoPtr);
+    }
+
+    public void setGlyphID(int id) {
+        setGlyphID(glyphInfoPtr, id);
+    }
+
+    public float getXAdvance() {
+        return StrikeCache.unsafe.getFloat(glyphInfoPtr + StrikeCache.xAdvanceOffset);
+    }
+
+    public float getYAdvance() {
+        return StrikeCache.unsafe.getFloat(glyphInfoPtr + StrikeCache.yAdvanceOffset);
+    }
+
+    public int getSourceRowBytes() {
+        return StrikeCache.unsafe.getShort(glyphInfoPtr + StrikeCache.rowBytesOffset);
+    }
+
+    public int getWidth() {
+        return StrikeCache.unsafe.getShort(glyphInfoPtr + StrikeCache.widthOffset);
+    }
+
+    public int getHeight() {
+        return StrikeCache.unsafe.getShort(glyphInfoPtr + StrikeCache.heightOffset);
+    }
+
+    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);
+        }
+        if (pixelDataAddress == 0L) {
+            return;
+        }
+
+        int width = getWidth();
+        int height = getHeight();
+        int rowBytes = getSourceRowBytes();
+        int paddedWidth = getPaddedWidth(uploadAsLCD);
+
+        if (!uploadAsLCD) {
+            for (int line = 0; line < height; line++) {
+                for(int x = 0; x < paddedWidth; x++) {
+                    if(x < width) {
+                        os.write(StrikeCache.unsafe.getByte(pixelDataAddress + (line * rowBytes + x)));
+                    }else {
+                         /*pad to multiple of 4 bytes per line*/
+                         os.write(0);
+                    }
+                }
+            }
+        } else {
+            for (int line = 0; line < height; line++) {
+                int rowStart = line * rowBytes;
+                int rowBytesWidth = width * 3;
+                int srcpix = 0;
+                while (srcpix < rowBytesWidth) {
+                    os.write(StrikeCache.unsafe.getByte
+                          (pixelDataAddress + (rowStart + srcpix + 2)));
+                    os.write(StrikeCache.unsafe.getByte
+                          (pixelDataAddress + (rowStart + srcpix + 1)));
+                    os.write(StrikeCache.unsafe.getByte
+                          (pixelDataAddress + (rowStart + srcpix + 0)));
+                    os.write(255);
+                    srcpix += 3;
+                }
+            }
+        }
+    }
+
+    public float getTopLeftXOffset() {
+        return StrikeCache.unsafe.getFloat(glyphInfoPtr + StrikeCache.topLeftXOffset);
+    }
+
+    public float getTopLeftYOffset() {
+        return StrikeCache.unsafe.getFloat(glyphInfoPtr + StrikeCache.topLeftYOffset);
+    }
+
+    public long getGlyphInfoPtr() {
+        return glyphInfoPtr;
+    }
+
+    public boolean isGrayscale(boolean listContainsLCDGlyphs) {
+        return getSourceRowBytes() == getWidth() && !(getWidth() == 0 && getHeight() == 0 && listContainsLCDGlyphs);
+    }
+
+    public int getPaddedWidth(boolean listContainsLCDGlyphs) {
+        int width = getWidth();
+        return isGrayscale(listContainsLCDGlyphs) ? (int) Math.ceil(width / 4.0) * 4 : width;
+    }
+
+    public int getDestinationRowBytes(boolean listContainsLCDGlyphs) {
+        boolean grayscale = isGrayscale(listContainsLCDGlyphs);
+        return grayscale ? getPaddedWidth(grayscale) : getWidth() * 4;
+    }
+
+    public int getGlyphDataLenth(boolean listContainsLCDGlyphs) {
+        return getDestinationRowBytes(listContainsLCDGlyphs) * getHeight();
+    }
+
+    public void setPinned() {
+        pinned = true;
+    }
+
+    public void setUnpinned() {
+        pinned = false;
+    }
+
+    public int getLastUsed() {
+        return lastUsed;
+    }
+
+    public void setLastUsed(int lastUsed) {
+        this.lastUsed = lastUsed;
+    }
+
+    public int getPixelCnt() {
+        return getWidth() * getHeight();
+    }
+
+    public boolean isPinned() {
+        return pinned;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/src/solaris/classes/sun/font/XRTextRenderer.java	Wed Jul 21 09:57:21 2010 -0700
@@ -0,0 +1,152 @@
+/*
+ * Copyright 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 sun.font;
+
+import sun.awt.*;
+import sun.java2d.SunGraphics2D;
+import sun.java2d.pipe.GlyphListPipe;
+import sun.java2d.xr.*;
+
+/**
+ * A delegate pipe of SG2D for drawing any text to a XRender surface
+ *
+ * @author Clemens Eisserer
+ */
+public class XRTextRenderer extends GlyphListPipe {
+
+    XRGlyphCache glyphCache;
+    XRCompositeManager maskBuffer;
+    XRBackend backend;
+
+    GrowableEltArray eltList;
+
+    public XRTextRenderer(XRCompositeManager buffer) {
+        glyphCache = new XRGlyphCache(buffer);
+        maskBuffer = buffer;
+        backend = buffer.getBackend();
+        eltList = new GrowableEltArray(64);
+    }
+
+    protected void drawGlyphList(SunGraphics2D sg2d, GlyphList gl) {
+        if (gl.getNumGlyphs() == 0) {
+            return;
+        }
+
+        try {
+            SunToolkit.awtLock();
+
+            XRSurfaceData x11sd = (XRSurfaceData) sg2d.surfaceData;
+            x11sd.validateAsDestination(null, sg2d.getCompClip());
+            x11sd.maskBuffer.validateCompositeState(sg2d.composite, sg2d.transform, sg2d.paint, sg2d);
+
+            float advX = gl.getX();
+            float advY = gl.getY();
+            int oldPosX = 0, oldPosY = 0;
+
+            if (gl.isSubPixPos()) {
+                advX += 0.1666667f;
+                advY += 0.1666667f;
+            } else {
+                advX += 0.5f;
+                advY += 0.5f;
+            }
+
+            XRGlyphCacheEntry[] cachedGlyphs = glyphCache.cacheGlyphs(gl);
+            boolean containsLCDGlyphs = false;
+            int activeGlyphSet = cachedGlyphs[0].getGlyphSet();
+
+            int eltIndex = -1;
+            gl.getBounds();
+            float[] positions = gl.getPositions();
+            for (int i = 0; i < gl.getNumGlyphs(); i++) {
+                gl.setGlyphIndex(i);
+                XRGlyphCacheEntry cacheEntry = cachedGlyphs[i];
+
+                eltList.getGlyphs().addInt(cacheEntry.getGlyphID());
+                int glyphSet = cacheEntry.getGlyphSet();
+
+                containsLCDGlyphs |= (glyphSet == glyphCache.lcdGlyphSet);
+
+                int posX = 0, posY = 0;
+                if (gl.usePositions()
+                        || (cacheEntry.getXAdvance() != ((float) cacheEntry.getXOff()) || cacheEntry.getYAdvance() != ((float) cacheEntry.getYOff()))
+                        || eltIndex < 0 || glyphSet != activeGlyphSet) {
+
+                    eltIndex = eltList.getNextIndex();
+                    eltList.setCharCnt(eltIndex, 1);
+                    activeGlyphSet = glyphSet;
+                    eltList.setGlyphSet(eltIndex, glyphSet);
+
+                    if (gl.usePositions()) {
+                        // /*In this case advX only stores rounding errors*/
+                        float x = positions[i * 2] + advX;
+                        float y = positions[i * 2 + 1] + advY;
+                        posX = (int) Math.floor(x);
+                        posY = (int) Math.floor(y);
+                        advX -= cacheEntry.getXOff();
+                        advY -= cacheEntry.getYOff();
+                    } else {
+                        /*
+                         * Calculate next glyph's position in the case of
+                         * relative positioning. In XRender we can only position
+                         * glyphs using integer coordinates, therefor we sum all
+                         * the advances up as float, and convert them to integer
+                         * later. This way rounding-error can be corrected, and
+                         * is required to be consistent with the software loops.
+                         */
+                        posX = (int) Math.floor(advX);
+                        posY = (int) Math.floor(advY);
+
+                        // Advance of ELT = difference between stored
+                        // relative
+                        // positioning information and required float.
+                        advX += (cacheEntry.getXAdvance() - cacheEntry.getXOff());
+                        advY += (cacheEntry.getYAdvance() - cacheEntry.getYOff());
+                    }
+                    /*
+                     * Offset of the current glyph is the difference to the last
+                     * glyph and this one
+                     */
+                    eltList.setXOff(eltIndex, (posX - oldPosX));
+                    eltList.setYOff(eltIndex, (posY - oldPosY));
+
+                    oldPosX = posX;
+                    oldPosY = posY;
+
+                } else {
+                    eltList.setCharCnt(eltIndex, eltList.getCharCnt(eltIndex) + 1);
+                }
+            }
+
+            int maskFormat = containsLCDGlyphs ? XRUtils.PictStandardARGB32 : XRUtils.PictStandardA8;
+            maskBuffer.compositeText(x11sd.picture, 0, maskFormat, eltList);
+
+            eltList.clear();
+        } finally {
+            SunToolkit.awtUnlock();
+        }
+    }
+}
--- a/jdk/src/solaris/classes/sun/java2d/UnixSurfaceManagerFactory.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/solaris/classes/sun/java2d/UnixSurfaceManagerFactory.java	Wed Jul 21 09:57:21 2010 -0700
@@ -33,6 +33,7 @@
 import sun.java2d.opengl.GLXGraphicsConfig;
 import sun.java2d.opengl.GLXVolatileSurfaceManager;
 import sun.java2d.x11.X11VolatileSurfaceManager;
+import sun.java2d.xr.*;
 
 /**
  * The SurfaceManagerFactory that creates VolatileSurfaceManager
@@ -54,9 +55,12 @@
                                                         Object context)
     {
         GraphicsConfiguration gc = vImg.getGraphicsConfig();
+
         if (gc instanceof GLXGraphicsConfig) {
             return new GLXVolatileSurfaceManager(vImg, context);
-        } else {
+        } else if(gc instanceof XRGraphicsConfig) {
+            return new XRVolatileSurfaceManager(vImg, context);
+        }else {
             return new X11VolatileSurfaceManager(vImg, context);
         }
     }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/src/solaris/classes/sun/java2d/jules/IdleTileCache.java	Wed Jul 21 09:57:21 2010 -0700
@@ -0,0 +1,109 @@
+/*
+ * Copyright 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 sun.java2d.jules;
+
+import java.util.*;
+
+public class IdleTileCache {
+    final static int IDLE_TILE_SYNC_GRANULARITY = 16;
+    final static ArrayList<JulesTile> idleBuffers = new ArrayList<JulesTile>();
+
+    ArrayList<JulesTile> idleTileWorkerCacheList = new ArrayList<JulesTile>();
+    ArrayList<JulesTile> idleTileConsumerCacheList =
+              new ArrayList<JulesTile>(IDLE_TILE_SYNC_GRANULARITY);
+
+    /**
+     * Return a cached Tile, if possible from cache.
+     * Allowed caller: Rasterizer/Producer-Thread
+     *
+     * @param: maxCache - Specify the maximum amount of tiles needed
+     */
+    public JulesTile getIdleTileWorker(int maxCache) {
+        /* Try to fetch idle tiles from the global cache list */
+        if (idleTileWorkerCacheList.size() == 0) {
+            idleTileWorkerCacheList.ensureCapacity(maxCache);
+
+            synchronized (idleBuffers) {
+                for (int i = 0; i < maxCache && idleBuffers.size() > 0; i++) {
+                    idleTileWorkerCacheList.add(
+                            idleBuffers.remove(idleBuffers.size() - 1));
+                }
+            }
+        }
+
+        if (idleTileWorkerCacheList.size() > 0) {
+            return idleTileWorkerCacheList.remove(idleTileWorkerCacheList.size() - 1);
+        }
+
+        return new JulesTile();
+    }
+
+    /**
+     * Release tile and allow it to be re-used by another thread. Allowed
+     *  Allowed caller: MaskBlit/Consumer-Thread
+     */
+    public void releaseTile(JulesTile tile) {
+        if (tile != null && tile.hasBuffer()) {
+            idleTileConsumerCacheList.add(tile);
+
+            if (idleTileConsumerCacheList.size() > IDLE_TILE_SYNC_GRANULARITY) {
+                synchronized (idleBuffers) {
+                    idleBuffers.addAll(idleTileConsumerCacheList);
+                }
+                idleTileConsumerCacheList.clear();
+            }
+        }
+    }
+
+    /**
+     * Releases thread-local tiles cached for use by the rasterizing thread.
+     * Allowed caller: Rasterizer/Producer-Thread
+     */
+    public void disposeRasterizerResources() {
+        releaseTiles(idleTileWorkerCacheList);
+    }
+
+    /**
+     * Releases thread-local tiles cached for performance reasons. Allowed
+     * Allowed caller: MaskBlit/Consumer-Thread
+     */
+    public void disposeConsumerResources() {
+        releaseTiles(idleTileConsumerCacheList);
+    }
+
+    /**
+     * Release a list of tiles and allow it to be re-used by another thread.
+     * Thread safe.
+     */
+    public void releaseTiles(List<JulesTile> tileList) {
+        if (tileList.size() > 0) {
+            synchronized (idleBuffers) {
+                idleBuffers.addAll(tileList);
+            }
+            tileList.clear();
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/src/solaris/classes/sun/java2d/jules/JulesAATileGenerator.java	Wed Jul 21 09:57:21 2010 -0700
@@ -0,0 +1,349 @@
+/*
+ * Copyright 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 sun.java2d.jules;
+
+import java.awt.*;
+import java.awt.geom.*;
+import java.util.concurrent.*;
+import sun.java2d.pipe.*;
+import sun.java2d.xr.*;
+
+public class JulesAATileGenerator implements AATileGenerator {
+    /* Threading stuff */
+    final static ExecutorService rasterThreadPool =
+                                          Executors.newCachedThreadPool();
+    final static int CPU_CNT = Runtime.getRuntime().availableProcessors();
+
+    final static boolean ENABLE_THREADING = false;
+    final static int THREAD_MIN = 16;
+    final static int THREAD_BEGIN = 16;
+
+    IdleTileCache tileCache;
+    TileWorker worker;
+    boolean threaded = false;
+    int rasterTileCnt;
+
+    /* Tiling */
+    final static int TILE_SIZE = 32;
+    final static int TILE_SIZE_FP = 32 << 16;
+    int left, right, top, bottom, width, height;
+    int leftFP, topFP;
+    int tileCnt, tilesX, tilesY;
+    int currTilePos = 0;
+    TrapezoidList traps;
+    TileTrapContainer[] tiledTrapArray;
+    JulesTile mainTile;
+
+    public JulesAATileGenerator(Shape s, AffineTransform at, Region clip,
+                                BasicStroke bs, boolean thin,
+                                boolean normalize, int[] bbox) {
+        JulesPathBuf buf = new JulesPathBuf();
+
+        if (bs == null) {
+            traps = buf.tesselateFill(s, at, clip);
+        } else {
+            traps = buf.tesselateStroke(s, bs, thin, false, true, at, clip);
+        }
+
+        calculateArea(bbox);
+        bucketSortTraps();
+        calculateTypicalAlpha();
+
+        threaded = ENABLE_THREADING &&
+                   rasterTileCnt >= THREAD_MIN && CPU_CNT >= 2;
+        if (threaded) {
+            tileCache = new IdleTileCache();
+            worker = new TileWorker(this, THREAD_BEGIN, tileCache);
+            rasterThreadPool.execute(worker);
+        }
+
+        mainTile = new JulesTile();
+    }
+
+    private static native long
+        rasterizeTrapezoidsNative(long pixmanImagePtr, int[] traps,
+                                  int[] trapPos, int trapCnt,
+                                  byte[] buffer, int xOff, int yOff);
+
+    private static native void freePixmanImgPtr(long pixmanImgPtr);
+
+    private void calculateArea(int[] bbox) {
+        tilesX = 0;
+        tilesY = 0;
+        tileCnt = 0;
+        bbox[0] = 0;
+        bbox[1] = 0;
+        bbox[2] = 0;
+        bbox[3] = 0;
+
+        if (traps.getSize() > 0) {
+            left = traps.getLeft();
+            right = traps.getRight();
+            top = traps.getTop();
+            bottom = traps.getBottom();
+            leftFP = left << 16;
+            topFP = top << 16;
+
+            bbox[0] = left;
+            bbox[1] = top;
+            bbox[2] = right;
+            bbox[3] = bottom;
+
+            width = right - left;
+            height = bottom - top;
+
+            if (width > 0 && height > 0) {
+                tilesX = (int) Math.ceil(((double) width) / TILE_SIZE);
+                tilesY = (int) Math.ceil(((double) height) / TILE_SIZE);
+                tileCnt = tilesY * tilesX;
+                tiledTrapArray = new TileTrapContainer[tileCnt];
+            } else {
+                // If there is no area touched by the traps, don't
+                // render them.
+                traps.setSize(0);
+            }
+        }
+    }
+
+
+    private void bucketSortTraps() {
+
+        for (int i = 0; i < traps.getSize(); i++) {
+            int top = traps.getTop(i) - XRUtils.XDoubleToFixed(this.top);
+            int bottom = traps.getBottom(i) - topFP;
+            int p1xLeft = traps.getP1XLeft(i) - leftFP;
+            int p2xLeft = traps.getP2XLeft(i) - leftFP;
+            int p1xRight = traps.getP1XRight(i) - leftFP;
+            int p2xRight = traps.getP2XRight(i) - leftFP;
+
+            int minLeft = Math.min(p1xLeft, p2xLeft);
+            int maxRight = Math.max(p1xRight, p2xRight);
+
+            maxRight = maxRight > 0 ? maxRight - 1 : maxRight;
+            bottom = bottom > 0 ? bottom - 1 : bottom;
+
+            int startTileY = top / TILE_SIZE_FP;
+            int endTileY = bottom / TILE_SIZE_FP;
+            int startTileX = minLeft / TILE_SIZE_FP;
+            int endTileX = maxRight / TILE_SIZE_FP;
+
+            for (int n = startTileY; n <= endTileY; n++) {
+
+                for (int m = startTileX; m <= endTileX; m++) {
+                    int trapArrayPos = n * tilesX + m;
+                    TileTrapContainer trapTileList = tiledTrapArray[trapArrayPos];
+                    if (trapTileList == null) {
+                        trapTileList = new TileTrapContainer(new GrowableIntArray(1, 16));
+                        tiledTrapArray[trapArrayPos] = trapTileList;
+                    }
+
+                    trapTileList.getTraps().addInt(i);
+                }
+            }
+        }
+    }
+
+    public void getAlpha(byte[] tileBuffer, int offset, int rowstride) {
+        JulesTile tile = null;
+
+        if (threaded) {
+            tile = worker.getPreRasterizedTile(currTilePos);
+        }
+
+        if (tile != null) {
+            System.arraycopy(tile.getImgBuffer(), 0,
+                             tileBuffer, 0, tileBuffer.length);
+            tileCache.releaseTile(tile);
+        } else {
+            mainTile.setImgBuffer(tileBuffer);
+            rasterizeTile(currTilePos, mainTile);
+        }
+
+        nextTile();
+    }
+
+    public void calculateTypicalAlpha() {
+        rasterTileCnt = 0;
+
+        for (int index = 0; index < tileCnt; index++) {
+
+            TileTrapContainer trapCont = tiledTrapArray[index];
+            if (trapCont != null) {
+                GrowableIntArray trapList = trapCont.getTraps();
+
+                int tileAlpha = 127;
+                if (trapList == null || trapList.getSize() == 0) {
+                    tileAlpha = 0;
+                } else if (doTrapsCoverTile(trapList, index)) {
+                    tileAlpha = 0xff;
+                }
+
+                if (tileAlpha == 127 || tileAlpha == 0xff) {
+                    rasterTileCnt++;
+                }
+
+                trapCont.setTileAlpha(tileAlpha);
+            }
+        }
+    }
+
+    /*
+     * Optimization for large fills. Foutunatly cairo does generate an y-sorted
+     * list of trapezoids. This makes it quite simple to check wether a tile is
+     * fully covered by traps by: - Checking wether the tile is fully covered by
+     * traps vertically (trap 2 starts where trap 1 ended) - Checking wether all
+     * traps cover the tile horizontally This also works, when a single tile
+     * coveres the whole tile.
+     */
+    protected boolean doTrapsCoverTile(GrowableIntArray trapList, int tileIndex) {
+
+        // Don't bother optimizing tiles with lots of traps, usually it won't
+        // succeed anyway.
+        if (trapList.getSize() > TILE_SIZE) {
+            return false;
+        }
+
+        int tileStartX = getXPos(tileIndex) * TILE_SIZE_FP + leftFP;
+        int tileStartY = getYPos(tileIndex) * TILE_SIZE_FP + topFP;
+        int tileEndX = tileStartX + TILE_SIZE_FP;
+        int tileEndY = tileStartY + TILE_SIZE_FP;
+
+        // Check wether first tile covers the beginning of the tile vertically
+        int firstTop = traps.getTop(trapList.getInt(0));
+        int firstBottom = traps.getBottom(trapList.getInt(0));
+        if (firstTop > tileStartY || firstBottom < tileStartY) {
+            return false;
+        }
+
+        // Initialize lastBottom with top, in order to pass the checks for the
+        // first iteration
+        int lastBottom = firstTop;
+
+        for (int i = 0; i < trapList.getSize(); i++) {
+            int trapPos = trapList.getInt(i);
+            if (traps.getP1XLeft(trapPos) > tileStartX ||
+                traps.getP2XLeft(trapPos) > tileStartX ||
+                traps.getP1XRight(trapPos) < tileEndX  ||
+                traps.getP2XRight(trapPos) < tileEndX  ||
+                 traps.getTop(trapPos) != lastBottom)
+            {
+                return false;
+            }
+            lastBottom = traps.getBottom(trapPos);
+        }
+
+        // When the last trap covered the tileEnd vertically, the tile is fully
+        // covered
+        return lastBottom >= tileEndY;
+    }
+
+    public int getTypicalAlpha() {
+        if (tiledTrapArray[currTilePos] == null) {
+            return 0;
+        } else {
+            return tiledTrapArray[currTilePos].getTileAlpha();
+        }
+    }
+
+    public void dispose() {
+        freePixmanImgPtr(mainTile.getPixmanImgPtr());
+
+        if (threaded) {
+            tileCache.disposeConsumerResources();
+            worker.disposeConsumerResources();
+        }
+    }
+
+    protected JulesTile rasterizeTile(int tileIndex, JulesTile tile) {
+        int tileOffsetX = left + getXPos(tileIndex) * TILE_SIZE;
+        int tileOffsetY = top + getYPos(tileIndex) * TILE_SIZE;
+        TileTrapContainer trapCont = tiledTrapArray[tileIndex];
+        GrowableIntArray trapList = trapCont.getTraps();
+
+        if (trapCont.getTileAlpha() == 127) {
+            long pixmanImgPtr =
+                 rasterizeTrapezoidsNative(tile.getPixmanImgPtr(),
+                                           traps.getTrapArray(),
+                                           trapList.getArray(),
+                                           trapList.getSize(),
+                                           tile.getImgBuffer(),
+                                           tileOffsetX, tileOffsetY);
+            tile.setPixmanImgPtr(pixmanImgPtr);
+        }
+
+        tile.setTilePos(tileIndex);
+        return tile;
+    }
+
+    protected int getXPos(int arrayPos) {
+        return arrayPos % tilesX;
+    }
+
+    protected int getYPos(int arrayPos) {
+        return arrayPos / tilesX;
+    }
+
+    public void nextTile() {
+        currTilePos++;
+    }
+
+    public int getTileHeight() {
+        return TILE_SIZE;
+    }
+
+    public int getTileWidth() {
+        return TILE_SIZE;
+    }
+
+    public int getTileCount() {
+        return tileCnt;
+    }
+
+    public TileTrapContainer getTrapContainer(int index) {
+        return tiledTrapArray[index];
+    }
+}
+
+class TileTrapContainer {
+    int tileAlpha;
+    GrowableIntArray traps;
+
+    public TileTrapContainer(GrowableIntArray traps) {
+        this.traps = traps;
+    }
+
+    public void setTileAlpha(int tileAlpha) {
+        this.tileAlpha = tileAlpha;
+    }
+
+    public int getTileAlpha() {
+        return tileAlpha;
+    }
+
+    public GrowableIntArray getTraps() {
+        return traps;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/src/solaris/classes/sun/java2d/jules/JulesPathBuf.java	Wed Jul 21 09:57:21 2010 -0700
@@ -0,0 +1,271 @@
+/*
+ * Copyright 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 sun.java2d.jules;
+
+import java.awt.*;
+import java.awt.geom.*;
+import sun.awt.X11GraphicsEnvironment;
+import sun.java2d.pipe.*;
+import sun.java2d.xr.*;
+
+public class JulesPathBuf {
+    static final double[] emptyDash = new double[0];
+
+    private static final byte CAIRO_PATH_OP_MOVE_TO = 0;
+    private static final byte CAIRO_PATH_OP_LINE_TO = 1;
+    private static final byte CAIRO_PATH_OP_CURVE_TO = 2;
+    private static final byte CAIRO_PATH_OP_CLOSE_PATH = 3;
+
+    private static final int  CAIRO_FILL_RULE_WINDING = 0;
+    private static final int CAIRO_FILL_RULE_EVEN_ODD = 1;
+
+    GrowablePointArray points = new GrowablePointArray(128);
+    GrowableByteArray ops = new GrowableByteArray(1, 128);
+    int[] xTrapArray = new int[512];
+
+    private static final boolean isCairoAvailable;
+
+    static {
+        isCairoAvailable =
+           java.security.AccessController.doPrivileged(
+                          new java.security.PrivilegedAction<Boolean>() {
+            public Boolean run() {
+                boolean loadSuccess = false;
+                if (X11GraphicsEnvironment.isXRenderAvailable()) {
+                    try {
+                        System.loadLibrary("jules");
+                        loadSuccess = true;
+                        if (X11GraphicsEnvironment.isXRenderVerbose()) {
+                            System.out.println(
+                                       "Xrender: INFO: Jules library loaded");
+                        }
+                    } catch (UnsatisfiedLinkError ex) {
+                        loadSuccess = false;
+                        if (X11GraphicsEnvironment.isXRenderVerbose()) {
+                            System.out.println(
+                                "Xrender: INFO: Jules library not installed.");
+                        }
+                    }
+                }
+                return Boolean.valueOf(loadSuccess);
+            }
+        });
+    }
+
+    public static boolean isCairoAvailable() {
+        return isCairoAvailable;
+    }
+
+    public TrapezoidList tesselateFill(Shape s, AffineTransform at, Region clip) {
+        int windingRule = convertPathData(s, at);
+        xTrapArray[0] = 0;
+
+        xTrapArray = tesselateFillNative(points.getArray(), ops.getArray(),
+                                         points.getSize(), ops.getSize(),
+                                         xTrapArray, xTrapArray.length,
+                                         getCairoWindingRule(windingRule),
+                                         clip.getLoX(), clip.getLoY(),
+                                         clip.getHiX(), clip.getHiY());
+
+        return new TrapezoidList(xTrapArray);
+    }
+
+    public TrapezoidList tesselateStroke(Shape s, BasicStroke bs, boolean thin,
+                                         boolean adjust, boolean antialias,
+                                         AffineTransform at, Region clip) {
+
+        float lw;
+        if (thin) {
+            if (antialias) {
+                lw = 0.5f;
+            } else {
+                lw = 1.0f;
+            }
+        } else {
+            lw = bs.getLineWidth();
+        }
+
+        convertPathData(s, at);
+
+        double[] dashArray = floatToDoubleArray(bs.getDashArray());
+        xTrapArray[0] = 0;
+
+        xTrapArray =
+             tesselateStrokeNative(points.getArray(), ops.getArray(),
+                                   points.getSize(), ops.getSize(),
+                                   xTrapArray, xTrapArray.length, lw,
+                                   bs.getEndCap(), bs.getLineJoin(),
+                                   bs.getMiterLimit(), dashArray,
+                                   dashArray.length, bs.getDashPhase(),
+                                   1, 0, 0, 0, 1, 0,
+                                   clip.getLoX(), clip.getLoY(),
+                                   clip.getHiX(), clip.getHiY());
+
+        return new TrapezoidList(xTrapArray);
+    }
+
+    protected double[] floatToDoubleArray(float[] dashArrayFloat) {
+        double[] dashArrayDouble = emptyDash;
+        if (dashArrayFloat != null) {
+            dashArrayDouble = new double[dashArrayFloat.length];
+
+            for (int i = 0; i < dashArrayFloat.length; i++) {
+                dashArrayDouble[i] = dashArrayFloat[i];
+            }
+        }
+
+        return dashArrayDouble;
+    }
+
+    protected int convertPathData(Shape s, AffineTransform at) {
+        PathIterator pi = s.getPathIterator(at);
+
+        double[] coords = new double[6];
+        double currX = 0;
+        double currY = 0;
+
+        while (!pi.isDone()) {
+            int curOp = pi.currentSegment(coords);
+
+            int pointIndex;
+            switch (curOp) {
+
+            case PathIterator.SEG_MOVETO:
+                ops.addByte(CAIRO_PATH_OP_MOVE_TO);
+                pointIndex = points.getNextIndex();
+                points.setX(pointIndex, DoubleToCairoFixed(coords[0]));
+                points.setY(pointIndex, DoubleToCairoFixed(coords[1]));
+                currX = coords[0];
+                currY = coords[1];
+                break;
+
+            case PathIterator.SEG_LINETO:
+                ops.addByte(CAIRO_PATH_OP_LINE_TO);
+                pointIndex = points.getNextIndex();
+                points.setX(pointIndex, DoubleToCairoFixed(coords[0]));
+                points.setY(pointIndex, DoubleToCairoFixed(coords[1]));
+                currX = coords[0];
+                currY = coords[1];
+                break;
+
+                /**
+                 *    q0 = p0
+                 *    q1 = (p0+2*p1)/3
+                 *    q2 = (p2+2*p1)/3
+                 *    q3 = p2
+                 */
+            case PathIterator.SEG_QUADTO:
+                double x1 = coords[0];
+                double y1 = coords[1];
+                double x2, y2;
+                double x3 = coords[2];
+                double y3 = coords[3];
+
+                x2 = x1 + (x3 - x1) / 3;
+                y2 = y1 + (y3 - y1) / 3;
+                x1 = currX + 2 * (x1 - currX) / 3;
+                y1 =currY + 2 * (y1 - currY) / 3;
+
+                ops.addByte(CAIRO_PATH_OP_CURVE_TO);
+                pointIndex = points.getNextIndex();
+                points.setX(pointIndex, DoubleToCairoFixed(x1));
+                points.setY(pointIndex, DoubleToCairoFixed(y1));
+                pointIndex = points.getNextIndex();
+                points.setX(pointIndex, DoubleToCairoFixed(x2));
+                points.setY(pointIndex, DoubleToCairoFixed(y2));
+                pointIndex = points.getNextIndex();
+                points.setX(pointIndex, DoubleToCairoFixed(x3));
+                points.setY(pointIndex, DoubleToCairoFixed(y3));
+                currX = x3;
+                currY = y3;
+                break;
+
+            case PathIterator.SEG_CUBICTO:
+                ops.addByte(CAIRO_PATH_OP_CURVE_TO);
+                pointIndex = points.getNextIndex();
+                points.setX(pointIndex, DoubleToCairoFixed(coords[0]));
+                points.setY(pointIndex, DoubleToCairoFixed(coords[1]));
+                pointIndex = points.getNextIndex();
+                points.setX(pointIndex, DoubleToCairoFixed(coords[2]));
+                points.setY(pointIndex, DoubleToCairoFixed(coords[3]));
+                pointIndex = points.getNextIndex();
+                points.setX(pointIndex, DoubleToCairoFixed(coords[4]));
+                points.setY(pointIndex, DoubleToCairoFixed(coords[5]));
+                currX = coords[4];
+                currY = coords[5];
+                break;
+
+            case PathIterator.SEG_CLOSE:
+                ops.addByte(CAIRO_PATH_OP_CLOSE_PATH);
+                break;
+            }
+
+            pi.next();
+        }
+
+        return pi.getWindingRule();
+    }
+
+    private static native int[]
+         tesselateStrokeNative(int[] pointArray, byte[] ops,
+                               int pointCnt, int opCnt,
+                               int[] xTrapArray, int xTrapArrayLength,
+                               double lineWidth, int lineCap, int lineJoin,
+                               double miterLimit, double[] dashArray,
+                               int dashCnt, double offset,
+                               double m00, double m01, double m02,
+                               double m10, double m11, double m12,
+                               int clipLowX, int clipLowY,
+                               int clipWidth, int clipHeight);
+
+    private static native int[]
+        tesselateFillNative(int[] pointArray, byte[] ops, int pointCnt,
+                            int opCnt, int[] xTrapArray, int xTrapArrayLength,
+                            int windingRule, int clipLowX, int clipLowY,                                    int clipWidth, int clipHeight);
+
+    public void clear() {
+        points.clear();
+        ops.clear();
+        xTrapArray[0] = 0;
+    }
+
+    private static int DoubleToCairoFixed(double dbl) {
+        return (int) (dbl * 256);
+    }
+
+    private static int getCairoWindingRule(int j2dWindingRule) {
+        switch(j2dWindingRule) {
+        case PathIterator.WIND_EVEN_ODD:
+            return CAIRO_FILL_RULE_EVEN_ODD;
+
+        case PathIterator.WIND_NON_ZERO:
+            return CAIRO_FILL_RULE_WINDING;
+
+            default:
+                throw new IllegalArgumentException("Illegal Java2D winding rule specified");
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/src/solaris/classes/sun/java2d/jules/JulesRenderingEngine.java	Wed Jul 21 09:57:21 2010 -0700
@@ -0,0 +1,54 @@
+/*
+ * Copyright 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 sun.java2d.jules;
+
+import java.awt.*;
+
+import java.awt.geom.*;
+import sun.java2d.pipe.*;
+import sun.java2d.pisces.*;
+
+public class JulesRenderingEngine extends PiscesRenderingEngine {
+
+    @Override
+    public AATileGenerator
+         getAATileGenerator(Shape s, AffineTransform at, Region clip,
+                            BasicStroke bs, boolean thin,
+                            boolean normalize, int[] bbox) {
+
+        if (JulesPathBuf.isCairoAvailable()) {
+            return new JulesAATileGenerator(s, at, clip, bs, thin,
+                                            normalize, bbox);
+        } else {
+            return super.getAATileGenerator(s, at, clip, bs, thin,
+                                            normalize, bbox);
+        }
+    }
+
+    public float getMinimumAAPenSize() {
+        return 0.5f;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/src/solaris/classes/sun/java2d/jules/JulesShapePipe.java	Wed Jul 21 09:57:21 2010 -0700
@@ -0,0 +1,102 @@
+/*
+ * Copyright 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 sun.java2d.jules;
+
+import java.awt.*;
+import sun.awt.*;
+import sun.java2d.*;
+import sun.java2d.pipe.*;
+import sun.java2d.xr.*;
+
+public class JulesShapePipe implements ShapeDrawPipe {
+
+    XRCompositeManager compMan;
+    JulesPathBuf buf = new JulesPathBuf();
+
+    public JulesShapePipe(XRCompositeManager compMan) {
+        this.compMan = compMan;
+    }
+
+    /**
+     * Common validate method, used by all XRRender functions to validate the
+     * destination context.
+     */
+    private final void validateSurface(SunGraphics2D sg2d) {
+        XRSurfaceData xrsd = (XRSurfaceData) sg2d.surfaceData;
+        xrsd.validateAsDestination(sg2d, sg2d.getCompClip());
+        xrsd.maskBuffer.validateCompositeState(sg2d.composite, sg2d.transform,
+                                               sg2d.paint, sg2d);
+    }
+
+    public void draw(SunGraphics2D sg2d, Shape s) {
+        try {
+            SunToolkit.awtLock();
+            validateSurface(sg2d);
+            XRSurfaceData xrsd = (XRSurfaceData) sg2d.surfaceData;
+
+            BasicStroke bs;
+
+            if (sg2d.stroke instanceof BasicStroke) {
+                bs = (BasicStroke) sg2d.stroke;
+            } else { //TODO: What happens in the case of a !BasicStroke??
+                s = sg2d.stroke.createStrokedShape(s);
+                bs = null;
+            }
+
+            boolean adjust =
+                (bs != null && sg2d.strokeHint != SunHints.INTVAL_STROKE_PURE);
+            boolean thin = (sg2d.strokeState <= SunGraphics2D.STROKE_THINDASHED);
+
+            TrapezoidList traps =
+                 buf.tesselateStroke(s, bs, thin, adjust, true,
+                                     sg2d.transform, sg2d.getCompClip());
+            compMan.XRCompositeTraps(xrsd.picture,
+                                     sg2d.transX, sg2d.transY, traps);
+
+            buf.clear();
+
+        } finally {
+            SunToolkit.awtUnlock();
+        }
+    }
+
+    public void fill(SunGraphics2D sg2d, Shape s) {
+        try {
+            SunToolkit.awtLock();
+            validateSurface(sg2d);
+
+            XRSurfaceData xrsd = (XRSurfaceData) sg2d.surfaceData;
+
+            TrapezoidList traps = buf.tesselateFill(s, sg2d.transform,
+                                                    sg2d.getCompClip());
+            compMan.XRCompositeTraps(xrsd.picture, 0, 0, traps);
+
+            buf.clear();
+        } finally {
+            SunToolkit.awtUnlock();
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/src/solaris/classes/sun/java2d/jules/JulesTile.java	Wed Jul 21 09:57:21 2010 -0700
@@ -0,0 +1,67 @@
+/*
+ * Copyright 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 sun.java2d.jules;
+
+public class JulesTile {
+    byte[] imgBuffer;
+    long pixmanImgPtr = 0;
+    int tilePos;
+
+    public JulesTile() {
+    }
+
+    public byte[] getImgBuffer() {
+        if(imgBuffer == null) {
+            imgBuffer = new byte[1024];
+        }
+
+        return imgBuffer;
+    }
+
+    public long getPixmanImgPtr() {
+        return pixmanImgPtr;
+    }
+
+    public void setPixmanImgPtr(long pixmanImgPtr) {
+        this.pixmanImgPtr = pixmanImgPtr;
+    }
+
+    public boolean hasBuffer() {
+        return imgBuffer != null;
+    }
+
+    public int getTilePos() {
+        return tilePos;
+    }
+
+    public void setTilePos(int tilePos) {
+        this.tilePos = tilePos;
+    }
+
+    public void setImgBuffer(byte[] imgBuffer){
+        this.imgBuffer = imgBuffer;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/src/solaris/classes/sun/java2d/jules/TileWorker.java	Wed Jul 21 09:57:21 2010 -0700
@@ -0,0 +1,146 @@
+/*
+ * Copyright 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 sun.java2d.jules;
+
+import java.util.*;
+
+public class TileWorker implements Runnable {
+    final static int RASTERIZED_TILE_SYNC_GRANULARITY = 8;
+    final ArrayList<JulesTile> rasterizedTileConsumerCache =
+         new ArrayList<JulesTile>();
+    final LinkedList<JulesTile> rasterizedBuffers = new LinkedList<JulesTile>();
+
+    IdleTileCache tileCache;
+    JulesAATileGenerator tileGenerator;
+    int workerStartIndex;
+    volatile int consumerPos = 0;
+
+    /* Threading statistics */
+    int mainThreadCnt = 0;
+    int workerCnt = 0;
+    int doubled = 0;
+
+    public TileWorker(JulesAATileGenerator tileGenerator, int workerStartIndex, IdleTileCache tileCache) {
+        this.tileGenerator = tileGenerator;
+        this.workerStartIndex = workerStartIndex;
+        this.tileCache = tileCache;
+    }
+
+    public void run() {
+        ArrayList<JulesTile> tiles = new ArrayList<JulesTile>(16);
+
+        for (int i = workerStartIndex; i < tileGenerator.getTileCount(); i++) {
+            TileTrapContainer tile = tileGenerator.getTrapContainer(i);
+
+            if (tile != null && tile.getTileAlpha() == 127) {
+                JulesTile rasterizedTile =
+                      tileGenerator.rasterizeTile(i,
+                           tileCache.getIdleTileWorker(
+                               tileGenerator.getTileCount() - i - 1));
+                tiles.add(rasterizedTile);
+
+                if (tiles.size() > RASTERIZED_TILE_SYNC_GRANULARITY) {
+                    addRasterizedTiles(tiles);
+                    tiles.clear();
+                }
+            }
+
+            i = Math.max(i, consumerPos + RASTERIZED_TILE_SYNC_GRANULARITY / 2);
+        }
+        addRasterizedTiles(tiles);
+
+        tileCache.disposeRasterizerResources();
+    }
+
+    /**
+     * Returns a rasterized tile for the specified tilePos,
+     * or null if it isn't available.
+     * Allowed caller: MaskBlit/Consumer-Thread
+     */
+    public JulesTile getPreRasterizedTile(int tilePos) {
+        JulesTile tile = null;
+
+        if (rasterizedTileConsumerCache.size() == 0 &&
+            tilePos >= workerStartIndex)
+        {
+            synchronized (rasterizedBuffers) {
+                rasterizedTileConsumerCache.addAll(rasterizedBuffers);
+                rasterizedBuffers.clear();
+            }
+        }
+
+        while (tile == null && rasterizedTileConsumerCache.size() > 0) {
+            JulesTile t = rasterizedTileConsumerCache.get(0);
+
+            if (t.getTilePos() > tilePos) {
+                break;
+            }
+
+            if (t.getTilePos() < tilePos) {
+                tileCache.releaseTile(t);
+                doubled++;
+            }
+
+            if (t.getTilePos() <= tilePos) {
+                rasterizedTileConsumerCache.remove(0);
+            }
+
+            if (t.getTilePos() == tilePos) {
+                tile = t;
+            }
+        }
+
+        if (tile == null) {
+            mainThreadCnt++;
+
+            // If there are no tiles left, tell the producer the current
+            // position. This avoids producing tiles twice.
+            consumerPos = tilePos;
+        } else {
+            workerCnt++;
+        }
+
+        return tile;
+    }
+
+    private void addRasterizedTiles(ArrayList<JulesTile> tiles) {
+        synchronized (rasterizedBuffers) {
+            rasterizedBuffers.addAll(tiles);
+        }
+    }
+
+    /**
+     * Releases cached tiles.
+     * Allowed caller: MaskBlit/Consumer-Thread
+     */
+    public void disposeConsumerResources() {
+        synchronized (rasterizedBuffers) {
+            tileCache.releaseTiles(rasterizedBuffers);
+        }
+
+        tileCache.releaseTiles(rasterizedTileConsumerCache);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/src/solaris/classes/sun/java2d/jules/TrapezoidList.java	Wed Jul 21 09:57:21 2010 -0700
@@ -0,0 +1,110 @@
+/*
+ * Copyright 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 sun.java2d.jules;
+
+public class TrapezoidList {
+    public static final int TRAP_START_INDEX = 5;
+    public static final int TRAP_SIZE = 10;
+
+    int[] trapArray;
+
+    public TrapezoidList(int[] trapArray) {
+        this.trapArray = trapArray;
+    }
+
+    public final int[] getTrapArray() {
+        return trapArray;
+    }
+
+    public final int getSize() {
+        return trapArray[0];
+    }
+
+    public final void setSize(int size) {
+        trapArray[0] = 0;
+    }
+
+    public final int getLeft() {
+        return trapArray[1];
+    }
+
+    public final int getTop() {
+        return trapArray[2];
+    }
+
+    public final int getRight() {
+        return trapArray[3];
+    }
+
+    public final int getBottom() {
+        return trapArray[4];
+    }
+
+
+    private final int getTrapStartAddresse(int pos) {
+        return TRAP_START_INDEX + TRAP_SIZE * pos;
+    }
+
+    public final int getTop(int pos) {
+        return trapArray[getTrapStartAddresse(pos) + 0];
+    }
+
+    public final int getBottom(int pos) {
+        return trapArray[getTrapStartAddresse(pos) + 1];
+    }
+
+    public final int getP1XLeft(int pos) {
+        return trapArray[getTrapStartAddresse(pos) + 2];
+    }
+
+    public final int getP1YLeft(int pos) {
+        return trapArray[getTrapStartAddresse(pos) + 3];
+    }
+
+    public final int getP2XLeft(int pos) {
+        return trapArray[getTrapStartAddresse(pos) + 4];
+    }
+
+    public final int getP2YLeft(int pos) {
+        return trapArray[getTrapStartAddresse(pos) + 5];
+    }
+
+    public final int getP1XRight(int pos) {
+        return trapArray[getTrapStartAddresse(pos) + 6];
+    }
+
+    public final int getP1YRight(int pos) {
+        return trapArray[getTrapStartAddresse(pos) + 7];
+    }
+
+    public final int getP2XRight(int pos) {
+        return trapArray[getTrapStartAddresse(pos) + 8];
+    }
+
+    public final int getP2YRight(int pos) {
+        return trapArray[getTrapStartAddresse(pos) + 9];
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/src/solaris/classes/sun/java2d/pisces/META-INF/services/sun.java2d.pipe.RenderingEngine	Wed Jul 21 09:57:21 2010 -0700
@@ -0,0 +1,5 @@
+# Jules Rendering Engine module
+sun.java2d.jules.JulesRenderingEngine
+
+#  Pisces Rendering Engine module
+sun.java2d.pisces.PiscesRenderingEngine
--- a/jdk/src/solaris/classes/sun/java2d/x11/X11SurfaceData.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/solaris/classes/sun/java2d/x11/X11SurfaceData.java	Wed Jul 21 09:57:21 2010 -0700
@@ -46,6 +46,7 @@
 import sun.awt.SunToolkit;
 import sun.awt.X11ComponentPeer;
 import sun.awt.X11GraphicsConfig;
+import sun.awt.X11GraphicsEnvironment;
 import sun.awt.image.PixelConverter;
 import sun.font.X11TextRenderer;
 import sun.java2d.InvalidPipeException;
@@ -64,7 +65,7 @@
 import sun.java2d.pipe.TextPipe;
 import sun.java2d.pipe.Region;
 
-public abstract class X11SurfaceData extends SurfaceData {
+public abstract class X11SurfaceData extends XSurfaceData {
     X11ComponentPeer peer;
     X11GraphicsConfig graphicsConfig;
     private RenderLoops solidloops;
@@ -74,8 +75,6 @@
     private static native void initIDs(Class xorComp, boolean tryDGA);
     protected native void initSurface(int depth, int width, int height,
                                       long drawable);
-    native boolean isDrawableValid();
-    protected native void flushNativeSurface();
 
     public static final String
         DESC_INT_BGR_X11        = "Integer BGR Pixmap";
@@ -212,7 +211,8 @@
     protected static boolean dgaAvailable;
 
     static {
-        if (!GraphicsEnvironment.isHeadless()) {
+       if (!isX11SurfaceDataInitialized() &&
+           !GraphicsEnvironment.isHeadless()) {
             // If a screen magnifier is present, don't attempt to use DGA
             String magPresent = (String) java.security.AccessController.doPrivileged
                 (new sun.security.action.GetPropertyAction("javax.accessibility.screen_magnifier_present"));
@@ -245,7 +245,7 @@
                 X11PMBlitLoops.register();
                 X11PMBlitBgLoops.register();
             }
-        }
+       }
     }
 
     /**
@@ -432,11 +432,11 @@
                                         cm, drawable, transparency);
     }
 
-    /**
-     * Initializes the native Ops pointer.
-     */
-    private native void initOps(X11ComponentPeer peer,
-                                X11GraphicsConfig gc, int depth);
+//    /**
+//     * Initializes the native Ops pointer.
+//     */
+//    private native void initOps(X11ComponentPeer peer,
+//                                X11GraphicsConfig gc, int depth);
 
     protected X11SurfaceData(X11ComponentPeer peer,
                              X11GraphicsConfig gc,
@@ -613,8 +613,6 @@
         return sType;
     }
 
-    public native void setInvalid();
-
     public void invalidate() {
         if (isValid()) {
             setInvalid();
@@ -628,16 +626,9 @@
      * X11SurfaceData object.
      */
 
-    private static native long XCreateGC(long pXSData);
-    private static native void XResetClip(long xgc);
-    private static native void XSetClip(long xgc,
-                                        int lox, int loy, int hix, int hiy,
-                                        Region complexclip);
     private static native void XSetCopyMode(long xgc);
     private static native void XSetXorMode(long xgc);
     private static native void XSetForeground(long xgc, int pixel);
-    private static native void XSetGraphicsExposures(long xgc,
-                                                     boolean needExposures);
 
     private long xgc;
     private Region validatedClip;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/src/solaris/classes/sun/java2d/x11/XSurfaceData.java	Wed Jul 21 09:57:21 2010 -0700
@@ -0,0 +1,40 @@
+package sun.java2d.x11;
+
+import java.awt.image.*;
+
+import sun.awt.*;
+import sun.java2d.*;
+import sun.java2d.loops.*;
+import sun.java2d.pipe.*;
+
+public abstract class XSurfaceData extends SurfaceData {
+    static boolean isX11SurfaceDataInitialized = false;
+
+    public static boolean isX11SurfaceDataInitialized() {
+        return isX11SurfaceDataInitialized;
+    }
+
+    public static void setX11SurfaceDataInitialized() {
+        isX11SurfaceDataInitialized = true;
+    }
+
+    public XSurfaceData(SurfaceType surfaceType, ColorModel cm) {
+        super(surfaceType, cm);
+    }
+
+    protected native void initOps(X11ComponentPeer peer, X11GraphicsConfig gc, int depth);
+
+    protected static native long XCreateGC(long pXSData);
+
+    protected static native void XResetClip(long xgc);
+
+    protected static native void XSetClip(long xgc, int lox, int loy, int hix, int hiy, Region complexclip);
+
+    protected native void flushNativeSurface();
+
+    protected native boolean isDrawableValid();
+
+    protected native void setInvalid();
+
+    protected static native void XSetGraphicsExposures(long xgc, boolean needExposures);
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/src/solaris/classes/sun/java2d/xr/DirtyRegion.java	Wed Jul 21 09:57:21 2010 -0700
@@ -0,0 +1,133 @@
+/*
+ * Copyright 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 sun.java2d.xr;
+
+import static java.lang.Math.min;
+import static java.lang.Math.max;
+import static sun.java2d.xr.MaskTileManager.MASK_SIZE;
+
+/**
+ * This class implements region tracking, used by the tiled-mask code.
+ *
+ * @author Clemens Eisserer
+ */
+
+public class DirtyRegion implements Cloneable {
+    int x, y, x2, y2;
+
+    public DirtyRegion() {
+        clear();
+    }
+
+    public void clear() {
+        x = Integer.MAX_VALUE;
+        y = Integer.MAX_VALUE;
+        x2 = Integer.MIN_VALUE;
+        y2 = Integer.MIN_VALUE;
+    }
+
+    public void growDirtyRegion(int x, int y, int x2, int y2) {
+        this.x = min(x, this.x);
+        this.y = min(y, this.y);
+        this.x2 = max(x2, this.x2);
+        this.y2 = max(y2, this.y2);
+    }
+
+    public int getWidth() {
+        return x2 - x;
+    }
+
+    public int getHeight() {
+        return y2 - y;
+    }
+
+    public void growDirtyRegionTileLimit(int x, int y, int x2, int y2) {
+        if (x < this.x) {
+            this.x = max(x, 0);
+        }
+        if (y < this.y) {
+            this.y = max(y, 0);
+        }
+        if (x2 > this.x2) {
+            this.x2 = min(x2, MASK_SIZE);
+        }
+        if (y2 > this.y2) {
+            this.y2 = min(y2, MASK_SIZE);
+        }
+    }
+
+    public static DirtyRegion combineRegion(DirtyRegion region1,
+                                            DirtyRegion region2) {
+        DirtyRegion region = new DirtyRegion();
+        region.x = min(region1.x, region2.x);
+        region.y = min(region1.y, region2.y);
+        region.x2 = max(region1.x2, region2.x2);
+        region.y2 = max(region1.y2, region2.y2);
+        return region;
+    }
+
+    public void setDirtyLineRegion(int x1, int y1, int x2, int y2) {
+        if (x1 < x2) {
+            this.x = x1;
+            this.x2 = x2;
+        } else {
+            this.x = x2;
+            this.x2 = x1;
+        }
+
+        if (y1 < y2) {
+            this.y = y1;
+            this.y2 = y2;
+        } else {
+            this.y = y2;
+            this.y2 = y1;
+        }
+    }
+
+    public void translate(int x, int y) {
+        if (this.x != Integer.MAX_VALUE) {
+            this.x += x;
+            this.x2 += x;
+            this.y += y;
+            this.y2 += y;
+        }
+    }
+
+    public String toString() {
+        return this.getClass().getName() +
+                "(x: " + x + ", y:" + y + ", x2:" + x2 + ", y2:" + y2 + ")";
+    }
+
+    public DirtyRegion cloneRegion() {
+        try {
+            return (DirtyRegion) clone();
+        } catch (CloneNotSupportedException ex) {
+            ex.printStackTrace();
+        }
+
+        return null;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/src/solaris/classes/sun/java2d/xr/GrowableByteArray.java	Wed Jul 21 09:57:21 2010 -0700
@@ -0,0 +1,127 @@
+/*
+ * Copyright 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 sun.java2d.xr;
+
+import java.util.*;
+
+/**
+ * Growable int array, designed to allow subclasses to emulate
+ * the behaviour of value types.
+ *
+ * @author Clemens Eisserer
+ */
+
+public class GrowableByteArray
+{
+
+        byte[] array;
+        int size;
+        int cellSize;
+
+        public GrowableByteArray(int cellSize, int initialSize)
+        {
+                array = new byte[initialSize];
+                size = 0;
+                this.cellSize = cellSize;
+        }
+
+        private int getNextCellIndex()
+        {
+                int oldSize = size;
+                size += cellSize;
+
+                if (size >= array.length)
+                {
+                        growArray();
+                }
+
+                return oldSize;
+        }
+
+        /**
+         * @return a direct reference to the backing array.
+         */
+        public byte[] getArray()
+        {
+                return array;
+        }
+
+        /**
+         * @return a copy of the backing array.
+         */
+        public byte[] getSizedArray()
+        {
+                return Arrays.copyOf(array, getSize());
+        }
+
+        public final int getByte(int index)
+        {
+                return array[getCellIndex(index)];
+        }
+
+        /**
+         * Returns the index of the next free cell,
+         * and grows the backing arrays if required.
+         */
+        public final int getNextIndex()
+        {
+                return getNextCellIndex() / cellSize;
+        }
+
+        protected final int getCellIndex(int cellIndex)
+        {
+                return cellSize * cellIndex;
+        }
+
+        public final void addByte(byte i)
+        {
+            int nextIndex = getNextIndex();
+            array[nextIndex] = i;
+        }
+
+        /**
+         * @return The number of stored cells.
+         */
+        public final int getSize()
+        {
+                return size / cellSize;
+        }
+
+        public void clear()
+        {
+                size = 0;
+        }
+
+        protected void growArray()
+        {
+                int newSize = Math.max(array.length * 2, 10);
+                byte[] oldArray = array;
+                array = new byte[newSize];
+
+                System.arraycopy(oldArray, 0, array, 0, oldArray.length);
+        }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/src/solaris/classes/sun/java2d/xr/GrowableEltArray.java	Wed Jul 21 09:57:21 2010 -0700
@@ -0,0 +1,84 @@
+/*
+ * Copyright 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 sun.java2d.xr;
+
+/**
+ * Class to efficiently store glyph information for laid out glyphs,
+ * passed to native or java backend.
+ *
+ * @author Clemens Eisserer
+ */
+public class GrowableEltArray extends GrowableIntArray {
+    private static final int ELT_SIZE = 4;
+    GrowableIntArray glyphs;
+
+    public GrowableEltArray(int initialSize)
+    {
+        super(ELT_SIZE, initialSize);
+        glyphs = new GrowableIntArray(1, initialSize*8);
+    }
+
+    public final int getCharCnt(int index) {
+        return array[getCellIndex(index) + 0];
+    }
+
+    public final void setCharCnt(int index, int cnt) {
+        array[getCellIndex(index) + 0] = cnt;
+    }
+
+    public final int getXOff(int index) {
+        return array[getCellIndex(index) + 1];
+    }
+
+    public final void setXOff(int index, int xOff) {
+        array[getCellIndex(index) + 1] = xOff;
+    }
+
+    public final int getYOff(int index) {
+        return array[getCellIndex(index) + 2];
+    }
+
+    public final void setYOff(int index, int yOff) {
+        array[getCellIndex(index) + 2] = yOff;
+    }
+
+    public final int getGlyphSet(int index) {
+        return array[getCellIndex(index) + 3];
+    }
+
+    public final void setGlyphSet(int index, int glyphSet) {
+        array[getCellIndex(index) + 3] = glyphSet;
+    }
+
+    public GrowableIntArray getGlyphs() {
+        return glyphs;
+    }
+
+    public void clear() {
+        glyphs.clear();
+        super.clear();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/src/solaris/classes/sun/java2d/xr/GrowableIntArray.java	Wed Jul 21 09:57:21 2010 -0700
@@ -0,0 +1,114 @@
+/*
+ * Copyright 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 sun.java2d.xr;
+
+import java.util.*;
+
+/**
+ * Growable int array, designed to allow subclasses to emulate
+ * the behaviour of value types.
+ *
+ * @author Clemens Eisserer
+ */
+
+public class GrowableIntArray {
+
+    int[] array;
+    int size;
+    int cellSize;
+
+    public GrowableIntArray(int cellSize, int initialSize) {
+        array = new int[initialSize];
+        size = 0;
+        this.cellSize = cellSize;
+    }
+
+    private int getNextCellIndex() {
+        int oldSize = size;
+        size += cellSize;
+
+        if (size >= array.length) {
+            growArray();
+        }
+
+        return oldSize;
+    }
+
+    /**
+     * @return a direct reference to the backing array.
+     */
+    public int[] getArray() {
+        return array;
+    }
+
+    /**
+     * @return a copy of the backing array.
+     */
+    public int[] getSizedArray() {
+        return Arrays.copyOf(array, getSize());
+    }
+
+    /**
+     * Returns the index of the next free cell,
+     * and grows the backing arrays if required.
+     */
+    public final int getNextIndex() {
+        return getNextCellIndex() / cellSize;
+    }
+
+    protected final int getCellIndex(int cellIndex) {
+        return cellSize * cellIndex;
+    }
+
+    public final int getInt(int cellIndex) {
+        return array[cellIndex];
+    }
+
+    public final void addInt(int i) {
+        int nextIndex = getNextIndex();
+        array[nextIndex] = i;
+    }
+
+    /**
+     * @return The number of stored cells.
+     */
+    public final int getSize() {
+        return size / cellSize;
+    }
+
+    public void clear() {
+        size = 0;
+    }
+
+    protected void growArray() {
+        int newSize = Math.max(array.length * 2, 10);
+        int[] oldArray = array;
+        array = new int[newSize];
+
+        System.arraycopy(oldArray, 0, array, 0, oldArray.length);
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/src/solaris/classes/sun/java2d/xr/GrowablePointArray.java	Wed Jul 21 09:57:21 2010 -0700
@@ -0,0 +1,62 @@
+/*
+ * Copyright 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 sun.java2d.xr;
+
+/**
+ * Class to efficiently store rectangles.
+ *
+ * @author Clemens Eisserer
+ */
+public class GrowablePointArray extends GrowableIntArray
+{
+
+        private static final int POINT_SIZE = 2;
+
+        public GrowablePointArray(int initialSize)
+        {
+                super(POINT_SIZE, initialSize);
+        }
+
+        public final int getX(int index)
+        {
+                return array[getCellIndex(index)];
+        }
+
+        public final int getY(int index)
+        {
+                return array[getCellIndex(index) + 1];
+        }
+
+        public final void setX(int index, int x)
+        {
+                array[getCellIndex(index)] = x;
+        }
+
+        public final void setY(int index, int y)
+        {
+                array[getCellIndex(index) + 1] = y;
+        }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/src/solaris/classes/sun/java2d/xr/GrowableRectArray.java	Wed Jul 21 09:57:21 2010 -0700
@@ -0,0 +1,79 @@
+/*
+ * Copyright 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 sun.java2d.xr;
+
+/**
+ * Class to efficiently store rectangles.
+ *
+ * @author Clemens Eisserer
+ */
+public class GrowableRectArray extends GrowableIntArray {
+
+    private static final int RECT_SIZE = 4;
+
+    public GrowableRectArray(int initialSize) {
+        super(RECT_SIZE, initialSize);
+    }
+
+    public final void setX(int index, int x) {
+        array[getCellIndex(index)] = x;
+    }
+
+    public final void setY(int index, int y) {
+        array[getCellIndex(index) + 1] = y;
+    }
+
+    public final void setWidth(int index, int width) {
+        array[getCellIndex(index) + 2] = width;
+    }
+
+    public final void setHeight(int index, int height) {
+        array[getCellIndex(index) + 3] = height;
+    }
+
+    public final int getX(int index) {
+        return array[getCellIndex(index)];
+    }
+
+    public final int getY(int index) {
+        return array[getCellIndex(index) + 1];
+    }
+
+    public final int getWidth(int index) {
+        return array[getCellIndex(index) + 2];
+    }
+
+    public final int getHeight(int index) {
+        return array[getCellIndex(index) + 3];
+    }
+
+    public final void translateRects(int x, int y) {
+        for (int i = 0; i < getSize(); i++) {
+            setX(i, getX(i) + x);
+            setY(i, getY(i) + y);
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/src/solaris/classes/sun/java2d/xr/MaskTile.java	Wed Jul 21 09:57:21 2010 -0700
@@ -0,0 +1,166 @@
+/*
+ * Copyright 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 sun.java2d.xr;
+
+/**
+ * Represents a single tile, used to store the rectangles covering the area
+ * of the mask where the tile is located.
+ *
+ * @author Clemens Eisserer
+ */
+public class MaskTile {
+    GrowableRectArray rects;
+    DirtyRegion dirtyArea;
+
+    public MaskTile()
+    {
+        rects = new GrowableRectArray(128);
+        dirtyArea = new DirtyRegion();
+    }
+
+    public void addRect(int x, int y, int width, int height) {
+        int index = rects.getNextIndex();
+        rects.setX(index, x);
+        rects.setY(index, y);
+        rects.setWidth(index, width);
+        rects.setHeight(index, height);
+    }
+
+    public void addLine(int x1, int y1, int x2, int y2) {
+        /*
+         * EXA is not able to accalerate diagonal lines, we try to "guide" it a
+         * bit to avoid excessive migration See project documentation for an
+         * detailed explanation
+         */
+        DirtyRegion region = new DirtyRegion();
+        region.setDirtyLineRegion(x1, y1, x2, y2);
+        int xDiff = region.x2 - region.x;
+        int yDiff = region.y2 - region.y;
+
+        if (xDiff == 0 || yDiff == 0) {
+            addRect(region.x, region.y,
+                    region.x2 - region.x + 1, region.y2 - region.y + 1);
+        } else if (xDiff == 1 && yDiff == 1) {
+            addRect(x1, y1, 1, 1);
+            addRect(x2, y2, 1, 1);
+        } else {
+            lineToRects(x1, y1, x2, y2);
+        }
+    }
+
+    private void lineToRects(int xstart, int ystart, int xend, int yend) {
+        int x, y, t, dx, dy, incx, incy, pdx, pdy, ddx, ddy, es, el, err;
+
+        /* Entfernung in beiden Dimensionen berechnen */
+        dx = xend - xstart;
+        dy = yend - ystart;
+
+        /* Vorzeichen des Inkrements bestimmen */
+        incx = dx > 0 ? 1 : (dx < 0) ? -1 : 0;
+        incy = dy > 0 ? 1 : (dy < 0) ? -1 : 0;
+        if (dx < 0)
+            dx = -dx;
+        if (dy < 0)
+            dy = -dy;
+
+        /* feststellen, welche Entfernung groesser ist */
+        if (dx > dy) {
+            /* x ist schnelle Richtung */
+            pdx = incx;
+            pdy = 0; /* pd. ist Parallelschritt */
+            ddx = incx;
+            ddy = incy; /* dd. ist Diagonalschritt */
+            es = dy;
+            el = dx; /* Fehlerschritte schnell, langsam */
+        } else {
+            /* y ist schnelle Richtung */
+            pdx = 0;
+            pdy = incy; /* pd. ist Parallelschritt */
+            ddx = incx;
+            ddy = incy; /* dd. ist Diagonalschritt */
+            es = dx;
+            el = dy; /* Fehlerschritte schnell, langsam */
+        }
+
+        /* Initialisierungen vor Schleifenbeginn */
+        x = xstart;
+        y = ystart;
+        err = el / 2;
+        addRect(x, y, 1, 1);
+
+        /* Pixel berechnen */
+        for (t = 0; t < el; ++t) /* t zaehlt die Pixel, el ist auch Anzahl */
+        {
+            /* Aktualisierung Fehlerterm */
+            err -= es;
+            if (err < 0) {
+                /* Fehlerterm wieder positiv (>=0) machen */
+                err += el;
+                /* Schritt in langsame Richtung, Diagonalschritt */
+                x += ddx;
+                y += ddy;
+            } else {
+                /* Schritt in schnelle Richtung, Parallelschritt */
+                x += pdx;
+                y += pdy;
+            }
+            addRect(x, y, 1, 1);
+            // SetPixel(x,y);
+            // System.out.println(x+":"+y);
+        }
+    }
+
+    public void calculateDirtyAreas()
+    {
+        for (int i=0; i < rects.getSize(); i++) {
+            int x = rects.getX(i);
+            int y = rects.getY(i);
+            dirtyArea.growDirtyRegion(x, y,
+                                      x + rects.getWidth(i),
+                                      y + rects.getHeight(i));
+        }
+    }
+
+    public void reset() {
+        rects.clear();
+        dirtyArea.clear();
+    }
+
+    public void translate(int x, int y) {
+        if (rects.getSize() > 0) {
+            dirtyArea.translate(x, y);
+        }
+        rects.translateRects(x, y);
+    }
+
+    public GrowableRectArray getRects() {
+        return rects;
+    }
+
+    public DirtyRegion getDirtyArea() {
+        return dirtyArea;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/src/solaris/classes/sun/java2d/xr/MaskTileManager.java	Wed Jul 21 09:57:21 2010 -0700
@@ -0,0 +1,327 @@
+/*
+ * Copyright 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 sun.java2d.xr;
+
+import java.awt.*;
+import java.util.*;
+
+/**
+ * We render non-antialiased geometry (consisting of rectangles) into a mask,
+ * which is later used in a composition step.
+ * To avoid mask-allocations of large size, MaskTileManager splits
+ * geometry larger than MASK_SIZE into several tiles,
+ * and stores the geometry in instances of MaskTile.
+ *
+ * @author Clemens Eisserer
+ */
+
+public class MaskTileManager {
+
+    public static final int MASK_SIZE = 256;
+
+    MaskTile mainTile = new MaskTile();
+
+    ArrayList<MaskTile> tileList;
+    int allocatedTiles = 0;
+    int xTiles, yTiles;
+
+    XRCompositeManager xrMgr;
+    XRBackend con;
+
+    int maskPixmap;
+    int maskPicture;
+    long maskGC;
+    int lineMaskPixmap;
+    int lineMaskPicture;
+    long drawLineGC;
+    long clearLineGC;
+
+    public MaskTileManager(XRCompositeManager xrMgr, int parentXid) {
+        tileList = new ArrayList<MaskTile>();
+        this.xrMgr = xrMgr;
+        this.con = xrMgr.getBackend();
+
+        maskPixmap = con.createPixmap(parentXid, 8, MASK_SIZE, MASK_SIZE);
+        maskPicture = con.createPicture(maskPixmap, XRUtils.PictStandardA8);
+        con.renderRectangle(maskPicture, XRUtils.PictOpClear,
+                            new XRColor(Color.black),
+                            0, 0, MASK_SIZE, MASK_SIZE);
+        maskGC = con.createGC(maskPixmap);
+        con.setGCExposures(maskGC, false);
+
+        lineMaskPixmap = con.createPixmap(parentXid, 8, MASK_SIZE, MASK_SIZE);
+        lineMaskPicture =
+             con.createPicture(lineMaskPixmap, XRUtils.PictStandardA8);
+        con.renderRectangle(lineMaskPicture, XRUtils.PictOpClear,
+                          new XRColor(Color.black), 0, 0, MASK_SIZE, MASK_SIZE);
+
+        drawLineGC = con.createGC(lineMaskPixmap);
+        con.setGCExposures(drawLineGC, false);
+        con.setGCForeground(drawLineGC, 255);
+
+        clearLineGC = con.createGC(lineMaskPixmap);
+        con.setGCExposures(clearLineGC, false);
+        con.setGCForeground(clearLineGC, 0);
+    }
+
+    /**
+     * Adds a rectangle to the mask.
+     */
+    public void addRect(int x, int y, int width, int height) {
+        mainTile.addRect(x, y, width, height);
+    }
+
+    /**
+     * Adds a line to the mask.
+     */
+    public void addLine(int x1, int y1, int x2, int y2) {
+        mainTile.addLine(x1, y1, x2, y2);
+    }
+
+    /**
+     * Transfers the geometry stored (rectangles, lines) to one or more masks,
+     * and renders the result to the destination surface.
+     */
+    public void fillMask(XRSurfaceData dst) {
+
+        boolean maskRequired = xrMgr.maskRequired();
+
+        if (maskRequired) {
+            mainTile.calculateDirtyAreas();
+            DirtyRegion dirtyArea = mainTile.getDirtyArea().cloneRegion();
+            mainTile.translate(-dirtyArea.x, -dirtyArea.y);
+
+            XRColor maskColor = xrMgr.getMaskColor();
+
+            // We don't need tiling if all geometry fits in a single tile
+            if (dirtyArea.getWidth() <= MASK_SIZE &&
+                dirtyArea.getHeight() <= MASK_SIZE)
+            {
+                compositeSingleTile(dst, mainTile, dirtyArea,
+                                     maskRequired, 0, 0, maskColor);
+            } else {
+                allocTiles(dirtyArea);
+                tileRects();
+
+                for (int i = 0; i < yTiles; i++) {
+                    for (int m = 0; m < xTiles; m++) {
+                        MaskTile tile = tileList.get(i * xTiles + m);
+
+                        int tileStartX = m * MASK_SIZE;
+                        int tileStartY = i * MASK_SIZE;
+                        compositeSingleTile(dst, tile, dirtyArea, maskRequired,
+                                            tileStartX, tileStartY, maskColor);
+                    }
+                }
+            }
+        } else {
+            xrMgr.XRRenderRectangles(dst, mainTile.getRects());
+        }
+
+        mainTile.reset();
+    }
+
+    /**
+     * Uploads aa geometry generated for maskblit/fill into the mask pixmap.
+     */
+    public int uploadMask(int w, int h, int maskscan, int maskoff, byte[] mask) {
+        int maskPic = XRUtils.None;
+
+        if (mask != null) {
+            float maskAlpha =
+                 xrMgr.isTexturePaintActive() ? xrMgr.getExtraAlpha() : 1.0f;
+            con.putMaskImage(maskPixmap, maskGC, mask, 0, 0, 0, 0,
+                             w, h, maskoff, maskscan, maskAlpha);
+            maskPic = maskPicture;
+        } else if (xrMgr.isTexturePaintActive()) {
+            maskPic = xrMgr.getExtraAlphaMask();
+         }
+
+        return maskPic;
+    }
+
+    /**
+     * Clears the area of the mask-pixmap used for uploading aa coverage values.
+     */
+    public void clearUploadMask(int mask, int w, int h) {
+        if (mask == maskPicture) {
+            con.renderRectangle(maskPicture, XRUtils.PictOpClear,
+                                XRColor.NO_ALPHA, 0, 0, w, h);
+        }
+    }
+
+
+    /**
+     * Renders the rectangles provided to the mask, and does a composition
+     * operation with the properties set inXRCompositeManager.
+     */
+    protected void compositeSingleTile(XRSurfaceData dst, MaskTile tile,
+                                       DirtyRegion dirtyArea,
+                                       boolean maskRequired,
+                                       int tileStartX, int tileStartY,
+                                       XRColor maskColor) {
+        if (tile.rects.getSize() > 0) {
+            DirtyRegion tileDirtyArea = tile.getDirtyArea();
+
+            int x = tileDirtyArea.x + tileStartX + dirtyArea.x;
+            int y = tileDirtyArea.y + tileStartY + dirtyArea.y;
+            int width = tileDirtyArea.x2 - tileDirtyArea.x;
+            int height = tileDirtyArea.y2 - tileDirtyArea.y;
+            width = Math.min(width, MASK_SIZE);
+            height = Math.min(height, MASK_SIZE);
+
+            int rectCnt = tile.rects.getSize();
+
+            if (maskRequired) {
+                int mask = XRUtils.None;
+
+                /*
+                 * Optimization: When the tile only contains one rectangle, the
+                 * composite-operation boundaries can be used as geometry
+                 */
+                if (rectCnt > 1) {
+                    con.renderRectangles(maskPicture, XRUtils.PictOpSrc,
+                                         maskColor, tile.rects);
+                    mask = maskPicture;
+                } else {
+                    if (xrMgr.isTexturePaintActive()) {
+                        mask = xrMgr.getExtraAlphaMask();
+                    }
+                }
+
+                xrMgr.XRComposite(XRUtils.None, mask, dst.getPicture(),
+                                  x, y, tileDirtyArea.x, tileDirtyArea.y,
+                                  x, y, width, height);
+
+                /* Clear dirty rectangle of the rect-mask */
+                if (rectCnt > 1) {
+                    con.renderRectangle(maskPicture, XRUtils.PictOpClear,
+                                        XRColor.NO_ALPHA,
+                                        tileDirtyArea.x, tileDirtyArea.y,
+                                        width, height);
+                }
+
+                tile.reset();
+            } else if (rectCnt > 0) {
+                tile.rects.translateRects(tileStartX + dirtyArea.x,
+                                          tileStartY + dirtyArea.y);
+                xrMgr.XRRenderRectangles(dst, tile.rects);
+            }
+        }
+    }
+
+
+    /**
+     * Allocates enough MaskTile instances, to cover the whole
+     * mask area, or resets existing ones.
+     */
+    protected void allocTiles(DirtyRegion maskArea) {
+        xTiles = (maskArea.getWidth() / MASK_SIZE) + 1;
+        yTiles = (maskArea.getHeight() / MASK_SIZE) + 1;
+        int tileCnt = xTiles * yTiles;
+
+        if (tileCnt > allocatedTiles) {
+            for (int i = 0; i < tileCnt; i++) {
+                if (i < allocatedTiles) {
+                    tileList.get(i).reset();
+                } else {
+                    tileList.add(new MaskTile());
+                }
+            }
+
+            allocatedTiles = tileCnt;
+        }
+    }
+
+    /**
+     * Tiles the stored rectangles, if they are larger than the MASK_SIZE
+     */
+    protected void tileRects() {
+        GrowableRectArray rects = mainTile.rects;
+
+        for (int i = 0; i < rects.getSize(); i++) {
+            int tileXStartIndex = rects.getX(i) / MASK_SIZE;
+            int tileYStartIndex = rects.getY(i) / MASK_SIZE;
+            int tileXLength =
+                ((rects.getX(i) + rects.getWidth(i)) / MASK_SIZE + 1) -
+                 tileXStartIndex;
+            int tileYLength =
+                 ((rects.getY(i) + rects.getHeight(i)) / MASK_SIZE + 1) -
+                 tileYStartIndex;
+
+            for (int n = 0; n < tileYLength; n++) {
+                for (int m = 0; m < tileXLength; m++) {
+
+                    int tileIndex =
+                         xTiles * (tileYStartIndex + n) + tileXStartIndex + m;
+                    MaskTile tile = tileList.get(tileIndex);
+
+                    GrowableRectArray rectTileList = tile.getRects();
+                    int tileArrayIndex = rectTileList.getNextIndex();
+
+                    int tileStartPosX = (tileXStartIndex + m) * MASK_SIZE;
+                    int tileStartPosY = (tileYStartIndex + n) * MASK_SIZE;
+
+                    rectTileList.setX(tileArrayIndex, rects.getX(i) - tileStartPosX);
+                    rectTileList.setY(tileArrayIndex, rects.getY(i) - tileStartPosY);
+                    rectTileList.setWidth(tileArrayIndex, rects.getWidth(i));
+                    rectTileList.setHeight(tileArrayIndex, rects.getHeight(i));
+
+                    limitRectCoords(rectTileList, tileArrayIndex);
+
+                    tile.getDirtyArea().growDirtyRegion
+                       (rectTileList.getX(tileArrayIndex),
+                        rectTileList.getY(tileArrayIndex),
+                        rectTileList.getWidth(tileArrayIndex) +
+                             rectTileList.getX(tileArrayIndex),
+                        rectTileList.getHeight(tileArrayIndex) +
+                            rectTileList.getY(tileArrayIndex));
+                }
+            }
+        }
+    }
+
+    /**
+     * Limits the rect's coordinates to the mask coordinates. The result is used
+     * by growDirtyRegion.
+     */
+    private void limitRectCoords(GrowableRectArray rects, int index) {
+        if ((rects.getX(index) + rects.getWidth(index)) > MASK_SIZE) {
+            rects.setWidth(index, MASK_SIZE - rects.getX(index));
+        }
+        if ((rects.getY(index) + rects.getHeight(index)) > MASK_SIZE) {
+            rects.setHeight(index, MASK_SIZE - rects.getY(index));
+        }
+        if (rects.getX(index) < 0) {
+            rects.setWidth(index, rects.getWidth(index) + rects.getX(index));
+            rects.setX(index, 0);
+        }
+        if (rects.getY(index) < 0) {
+            rects.setHeight(index, rects.getHeight(index) + rects.getY(index));
+            rects.setY(index, 0);
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/src/solaris/classes/sun/java2d/xr/MutableInteger.java	Wed Jul 21 09:57:21 2010 -0700
@@ -0,0 +1,57 @@
+/*
+ * Copyright 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 sun.java2d.xr;
+
+/**
+ * Simple MutableInteger implementation to be used as a reuseable HashMap key.
+ *
+ * @author Clemens Eisserer
+ */
+
+public class MutableInteger {
+    private int value;
+
+    public MutableInteger(int value) {
+        this.setValue(value);
+    }
+
+    public int hashCode() {
+        return getValue();
+    }
+
+    public boolean equals(Object o) {
+        return (o instanceof MutableInteger) &&
+               (((MutableInteger) o).getValue() == getValue());
+    }
+
+    public void setValue(int value) {
+        this.value = value;
+    }
+
+    public int getValue() {
+        return value;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/src/solaris/classes/sun/java2d/xr/XIDGenerator.java	Wed Jul 21 09:57:21 2010 -0700
@@ -0,0 +1,53 @@
+/*
+ * Copyright 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 sun.java2d.xr;
+
+/**
+ * Class provides unused XIDs, used for creating server-side objects
+ * created by the java backend.
+ * It does buffering, to minimize JNI overhead.
+ *
+ * @author Clemens Eisserer
+ */
+
+public class XIDGenerator {
+    private final static int XID_BUFFER_SIZE = 512;
+
+    int[] xidBuffer = new int[XID_BUFFER_SIZE];
+    int currentIndex = XID_BUFFER_SIZE;
+
+    public int getNextXID() {
+
+        if (currentIndex >= XID_BUFFER_SIZE) {
+            bufferXIDs(xidBuffer, xidBuffer.length);
+            currentIndex = 0;
+        }
+
+        return xidBuffer[currentIndex++];
+    }
+
+    private static native void bufferXIDs(int[] buffer, int arraySize);
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/src/solaris/classes/sun/java2d/xr/XRBackend.java	Wed Jul 21 09:57:21 2010 -0700
@@ -0,0 +1,117 @@
+/*
+ * Copyright 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 sun.java2d.xr;
+
+/**
+ * XRender pipeline backend interface.
+ * Currently there are two different backends implemented:
+ * - XRBackendJava: And experimental backend, generating protocol directly using java-code and xcb's socket handoff functionality.
+ * - XRBackendNative: Native 1:1 binding with libX11.
+ */
+
+import java.awt.geom.*;
+import java.util.*;
+
+import sun.font.*;
+import sun.java2d.jules.*;
+import sun.java2d.pipe.*;
+
+public interface XRBackend {
+
+    public void freePicture(int picture);
+
+    public void freePixmap(int pixmap);
+
+    public int createPixmap(int drawable, int depth, int width, int height);
+
+    public int createPicture(int drawable, int formatID);
+
+    public long createGC(int drawable);
+
+    public void freeGC(long gc); /* TODO: Use!! */
+
+    public void copyArea(int src, int dst, long gc, int srcx, int srcy,
+                         int width, int height, int dstx, int dsty);
+
+    public void putMaskImage(int drawable, long gc, byte[] imageData,
+                             int sx, int sy, int dx, int dy,
+                             int width, int height, int maskOff,
+                             int maskScan, float ea);
+
+    public void setGCClipRectangles(long gc, Region clip);
+
+    public void GCRectangles(int drawable, long gc, GrowableRectArray rects);
+
+    public void setClipRectangles(int picture, Region clip);
+
+    public void setGCExposures(long gc, boolean exposure);
+
+    public void setGCForeground(long gc, int pixel);
+
+    public void setPictureTransform(int picture, AffineTransform transform);
+
+    public void setPictureRepeat(int picture, int repeat);
+
+    public void setFilter(int picture, int filter);
+
+    public void renderRectangle(int dst, byte op, XRColor color,
+                                int x, int y, int width, int height);
+
+    public void renderRectangles(int dst, byte op, XRColor color,
+                                 GrowableRectArray rects);
+
+    public void renderComposite(byte op, int src, int mask, int dst,
+                                int srcX, int srcY, int maskX, int maskY,
+                                int dstX, int dstY, int width, int height);
+
+    public int XRenderCreateGlyphSet(int formatID);
+
+    public void XRenderAddGlyphs(int glyphSet, GlyphList gl,
+                                 List<XRGlyphCacheEntry> cacheEntries,
+                                 byte[] pixelData);
+
+    public void XRenderFreeGlyphs(int glyphSet, int[] gids);
+
+    public void XRenderCompositeText(byte op, int src, int dst,
+                                     int maskFormatID,
+                                     int xSrc, int ySrc, int xDst, int yDst,
+                                     int glyphset, GrowableEltArray elts);
+
+    public int createRadialGradient(Point2D inner, Point2D outer,
+                                    float innerRadius, float outerRadius,
+                                    float[] fractions, int[] pixels,
+                                    int repeat, AffineTransform transform);
+
+    public int createLinearGradient(Point2D p1, Point2D p2, float[] fractions,
+                                    int[] pixels, int repeat,
+                                     AffineTransform transform);
+
+    public void setGCMode(long gc, boolean copy);
+
+    public void renderCompositeTrapezoids(byte op, int src, int maskFormat,
+                                          int dst, int srcX, int srcY,
+                                          TrapezoidList trapList);
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/src/solaris/classes/sun/java2d/xr/XRBackendNative.java	Wed Jul 21 09:57:21 2010 -0700
@@ -0,0 +1,343 @@
+/*
+ * Copyright 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 sun.java2d.xr;
+
+import java.awt.geom.*;
+import java.util.*;
+
+import sun.font.*;
+import sun.java2d.jules.*;
+import sun.java2d.pipe.*;
+
+import static sun.java2d.xr.XRUtils.XDoubleToFixed;
+
+/**
+ * Native implementation of XRBackend.
+ * Almost direct 1:1 binding to libX11.
+ *
+ * @author Clemens Eisserer
+ */
+
+public class XRBackendNative implements XRBackend {
+
+    static {
+        initIDs();
+    }
+
+    private static long FMTPTR_A8;
+    private static long FMTPTR_ARGB32;
+    private static long MASK_XIMG;
+
+    private static native void initIDs();
+
+    public native long createGC(int drawable);
+
+    public native void freeGC(long gc);
+
+    public native int createPixmap(int drawable, int depth,
+                                   int width, int height);
+
+    private native int createPictureNative(int drawable, long formatID);
+
+    public native void freePicture(int picture);
+
+    public native void freePixmap(int pixmap);
+
+    public native void setGCExposures(long gc, boolean exposure);
+
+    public native void setGCForeground(long gc, int pixel);
+
+    public native void setPictureRepeat(int picture, int repeat);
+
+    public native void copyArea(int src, int dst, long gc,
+                                int srcx, int srcy, int width, int height,
+                                 int dstx, int dsty);
+
+    public native void setGCMode(long gc, boolean copy);
+
+    private static native void GCRectanglesNative(int drawable, long gc,
+                                                  int[] rectArray, int rectCnt);
+
+    public native void renderComposite(byte op, int src, int mask,
+                                       int dst, int srcX, int srcY,
+                                       int maskX, int maskY, int dstX, int dstY,
+                                       int width, int height);
+
+    private native void renderRectangle(int dst, byte op,
+                                        short red, short green,
+                                        short blue, short alpha,
+                                        int x, int y, int width, int height);
+
+    private static native void
+         XRenderRectanglesNative(int dst, byte op,
+                                 short red, short green,
+                                 short blue, short alpha,
+                                 int[] rects, int rectCnt);
+
+    private native void XRSetTransformNative(int pic,
+                                             int m00, int m01, int m02,
+                                             int m10, int m11, int m12);
+
+    private static native int
+        XRCreateLinearGradientPaintNative(float[] fractionsArray,
+                                          short[] pixelsArray,
+                                          int x1, int y1, int x2, int y2,
+                                          int numStops, int repeat,
+                                          int m00, int m01, int m02,
+                                           int m10, int m11, int m12);
+
+    private native static int
+        XRCreateRadialGradientPaintNative(float[] fractionsArray,
+                                          short[] pixelsArray, int numStops,
+                                          int innerRadius, int outerRadius,
+                                          int repeat,
+                                          int m00, int m01, int m02,
+                                          int m10, int m11, int m12);
+
+    public native void setFilter(int picture, int filter);
+
+    private static native void XRSetClipNative(long dst,
+                                               int x1, int y1, int x2, int y2,
+                                               Region clip, boolean isGC);
+
+    public void GCRectangles(int drawable, long gc, GrowableRectArray rects) {
+        GCRectanglesNative(drawable, gc, rects.getArray(), rects.getSize());
+    }
+
+    public int createPicture(int drawable, int formatID) {
+        return createPictureNative(drawable, getFormatPtr(formatID));
+    }
+
+    public void setPictureTransform(int picture, AffineTransform transform) {
+        XRSetTransformNative(picture,
+                             XDoubleToFixed(transform.getScaleX()),
+                             XDoubleToFixed(transform.getShearX()),
+                             XDoubleToFixed(transform.getTranslateX()),
+                             XDoubleToFixed(transform.getShearY()),
+                             XDoubleToFixed(transform.getScaleY()),
+                             XDoubleToFixed(transform.getTranslateY()));
+    }
+
+    public void renderRectangle(int dst, byte op, XRColor color,
+                                int x, int y, int width, int height) {
+        renderRectangle(dst, op, (short)color.red, (short)color.green,
+                       (short)color.blue, (short)color.alpha,
+                        x, y, width, height);
+    }
+
+    private short[] getRenderColors(int[] pixels) {
+        short[] renderColors = new short[pixels.length * 4];
+
+        XRColor c = new XRColor();
+        for (int i = 0; i < pixels.length; i++) {
+            c.setColorValues(pixels[i], true);
+            renderColors[i * 4 + 0] = (short) c.alpha;
+            renderColors[i * 4 + 1] = (short) c.red;
+            renderColors[i * 4 + 2] = (short) c.green;
+            renderColors[i * 4 + 3] = (short) c.blue;
+        }
+
+        return renderColors;
+    }
+
+    private static long getFormatPtr(int formatID) {
+        switch (formatID) {
+        case XRUtils.PictStandardA8:
+            return FMTPTR_A8;
+        case XRUtils.PictStandardARGB32:
+            return FMTPTR_ARGB32;
+        }
+
+        return 0L;
+    }
+
+    public int createLinearGradient(Point2D p1, Point2D p2, float[] fractions,
+                              int[] pixels,  int repeat, AffineTransform trx) {
+
+        short[] colorValues = getRenderColors(pixels);
+        int gradient =
+           XRCreateLinearGradientPaintNative(fractions, colorValues,
+                XDoubleToFixed(p1.getX()), XDoubleToFixed(p1.getY()),
+                XDoubleToFixed(p2.getX()), XDoubleToFixed(p2.getY()),
+                fractions.length, repeat,
+                XDoubleToFixed(trx.getScaleX()),
+                XDoubleToFixed(trx.getShearX()),
+                XDoubleToFixed(trx.getTranslateX()),
+                XDoubleToFixed(trx.getShearY()),
+                XDoubleToFixed(trx.getScaleY()),
+                XDoubleToFixed(trx.getTranslateY()));
+        return gradient;
+    }
+
+    public int createRadialGradient(Point2D inner, Point2D outer,
+                                   float innerRadius, float outerRadius,
+                                   float[] fractions, int[] pixels, int repeat,
+                                   AffineTransform trx) {
+
+        short[] colorValues = getRenderColors(pixels);
+        return XRCreateRadialGradientPaintNative
+             (fractions, colorValues, fractions.length,
+              XDoubleToFixed(innerRadius),
+              XDoubleToFixed(outerRadius),
+              repeat,
+              XDoubleToFixed(trx.getScaleX()),
+              XDoubleToFixed(trx.getShearX()),
+              XDoubleToFixed(trx.getTranslateX()),
+              XDoubleToFixed(trx.getShearY()),
+              XDoubleToFixed(trx.getScaleY()),
+              XDoubleToFixed(trx.getTranslateY()));
+    }
+
+    public void setGCClipRectangles(long gc, Region clip) {
+        XRSetClipNative(gc, clip.getLoX(), clip.getLoY(),
+                        clip.getHiX(), clip.getHiY(),
+                        clip.isRectangular() ? null : clip, true);
+    }
+
+    public void setClipRectangles(int picture, Region clip) {
+        if (clip != null) {
+            XRSetClipNative(picture, clip.getLoX(), clip.getLoY(),
+                            clip.getHiX(), clip.getHiY(),
+                            clip.isRectangular() ? null : clip, false);
+        } else {
+            XRSetClipNative(picture, 0, 0, 32767, 32767, null, false);
+        }
+    }
+
+    public void renderRectangles(int dst, byte op, XRColor color,
+                                 GrowableRectArray rects) {
+        XRenderRectanglesNative(dst, op,
+                                (short) color.red, (short) color.green,
+                                (short) color.blue, (short) color.alpha,
+                                rects.getArray(), rects
+                .getSize());
+    }
+
+    private static long[] getGlyphInfoPtrs(List<XRGlyphCacheEntry> cacheEntries) {
+        long[] glyphInfoPtrs = new long[cacheEntries.size()];
+        for (int i = 0; i < cacheEntries.size(); i++) {
+            glyphInfoPtrs[i] = cacheEntries.get(i).getGlyphInfoPtr();
+        }
+        return glyphInfoPtrs;
+    }
+
+    public void XRenderAddGlyphs(int glyphSet, GlyphList gl,
+                                 List<XRGlyphCacheEntry> cacheEntries,
+                                 byte[] pixelData) {
+        long[] glyphInfoPtrs = getGlyphInfoPtrs(cacheEntries);
+        XRAddGlyphsNative(glyphSet, glyphInfoPtrs,
+                          glyphInfoPtrs.length, pixelData, pixelData.length);
+    }
+
+    public void XRenderFreeGlyphs(int glyphSet, int[] gids) {
+        XRFreeGlyphsNative(glyphSet, gids, gids.length);
+    }
+
+    private static native void XRAddGlyphsNative(int glyphSet,
+                                                 long[] glyphInfoPtrs,
+                                                 int glyphCnt,
+                                                 byte[] pixelData,
+                                                 int pixelDataLength);
+
+    private static native void XRFreeGlyphsNative(int glyphSet,
+                                                  int[] gids, int idCnt);
+
+    private static native void
+        XRenderCompositeTextNative(int op, int src, int dst,
+                                   long maskFormat, int[] eltArray,
+                                   int[] glyphIDs, int eltCnt, int glyphCnt);
+
+    public int XRenderCreateGlyphSet(int formatID) {
+        return XRenderCreateGlyphSetNative(getFormatPtr(formatID));
+    }
+
+    private static native int XRenderCreateGlyphSetNative(long format);
+
+    public void XRenderCompositeText(byte op, int src, int dst,
+                                     int maskFormatID,
+                                     int src2, int src3, int dst2, int dst3,
+                                     int glyphset, GrowableEltArray elts) {
+
+        GrowableIntArray glyphs = elts.getGlyphs();
+        XRenderCompositeTextNative(op, src, dst, 0, elts.getArray(),
+                                   glyphs.getArray(), elts.getSize(),
+                                   glyphs.getSize());
+    }
+
+    public void putMaskImage(int drawable, long gc, byte[] imageData,
+                             int sx, int sy, int dx, int dy,
+                             int width, int height, int maskOff,
+                             int maskScan, float ea) {
+        putMaskNative(drawable, gc, imageData, sx, sy, dx, dy,
+                      width, height, maskOff, maskScan, ea, MASK_XIMG);
+    }
+
+    private static native void putMaskNative(int drawable, long gc,
+                                             byte[] imageData,
+                                             int sx, int sy, int dx, int dy,
+                                             int width, int height,
+                                             int maskOff, int maskScan,
+                                             float ea, long xImg);
+
+    public void padBlit(byte op, int srcPict, int maskPict, int dstPict,
+                        AffineTransform maskTrx, int maskWidth, int maskHeight,
+                        int lastMaskWidth, int lastMaskHeight,
+                        int sx, int sy, int dx, int dy, int w, int h) {
+
+        padBlitNative(op, srcPict, maskPict, dstPict,
+                      XDoubleToFixed(maskTrx.getScaleX()),
+                      XDoubleToFixed(maskTrx.getShearX()),
+                      XDoubleToFixed(maskTrx.getTranslateX()),
+                      XDoubleToFixed(maskTrx.getShearY()),
+                      XDoubleToFixed(maskTrx.getScaleY()),
+                      XDoubleToFixed(maskTrx.getTranslateY()),
+                      maskWidth, maskHeight, lastMaskWidth, lastMaskHeight,
+                      sx, sy, dx, dy, w, h);
+    }
+
+    private static native void padBlitNative(byte op, int srcPict,
+                                             int maskPict, int dstPict,
+                                             int m00, int m01, int m02,
+                                             int m10, int m11, int m12,
+                                             int maskWidth, int maskHeight,
+                                             int lastMaskWidth,
+                                             int lastMaskHeight,
+                                             int sx, int sy, int dx, int dy,
+                                             int w, int h);
+
+    public void renderCompositeTrapezoids(byte op, int src, int maskFormat,
+                                          int dst, int srcX, int srcY,
+                                          TrapezoidList trapList) {
+        renderCompositeTrapezoidsNative(op, src, getFormatPtr(maskFormat),
+                                        dst, srcX, srcY,
+                                        trapList.getTrapArray());
+    }
+
+    private static native void
+        renderCompositeTrapezoidsNative(byte op, int src, long maskFormat,
+                                        int dst, int srcX, int srcY,
+                                        int[] trapezoids);
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/src/solaris/classes/sun/java2d/xr/XRColor.java	Wed Jul 21 09:57:21 2010 -0700
@@ -0,0 +1,141 @@
+/*
+ * Copyright 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 sun.java2d.xr;
+
+import java.awt.*;
+
+/**
+ * XRender color class.
+ *
+ * @author Clemens Eisserer
+ */
+
+public class XRColor {
+    public static final XRColor FULL_ALPHA = new XRColor(0xffff, 0, 0, 0);
+    public static final XRColor NO_ALPHA = new XRColor(0, 0, 0, 0);
+
+    int red, green, blue, alpha;
+
+    public XRColor() {
+        red = 0;
+        green = 0;
+        blue = 0;
+        alpha = 0;
+    }
+
+    public XRColor(int alpha, int red, int green, int blue) {
+        this.alpha = alpha;
+        this.red = red;
+        this.green = green;
+        this.blue = blue;
+    }
+
+    public XRColor(Color color) {
+    }
+
+    public void setColorValues(Color color) {
+        alpha = byteToXRColorValue(color.getAlpha());
+
+        red = byteToXRColorValue(
+                      (int)(color.getRed() * color.getAlpha() / 255.0));
+        green = byteToXRColorValue(
+                      (int)(color.getGreen() * color.getAlpha() / 255.0));
+        blue = byteToXRColorValue(
+                      (int)(color.getBlue() * color.getAlpha() / 255.0));
+    }
+
+    public static int[] ARGBPrePixelToXRColors(int[] pixels) {
+        int[] colorValues = new int[pixels.length * 4];
+        XRColor c = new XRColor();
+
+        for (int i = 0; i < pixels.length; i++) {
+            c.setColorValues(pixels[i], true);
+            colorValues[i * 4 + 0] = c.alpha;
+            colorValues[i * 4 + 1] = c.red;
+            colorValues[i * 4 + 2] = c.green;
+            colorValues[i * 4 + 3] = c.blue;
+        }
+
+        return colorValues;
+    }
+
+    public void setColorValues(int pixel, boolean pre) {
+        long pix = XRUtils.intToULong(pixel);
+        alpha = (int) (((pix & 0xFF000000) >> 16) + 255);
+        red = (int) (((pix & 0x00FF0000) >> 8) + 255);
+        green = (int) (((pix & 0x0000FF00) >> 0) + 255);
+        blue = (int) (((pix & 0x000000FF) << 8) + 255);
+
+        if (alpha == 255) {
+            alpha = 0;
+        }
+
+        if (!pre) {
+            double alphaMult = XRUtils.XFixedToDouble(alpha);
+            this.red = (int) (red * alphaMult);
+            this.green = (int) (green * alphaMult);
+            this.blue = (int) (blue * alphaMult);
+        }
+    }
+
+    public static int byteToXRColorValue(int byteValue) {
+        int xrValue = 0;
+
+        if (byteValue != 0) {
+            if (byteValue == 255) {
+                xrValue = 0xffff;
+            } else {
+                xrValue = ((byteValue << 8) + 255);
+            }
+        }
+
+        return xrValue;
+    }
+
+    public String toString(){
+        return "A:"+alpha+"  R:"+red+"  G:"+green+" B:"+blue;
+    }
+
+    public void setAlpha(int alpha) {
+        this.alpha = alpha;
+    }
+
+    public int getAlpha() {
+        return alpha;
+    }
+
+    public int getRed() {
+        return red;
+    }
+
+    public int getGreen() {
+        return green;
+    }
+
+    public int getBlue() {
+        return blue;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/src/solaris/classes/sun/java2d/xr/XRCompositeManager.java	Wed Jul 21 09:57:21 2010 -0700
@@ -0,0 +1,334 @@
+/*
+ * Copyright 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 sun.java2d.xr;
+
+import java.awt.*;
+import java.awt.geom.*;
+
+import sun.font.*;
+import sun.java2d.*;
+import sun.java2d.jules.*;
+import sun.java2d.loops.*;
+
+/**
+ * Manages per-application resources, e.g. the 1x1 pixmap used for solid color
+ * fill as well as per-application state e.g. the currently set source picture
+ * used for composition .
+ *
+ * @author Clemens Eisserer
+ */
+
+public class XRCompositeManager {
+    private static boolean enableGradCache = true;
+    private static XRCompositeManager instance;
+
+    XRSurfaceData src;
+    XRSurfaceData texture;
+    XRSurfaceData gradient;
+    int alphaMask = XRUtils.None;
+
+    XRColor solidColor = new XRColor();
+    float extraAlpha = 1.0f;
+    byte compRule = XRUtils.PictOpOver;
+    XRColor alphaColor = new XRColor();
+
+    XRSurfaceData solidSrcPict;
+    int alphaMaskPict;
+    int gradCachePixmap;
+    int gradCachePicture;
+
+    boolean xorEnabled = false;
+    int validatedPixel = 0;
+    Composite validatedComp;
+    Paint validatedPaint;
+    float validatedExtraAlpha = 1.0f;
+
+    XRBackend con;
+    MaskTileManager maskBuffer;
+    XRTextRenderer textRenderer;
+    XRMaskImage maskImage;
+
+    public static synchronized XRCompositeManager getInstance(
+            XRSurfaceData surface) {
+        if (instance == null) {
+            instance = new XRCompositeManager(surface);
+        }
+        return instance;
+    }
+
+    private XRCompositeManager(XRSurfaceData surface) {
+        con = new XRBackendNative();
+        // con = XRBackendJava.getInstance();
+
+        String gradProp = System.getProperty("sun.java2d.xrgradcache");
+        enableGradCache = gradProp == null ||
+                          !(gradProp.equalsIgnoreCase("false") ||
+                          gradProp.equalsIgnoreCase("f"));
+
+        XRPaints.register(this);
+
+        initResources(surface);
+
+        maskBuffer = new MaskTileManager(this, surface.getXid());
+        textRenderer = new XRTextRenderer(this);
+        maskImage = new XRMaskImage(this, surface.getXid());
+    }
+
+    public void initResources(XRSurfaceData surface) {
+        int parentXid = surface.getXid();
+
+        int solidPixmap = con.createPixmap(parentXid, 32, 1, 1);
+        int solidSrcPictXID = con.createPicture(solidPixmap,
+                XRUtils.PictStandardARGB32);
+        con.setPictureRepeat(solidSrcPictXID, XRUtils.RepeatNormal);
+        con.renderRectangle(solidSrcPictXID, XRUtils.PictOpSrc,
+                XRColor.FULL_ALPHA, 0, 0, 1, 1);
+        solidSrcPict = new XRSurfaceData.XRInternalSurfaceData(con,
+                solidSrcPictXID, null);
+        setForeground(0);
+
+        int extraAlphaMask = con.createPixmap(parentXid, 8, 1, 1);
+        alphaMaskPict = con.createPicture(extraAlphaMask,
+                XRUtils.PictStandardA8);
+        con.setPictureRepeat(alphaMaskPict, XRUtils.RepeatNormal);
+        con.renderRectangle(alphaMaskPict, XRUtils.PictOpClear,
+                XRColor.NO_ALPHA, 0, 0, 1, 1);
+
+        if (enableGradCache) {
+            gradCachePixmap = con.createPixmap(parentXid, 32,
+                    MaskTileManager.MASK_SIZE, MaskTileManager.MASK_SIZE);
+            gradCachePicture = con.createPicture(gradCachePixmap,
+                    XRUtils.PictStandardARGB32);
+        }
+    }
+
+    public void setForeground(int pixel) {
+        solidColor.setColorValues(pixel, false);
+        con.renderRectangle(solidSrcPict.picture, XRUtils.PictOpSrc,
+                solidColor, 0, 0, 1, 1);
+    }
+
+    public void setGradientPaint(XRSurfaceData gradient) {
+        if (this.gradient != null) {
+            con.freePicture(this.gradient.picture);
+        }
+        this.gradient = gradient;
+        src = gradient;
+    }
+
+    public void setTexturePaint(XRSurfaceData texture) {
+        this.texture = texture;
+        src = texture;
+    }
+
+    public void XRResetPaint() {
+        src = solidSrcPict;
+    }
+
+    public void validateCompositeState(Composite comp, AffineTransform xform,
+            Paint paint, SunGraphics2D sg2d) {
+        boolean updatePaint = (paint != validatedPaint) || paint == null;
+
+        // validate composite
+        if ((comp != validatedComp)) {
+            if (comp != null) {
+                setComposite(comp);
+            } else {
+                comp = AlphaComposite.getInstance(AlphaComposite.SRC_OVER);
+                setComposite(comp);
+            }
+            // the paint state is dependent on the composite state, so make
+            // sure we update the color below
+            updatePaint = true;
+            validatedComp = comp;
+        }
+
+        if (sg2d != null && validatedPixel != sg2d.pixel) {
+            validatedPixel = sg2d.pixel;
+            setForeground(validatedPixel);
+        }
+
+        // validate paint
+        if (updatePaint) {
+            if (paint != null && sg2d != null
+                    && sg2d.paintState >= SunGraphics2D.PAINT_GRADIENT) {
+                XRPaints.setPaint(sg2d, paint);
+            } else {
+                XRResetPaint();
+            }
+            validatedPaint = paint;
+        }
+
+        if (src != solidSrcPict) {
+            AffineTransform at = (AffineTransform) xform.clone();
+            try {
+                at.invert();
+            } catch (NoninvertibleTransformException e) {
+                at.setToIdentity();
+            }
+            src.validateAsSource(at, -1, -1);
+        }
+    }
+
+    private void setComposite(Composite comp) {
+        if (comp instanceof AlphaComposite) {
+            AlphaComposite aComp = (AlphaComposite) comp;
+            validatedExtraAlpha = aComp.getAlpha();
+
+            this.compRule = XRUtils.j2dAlphaCompToXR(aComp.getRule());
+            this.extraAlpha = validatedExtraAlpha;
+
+            if (extraAlpha == 1.0f) {
+                alphaMask = XRUtils.None;
+                alphaColor.alpha = XRColor.FULL_ALPHA.alpha;
+            } else {
+                alphaColor.alpha = XRColor
+                        .byteToXRColorValue((int) (extraAlpha * 255));
+                alphaMask = alphaMaskPict;
+                con.renderRectangle(alphaMaskPict, XRUtils.PictOpSrc,
+                        alphaColor, 0, 0, 1, 1);
+            }
+
+            xorEnabled = false;
+        } else if (comp instanceof XORComposite) {
+            /* XOR composite validation is handled in XRSurfaceData */
+            xorEnabled = true;
+        } else {
+            throw new InternalError(
+                    "Composite accaleration not implemented for: "
+                            + comp.getClass().getName());
+        }
+    }
+
+    public boolean maskRequired() {
+        return (!xorEnabled)
+                && ((src != solidSrcPict)
+                        || (src == solidSrcPict && solidColor.alpha != 0xffff) || (extraAlpha != 1.0f));
+    }
+
+    public void XRComposite(int src, int mask, int dst, int srcX, int srcY,
+            int maskX, int maskY, int dstX, int dstY, int width, int height) {
+        int cachedSrc = (src == XRUtils.None) ? this.src.picture : src;
+        int cachedX = srcX;
+        int cachedY = srcY;
+
+        if (enableGradCache && gradient != null
+                && cachedSrc == gradient.picture) {
+            con.renderComposite(XRUtils.PictOpSrc, gradient.picture,
+                    XRUtils.None, gradCachePicture, srcX, srcY, 0, 0, 0, 0,
+                    width, height);
+            cachedX = 0;
+            cachedY = 0;
+            cachedSrc = gradCachePicture;
+        }
+
+        con.renderComposite(compRule, cachedSrc, mask, dst, cachedX, cachedY,
+                maskX, maskY, dstX, dstY, width, height);
+    }
+
+    public void XRCompositeTraps(int dst, int srcX, int srcY,
+            TrapezoidList trapList) {
+        int renderReferenceX = 0;
+        int renderReferenceY = 0;
+
+        if (trapList.getP1YLeft(0) < trapList.getP2YLeft(0)) {
+            renderReferenceX = trapList.getP1XLeft(0);
+            renderReferenceY = trapList.getP1YLeft(0);
+        } else {
+            renderReferenceX = trapList.getP2XLeft(0);
+            renderReferenceY = trapList.getP2YLeft(0);
+        }
+
+        renderReferenceX = (int) Math.floor(XRUtils
+                .XFixedToDouble(renderReferenceX));
+        renderReferenceY = (int) Math.floor(XRUtils
+                .XFixedToDouble(renderReferenceY));
+
+        con.renderCompositeTrapezoids(compRule, src.picture,
+                XRUtils.PictStandardA8, dst, renderReferenceX,
+                renderReferenceY, trapList);
+    }
+
+    public void XRRenderRectangles(XRSurfaceData dst, GrowableRectArray rects) {
+        if (xorEnabled) {
+            con.GCRectangles(dst.getXid(), dst.getGC(), rects);
+        } else {
+            con.renderRectangles(dst.getPicture(), compRule, solidColor, rects);
+        }
+    }
+
+    public void compositeBlit(XRSurfaceData src, XRSurfaceData dst, int sx,
+            int sy, int dx, int dy, int w, int h) {
+        con.renderComposite(compRule, src.picture, alphaMask, dst.picture, sx,
+                sy, 0, 0, dx, dy, w, h);
+    }
+
+    public void compositeText(int dst, int glyphSet, int maskFormat,
+            GrowableEltArray elts) {
+        con.XRenderCompositeText(compRule, src.picture, dst, maskFormat, 0, 0,
+                0, 0, glyphSet, elts);
+    }
+
+    public XRColor getMaskColor() {
+        return !isTexturePaintActive() ? XRColor.FULL_ALPHA : getAlphaColor();
+    }
+
+    public int getExtraAlphaMask() {
+        return alphaMask;
+    }
+
+    public boolean isTexturePaintActive() {
+        return src == texture;
+    }
+
+    public XRColor getAlphaColor() {
+        return alphaColor;
+    }
+
+    public XRBackend getBackend() {
+        return con;
+    }
+
+    public float getExtraAlpha() {
+        return validatedExtraAlpha;
+    }
+
+    public byte getCompRule() {
+        return compRule;
+    }
+
+    public XRTextRenderer getTextRenderer() {
+        return textRenderer;
+    }
+
+    public MaskTileManager getMaskBuffer() {
+        return maskBuffer;
+    }
+
+    public XRMaskImage getMaskImage() {
+        return maskImage;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/src/solaris/classes/sun/java2d/xr/XRDrawImage.java	Wed Jul 21 09:57:21 2010 -0700
@@ -0,0 +1,67 @@
+/*
+ * Copyright 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 sun.java2d.xr;
+
+import java.awt.*;
+import java.awt.geom.*;
+
+import sun.java2d.*;
+import sun.java2d.loops.*;
+import sun.java2d.pipe.*;
+
+/**
+ * Class used for re-routing transformed blits to the accelerated loops.
+ */
+
+public class XRDrawImage extends DrawImage {
+    @Override
+    protected void renderImageXform(SunGraphics2D sg, Image img,
+            AffineTransform tx, int interpType, int sx1, int sy1, int sx2,
+            int sy2, Color bgColor) {
+        SurfaceData dstData = sg.surfaceData;
+        SurfaceData srcData = dstData.getSourceSurfaceData(img,
+                SunGraphics2D.TRANSFORM_GENERIC, sg.imageComp, bgColor);
+
+        if (srcData != null && !isBgOperation(srcData, bgColor))  { // TODO: Do we bail out on bgBlits?
+        //      && srcData instanceof XRSurfaceData) {
+            SurfaceType srcType = srcData.getSurfaceType();
+            SurfaceType dstType = dstData.getSurfaceType();
+
+            TransformBlit blit = TransformBlit.getFromCache(srcType,
+                    sg.imageComp, dstType);
+
+            if (blit != null) {
+                blit.Transform(srcData, dstData, sg.composite,
+                        sg.getCompClip(), tx, interpType, sx1, sy1, 0, 0, sx2
+                                - sx1, sy2 - sy1);
+                return;
+            }
+        }
+
+        super.renderImageXform(sg, img, tx, interpType, sx1, sy1, sx2, sy2,
+                bgColor);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/src/solaris/classes/sun/java2d/xr/XRGraphicsConfig.java	Wed Jul 21 09:57:21 2010 -0700
@@ -0,0 +1,61 @@
+/*
+ * Copyright 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.
+ */
+
+/*
+ * To change this template, choose Tools | Templates
+ * and open the template in the editor.
+ */
+
+package sun.java2d.xr;
+
+import sun.awt.*;
+import sun.awt.image.*;
+import sun.java2d.*;
+
+public class XRGraphicsConfig extends X11GraphicsConfig implements
+        SurfaceManager.ProxiedGraphicsConfig {
+    private XRGraphicsConfig(X11GraphicsDevice device, int visualnum,
+            int depth, int colormap, boolean doubleBuffer) {
+        super(device, visualnum, depth, colormap, doubleBuffer);
+    }
+
+    public SurfaceData createSurfaceData(X11ComponentPeer peer) {
+        return XRSurfaceData.createData(peer);
+    }
+
+    public static XRGraphicsConfig getConfig(X11GraphicsDevice device,
+            int visualnum, int depth, int colormap, boolean doubleBuffer) {
+        if (!X11GraphicsEnvironment.isXRenderAvailable()) {
+            return null;
+        }
+
+        return new XRGraphicsConfig(device, visualnum, depth, colormap,
+                doubleBuffer);
+    }
+
+    public Object getProxyKey() {
+        return this;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/src/solaris/classes/sun/java2d/xr/XRMaskBlit.java	Wed Jul 21 09:57:21 2010 -0700
@@ -0,0 +1,94 @@
+/*
+ * Copyright 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 sun.java2d.xr;
+
+import static sun.java2d.loops.CompositeType.SrcNoEa;
+import static sun.java2d.loops.CompositeType.SrcOver;
+
+import java.awt.Composite;
+
+import sun.awt.*;
+import sun.java2d.*;
+import sun.java2d.loops.*;
+import sun.java2d.pipe.Region;
+
+/**
+ * For XRender there is no "blit", everything is just a fill with Repeat or Not.
+ * So basically this just quite the same as MaskFill.
+ *
+ * @author Clemens Eisserer
+ */
+public class XRMaskBlit extends MaskBlit {
+    static void register() {
+        GraphicsPrimitive[] primitives = {
+                new XRMaskBlit(XRSurfaceData.IntArgbPreX11, SrcOver,
+                               XRSurfaceData.IntArgbPreX11),
+                new XRMaskBlit(XRSurfaceData.IntRgbX11, SrcOver,
+                               XRSurfaceData.IntRgbX11),
+                new XRMaskBlit(XRSurfaceData.IntArgbPreX11, SrcNoEa,
+                               XRSurfaceData.IntRgbX11),
+                new XRMaskBlit(XRSurfaceData.IntRgbX11, SrcNoEa,
+                               XRSurfaceData.IntArgbPreX11)
+                };
+        GraphicsPrimitiveMgr.register(primitives);
+    }
+
+    public XRMaskBlit(SurfaceType srcType, CompositeType compType,
+            SurfaceType dstType) {
+        super(srcType, CompositeType.AnyAlpha, dstType);
+    }
+
+    protected native void maskBlit(long srcXsdo, long dstxsdo, int srcx,
+            int srcy, int dstx, int dsty, int w, int h, int maskoff,
+            int maskscan, int masklen, byte[] mask);
+
+    public void MaskBlit(SurfaceData src, SurfaceData dst, Composite comp,
+            Region clip, int srcx, int srcy, int dstx, int dsty, int width,
+            int height, byte[] mask, int maskoff, int maskscan) {
+        if (width <= 0 || height <= 0) {
+            return;
+        }
+
+        try {
+            SunToolkit.awtLock();
+
+            XRSurfaceData x11sd = (XRSurfaceData) src;
+            x11sd.validateAsSource(null, XRUtils.RepeatNone, XRUtils.FAST);
+
+            XRCompositeManager maskBuffer = x11sd.maskBuffer;
+            XRSurfaceData x11dst = (XRSurfaceData) dst;
+            x11dst.validateAsDestination(null, clip);
+
+            int maskPict = maskBuffer.getMaskBuffer().
+                         uploadMask(width, height, maskscan, maskoff, mask);
+            maskBuffer.XRComposite(x11sd.getPicture(), maskPict, x11sd.picture,
+                                  srcx, srcy, 0, 0, dstx, dsty, width, height);
+            maskBuffer.getMaskBuffer().clearUploadMask(maskPict, width, height);
+        } finally {
+            SunToolkit.awtUnlock();
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/src/solaris/classes/sun/java2d/xr/XRMaskFill.java	Wed Jul 21 09:57:21 2010 -0700
@@ -0,0 +1,115 @@
+/*
+ * Copyright 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 sun.java2d.xr;
+
+import static sun.java2d.loops.CompositeType.SrcNoEa;
+
+import static sun.java2d.loops.CompositeType.SrcOver;
+import static sun.java2d.loops.SurfaceType.AnyColor;
+import static sun.java2d.loops.SurfaceType.GradientPaint;
+import static sun.java2d.loops.SurfaceType.LinearGradientPaint;
+import static sun.java2d.loops.SurfaceType.OpaqueColor;
+import static sun.java2d.loops.SurfaceType.OpaqueGradientPaint;
+import static sun.java2d.loops.SurfaceType.OpaqueLinearGradientPaint;
+import static sun.java2d.loops.SurfaceType.OpaqueRadialGradientPaint;
+import static sun.java2d.loops.SurfaceType.OpaqueTexturePaint;
+import static sun.java2d.loops.SurfaceType.RadialGradientPaint;
+import static sun.java2d.loops.SurfaceType.TexturePaint;
+
+import java.awt.*;
+import sun.awt.*;
+import sun.java2d.*;
+import sun.java2d.loops.*;
+
+public class XRMaskFill extends MaskFill {
+    static void register() {
+        GraphicsPrimitive[] primitives = {
+                new XRMaskFill(AnyColor, SrcOver, XRSurfaceData.IntRgbX11),
+                new XRMaskFill(OpaqueColor, SrcNoEa, XRSurfaceData.IntRgbX11),
+                new XRMaskFill(GradientPaint, SrcOver, XRSurfaceData.IntRgbX11),
+                new XRMaskFill(OpaqueGradientPaint, SrcNoEa,
+                        XRSurfaceData.IntRgbX11),
+                new XRMaskFill(LinearGradientPaint, SrcOver,
+                        XRSurfaceData.IntRgbX11),
+                new XRMaskFill(OpaqueLinearGradientPaint, SrcNoEa,
+                        XRSurfaceData.IntRgbX11),
+                new XRMaskFill(RadialGradientPaint, SrcOver,
+                        XRSurfaceData.IntRgbX11),
+                new XRMaskFill(OpaqueRadialGradientPaint, SrcNoEa,
+                        XRSurfaceData.IntRgbX11),
+                new XRMaskFill(TexturePaint, SrcOver, XRSurfaceData.IntRgbX11),
+                new XRMaskFill(OpaqueTexturePaint, SrcNoEa,
+                        XRSurfaceData.IntRgbX11),
+
+                new XRMaskFill(AnyColor, SrcOver, XRSurfaceData.IntArgbPreX11),
+                new XRMaskFill(OpaqueColor, SrcNoEa, XRSurfaceData.IntArgbPreX11),
+                new XRMaskFill(GradientPaint, SrcOver, XRSurfaceData.IntArgbPreX11),
+                new XRMaskFill(OpaqueGradientPaint, SrcNoEa,
+                        XRSurfaceData.IntArgbPreX11),
+                new XRMaskFill(LinearGradientPaint, SrcOver,
+                        XRSurfaceData.IntArgbPreX11),
+                new XRMaskFill(OpaqueLinearGradientPaint, SrcNoEa,
+                        XRSurfaceData.IntArgbPreX11),
+                new XRMaskFill(RadialGradientPaint, SrcOver,
+                        XRSurfaceData.IntArgbPreX11),
+                new XRMaskFill(OpaqueRadialGradientPaint, SrcNoEa,
+                        XRSurfaceData.IntArgbPreX11),
+                new XRMaskFill(TexturePaint, SrcOver, XRSurfaceData.IntArgbPreX11),
+                new XRMaskFill(OpaqueTexturePaint, SrcNoEa,
+                        XRSurfaceData.IntArgbPreX11)
+                };
+
+        GraphicsPrimitiveMgr.register(primitives);
+    }
+
+    protected XRMaskFill(SurfaceType srcType, CompositeType compType,
+            SurfaceType surfaceType) {
+        super(srcType, compType, surfaceType);
+    }
+
+    protected native void maskFill(long xsdo, int x, int y, int w, int h,
+            int maskoff, int maskscan, int masklen, byte[] mask);
+
+    public void MaskFill(SunGraphics2D sg2d, SurfaceData sData, Composite comp,
+            final int x, final int y, final int w, final int h,
+            final byte[] mask, final int maskoff, final int maskscan) {
+        try {
+            SunToolkit.awtLock();
+
+            XRSurfaceData x11sd = (XRSurfaceData) sData;
+            x11sd.validateAsDestination(null, sg2d.getCompClip());
+
+            XRCompositeManager maskBuffer = x11sd.maskBuffer;
+            maskBuffer.validateCompositeState(comp, sg2d.transform, sg2d.paint, sg2d);
+
+            int maskPict = maskBuffer.getMaskBuffer().uploadMask(w, h, maskscan, maskoff, mask);
+            maskBuffer.XRComposite(XRUtils.None, maskPict, x11sd.picture, x, y, 0, 0, x, y, w, h);
+            maskBuffer.getMaskBuffer().clearUploadMask(maskPict, w, h);
+        } finally {
+            SunToolkit.awtUnlock();
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/src/solaris/classes/sun/java2d/xr/XRMaskImage.java	Wed Jul 21 09:57:21 2010 -0700
@@ -0,0 +1,129 @@
+/*
+ * Copyright 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 sun.java2d.xr;
+
+import java.awt.*;
+import java.awt.geom.*;
+
+/**
+ *  Management of mask used for some blit-types.
+ *
+ * @author Clemens Eisserer
+ */
+
+public class XRMaskImage {
+
+    private static final int MASK_SCALE_FACTOR = 8;
+
+    private static final int BLIT_MASK_SIZE = 8;
+
+    Dimension blitMaskDimensions = new Dimension(BLIT_MASK_SIZE, BLIT_MASK_SIZE);
+    int blitMaskPixmap;
+    int blitMaskPicture;
+    int lastMaskWidth = 0;
+    int lastMaskHeight = 0;
+    AffineTransform lastMaskTransform;
+
+    XRCompositeManager xrMgr;
+    XRBackend con;
+
+    public XRMaskImage(XRCompositeManager xrMgr, int parentDrawable) {
+        this.xrMgr = xrMgr;
+        this.con = xrMgr.getBackend();
+
+        initBlitMask(parentDrawable, BLIT_MASK_SIZE, BLIT_MASK_SIZE);
+    }
+
+
+    /**
+     * Prepares a mask used by a TransformedBlit, fills mask-contents and applies
+     * transformation.
+     */
+    public int prepareBlitMask(XRSurfaceData dst, AffineTransform maskTX, int width,
+            int height) {
+
+        int maskWidth = Math.max(width / MASK_SCALE_FACTOR, 1);
+        int maskHeight = Math.max(height / MASK_SCALE_FACTOR, 1);
+        maskTX.scale(((double) width) / maskWidth, ((double) height) / maskHeight);
+
+        try {
+            maskTX.invert();
+        } catch (NoninvertibleTransformException ex) {
+            maskTX.setToIdentity();
+        }
+
+        ensureBlitMaskSize(maskWidth, maskHeight);
+
+        if (lastMaskTransform == null || !lastMaskTransform.equals(maskTX)) {
+                con.setPictureTransform(blitMaskPicture, maskTX);
+                lastMaskTransform = maskTX;
+        }
+
+        if (lastMaskWidth != maskWidth || lastMaskHeight != maskHeight)  {
+            //Only clear mask, if previous mask area is larger than new one, otherwise simple overpaint it
+            if (lastMaskWidth > maskWidth || lastMaskHeight > maskHeight)  {
+                con.renderRectangle(blitMaskPicture, XRUtils.PictOpClear, XRColor.NO_ALPHA, 0, 0, lastMaskWidth, lastMaskHeight);
+            }
+
+            con.renderRectangle(blitMaskPicture, XRUtils.PictOpSrc, xrMgr.getAlphaColor(), 0, 0, maskWidth, maskHeight);
+        }
+
+        lastMaskWidth = maskWidth;
+        lastMaskHeight = maskHeight;
+
+        return blitMaskPicture;
+    }
+
+    private void initBlitMask(int parentDrawable, int width, int height) {
+        int newPM = con.createPixmap(parentDrawable, 8, width, height);
+        int newPict = con.createPicture(newPM, XRUtils.PictStandardA8);
+
+        /*Free old mask*/
+        if (blitMaskPixmap != 0) {
+            con.freePixmap(blitMaskPixmap);
+            con.freePicture(blitMaskPicture);
+        }
+
+        blitMaskPixmap = newPM;
+        blitMaskPicture = newPict;
+
+        con.renderRectangle(blitMaskPicture, XRUtils.PictOpClear, XRColor.NO_ALPHA, 0, 0, width, height);
+
+        blitMaskDimensions.width = width;
+        blitMaskDimensions.height = height;
+        lastMaskWidth = 0;
+        lastMaskHeight = 0;
+        lastMaskTransform = null;
+    }
+
+    private void ensureBlitMaskSize(int minSizeX, int minSizeY) {
+        if (minSizeX > blitMaskDimensions.width || minSizeY > blitMaskDimensions.height) {
+            int newWidth = Math.max(minSizeX, blitMaskDimensions.width);
+            int newHeight = Math.max(minSizeY, blitMaskDimensions.height);
+            initBlitMask(blitMaskPixmap, newWidth, newHeight);
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/src/solaris/classes/sun/java2d/xr/XRPMBlitLoops.java	Wed Jul 21 09:57:21 2010 -0700
@@ -0,0 +1,400 @@
+/*
+ * Copyright 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 sun.java2d.xr;
+
+import sun.awt.SunToolkit;
+import sun.awt.image.*;
+import sun.java2d.loops.*;
+import sun.java2d.pipe.*;
+import sun.java2d.*;
+import java.awt.*;
+import java.awt.geom.*;
+import java.lang.ref.*;
+
+public class XRPMBlitLoops {
+
+    static WeakReference<SunVolatileImage> argbTmpPM = new WeakReference<SunVolatileImage>(null);
+    static WeakReference<SunVolatileImage> rgbTmpPM = new WeakReference<SunVolatileImage>(null);
+
+    public XRPMBlitLoops() {
+    }
+
+    public static void register() {
+        GraphicsPrimitive[] primitives = { new XRPMBlit(XRSurfaceData.IntRgbX11, XRSurfaceData.IntRgbX11),
+                new XRPMBlit(XRSurfaceData.IntRgbX11, XRSurfaceData.IntArgbPreX11),
+                new XRPMBlit(XRSurfaceData.IntArgbPreX11, XRSurfaceData.IntRgbX11),
+                new XRPMBlit(XRSurfaceData.IntArgbPreX11, XRSurfaceData.IntArgbPreX11),
+
+                new XRPMScaledBlit(XRSurfaceData.IntRgbX11, XRSurfaceData.IntRgbX11),
+                new XRPMScaledBlit(XRSurfaceData.IntRgbX11, XRSurfaceData.IntArgbPreX11),
+                new XRPMScaledBlit(XRSurfaceData.IntArgbPreX11, XRSurfaceData.IntRgbX11),
+                new XRPMScaledBlit(XRSurfaceData.IntArgbPreX11, XRSurfaceData.IntArgbPreX11),
+
+                new XRPMTransformedBlit(XRSurfaceData.IntRgbX11, XRSurfaceData.IntRgbX11),
+                new XRPMTransformedBlit(XRSurfaceData.IntRgbX11, XRSurfaceData.IntArgbPreX11),
+                new XRPMTransformedBlit(XRSurfaceData.IntArgbPreX11, XRSurfaceData.IntRgbX11),
+                new XRPMTransformedBlit(XRSurfaceData.IntArgbPreX11, XRSurfaceData.IntArgbPreX11),
+
+                /* SW -> Surface Blits */
+                new XrSwToPMBlit(SurfaceType.IntArgb, XRSurfaceData.IntRgbX11),
+                new XrSwToPMBlit(SurfaceType.IntRgb, XRSurfaceData.IntRgbX11),
+                new XrSwToPMBlit(SurfaceType.IntBgr, XRSurfaceData.IntRgbX11),
+                new XrSwToPMBlit(SurfaceType.ThreeByteBgr, XRSurfaceData.IntRgbX11),
+                new XrSwToPMBlit(SurfaceType.Ushort565Rgb, XRSurfaceData.IntRgbX11),
+                new XrSwToPMBlit(SurfaceType.Ushort555Rgb, XRSurfaceData.IntRgbX11),
+                new XrSwToPMBlit(SurfaceType.ByteIndexed, XRSurfaceData.IntRgbX11),
+
+                new XrSwToPMBlit(SurfaceType.IntArgb, XRSurfaceData.IntArgbPreX11),
+                new XrSwToPMBlit(SurfaceType.IntRgb, XRSurfaceData.IntArgbPreX11),
+                new XrSwToPMBlit(SurfaceType.IntBgr, XRSurfaceData.IntArgbPreX11),
+                new XrSwToPMBlit(SurfaceType.ThreeByteBgr, XRSurfaceData.IntArgbPreX11),
+                new XrSwToPMBlit(SurfaceType.Ushort565Rgb, XRSurfaceData.IntArgbPreX11),
+                new XrSwToPMBlit(SurfaceType.Ushort555Rgb, XRSurfaceData.IntArgbPreX11),
+                new XrSwToPMBlit(SurfaceType.ByteIndexed, XRSurfaceData.IntArgbPreX11),
+
+                /* SW->Surface Scales */
+                new XrSwToPMScaledBlit(SurfaceType.IntArgb, XRSurfaceData.IntRgbX11),
+                new XrSwToPMScaledBlit(SurfaceType.IntRgb, XRSurfaceData.IntRgbX11),
+                new XrSwToPMScaledBlit(SurfaceType.IntBgr, XRSurfaceData.IntRgbX11),
+                new XrSwToPMScaledBlit(SurfaceType.ThreeByteBgr, XRSurfaceData.IntRgbX11),
+                new XrSwToPMScaledBlit(SurfaceType.Ushort565Rgb, XRSurfaceData.IntRgbX11),
+                new XrSwToPMScaledBlit(SurfaceType.Ushort555Rgb, XRSurfaceData.IntRgbX11),
+                new XrSwToPMScaledBlit(SurfaceType.ByteIndexed, XRSurfaceData.IntRgbX11),
+
+                new XrSwToPMScaledBlit(SurfaceType.IntArgb, XRSurfaceData.IntArgbPreX11),
+                new XrSwToPMScaledBlit(SurfaceType.IntRgb, XRSurfaceData.IntArgbPreX11),
+                new XrSwToPMScaledBlit(SurfaceType.IntBgr, XRSurfaceData.IntArgbPreX11),
+                new XrSwToPMScaledBlit(SurfaceType.ThreeByteBgr, XRSurfaceData.IntArgbPreX11),
+                new XrSwToPMScaledBlit(SurfaceType.Ushort565Rgb, XRSurfaceData.IntArgbPreX11),
+                new XrSwToPMScaledBlit(SurfaceType.Ushort555Rgb, XRSurfaceData.IntArgbPreX11),
+                new XrSwToPMScaledBlit(SurfaceType.ByteIndexed, XRSurfaceData.IntArgbPreX11),
+
+                /* SW->Surface Transforms */
+                new XrSwToPMTransformedBlit(SurfaceType.IntArgb, XRSurfaceData.IntRgbX11),
+                new XrSwToPMTransformedBlit(SurfaceType.IntRgb, XRSurfaceData.IntRgbX11),
+                new XrSwToPMTransformedBlit(SurfaceType.IntBgr, XRSurfaceData.IntRgbX11),
+                new XrSwToPMTransformedBlit(SurfaceType.ThreeByteBgr, XRSurfaceData.IntRgbX11),
+                new XrSwToPMTransformedBlit(SurfaceType.Ushort565Rgb, XRSurfaceData.IntRgbX11),
+                new XrSwToPMTransformedBlit(SurfaceType.Ushort555Rgb, XRSurfaceData.IntRgbX11),
+                new XrSwToPMTransformedBlit(SurfaceType.ByteIndexed, XRSurfaceData.IntRgbX11),
+
+                new XrSwToPMTransformedBlit(SurfaceType.IntArgb, XRSurfaceData.IntArgbPreX11),
+                new XrSwToPMTransformedBlit(SurfaceType.IntRgb, XRSurfaceData.IntArgbPreX11),
+                new XrSwToPMTransformedBlit(SurfaceType.IntBgr, XRSurfaceData.IntArgbPreX11),
+                new XrSwToPMTransformedBlit(SurfaceType.ThreeByteBgr, XRSurfaceData.IntArgbPreX11),
+                new XrSwToPMTransformedBlit(SurfaceType.Ushort565Rgb, XRSurfaceData.IntArgbPreX11),
+                new XrSwToPMTransformedBlit(SurfaceType.Ushort555Rgb, XRSurfaceData.IntArgbPreX11),
+                new XrSwToPMTransformedBlit(SurfaceType.ByteIndexed, XRSurfaceData.IntArgbPreX11), };
+        GraphicsPrimitiveMgr.register(primitives);
+    }
+
+    /**
+     * Caches a SW surface using a temporary pixmap. The pixmap is held by a WeakReference,
+     *  allowing it to shrink again after some time.
+     */
+    protected static XRSurfaceData cacheToTmpSurface(SurfaceData src, XRSurfaceData dst, int w, int h, int sx, int sy) {
+        SunVolatileImage vImg;
+        SurfaceType vImgSurfaceType;
+
+        if (src.getTransparency() == Transparency.OPAQUE) {
+            vImg = rgbTmpPM.get();
+            vImgSurfaceType = SurfaceType.IntRgb;
+        } else {
+            vImg = argbTmpPM.get();
+            vImgSurfaceType = SurfaceType.IntArgbPre;
+        }
+
+        if (vImg == null || vImg.getWidth() < w || vImg.getHeight() < h) {
+            if (vImg != null) {
+                vImg.flush();
+            }
+            vImg = (SunVolatileImage) dst.getGraphicsConfig().createCompatibleVolatileImage(w, h, src.getTransparency());
+            vImg.setAccelerationPriority(1.0f);
+
+            if (src.getTransparency() == SurfaceData.OPAQUE) {
+                rgbTmpPM = new WeakReference<SunVolatileImage>(vImg);
+            } else {
+                argbTmpPM = new WeakReference<SunVolatileImage>(vImg);
+            }
+        }
+
+        Blit swToSurfaceBlit = Blit.getFromCache(src.getSurfaceType(), CompositeType.SrcNoEa, vImgSurfaceType);
+        XRSurfaceData vImgSurface = (XRSurfaceData) vImg.getDestSurface();
+        swToSurfaceBlit.Blit(src, vImgSurface, null, null, sx, sy, 0, 0, w, h);
+
+        return vImgSurface;
+    }
+}
+
+class XRPMBlit extends Blit {
+    public XRPMBlit(SurfaceType srcType, SurfaceType dstType) {
+        super(srcType, CompositeType.AnyAlpha, dstType);
+    }
+
+    public void Blit(SurfaceData src, SurfaceData dst, Composite comp, Region clip, int sx, int sy, int dx, int dy, int w, int h) {
+        try {
+            SunToolkit.awtLock();
+
+            XRSurfaceData x11sdDst = (XRSurfaceData) dst;
+            x11sdDst.validateAsDestination(null, clip);
+            XRSurfaceData x11sdSrc = (XRSurfaceData) src;
+            x11sdSrc.validateAsSource(null, XRUtils.RepeatNone, XRUtils.FAST);
+
+            x11sdDst.maskBuffer.validateCompositeState(comp, null, null, null);
+
+            x11sdDst.maskBuffer.compositeBlit(x11sdSrc, x11sdDst, sx, sy, dx, dy, w, h);
+        } finally {
+            SunToolkit.awtUnlock();
+        }
+    }
+}
+
+class XRPMScaledBlit extends ScaledBlit {
+    public XRPMScaledBlit(SurfaceType srcType, SurfaceType dstType) {
+        super(srcType, CompositeType.AnyAlpha, dstType);
+    }
+
+    /*
+     * TODO: This breaks scales with non-integer coordinates!?!?!
+     */
+    public void Scale(SurfaceData src, SurfaceData dst, Composite comp, Region clip, int sx1, int sy1, int sx2, int sy2, double dx1, double dy1,
+            double dx2, double dy2) {
+        try {
+            SunToolkit.awtLock();
+
+            XRSurfaceData x11sdDst = (XRSurfaceData) dst;
+            x11sdDst.validateAsDestination(null, clip);
+            XRSurfaceData x11sdSrc = (XRSurfaceData) src;
+            x11sdDst.maskBuffer.validateCompositeState(comp, null, null, null);
+
+            double xScale = (dx2 - dx1) / (sx2 - sx1);
+            double yScale = (dy2 - dy1) / (sy2 - sy1);
+
+            sx1 *= xScale;
+            sx2 *= xScale;
+            sy1 *= yScale;
+            sy2 *= yScale;
+
+            AffineTransform xForm = AffineTransform.getScaleInstance(1 / xScale, 1 / yScale);
+
+            x11sdSrc.validateAsSource(xForm, XRUtils.RepeatNone, XRUtils.FAST); /*
+                                                                                 * TODO:
+                                                                                 * padded
+                                                                                 * blit
+                                                                                 * required
+                                                                                 * :
+                                                                                 * -
+                                                                                 * /
+                                                                                 * ?
+                                                                                 * ?
+                                                                                 */
+            x11sdDst.maskBuffer.compositeBlit(x11sdSrc, x11sdDst, (int) sx1, (int) sy1, (int) dx1, (int) dy1, (int) (dx2 - dx1), (int) (dy2 - dy1));
+        } finally {
+            SunToolkit.awtUnlock();
+        }
+    }
+}
+
+/**
+ * Called also if scale+transform is set
+ *
+ * @author Clemens Eisserer
+ */
+class XRPMTransformedBlit extends TransformBlit {
+
+    public XRPMTransformedBlit(SurfaceType srcType, SurfaceType dstType) {
+        super(srcType, CompositeType.AnyAlpha, dstType);
+    }
+
+    /*
+     * Calculates the composite-rectangle required for transformed blits. This
+     * method is functionally equal to: Shape shp =
+     * xform.createTransformedShape(rect); Rectangle bounds = shp.getBounds();
+     * but performs significantly better.
+     */
+    public Rectangle getCompositeBounds(AffineTransform tr, int dstx, int dsty, int width, int height) {
+        double[] compBounds = new double[8];
+        compBounds[0] = dstx;
+        compBounds[1] = dsty;
+        compBounds[2] = dstx + width;
+        compBounds[3] = dsty;
+        compBounds[4] = dstx + width;
+        compBounds[5] = dsty + height;
+        compBounds[6] = dstx;
+        compBounds[7] = dsty + height;
+
+        tr.transform(compBounds, 0, compBounds, 0, 4);
+
+        double minX = Math.min(compBounds[0], Math.min(compBounds[2], Math.min(compBounds[4], compBounds[6])));
+        double minY = Math.min(compBounds[1], Math.min(compBounds[3], Math.min(compBounds[5], compBounds[7])));
+        double maxX = Math.max(compBounds[0], Math.max(compBounds[2], Math.max(compBounds[4], compBounds[6])));
+        double maxY = Math.max(compBounds[1], Math.max(compBounds[3], Math.max(compBounds[5], compBounds[7])));
+
+        minX = Math.floor(minX);
+        minY = Math.floor(minY);
+        maxX = Math.ceil(maxX);
+        maxY = Math.ceil(maxY);
+
+        return new Rectangle((int) minX, (int) minY, (int) (maxX - minX), (int) (maxY - minY));
+    }
+
+    public void Transform(SurfaceData src, SurfaceData dst, Composite comp, Region clip, AffineTransform xform, int hint, int srcx, int srcy,
+            int dstx, int dsty, int width, int height) {
+        try {
+            SunToolkit.awtLock();
+
+            int filter = XRUtils.ATransOpToXRQuality(hint);
+
+            XRSurfaceData x11sdDst = (XRSurfaceData) dst;
+            x11sdDst.validateAsDestination(null, clip);
+            XRSurfaceData x11sdSrc = (XRSurfaceData) src;
+            x11sdDst.maskBuffer.validateCompositeState(comp, null, null, null);
+
+            Rectangle bounds = getCompositeBounds(xform, dstx, dsty, width, height);
+
+            AffineTransform trx = AffineTransform.getTranslateInstance((-bounds.x), (-bounds.y));
+            trx.concatenate(xform);
+            AffineTransform maskTX = (AffineTransform) trx.clone();
+
+            trx.translate(-srcx, -srcy);
+
+            try {
+                trx.invert();
+            } catch (NoninvertibleTransformException ex) {
+                trx.setToIdentity();
+                System.err.println("Reseted to identity!");
+            }
+
+            boolean omitMask = isMaskOmittable(trx, comp, filter);
+
+            if (!omitMask) {
+                XRMaskImage mask = x11sdSrc.maskBuffer.getMaskImage();
+
+                x11sdSrc.validateAsSource(trx, XRUtils.RepeatPad, filter);
+                int maskPicture = mask.prepareBlitMask(x11sdDst, maskTX, width, height);
+                x11sdDst.maskBuffer.con.renderComposite(XRCompositeManager.getInstance(x11sdSrc).getCompRule(), x11sdSrc.picture, maskPicture, x11sdDst.picture,
+                        0, 0, 0, 0, bounds.x, bounds.y, bounds.width, bounds.height);
+            } else {
+                int repeat = filter == XRUtils.FAST ? XRUtils.RepeatNone : XRUtils.RepeatPad;
+
+                x11sdSrc.validateAsSource(trx, repeat, filter);
+                x11sdDst.maskBuffer.compositeBlit(x11sdSrc, x11sdDst, 0, 0, bounds.x, bounds.y, bounds.width, bounds.height);
+            }
+        } finally {
+            SunToolkit.awtUnlock();
+        }
+    }
+
+    /* TODO: Is mask ever omitable??? ... should be for 90 degree rotation and no shear, but we always need to use RepeatPad */
+    protected static boolean isMaskOmittable(AffineTransform trx, Composite comp, int filter) {
+        return (filter == XRUtils.FAST || trx.getTranslateX() == (int) trx.getTranslateX() /*
+                                                                                            * If
+                                                                                            * translate
+                                                                                            * is
+                                                                                            * integer
+                                                                                            * only
+                                                                                            */
+                && trx.getTranslateY() == (int) trx.getTranslateY() && (trx.getShearX() == 0 && trx.getShearY() == 0 // Only
+                // 90 degree
+                // rotation
+                || trx.getShearX() == -trx.getShearY())) && ((AlphaComposite) comp).getAlpha() == 1.0f; // No
+        // ExtraAlpha!=1
+    }
+}
+
+class XrSwToPMBlit extends Blit {
+    Blit pmToSurfaceBlit;
+
+    XrSwToPMBlit(SurfaceType srcType, SurfaceType dstType) {
+        super(srcType, CompositeType.AnyAlpha, dstType);
+        pmToSurfaceBlit = new XRPMBlit(dstType, dstType);
+    }
+
+    public void Blit(SurfaceData src, SurfaceData dst, Composite comp, Region clip, int sx, int sy, int dx, int dy, int w, int h) {
+        /*
+         * If the blit is write-only (putimge), no need for a temporary VI.
+         */
+        if (CompositeType.SrcOverNoEa.equals(comp) && (src.getTransparency() == Transparency.OPAQUE)) {
+            Blit opaqueSwToSurfaceBlit = Blit.getFromCache(src.getSurfaceType(), CompositeType.SrcNoEa, dst.getSurfaceType());
+            opaqueSwToSurfaceBlit.Blit(src, dst, comp, clip, sx, sy, dx, dy, w, h);
+        } else {
+            try {
+                SunToolkit.awtLock();
+
+                XRSurfaceData vImgSurface = XRPMBlitLoops.cacheToTmpSurface(src, (XRSurfaceData) dst, w, h, sx, sy);
+                pmToSurfaceBlit.Blit(vImgSurface, dst, comp, clip, 0, 0, dx, dy, w, h);
+            } finally {
+                SunToolkit.awtUnlock();
+            }
+        }
+    }
+}
+
+class XrSwToPMScaledBlit extends ScaledBlit {
+    ScaledBlit pmToSurfaceBlit;
+
+    XrSwToPMScaledBlit(SurfaceType srcType, SurfaceType dstType) {
+        super(srcType, CompositeType.AnyAlpha, dstType);
+        pmToSurfaceBlit = new XRPMScaledBlit(dstType, dstType);
+    }
+
+    public void Scale(SurfaceData src, SurfaceData dst, Composite comp, Region clip, int sx1, int sy1, int sx2, int sy2, double dx1, double dy1,
+            double dx2, double dy2) {
+        {
+            int w = sx2 - sx1;
+            int h = sy2 - sy1;
+
+            try {
+                SunToolkit.awtLock();
+                XRSurfaceData vImgSurface = XRPMBlitLoops.cacheToTmpSurface(src, (XRSurfaceData) dst, w, h, sx1, sy1);
+                pmToSurfaceBlit.Scale(vImgSurface, dst, comp, clip, 0, 0, w, h, dx1, dy1, dx2, dy2);
+            } finally {
+                SunToolkit.awtUnlock();
+            }
+        }
+    }
+}
+
+class XrSwToPMTransformedBlit extends TransformBlit {
+    TransformBlit pmToSurfaceBlit;
+
+    XrSwToPMTransformedBlit(SurfaceType srcType, SurfaceType dstType) {
+        super(srcType, CompositeType.AnyAlpha, dstType);
+        pmToSurfaceBlit = new XRPMTransformedBlit(dstType, dstType);
+    }
+
+    public void Transform(SurfaceData src, SurfaceData dst, Composite comp, Region clip, AffineTransform xform, int hint, int sx, int sy, int dstx,
+            int dsty, int w, int h) {
+        try {
+            SunToolkit.awtLock();
+
+            XRSurfaceData vImgSurface = XRPMBlitLoops.cacheToTmpSurface(src, (XRSurfaceData) dst, w, h, sx, sy);
+            pmToSurfaceBlit.Transform(vImgSurface, dst, comp, clip, xform, hint, 0, 0, dstx, dsty, w, h);
+        } finally {
+            SunToolkit.awtUnlock();
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/src/solaris/classes/sun/java2d/xr/XRPaints.java	Wed Jul 21 09:57:21 2010 -0700
@@ -0,0 +1,314 @@
+/*
+ * Copyright 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 sun.java2d.xr;
+
+import java.awt.*;
+import java.awt.MultipleGradientPaint.*;
+import java.awt.geom.*;
+import java.awt.image.*;
+
+import sun.java2d.*;
+import sun.java2d.loops.*;
+import sun.java2d.pipe.*;
+
+abstract class XRPaints {
+    static XRCompositeManager xrCompMan;
+
+    static final XRGradient xrGradient = new XRGradient();
+    static final XRLinearGradient xrLinearGradient = new XRLinearGradient();
+    static final XRRadialGradient xrRadialGradient = new XRRadialGradient();
+    static final XRTexture xrTexture = new XRTexture();
+
+    public static void register(XRCompositeManager xrComp) {
+        xrCompMan = xrComp;
+    }
+
+    private static XRPaints getXRPaint(SunGraphics2D sg2d) {
+        switch (sg2d.paintState) {
+        case SunGraphics2D.PAINT_GRADIENT:
+            return xrGradient;
+
+        case SunGraphics2D.PAINT_LIN_GRADIENT:
+            return xrLinearGradient;
+
+        case SunGraphics2D.PAINT_RAD_GRADIENT:
+            return xrRadialGradient;
+
+        case SunGraphics2D.PAINT_TEXTURE:
+            return xrTexture;
+
+        default:
+            return null;
+        }
+    }
+
+    /**
+     * Attempts to locate an implementation corresponding to the paint state of
+     * the provided SunGraphics2D object. If no implementation can be found, or
+     * if the paint cannot be accelerated under the conditions of the
+     * SunGraphics2D, this method returns false; otherwise, returns true.
+     */
+    static boolean isValid(SunGraphics2D sg2d) {
+        XRPaints impl = getXRPaint(sg2d);
+        return (impl != null && impl.isPaintValid(sg2d));
+    }
+
+    static void setPaint(SunGraphics2D sg2d, Paint paint) {
+        XRPaints impl = getXRPaint(sg2d);
+        if (impl != null) {
+            impl.setXRPaint(sg2d, paint);
+        }
+    }
+
+    /**
+     * Returns true if this implementation is able to accelerate the Paint
+     * object associated with, and under the conditions of, the provided
+     * SunGraphics2D instance; otherwise returns false.
+     */
+    abstract boolean isPaintValid(SunGraphics2D sg2d);
+
+    abstract void setXRPaint(SunGraphics2D sg2d, Paint paint);
+
+    private static class XRGradient extends XRPaints {
+        private XRGradient() {
+        }
+
+        /**
+         * There are no restrictions for accelerating GradientPaint, so this
+         * method always returns true.
+         */
+        @Override
+        boolean isPaintValid(SunGraphics2D sg2d) {
+            return true;
+        }
+
+        void setXRPaint(SunGraphics2D sg2d, Paint pt) {
+            GradientPaint paint = (GradientPaint) pt;
+
+            int[] pixels = convertToIntArgbPixels(new Color[] { paint.getColor1(), paint.getColor2() }, false);
+
+            float fractions[] = new float[2];
+            fractions[0] = 0;
+            fractions[1] = 1;
+
+            Point2D pt1 = paint.getPoint1();
+            Point2D pt2 = paint.getPoint2();
+
+            AffineTransform at = (AffineTransform) sg2d.transform.clone();
+            try {
+                at.invert();
+            } catch (NoninvertibleTransformException ex) {
+                at.setToIdentity();
+            }
+
+            int repeat = paint.isCyclic() ? XRUtils.RepeatReflect : XRUtils.RepeatPad;
+
+            XRBackend con = xrCompMan.getBackend();
+            int gradient = con.createLinearGradient(pt1, pt2, fractions, pixels, repeat, at);
+            xrCompMan.setGradientPaint(new XRSurfaceData.XRInternalSurfaceData(con, gradient, at));
+        }
+    }
+
+    public int getGradientLength(Point2D pt1, Point2D pt2) {
+           double xDiff = Math.max(pt1.getX(), pt2.getX()) - Math.min(pt1.getX(), pt2.getX());
+           double yDiff = Math.max(pt1.getY(), pt2.getY()) - Math.min(pt1.getY(), pt2.getY());
+           return (int) Math.ceil(Math.sqrt(xDiff*xDiff + yDiff*yDiff));
+    }
+
+    private static class XRLinearGradient extends XRPaints {
+
+        @Override
+        boolean isPaintValid(SunGraphics2D sg2d) {
+            return true;
+        }
+
+        @Override
+        void setXRPaint(SunGraphics2D sg2d, Paint pt) {
+            LinearGradientPaint paint = (LinearGradientPaint) pt;
+            boolean linear = (paint.getColorSpace() == ColorSpaceType.LINEAR_RGB);
+
+            Color[] colors = paint.getColors();
+            Point2D pt1 = paint.getStartPoint();
+            Point2D pt2 = paint.getEndPoint();
+
+
+            AffineTransform at = paint.getTransform();
+            at.preConcatenate(sg2d.transform);
+
+            int repeat = XRUtils.getRepeatForCycleMethod(paint.getCycleMethod());
+            float[] fractions = paint.getFractions();
+            int[] pixels = convertToIntArgbPixels(colors, linear);
+
+            try {
+                at.invert();
+            } catch (NoninvertibleTransformException ex) {
+                ex.printStackTrace();
+            }
+
+            XRBackend con = xrCompMan.getBackend();
+            int gradient = con.createLinearGradient(pt1, pt2, fractions, pixels, repeat, at);
+            xrCompMan.setGradientPaint(new XRSurfaceData.XRInternalSurfaceData(con, gradient, at));
+        }
+    }
+
+    private static class XRRadialGradient extends XRPaints {
+
+        @Override
+        boolean isPaintValid(SunGraphics2D sg2d) {
+            RadialGradientPaint grad = (RadialGradientPaint) sg2d.paint;
+            return grad.getFocusPoint().equals(grad.getCenterPoint());
+        }
+
+        @Override
+        void setXRPaint(SunGraphics2D sg2d, Paint pt) {
+            RadialGradientPaint paint = (RadialGradientPaint) pt;
+            boolean linear = (paint.getColorSpace() == ColorSpaceType.LINEAR_RGB);
+            Color[] colors = paint.getColors();
+            Point2D center = paint.getCenterPoint();
+            Point2D focus = paint.getFocusPoint();
+
+            int repeat = XRUtils.getRepeatForCycleMethod(paint.getCycleMethod());
+            float[] fractions = paint.getFractions();
+            int[] pixels = convertToIntArgbPixels(colors, linear);
+            float radius = paint.getRadius();
+
+            // save original (untransformed) center and focus points
+            double cx = center.getX();
+            double cy = center.getY();
+            double fx = focus.getX();
+            double fy = focus.getY();
+
+            AffineTransform at = paint.getTransform();
+            at.preConcatenate(sg2d.transform);
+            focus = at.transform(focus, focus);
+
+            // transform unit circle to gradient coords; we start with the
+            // unit circle (center=(0,0), focus on positive x-axis, radius=1)
+            // and then transform into gradient space
+            at.translate(cx, cy);
+            at.rotate(fx - cx, fy - cy);
+            // at.scale(radius, radius);
+
+            // invert to get mapping from device coords to unit circle
+            try {
+                at.invert();
+            } catch (Exception e) {
+                at.setToScale(0.0, 0.0);
+            }
+            focus = at.transform(focus, focus);
+
+            // clamp the focus point so that it does not rest on, or outside
+            // of, the circumference of the gradient circle
+            fx = Math.min(focus.getX(), 0.99);
+
+            XRBackend con = xrCompMan.getBackend();
+            int gradient = con.createRadialGradient(new Point2D.Float(0, 0), new Point2D.Float(0, 0), 0, radius, fractions, pixels, repeat, at);
+            xrCompMan.setGradientPaint(new XRSurfaceData.XRInternalSurfaceData(con, gradient, at));
+        }
+    }
+
+    private static class XRTexture extends XRPaints {
+
+        @Override
+        boolean isPaintValid(SunGraphics2D sg2d) {
+            TexturePaint paint = (TexturePaint) sg2d.paint;
+            BufferedImage bi = paint.getImage();
+            XRSurfaceData dstData = (XRSurfaceData) sg2d.getDestSurface();
+
+            SurfaceData srcData = dstData.getSourceSurfaceData(bi, SunGraphics2D.TRANSFORM_ISIDENT, CompositeType.SrcOver, null);
+            if (!(srcData instanceof XRSurfaceData)) {
+                // REMIND: this is a hack that attempts to cache the system
+                // memory image from the TexturePaint instance into an
+                // OpenGL texture...
+                srcData = dstData.getSourceSurfaceData(bi, SunGraphics2D.TRANSFORM_ISIDENT, CompositeType.SrcOver, null);
+                if (!(srcData instanceof XRSurfaceData)) {
+                    return false;
+                }
+            }
+
+            return true;
+        }
+
+        @Override
+        void setXRPaint(SunGraphics2D sg2d, Paint pt) {
+            TexturePaint paint = (TexturePaint) pt;
+
+            BufferedImage bi = paint.getImage();
+            SurfaceData dstData = sg2d.surfaceData;
+            SurfaceData srcData = dstData.getSourceSurfaceData(bi, SunGraphics2D.TRANSFORM_ISIDENT, CompositeType.SrcOver, null);
+
+            // REMIND: this hack tries to ensure that we have a cached texture
+            if (!(srcData instanceof XRSurfaceData)) {
+                srcData = dstData.getSourceSurfaceData(paint.getImage(), SunGraphics2D.TRANSFORM_ISIDENT, CompositeType.SrcOver, null);
+                if (!(srcData instanceof XRSurfaceData)) {
+                    throw new InternalError("Surface not cachable");
+                }
+            }
+
+            XRSurfaceData x11SrcData = (XRSurfaceData) srcData;
+
+            AffineTransform at = (AffineTransform) sg2d.transform.clone();
+            Rectangle2D anchor = paint.getAnchorRect();
+            at.translate(anchor.getX(), anchor.getY());
+            at.scale(anchor.getWidth() / ((double) bi.getWidth()), anchor.getHeight() / ((double) bi.getHeight()));
+
+            try {
+                at.invert();
+            } catch (NoninvertibleTransformException ex) {
+                at.setToIdentity(); /* TODO: Right thing to do in this case? */
+            }
+
+            x11SrcData.validateAsSource(at, XRUtils.RepeatNormal, XRUtils.ATransOpToXRQuality(sg2d.interpolationType));
+            xrCompMan.setTexturePaint(((XRSurfaceData) srcData));
+        }
+    }
+
+    public int[] convertToIntArgbPixels(Color[] colors, boolean linear) {
+        int[] pixels = new int[colors.length];
+        for (int i = 0; i < colors.length; i++) {
+            pixels[i] = colorToIntArgbPixel(colors[i], linear);
+        }
+        return pixels;
+    }
+
+    public int colorToIntArgbPixel(Color c, boolean linear) {
+        int rgb = c.getRGB();
+
+        int a = rgb >>> 24;
+        int r = (rgb >> 16) & 0xff;
+        int g = (rgb >> 8) & 0xff;
+        int b = (rgb) & 0xff;
+        if (linear) {
+            r = BufferedPaints.convertSRGBtoLinearRGB(r);
+            g = BufferedPaints.convertSRGBtoLinearRGB(g);
+            b = BufferedPaints.convertSRGBtoLinearRGB(b);
+        }
+
+        a *= xrCompMan.getExtraAlpha();
+
+        return ((a << 24) | (r << 16) | (g << 8) | (b));
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/src/solaris/classes/sun/java2d/xr/XRRenderer.java	Wed Jul 21 09:57:21 2010 -0700
@@ -0,0 +1,331 @@
+/*
+ * Copyright 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 sun.java2d.xr;
+
+import java.awt.*;
+import java.awt.geom.*;
+
+import sun.awt.SunToolkit;
+import sun.java2d.SunGraphics2D;
+import sun.java2d.loops.*;
+import sun.java2d.pipe.Region;
+import sun.java2d.pipe.PixelDrawPipe;
+import sun.java2d.pipe.PixelFillPipe;
+import sun.java2d.pipe.ShapeDrawPipe;
+import sun.java2d.pipe.SpanIterator;
+import sun.java2d.pipe.ShapeSpanIterator;
+import sun.java2d.pipe.LoopPipe;
+
+/**
+ * XRender provides only accalerated rectangles. To emulate higher "order"
+ *  geometry we have to pass everything else to DoPath/FillSpans.
+ *
+ * TODO: DrawRect could be instrified
+ *
+ * @author Clemens Eisserer
+ */
+
+public class XRRenderer implements PixelDrawPipe, PixelFillPipe, ShapeDrawPipe {
+    XRDrawHandler drawHandler;
+    MaskTileManager tileManager;
+
+    public XRRenderer(MaskTileManager tileManager) {
+        this.tileManager = tileManager;
+        this.drawHandler = new XRDrawHandler();
+    }
+
+    /**
+     * Common validate method, used by all XRRender functions to validate the
+     * destination context.
+     */
+    private final void validateSurface(SunGraphics2D sg2d) {
+        XRSurfaceData xrsd = (XRSurfaceData) sg2d.surfaceData;
+        xrsd.validateAsDestination(sg2d, sg2d.getCompClip());
+        xrsd.maskBuffer.validateCompositeState(sg2d.composite, sg2d.transform,
+                                               sg2d.paint, sg2d);
+    }
+
+    public void drawLine(SunGraphics2D sg2d, int x1, int y1, int x2, int y2) {
+        try {
+            SunToolkit.awtLock();
+
+            validateSurface(sg2d);
+            int transx = sg2d.transX;
+            int transy = sg2d.transY;
+
+            XRSurfaceData xrsd = (XRSurfaceData) sg2d.surfaceData;
+
+            tileManager.addLine(x1 + transx, y1 + transy,
+                                x2 + transx, y2 + transy);
+            tileManager.fillMask(xrsd);
+        } finally {
+            SunToolkit.awtUnlock();
+        }
+    }
+
+    public void drawRect(SunGraphics2D sg2d,
+                         int x, int y, int width, int height) {
+        draw(sg2d, new Rectangle2D.Float(x, y, width, height));
+    }
+
+    public void drawPolyline(SunGraphics2D sg2d,
+                             int xpoints[], int ypoints[], int npoints) {
+        Path2D.Float p2d = new Path2D.Float();
+        if (npoints > 1) {
+            p2d.moveTo(xpoints[0], ypoints[0]);
+            for (int i = 1; i < npoints; i++) {
+                p2d.lineTo(xpoints[i], ypoints[i]);
+            }
+        }
+
+        draw(sg2d, p2d);
+    }
+
+    public void drawPolygon(SunGraphics2D sg2d,
+                            int xpoints[], int ypoints[], int npoints) {
+        draw(sg2d, new Polygon(xpoints, ypoints, npoints));
+    }
+
+    public synchronized void fillRect(SunGraphics2D sg2d,
+                                      int x, int y, int width, int height) {
+        SunToolkit.awtLock();
+        try {
+            validateSurface(sg2d);
+
+            XRSurfaceData xrsd = (XRSurfaceData) sg2d.surfaceData;
+
+            x += sg2d.transform.getTranslateX();
+            y += sg2d.transform.getTranslateY();
+
+            tileManager.addRect(x, y, width, height);
+            tileManager.fillMask(xrsd);
+
+        } finally {
+            SunToolkit.awtUnlock();
+        }
+    }
+
+    public void fillPolygon(SunGraphics2D sg2d,
+                            int xpoints[], int ypoints[], int npoints) {
+        fill(sg2d, new Polygon(xpoints, ypoints, npoints));
+    }
+
+    public void drawRoundRect(SunGraphics2D sg2d,
+                              int x, int y, int width, int height,
+                              int arcWidth, int arcHeight) {
+        draw(sg2d, new RoundRectangle2D.Float(x, y, width, height,
+                                              arcWidth, arcHeight));
+    }
+
+    public void fillRoundRect(SunGraphics2D sg2d, int x, int y,
+                              int width, int height,
+                              int arcWidth, int arcHeight) {
+        fill(sg2d, new RoundRectangle2D.Float(x, y, width, height,
+                                              arcWidth, arcHeight));
+    }
+
+    public void drawOval(SunGraphics2D sg2d,
+                         int x, int y, int width, int height) {
+        draw(sg2d, new Ellipse2D.Float(x, y, width, height));
+    }
+
+    public void fillOval(SunGraphics2D sg2d,
+                         int x, int y, int width, int height) {
+        fill(sg2d, new Ellipse2D.Float(x, y, width, height));
+    }
+
+    public void drawArc(SunGraphics2D sg2d,
+                       int x, int y, int width, int height,
+                        int startAngle, int arcAngle) {
+        draw(sg2d, new Arc2D.Float(x, y, width, height,
+                                   startAngle, arcAngle, Arc2D.OPEN));
+    }
+
+    public void fillArc(SunGraphics2D sg2d,
+                         int x, int y, int width, int height,
+                         int startAngle, int arcAngle) {
+        fill(sg2d, new Arc2D.Float(x, y, width, height,
+             startAngle, arcAngle, Arc2D.PIE));
+    }
+
+    private class XRDrawHandler extends ProcessPath.DrawHandler {
+
+        XRDrawHandler() {
+            // these are bogus values; the caller will use validate()
+            // to ensure that they are set properly prior to each usage
+            super(0, 0, 0, 0);
+        }
+
+        /**
+         * This method needs to be called prior to each draw/fillPath()
+         * operation to ensure the clip bounds are up to date.
+         */
+        void validate(SunGraphics2D sg2d) {
+            Region clip = sg2d.getCompClip();
+            setBounds(clip.getLoX(), clip.getLoY(),
+                      clip.getHiX(), clip.getHiY(), sg2d.strokeHint);
+            validateSurface(sg2d);
+        }
+
+        public void drawLine(int x1, int y1, int x2, int y2) {
+            tileManager.addLine(x1, y1, x2, y2);
+        }
+
+        public void drawPixel(int x, int y) {
+            tileManager.addRect(x, y, 1, 1);
+        }
+
+        public void drawScanline(int x1, int x2, int y) {
+            tileManager.addRect(x1, y, x2 - x1 + 1, 1);
+        }
+    }
+
+    protected void drawPath(SunGraphics2D sg2d, Path2D.Float p2df,
+                            int transx, int transy) {
+        SunToolkit.awtLock();
+        try {
+            validateSurface(sg2d);
+            drawHandler.validate(sg2d);
+            ProcessPath.drawPath(drawHandler, p2df, transx, transy);
+            tileManager.fillMask(((XRSurfaceData) sg2d.surfaceData));
+        } finally {
+            SunToolkit.awtUnlock();
+        }
+    }
+
+    protected void fillPath(SunGraphics2D sg2d, Path2D.Float p2df,
+                            int transx, int transy) {
+        SunToolkit.awtLock();
+        try {
+            validateSurface(sg2d);
+            drawHandler.validate(sg2d);
+            ProcessPath.fillPath(drawHandler, p2df, transx, transy);
+            tileManager.fillMask(((XRSurfaceData) sg2d.surfaceData));
+        } finally {
+            SunToolkit.awtUnlock();
+        }
+    }
+
+    protected void fillSpans(SunGraphics2D sg2d, SpanIterator si,
+                             int transx, int transy) {
+        SunToolkit.awtLock();
+        try {
+            validateSurface(sg2d);
+            int[] spanBox = new int[4];
+            while (si.nextSpan(spanBox)) {
+                tileManager.addRect(spanBox[0] + transx,
+                                    spanBox[1] + transy,
+                                    spanBox[2] - spanBox[0],
+                                    spanBox[3] - spanBox[1]);
+            }
+            tileManager.fillMask(((XRSurfaceData) sg2d.surfaceData));
+        } finally {
+            SunToolkit.awtUnlock();
+        }
+    }
+
+    public void draw(SunGraphics2D sg2d, Shape s) {
+        if (sg2d.strokeState == SunGraphics2D.STROKE_THIN) {
+            Path2D.Float p2df;
+            int transx, transy;
+            if (sg2d.transformState <= SunGraphics2D.TRANSFORM_INT_TRANSLATE) {
+                if (s instanceof Path2D.Float) {
+                    p2df = (Path2D.Float) s;
+                } else {
+                    p2df = new Path2D.Float(s);
+                }
+                transx = sg2d.transX;
+                transy = sg2d.transY;
+            } else {
+                p2df = new Path2D.Float(s, sg2d.transform);
+                transx = 0;
+                transy = 0;
+            }
+            drawPath(sg2d, p2df, transx, transy);
+        } else if (sg2d.strokeState < SunGraphics2D.STROKE_CUSTOM) {
+            ShapeSpanIterator si = LoopPipe.getStrokeSpans(sg2d, s);
+            try {
+                fillSpans(sg2d, si, 0, 0);
+            } finally {
+                si.dispose();
+            }
+        } else {
+            fill(sg2d, sg2d.stroke.createStrokedShape(s));
+        }
+    }
+
+    public void fill(SunGraphics2D sg2d, Shape s) {
+        int transx, transy;
+
+        if (sg2d.strokeState == SunGraphics2D.STROKE_THIN) {
+            // Here we are able to use fillPath() for
+            // high-quality fills.
+            Path2D.Float p2df;
+            if (sg2d.transformState <= SunGraphics2D.TRANSFORM_INT_TRANSLATE) {
+                if (s instanceof Path2D.Float) {
+                    p2df = (Path2D.Float) s;
+                } else {
+                    p2df = new Path2D.Float(s);
+                }
+                transx = sg2d.transX;
+                transy = sg2d.transY;
+            } else {
+                p2df = new Path2D.Float(s, sg2d.transform);
+                transx = 0;
+                transy = 0;
+            }
+            fillPath(sg2d, p2df, transx, transy);
+            return;
+        }
+
+        AffineTransform at;
+        if (sg2d.transformState <= SunGraphics2D.TRANSFORM_INT_TRANSLATE) {
+            // Transform (translation) will be done by FillSpans
+            at = null;
+            transx = sg2d.transX;
+            transy = sg2d.transY;
+        } else {
+            // Transform will be done by the PathIterator
+            at = sg2d.transform;
+            transx = transy = 0;
+        }
+
+        ShapeSpanIterator ssi = LoopPipe.getFillSSI(sg2d);
+        try {
+            // Subtract transx/y from the SSI clip to match the
+            // (potentially untranslated) geometry fed to it
+            Region clip = sg2d.getCompClip();
+            ssi.setOutputAreaXYXY(clip.getLoX() - transx,
+                                  clip.getLoY() - transy,
+                                  clip.getHiX() - transx,
+                                  clip.getHiY() - transy);
+            ssi.appendPath(s.getPathIterator(at));
+            fillSpans(sg2d, ssi, transx, transy);
+        } finally {
+            ssi.dispose();
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/src/solaris/classes/sun/java2d/xr/XRSurfaceData.java	Wed Jul 21 09:57:21 2010 -0700
@@ -0,0 +1,668 @@
+/*
+ * Copyright 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 sun.java2d.xr;
+
+import java.awt.*;
+import java.awt.geom.*;
+import java.awt.image.*;
+import sun.awt.*;
+import sun.java2d.InvalidPipeException;
+import sun.java2d.SunGraphics2D;
+import sun.java2d.SurfaceData;
+import sun.java2d.SurfaceDataProxy;
+import sun.java2d.jules.*;
+import sun.java2d.loops.*;
+import sun.java2d.pipe.*;
+import sun.java2d.x11.*;
+import sun.font.FontManagerNativeLibrary;
+
+public abstract class XRSurfaceData extends XSurfaceData {
+    X11ComponentPeer peer;
+    XRGraphicsConfig graphicsConfig;
+    XRBackend renderQueue;
+
+    private RenderLoops solidloops;
+
+    protected int depth;
+
+    private static native void initIDs();
+
+    protected native void XRInitSurface(int depth, int width, int height,
+                                        long drawable, int pictFormat);
+
+    native void initXRPicture(long xsdo, int pictForm);
+
+    public static final String DESC_BYTE_A8_X11 = "Byte A8 Pixmap";
+    public static final String DESC_INT_RGB_X11 = "Integer RGB Pixmap";
+    public static final String DESC_INT_ARGB_X11 = "Integer ARGB-Pre Pixmap";
+
+    public static final SurfaceType
+        ByteA8X11 = SurfaceType.ByteGray.deriveSubType(DESC_BYTE_A8_X11);
+    public static final SurfaceType
+        IntRgbX11 = SurfaceType.IntRgb.deriveSubType(DESC_INT_RGB_X11);
+    public static final SurfaceType
+        IntArgbPreX11 = SurfaceType.IntArgbPre.deriveSubType(DESC_INT_ARGB_X11);
+
+    public Raster getRaster(int x, int y, int w, int h) {
+        throw new InternalError("not implemented yet");
+    }
+
+    protected XRRenderer xrpipe;
+    protected PixelToShapeConverter xrtxpipe;
+    protected TextPipe xrtextpipe;
+    protected XRDrawImage xrDrawImage;
+
+    protected ShapeDrawPipe aaShapePipe;
+    protected PixelToShapeConverter aaPixelToShapeConv;
+
+    public static void initXRSurfaceData() {
+        if (!isX11SurfaceDataInitialized()) {
+            FontManagerNativeLibrary.load();
+            initIDs();
+            XRPMBlitLoops.register();
+            XRMaskFill.register();
+            XRMaskBlit.register();
+
+            setX11SurfaceDataInitialized();
+        }
+    }
+
+    /**
+     * Synchronized accessor method for isDrawableValid.
+     */
+    protected boolean isXRDrawableValid() {
+        try {
+            SunToolkit.awtLock();
+            return isDrawableValid();
+        } finally {
+            SunToolkit.awtUnlock();
+        }
+    }
+
+    @Override
+    public SurfaceDataProxy makeProxyFor(SurfaceData srcData) {
+        return XRSurfaceDataProxy.createProxy(srcData, graphicsConfig);
+    }
+
+    public void validatePipe(SunGraphics2D sg2d) {
+        TextPipe textpipe;
+        boolean validated = false;
+
+        /*
+         * The textpipe for now can't handle TexturePaint when extra-alpha is
+         * specified nore XOR mode
+         */
+        if (sg2d.compositeState < SunGraphics2D.COMP_XOR &&
+            (sg2d.paintState < SunGraphics2D.PAINT_TEXTURE ||
+             sg2d.composite == null ||
+             !(sg2d.composite instanceof AlphaComposite) ||
+             ((AlphaComposite) sg2d.composite).getAlpha() == 1.0f))
+        {
+            textpipe = xrtextpipe;
+        } else {
+            super.validatePipe(sg2d);
+            textpipe = sg2d.textpipe;
+            validated = true;
+        }
+
+        PixelToShapeConverter txPipe = null;
+        XRRenderer nonTxPipe = null;
+
+        /*
+         * TODO: Can we rely on the GC for ARGB32 surfaces?
+         */
+        if (sg2d.antialiasHint != SunHints.INTVAL_ANTIALIAS_ON) {
+            if (sg2d.paintState <= SunGraphics2D.PAINT_ALPHACOLOR) {
+                if (sg2d.compositeState <= SunGraphics2D.COMP_XOR) {
+                    txPipe = xrtxpipe;
+                    nonTxPipe = xrpipe;
+                }
+            } else if (sg2d.compositeState <= SunGraphics2D.COMP_ALPHA) {
+                if (XRPaints.isValid(sg2d)) {
+                    txPipe = xrtxpipe;
+                    nonTxPipe = xrpipe;
+                }
+                // custom paints handled by super.validatePipe() below
+            }
+        }
+
+        if (sg2d.antialiasHint == SunHints.INTVAL_ANTIALIAS_ON &&
+            JulesPathBuf.isCairoAvailable())
+        {
+            sg2d.shapepipe = aaShapePipe;
+            sg2d.drawpipe = aaPixelToShapeConv;
+            sg2d.fillpipe = aaPixelToShapeConv;
+        } else {
+            if (txPipe != null) {
+                if (sg2d.transformState >= SunGraphics2D.TRANSFORM_TRANSLATESCALE) {
+                    sg2d.drawpipe = txPipe;
+                    sg2d.fillpipe = txPipe;
+                } else if (sg2d.strokeState != SunGraphics2D.STROKE_THIN) {
+                    sg2d.drawpipe = txPipe;
+                    sg2d.fillpipe = nonTxPipe;
+                } else {
+                    sg2d.drawpipe = nonTxPipe;
+                    sg2d.fillpipe = nonTxPipe;
+                }
+                sg2d.shapepipe = nonTxPipe;
+            } else {
+                if (!validated) {
+                    super.validatePipe(sg2d);
+                }
+            }
+        }
+
+        // install the text pipe based on our earlier decision
+        sg2d.textpipe = textpipe;
+
+        // always override the image pipe with the specialized XRender pipe
+        sg2d.imagepipe = xrDrawImage;
+    }
+
+    protected MaskFill getMaskFill(SunGraphics2D sg2d) {
+        if (sg2d.paintState > SunGraphics2D.PAINT_ALPHACOLOR &&
+            !XRPaints.isValid(sg2d))
+        {
+            return null;
+        }
+        return super.getMaskFill(sg2d);
+    }
+
+    public RenderLoops getRenderLoops(SunGraphics2D sg2d) {
+        if (sg2d.paintState <= SunGraphics2D.PAINT_ALPHACOLOR &&
+            sg2d.compositeState <= SunGraphics2D.COMP_ALPHA)
+        {
+            return solidloops;
+        }
+
+        return super.getRenderLoops(sg2d);
+    }
+
+    public GraphicsConfiguration getDeviceConfiguration() {
+        return graphicsConfig;
+    }
+
+    /**
+     * Method for instantiating a Window SurfaceData
+     */
+    public static XRWindowSurfaceData createData(X11ComponentPeer peer) {
+        XRGraphicsConfig gc = getGC(peer);
+        return new XRWindowSurfaceData(peer, gc, gc.getSurfaceType());
+    }
+
+    /**
+     * Method for instantiating a Pixmap SurfaceData (offscreen).
+     * If the surface * is opaque a 24-bit/RGB surface is chosen,
+     * otherwise a 32-bit ARGB surface.
+     */
+    public static XRPixmapSurfaceData createData(XRGraphicsConfig gc,
+                                                 int width, int height,
+                                                 ColorModel cm, Image image,
+                                                 long drawable,
+                                                 int transparency) {
+        int depth = transparency > Transparency.OPAQUE ? 32 : 24;
+        if (depth == 24) {
+            cm = new DirectColorModel(depth,
+                                      0x00FF0000, 0x0000FF00, 0x000000FF);
+        } else {
+            cm = new DirectColorModel(depth, 0x00FF0000, 0x0000FF00,
+                                      0x000000FF, 0xFF000000);
+        }
+
+        return new XRPixmapSurfaceData
+            (gc, width, height, image, getSurfaceType(gc, transparency),
+             cm, drawable, transparency,
+             XRUtils.getPictureFormatForTransparency(transparency), depth);
+    }
+
+    protected XRSurfaceData(X11ComponentPeer peer, XRGraphicsConfig gc,
+        SurfaceType sType, ColorModel cm, int depth, int transparency)
+    {
+        super(sType, cm);
+        this.peer = peer;
+        this.graphicsConfig = gc;
+        this.solidloops = graphicsConfig.getSolidLoops(sType);
+        this.depth = depth;
+        initOps(peer, graphicsConfig, depth);
+
+        setBlitProxyKey(gc.getProxyKey());
+    }
+
+    protected XRSurfaceData(XRBackend renderQueue) {
+        super(XRSurfaceData.IntRgbX11,
+              new DirectColorModel(24, 0x00FF0000, 0x0000FF00, 0x000000FF));
+        this.renderQueue = renderQueue;
+    }
+
+    /**
+     * Inits the XRender-data-structures which belong to the XRSurfaceData.
+     *
+     * @param pictureFormat
+     */
+    public void initXRender(int pictureFormat) {
+        try {
+            SunToolkit.awtLock();
+            initXRPicture(getNativeOps(), pictureFormat);
+            renderQueue = XRCompositeManager.getInstance(this).getBackend();
+            maskBuffer = XRCompositeManager.getInstance(this);
+        } catch (Throwable ex) {
+            ex.printStackTrace();
+        } finally {
+            SunToolkit.awtUnlock();
+        }
+    }
+
+    public static XRGraphicsConfig getGC(X11ComponentPeer peer) {
+        if (peer != null) {
+            return (XRGraphicsConfig) peer.getGraphicsConfiguration();
+        } else {
+            GraphicsEnvironment env =
+                GraphicsEnvironment.getLocalGraphicsEnvironment();
+            GraphicsDevice gd = env.getDefaultScreenDevice();
+            return (XRGraphicsConfig) gd.getDefaultConfiguration();
+        }
+    }
+
+    /**
+     * Returns a boolean indicating whether or not a copyArea from the given
+     * rectangle source coordinates might be incomplete and result in X11
+     * GraphicsExposure events being generated from XCopyArea. This method
+     * allows the SurfaceData copyArea method to determine if it needs to set
+     * the GraphicsExposures attribute of the X11 GC to True or False to receive
+     * or avoid the events.
+     *
+     * @return true if there is any chance that an XCopyArea from the given
+     *         source coordinates could produce any X11 Exposure events.
+     */
+    public abstract boolean canSourceSendExposures(int x, int y, int w, int h);
+
+    /**
+     * CopyArea is implemented using the "old" X11 GC, therefor clip and
+     * needExposures have to be validated against that GC. Pictures and GCs
+     * don't share state.
+     */
+    public void validateCopyAreaGC(Region gcClip, boolean needExposures) {
+        if (validatedGCClip != gcClip) {
+            if (gcClip != null)
+                renderQueue.setGCClipRectangles(xgc, gcClip);
+            validatedGCClip = gcClip;
+        }
+
+        if (validatedExposures != needExposures) {
+            validatedExposures = needExposures;
+            renderQueue.setGCExposures(xgc, needExposures);
+        }
+
+        if (validatedXorComp != null) {
+            renderQueue.setGCMode(xgc, true);
+            renderQueue.setGCForeground(xgc, validatedGCForegroundPixel);
+            validatedXorComp = null;
+        }
+    }
+
+    public boolean copyArea(SunGraphics2D sg2d, int x, int y, int w, int h,
+                            int dx, int dy) {
+        if (xrpipe == null) {
+            if (!isXRDrawableValid()) {
+                return true;
+            }
+            makePipes();
+        }
+        CompositeType comptype = sg2d.imageComp;
+        if (sg2d.transformState < SunGraphics2D.TRANSFORM_TRANSLATESCALE &&
+            (CompositeType.SrcOverNoEa.equals(comptype) ||
+             CompositeType.SrcNoEa.equals(comptype)))
+        {
+            x += sg2d.transX;
+            y += sg2d.transY;
+            try {
+                SunToolkit.awtLock();
+                boolean needExposures = canSourceSendExposures(x, y, w, h);
+                validateCopyAreaGC(sg2d.getCompClip(), needExposures);
+                renderQueue.copyArea(xid, xid, xgc, x, y, w, h, x + dx, y + dy);
+            } finally {
+                SunToolkit.awtUnlock();
+            }
+            return true;
+        }
+        return false;
+    }
+
+    /**
+     * Returns the XRender SurfaceType which is able to fullfill the specified
+     * transparency requirement.
+     */
+    public static SurfaceType getSurfaceType(XRGraphicsConfig gc,
+                                             int transparency) {
+        SurfaceType sType = null;
+
+        switch (transparency) {
+        case Transparency.OPAQUE:
+            sType = XRSurfaceData.IntRgbX11;
+            break;
+
+        case Transparency.BITMASK:
+        case Transparency.TRANSLUCENT:
+            sType = XRSurfaceData.IntArgbPreX11;
+            break;
+        }
+
+        return sType;
+    }
+
+    public void invalidate() {
+        if (isValid()) {
+            setInvalid();
+            super.invalidate();
+        }
+    }
+
+    private long xgc; // GC is still used for copyArea
+    private int validatedGCForegroundPixel = 0;
+    private XORComposite validatedXorComp;
+    private int xid;
+    public int picture;
+    public XRCompositeManager maskBuffer;
+
+    private Region validatedClip;
+    private Region validatedGCClip;
+    private boolean validatedExposures = true;
+
+    boolean transformInUse = false;
+    AffineTransform validatedSourceTransform = new AffineTransform();
+    int validatedRepeat = XRUtils.RepeatNone;
+    int validatedFilter = XRUtils.FAST;
+
+    /**
+     * Validates an XRSurfaceData when used as source. Note that the clip is
+     * applied when used as source as well as destination.
+     */
+    void validateAsSource(AffineTransform sxForm, int repeat, int filter) {
+
+        if (validatedClip != null) {
+            validatedClip = null;
+            renderQueue.setClipRectangles(picture, null);
+        }
+
+        if (validatedRepeat != repeat && repeat != -1) {
+            validatedRepeat = repeat;
+            renderQueue.setPictureRepeat(picture, repeat);
+        }
+
+        if (sxForm == null) {
+            if (transformInUse) {
+                validatedSourceTransform.setToIdentity();
+                renderQueue.setPictureTransform(picture,
+                                                validatedSourceTransform);
+                transformInUse = false;
+            }
+        } else if (!transformInUse ||
+                   (transformInUse && !sxForm.equals(validatedSourceTransform))) {
+            validatedSourceTransform.setTransform(sxForm.getScaleX(),
+                                                  sxForm.getShearY(),
+                                                  sxForm.getShearX(),
+                                                  sxForm.getScaleY(),
+                                                  sxForm.getTranslateX(),
+                                                  sxForm.getTranslateY());
+            renderQueue.setPictureTransform(picture, validatedSourceTransform);
+            transformInUse = true;
+        }
+
+        if (filter != validatedFilter && filter != -1) {
+            renderQueue.setFilter(picture, filter);
+            validatedFilter = filter;
+        }
+    }
+
+    /**
+     * Validates the Surface when used as destination.
+     */
+    public void validateAsDestination(SunGraphics2D sg2d, Region clip) {
+        if (!isValid()) {
+            throw new InvalidPipeException("bounds changed");
+        }
+
+        boolean updateGCClip = false;
+        if (clip != validatedClip) {
+            renderQueue.setClipRectangles(picture, clip);
+            validatedClip = clip;
+            updateGCClip = true;
+        }
+
+        if (sg2d != null && sg2d.compositeState == SunGraphics2D.COMP_XOR) {
+            if (validatedXorComp != sg2d.getComposite()) {
+                validatedXorComp = (XORComposite) sg2d.getComposite();
+                int xorpixelmod = validatedXorComp.getXorPixel();
+                renderQueue.setGCMode(xgc, false);
+
+                // validate pixel
+                int pixel = sg2d.pixel;
+                if (validatedGCForegroundPixel != pixel) {
+                    renderQueue.setGCForeground(xgc, pixel ^ xorpixelmod);
+                    validatedGCForegroundPixel = pixel;
+                }
+            }
+
+            if (updateGCClip) {
+                renderQueue.setGCClipRectangles(xgc, clip);
+            }
+        }
+    }
+
+    public synchronized void makePipes() { /*
+                                            * TODO: Why is this synchronized,
+                                            * but access not?
+                                            */
+        if (xrpipe == null) {
+            try {
+                SunToolkit.awtLock();
+                xgc = renderQueue.createGC(xid); // TODO: GC leak? where to
+                // clean up?
+
+                xrpipe = new XRRenderer(maskBuffer.getMaskBuffer());
+                xrtxpipe = new PixelToShapeConverter(xrpipe);
+                xrtextpipe = maskBuffer.getTextRenderer();
+                xrDrawImage = new XRDrawImage();
+
+                if (JulesPathBuf.isCairoAvailable()) {
+                    aaShapePipe =
+                       new JulesShapePipe(XRCompositeManager.getInstance(this));
+                    aaPixelToShapeConv = new PixelToShapeConverter(aaShapePipe);
+                }
+            } finally {
+                SunToolkit.awtUnlock();
+            }
+        }
+    }
+
+    public static class XRWindowSurfaceData extends XRSurfaceData {
+        public XRWindowSurfaceData(X11ComponentPeer peer,
+                                   XRGraphicsConfig gc, SurfaceType sType) {
+            super(peer, gc, sType, peer.getColorModel(),
+                  peer.getColorModel().getPixelSize(), Transparency.OPAQUE);
+
+            if (isXRDrawableValid()) {
+                initXRender(XRUtils.
+                    getPictureFormatForTransparency(Transparency.OPAQUE));
+                makePipes();
+            }
+        }
+
+        public SurfaceData getReplacement() {
+            return peer.getSurfaceData();
+        }
+
+        public Rectangle getBounds() {
+            Rectangle r = peer.getBounds();
+            r.x = r.y = 0;
+            return r;
+        }
+
+        @Override
+        public boolean canSourceSendExposures(int x, int y, int w, int h) {
+            return true;
+        }
+
+        /**
+         * Returns destination Component associated with this SurfaceData.
+         */
+        public Object getDestination() {
+            return peer.getTarget();
+        }
+    }
+
+    public static class XRInternalSurfaceData extends XRSurfaceData {
+        public XRInternalSurfaceData(XRBackend renderQueue, int pictXid,
+                                     AffineTransform transform) {
+          super(renderQueue);
+          this.picture = pictXid;
+          this.validatedSourceTransform = transform;
+
+          if (validatedSourceTransform != null) {
+              transformInUse = true;
+          }
+        }
+
+        public boolean canSourceSendExposures(int x, int y, int w, int h) {
+            return false;
+        }
+
+        public Rectangle getBounds() {
+            return null;
+        }
+
+        public Object getDestination() {
+            return null;
+        }
+
+        public SurfaceData getReplacement() {
+            return null;
+        }
+    }
+
+    public static class XRPixmapSurfaceData extends XRSurfaceData {
+        Image offscreenImage;
+        int width;
+        int height;
+        int transparency;
+
+        public XRPixmapSurfaceData(XRGraphicsConfig gc, int width, int height,
+                                   Image image, SurfaceType sType,
+                                   ColorModel cm, long drawable,
+                                   int transparency, int pictFormat,
+                                   int depth) {
+            super(null, gc, sType, cm, depth, transparency);
+            this.width = width;
+            this.height = height;
+            offscreenImage = image;
+            this.transparency = transparency;
+            initSurface(depth, width, height, drawable, pictFormat);
+
+            initXRender(pictFormat);
+            makePipes();
+        }
+
+        public void initSurface(int depth, int width, int height,
+                                long drawable, int pictFormat) {
+            try {
+                SunToolkit.awtLock();
+                XRInitSurface(depth, width, height, drawable, pictFormat);
+            } finally {
+                SunToolkit.awtUnlock();
+            }
+        }
+
+        public SurfaceData getReplacement() {
+            return restoreContents(offscreenImage);
+        }
+
+        /**
+         * Need this since the surface data is created with the color model of
+         * the target GC, which is always opaque. But in SunGraphics2D.blitSD we
+         * choose loops based on the transparency on the source SD, so it could
+         * choose wrong loop (blit instead of blitbg, for example).
+         */
+        public int getTransparency() {
+            return transparency;
+        }
+
+        public Rectangle getBounds() {
+            return new Rectangle(width, height);
+        }
+
+        @Override
+        public boolean canSourceSendExposures(int x, int y, int w, int h) {
+            return (x < 0 || y < 0 || (x + w) > width || (y + h) > height);
+        }
+
+        public void flush() {
+            /*
+             * We need to invalidate the surface before disposing the native
+             * Drawable and Picture. This way if an application tries to render
+             * to an already flushed XRSurfaceData, we will notice in the
+             * validate() method above that it has been invalidated, and we will
+             * avoid using those native resources that have already been
+             * disposed.
+             */
+            invalidate();
+            flushNativeSurface();
+        }
+
+        /**
+         * Returns destination Image associated with this SurfaceData.
+         */
+        public Object getDestination() {
+            return offscreenImage;
+        }
+    }
+
+    public long getGC() {
+        return xgc;
+    }
+
+    public static class LazyPipe extends ValidatePipe {
+        public boolean validate(SunGraphics2D sg2d) {
+            XRSurfaceData xsd = (XRSurfaceData) sg2d.surfaceData;
+            if (!xsd.isXRDrawableValid()) {
+                return false;
+            }
+            xsd.makePipes();
+            return super.validate(sg2d);
+        }
+    }
+
+    public int getPicture() {
+        return picture;
+    }
+
+    public int getXid() {
+        return xid;
+    }
+
+    public XRGraphicsConfig getGraphicsConfig() {
+        return graphicsConfig;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/src/solaris/classes/sun/java2d/xr/XRSurfaceDataProxy.java	Wed Jul 21 09:57:21 2010 -0700
@@ -0,0 +1,83 @@
+/*
+ * Copyright 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 sun.java2d.xr;
+
+import java.awt.Color;
+import java.awt.Transparency;
+import sun.java2d.SurfaceData;
+import sun.java2d.SurfaceDataProxy;
+import sun.java2d.loops.CompositeType;
+
+/**
+ * The proxy class contains the logic if to replace a SurfaceData with a
+ * cached X11 Pixmap and the code to create the accelerated surfaces.
+ */
+public class XRSurfaceDataProxy extends SurfaceDataProxy implements Transparency {
+
+    public static SurfaceDataProxy createProxy(SurfaceData srcData,
+            XRGraphicsConfig dstConfig) {
+
+        /*Don't cache already native surfaces*/
+        if (srcData instanceof XRSurfaceData) {
+            return UNCACHED;
+        }
+
+        return new XRSurfaceDataProxy(dstConfig, srcData.getTransparency());
+    }
+
+    XRGraphicsConfig xrgc;
+    int transparency;
+
+    public XRSurfaceDataProxy(XRGraphicsConfig x11gc) {
+        this.xrgc = x11gc;
+    }
+
+    @Override
+    public SurfaceData validateSurfaceData(SurfaceData srcData,
+            SurfaceData cachedData, int w, int h) {
+        if (cachedData == null) {
+            cachedData = XRSurfaceData.createData(xrgc, w, h, xrgc
+                    .getColorModel(), null, 0, getTransparency());
+        }
+        return cachedData;
+    }
+
+    public XRSurfaceDataProxy(XRGraphicsConfig x11gc, int transparency) {
+        this.xrgc = x11gc;
+        this.transparency = transparency;
+    }
+
+    //TODO: Is that really ok?
+    @Override
+    public boolean isSupportedOperation(SurfaceData srcData, int txtype,
+            CompositeType comp, Color bgColor) {
+        return (bgColor == null || transparency == Transparency.TRANSLUCENT);
+    }
+
+    public int getTransparency() {
+        return transparency;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/src/solaris/classes/sun/java2d/xr/XRUtils.java	Wed Jul 21 09:57:21 2010 -0700
@@ -0,0 +1,261 @@
+/*
+ * Copyright 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 sun.java2d.xr;
+
+import java.awt.*;
+import java.awt.MultipleGradientPaint.*;
+import java.awt.image.*;
+import sun.java2d.loops.*;
+import static java.awt.AlphaComposite.*;
+
+/**
+ * XRender constants and utility methods.
+ *
+ * @author Clemens Eisserer
+ */
+
+public class XRUtils {
+    public static final int None = 0;
+
+    /* Composition Operators */
+    public static final byte PictOpClear = 0;
+    public static final byte PictOpSrc = 1;
+    public static final byte PictOpDst = 2;
+    public static final byte PictOpOver = 3;
+    public static final byte PictOpOverReverse = 4;
+    public static final byte PictOpIn = 5;
+    public static final byte PictOpInReverse = 6;
+    public static final byte PictOpOut = 7;
+    public static final byte PictOpOutReverse = 8;
+    public static final byte PictOpAtop = 9;
+    public static final byte PictOpAtopReverse = 10;
+    public static final byte PictOpXor = 11;
+    public static final byte PictOpAdd = 12;
+    public static final byte PictOpSaturate = 13;
+
+    /* Repeats */
+    public static final int RepeatNone = 0;
+    public static final int RepeatNormal = 1;
+    public static final int RepeatPad = 2;
+    public static final int RepeatReflect = 3;
+
+    /* Interpolation qualities */
+    public static final int FAST = 0;
+    public static final int GOOD = 1;
+    public static final int BEST = 2;
+    public static final byte[] FAST_NAME = "fast".getBytes();
+    public static final byte[] GOOD_NAME = "good".getBytes();
+    public static final byte[] BEST_NAME = "best".getBytes();
+
+    /* PictFormats */
+    public static final int PictStandardARGB32 = 0;
+    public static final int PictStandardRGB24 = 1;
+    public static final int PictStandardA8 = 2;
+    public static final int PictStandardA4 = 3;
+    public static final int PictStandardA1 = 4;
+
+    /**
+     * Maps the specified affineTransformOp to the corresponding XRender image
+     * filter.
+     */
+    public static int ATransOpToXRQuality(int affineTranformOp) {
+
+        switch (affineTranformOp) {
+        case AffineTransformOp.TYPE_NEAREST_NEIGHBOR:
+            return FAST;
+
+        case AffineTransformOp.TYPE_BILINEAR:
+            return GOOD;
+
+        case AffineTransformOp.TYPE_BICUBIC:
+            return BEST;
+        }
+
+        return -1;
+    }
+
+    /**
+     * Maps the specified affineTransformOp to the corresponding XRender image
+     * filter.
+     */
+    public static byte[] ATransOpToXRQualityName(int affineTranformOp) {
+
+        switch (affineTranformOp) {
+        case AffineTransformOp.TYPE_NEAREST_NEIGHBOR:
+            return FAST_NAME;
+
+        case AffineTransformOp.TYPE_BILINEAR:
+            return GOOD_NAME;
+
+        case AffineTransformOp.TYPE_BICUBIC:
+            return BEST_NAME;
+        }
+
+        return null;
+    }
+
+
+    public static byte[] getFilterName(int filterType) {
+        switch (filterType) {
+        case FAST:
+            return FAST_NAME;
+        case GOOD:
+            return GOOD_NAME;
+        case BEST:
+            return BEST_NAME;
+        }
+
+        return null;
+    }
+
+
+    /**
+     * Returns the XRender picture Format which is required to fullfill the
+     * Java2D transparency requirement.
+     */
+    public static int getPictureFormatForTransparency(int transparency) {
+        switch (transparency) {
+        case Transparency.OPAQUE:
+            return PictStandardRGB24;
+
+        case Transparency.BITMASK:
+        case Transparency.TRANSLUCENT:
+            return PictStandardARGB32;
+        }
+
+        return -1;
+    }
+
+
+    public static SurfaceType getXRSurfaceTypeForTransparency(int transparency) {
+        if (transparency == Transparency.OPAQUE) {
+            return SurfaceType.IntRgb;
+        }else {
+            return SurfaceType.IntArgbPre;
+        }
+    }
+
+    /**
+     * Maps Java2D CycleMethod to XRender's Repeat property.
+     */
+    public static int getRepeatForCycleMethod(CycleMethod cycleMethod) {
+        if (cycleMethod.equals(CycleMethod.NO_CYCLE)) {
+            return RepeatPad;
+        } else if (cycleMethod.equals(CycleMethod.REFLECT)) {
+            return RepeatReflect;
+        } else if (cycleMethod.equals(CycleMethod.REPEAT)) {
+            return RepeatNormal;
+        }
+
+        return RepeatNone;
+    }
+
+    /**
+     * Converts a double into an XFixed.
+     */
+    public static int XDoubleToFixed(double dbl) {
+        return (int) (dbl * 65536);
+    }
+
+    public static double XFixedToDouble(int fixed) {
+        return ((double) fixed) / 65536;
+    }
+
+    public static int[] convertFloatsToFixed(float[] values) {
+        int[] fixed = new int[values.length];
+
+        for (int i = 0; i < values.length; i++) {
+            fixed[i] = XDoubleToFixed(values[i]);
+        }
+
+        return fixed;
+    }
+
+    public static long intToULong(int signed) {
+        if (signed < 0) {
+            return ((long) signed) + (((long) Integer.MAX_VALUE) -
+                    ((long) Integer.MIN_VALUE) + 1);
+        }
+
+        return signed;
+    }
+
+    /**
+     * Maps the specified Java2D composition rule, to the corresponding XRender
+     * composition rule.
+     */
+    public static byte j2dAlphaCompToXR(int j2dRule) {
+        switch (j2dRule) {
+        case CLEAR:
+            return PictOpClear;
+
+        case SRC:
+            return PictOpSrc;
+
+        case DST:
+            return PictOpDst;
+
+        case SRC_OVER:
+            return PictOpOver;
+
+        case DST_OVER:
+            return PictOpOverReverse;
+
+        case SRC_IN:
+            return PictOpIn;
+
+        case DST_IN:
+            return PictOpInReverse;
+
+        case SRC_OUT:
+            return PictOpOut;
+
+        case DST_OUT:
+            return PictOpOutReverse;
+
+        case SRC_ATOP:
+            return PictOpAtop;
+
+        case DST_ATOP:
+            return PictOpAtopReverse;
+
+        case XOR:
+            return PictOpXor;
+        }
+
+        throw new InternalError("No XRender equivalent available for requested java2d composition rule: "+j2dRule);
+    }
+
+    public static short clampToShort(int x) {
+        return (short) (x > Short.MAX_VALUE
+                           ? Short.MAX_VALUE
+                           : (x < Short.MIN_VALUE ? Short.MIN_VALUE : x));
+    }
+
+    public static short clampToUShort(int x) {
+        return (short) (x > 65535 ? 65535 : (x < 0) ? 0 : x);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/src/solaris/classes/sun/java2d/xr/XRVolatileSurfaceManager.java	Wed Jul 21 09:57:21 2010 -0700
@@ -0,0 +1,94 @@
+/*
+ * Copyright 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 sun.java2d.xr;
+
+import java.awt.GraphicsConfiguration;
+import java.awt.ImageCapabilities;
+import java.awt.image.ColorModel;
+import sun.awt.image.SunVolatileImage;
+import sun.awt.image.VolatileSurfaceManager;
+import sun.java2d.SurfaceData;
+
+/**
+ * XRender platform implementation of the VolatileSurfaceManager class.
+ */
+public class XRVolatileSurfaceManager extends VolatileSurfaceManager {
+
+    public XRVolatileSurfaceManager(SunVolatileImage vImg, Object context) {
+        super(vImg, context);
+    }
+
+    protected boolean isAccelerationEnabled() {
+        return true;
+    }
+
+    /**
+     * Create a pixmap-based SurfaceData object
+     */
+    protected SurfaceData initAcceleratedSurface() {
+        SurfaceData sData;
+
+        try {
+            XRGraphicsConfig gc = (XRGraphicsConfig) vImg.getGraphicsConfig();
+            ColorModel cm = gc.getColorModel();
+            long drawable = 0;
+            if (context instanceof Long) {
+                drawable = ((Long)context).longValue();
+            }
+            sData = XRSurfaceData.createData(gc,
+                                              vImg.getWidth(),
+                                              vImg.getHeight(),
+                                              cm, vImg, drawable,
+                                              vImg.getTransparency());
+        } catch (NullPointerException ex) {
+            sData = null;
+        } catch (OutOfMemoryError er) {
+            sData = null;
+        }
+
+        return sData;
+    }
+
+   /**
+    * XRender should allow copies between different formats and depths.
+    * TODO: verify that this assumption is correct.
+    */
+    protected boolean isConfigValid(GraphicsConfiguration gc) {
+        return true;
+    }
+
+    /**
+     * Need to override the default behavior because Pixmaps-based
+     * images are accelerated but not volatile.
+     */
+    @Override
+    public ImageCapabilities getCapabilities(GraphicsConfiguration gc) {
+        if (isConfigValid(gc) && isAccelerationEnabled()) {
+            return new ImageCapabilities(true);
+        }
+        return new ImageCapabilities(false);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/src/solaris/classes/sun/java2d/xr/XcbRequestCounter.java	Wed Jul 21 09:57:21 2010 -0700
@@ -0,0 +1,59 @@
+/*
+ * Copyright 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 sun.java2d.xr;
+
+/**
+ * UInt32 "emulation", mimics the behaviour of xcb's request counter.
+ * In order to be compatible with xcb we have to wrap exactly when xcb would do.
+ * @author Clemens Eisserer
+ */
+
+public class XcbRequestCounter {
+    private final static long MAX_UINT = 4294967295L;
+
+    long value;
+
+    public XcbRequestCounter(long value) {
+        this.value = value;
+    }
+
+    public void setValue(long value) {
+        this.value = value;
+    }
+
+    public long getValue() {
+        return value;
+    }
+
+    public void add(long v) {
+        value += v;
+
+        /*Handle 32-bit unsigned int overflow*/
+        if (value > MAX_UINT) {
+            value = 0; //-= MAX_UINT; //Shouldn't that be zero?!?!
+        }
+    }
+}
--- a/jdk/src/solaris/classes/sun/nio/cs/ext/COMPOUND_TEXT_Encoder.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/solaris/classes/sun/nio/cs/ext/COMPOUND_TEXT_Encoder.java	Wed Jul 21 09:57:21 2010 -0700
@@ -43,8 +43,8 @@
      * cannot be used for actual encoding because they are shared across all
      * COMPOUND_TEXT encoders and may be stateful.
      */
-    private static final Map encodingToEncoderMap =
-        Collections.synchronizedMap(new HashMap(21, 1.0f));
+    private static final Map<String,CharsetEncoder> encodingToEncoderMap =
+      Collections.synchronizedMap(new HashMap<String,CharsetEncoder>(21, 1.0f));
     private static final CharsetEncoder latin1Encoder;
     private static final CharsetEncoder defaultEncoder;
     private static final boolean defaultEncodingSupported;
@@ -221,7 +221,7 @@
             out.put((byte)0x1B);
             out.put((byte)0x25);
             out.put((byte)0x2F);
-            out.put((byte)nonStandardBytes[3]);
+            out.put(nonStandardBytes[3]);
 
             int toWrite = Math.min(numBytes - nonStandardBytesOff,
                                    (1 << 14) - 1 - nonStandardEncodingLen);
@@ -313,12 +313,9 @@
         }
 
         // 4. Brute force search of all supported encodings.
-        for (Iterator iter = CompoundTextSupport.getEncodings().iterator();
-             iter.hasNext();)
+        for (String encoding : CompoundTextSupport.getEncodings())
         {
-            String encoding = (String)iter.next();
-            CharsetEncoder enc =
-                (CharsetEncoder)encodingToEncoderMap.get(encoding);
+            CharsetEncoder enc = encodingToEncoderMap.get(encoding);
             if (enc == null) {
                 enc = CompoundTextSupport.getEncoder(encoding);
                 if (enc == null) {
--- a/jdk/src/solaris/classes/sun/nio/cs/ext/CompoundTextSupport.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/solaris/classes/sun/nio/cs/ext/CompoundTextSupport.java	Wed Jul 21 09:57:21 2010 -0700
@@ -130,13 +130,13 @@
     /**
      * Maps a GL or GR escape sequence to an encoding.
      */
-    private static final Map sequenceToEncodingMap;
+    private static final Map<ControlSequence, String> sequenceToEncodingMap;
 
     /**
      * Indicates whether a particular encoding wants the high bit turned on
      * or off.
      */
-    private static final Map highBitsMap;
+    private static final Map<ControlSequence, Boolean> highBitsMap;
 
     /**
      * Maps an encoding to an escape sequence. Rather than manage two
@@ -144,18 +144,21 @@
      * modify both GL and GR if necessary. This makes the output slightly less
      * efficient, but our code much simpler.
      */
-    private static final Map encodingToSequenceMap;
+    private static final Map<String, ControlSequence> encodingToSequenceMap;
 
     /**
      * The keys of 'encodingToSequenceMap', sorted in preferential order.
      */
-    private static final List encodings;
+    private static final List<String> encodings;
 
     static {
-        HashMap tSequenceToEncodingMap = new HashMap(33, 1.0f);
-        HashMap tHighBitsMap = new HashMap(31, 1.0f);
-        HashMap tEncodingToSequenceMap = new HashMap(21, 1.0f);
-        ArrayList tEncodings = new ArrayList(21);
+        HashMap<ControlSequence, String> tSequenceToEncodingMap =
+            new HashMap<>(33, 1.0f);
+        HashMap<ControlSequence, Boolean> tHighBitsMap =
+            new HashMap<>(31, 1.0f);
+        HashMap<String, ControlSequence> tEncodingToSequenceMap =
+            new HashMap<>(21, 1.0f);
+        ArrayList<String> tEncodings = new ArrayList<>(21);
 
         if (!(isEncodingSupported("US-ASCII") &&
               isEncodingSupported("ISO-8859-1")))
@@ -457,13 +460,12 @@
         return getNonStandardDecoder(escSequence, null);
     }
     static boolean getHighBit(byte[] escSequence) {
-        Boolean bool = (Boolean)highBitsMap.get
-            (new ControlSequence(escSequence));
+        Boolean bool = highBitsMap.get(new ControlSequence(escSequence));
         return (bool == Boolean.TRUE);
     }
     static CharsetDecoder getNonStandardDecoder(byte[] escSequence,
                                                        byte[] encoding) {
-        return getDecoder((String)sequenceToEncodingMap.get
+        return getDecoder(sequenceToEncodingMap.get
             (new ControlSequence(escSequence, encoding)));
     }
     static CharsetDecoder getDecoder(String enc) {
@@ -474,7 +476,7 @@
         try {
             cs = Charset.forName(enc);
         } catch (IllegalArgumentException e) {
-            Class cls;
+            Class<?> cls;
             try {
                 cls = Class.forName("sun.awt.motif." + enc);
             } catch (ClassNotFoundException ee) {
@@ -497,22 +499,20 @@
 
     // For Encoder
     static byte[] getEscapeSequence(String encoding) {
-        ControlSequence seq = (ControlSequence)
-            encodingToSequenceMap.get(encoding);
+        ControlSequence seq = encodingToSequenceMap.get(encoding);
         if (seq != null) {
             return seq.escSequence;
         }
         return null;
     }
     static byte[] getEncoding(String encoding) {
-        ControlSequence seq = (ControlSequence)
-            encodingToSequenceMap.get(encoding);
+        ControlSequence seq = encodingToSequenceMap.get(encoding);
         if (seq != null) {
             return seq.encoding;
         }
         return null;
     }
-    static List getEncodings() {
+    static List<String> getEncodings() {
         return encodings;
     }
     static CharsetEncoder getEncoder(String enc) {
@@ -523,7 +523,7 @@
         try {
             cs = Charset.forName(enc);
         } catch (IllegalArgumentException e) {
-            Class cls;
+            Class<?> cls;
             try {
                 cls = Class.forName("sun.awt.motif." + enc);
             } catch (ClassNotFoundException ee) {
--- a/jdk/src/solaris/classes/sun/tools/attach/LinuxVirtualMachine.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/solaris/classes/sun/tools/attach/LinuxVirtualMachine.java	Wed Jul 21 09:57:21 2010 -0700
@@ -37,6 +37,8 @@
  * Linux implementation of HotSpotVirtualMachine
  */
 public class LinuxVirtualMachine extends HotSpotVirtualMachine {
+    // temp directory for socket file
+    private static final String tmpdir = System.getProperty("java.io.tmpdir");
 
     // Indicates if this machine uses the old LinuxThreads
     static boolean isLinuxThreads;
@@ -260,7 +262,7 @@
 
     // Return the socket file for the given process.
     // Checks working directory of process for .java_pid<pid>. If not
-    // found it looks in /tmp.
+    // found it looks in temp directory.
     private String findSocketFile(int pid) {
         // First check for a .java_pid<pid> file in the working directory
         // of the target process
@@ -268,20 +270,17 @@
         String path = "/proc/" + pid + "/cwd/" + fn;
         File f = new File(path);
         if (!f.exists()) {
-            // Not found, so try /tmp
-            path = "/tmp/" + fn;
-            f = new File(path);
-            if (!f.exists()) {
-                return null;            // not found
-            }
+            // Not found, so try temp directory
+            f = new File(tmpdir, fn);
+            path = f.exists() ? f.getPath() : null;
         }
         return path;
     }
 
     // On Solaris/Linux a simple handshake is used to start the attach mechanism
     // if not already started. The client creates a .attach_pid<pid> file in the
-    // target VM's working directory (or /tmp), and the SIGQUIT handler checks
-    // for the file.
+    // target VM's working directory (or temp directory), and the SIGQUIT handler
+    // checks for the file.
     private File createAttachFile(int pid) throws IOException {
         String fn = ".attach_pid" + pid;
         String path = "/proc/" + pid + "/cwd/" + fn;
@@ -289,8 +288,7 @@
         try {
             f.createNewFile();
         } catch (IOException x) {
-            path = "/tmp/" + fn;
-            f = new File(path);
+            f = new File(tmpdir, fn);
             f.createNewFile();
         }
         return f;
--- a/jdk/src/solaris/classes/sun/tools/attach/SolarisVirtualMachine.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/solaris/classes/sun/tools/attach/SolarisVirtualMachine.java	Wed Jul 21 09:57:21 2010 -0700
@@ -38,6 +38,11 @@
  * Solaris implementation of HotSpotVirtualMachine.
  */
 public class SolarisVirtualMachine extends HotSpotVirtualMachine {
+    // Use /tmp instead of /var/tmp on Solaris as /tmp is the default used by
+    // HotSpot when the property is not set on the command line.
+    private static final String tmpdir1 = System.getProperty("java.io.tmpdir");
+    private static final String tmpdir =
+        (tmpdir1.equals("/var/tmp") || tmpdir1.equals("/var/tmp/")) ? "/tmp" : tmpdir1;
 
     // door descriptor;
     private int fd = -1;
@@ -187,7 +192,7 @@
     }
 
     // The door is attached to .java_pid<pid> in the target VM's working
-    // directory or /tmp.
+    // directory or temporary directory.
     private int openDoor(int pid) throws IOException {
         // First check for a .java_pid<pid> file in the working directory
         // of the target process
@@ -196,7 +201,7 @@
         try {
             fd = open(path);
         } catch (FileNotFoundException fnf) {
-            path = "/tmp/" + fn;
+            path = tmpdir + "/" + fn;
             fd = open(path);
         }
 
@@ -213,8 +218,8 @@
 
     // On Solaris/Linux a simple handshake is used to start the attach mechanism
     // if not already started. The client creates a .attach_pid<pid> file in the
-    // target VM's working directory (or /tmp), and the SIGQUIT handler checks
-    // for the file.
+    // target VM's working directory (or temporary directory), and the SIGQUIT
+    // handler checks for the file.
     private File createAttachFile(int pid) throws IOException {
         String fn = ".attach_pid" + pid;
         String path = "/proc/" + pid + "/cwd/" + fn;
@@ -222,8 +227,7 @@
         try {
             f.createNewFile();
         } catch (IOException x) {
-            path = "/tmp/" + fn;
-            f = new File(path);
+            f = new File(tmpdir, fn);
             f.createNewFile();
         }
         return f;
--- a/jdk/src/solaris/demo/jni/Poller/Poller.c	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/solaris/demo/jni/Poller/Poller.c	Wed Jul 21 09:57:21 2010 -0700
@@ -160,10 +160,10 @@
   return -1;
 }
 
-#define MEMORY_EXCEPTION(str) throwOutOfMemoryError(env, "Poller:" ## str)
-#define STATE_EXCEPTION(str)  throwIllegalStateException(env, "Poller:" ## str)
+#define MEMORY_EXCEPTION(str) throwOutOfMemoryError(env, "Poller:" str)
+#define STATE_EXCEPTION(str)  throwIllegalStateException(env, "Poller:" str)
 #define INTERRUPT_EXCEPTION(str) throwInterruptedIOException(env, \
-                                                             "Poller:" ## str)
+                                                             "Poller:" str)
 jint addfd(JNIEnv *, ioevent_t *, jint, jshort);
 jint removefd(JNIEnv *, ioevent_t *, jint);
 
--- a/jdk/src/solaris/doc/sun/man/man1/appletviewer.1	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/solaris/doc/sun/man/man1/appletviewer.1	Wed Jul 21 09:57:21 2010 -0700
@@ -1,4 +1,4 @@
-." Copyright 2002-2006 Sun Microsystems, Inc.  All Rights Reserved.
+." Copyright (c) 1995, 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
@@ -19,12 +19,11 @@
 ." or visit www.oracle.com if you need additional information or have any
 ." questions.
 ."
-.TH appletviewer 1 "04 May 2009"
-." Generated from HTML by html2man (author: Eric Armstrong)
+.TH appletviewer 1 "02 Jun 2010"
 
 .LP
 .SH "Name"
-appletviewer \- The Java Applet Viewer
+appletviewer \- The Java Applet Viewer.
 .LP
 .RS 3
 
@@ -74,6 +73,4 @@
 .LP
 
 .LP
-
-.LP
  
--- a/jdk/src/solaris/doc/sun/man/man1/apt.1	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/solaris/doc/sun/man/man1/apt.1	Wed Jul 21 09:57:21 2010 -0700
@@ -1,4 +1,4 @@
-." Copyright 2004-2006 Sun Microsystems, Inc.  All Rights Reserved.
+." 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
@@ -19,8 +19,7 @@
 ." or visit www.oracle.com if you need additional information or have any
 ." questions.
 ."
-.TH apt 1 "04 May 2009"
-." Generated from HTML by html2man (author: Eric Armstrong)
+.TH apt 1 "02 Jun 2010"
 
 .LP
 .SH "NAME"
@@ -124,6 +123,4 @@
 .RE
 
 .LP
-
-.LP
  
--- a/jdk/src/solaris/doc/sun/man/man1/extcheck.1	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/solaris/doc/sun/man/man1/extcheck.1	Wed Jul 21 09:57:21 2010 -0700
@@ -1,4 +1,4 @@
-." Copyright 2002-2006 Sun Microsystems, Inc.  All Rights Reserved.
+." Copyright (c) 1998, 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
@@ -19,8 +19,7 @@
 ." or visit www.oracle.com if you need additional information or have any
 ." questions.
 ."
-.TH extcheck 1 "04 May 2009"
-." Generated from HTML by html2man (author: Eric Armstrong)
+.TH extcheck 1 "02 Jun 2010"
 
 .LP
 .SH "Name"
@@ -83,6 +82,4 @@
 .LP
 jar(1)
 .LP
-
-.LP
  
--- a/jdk/src/solaris/doc/sun/man/man1/idlj.1	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/solaris/doc/sun/man/man1/idlj.1	Wed Jul 21 09:57:21 2010 -0700
@@ -1,4 +1,4 @@
-." Copyright 2001-2006 Sun Microsystems, Inc.  All Rights Reserved.
+." Copyright (c) 2001, 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
@@ -19,8 +19,7 @@
 ." or visit www.oracle.com if you need additional information or have any
 ." questions.
 ."
-.TH idlj 1 "04 May 2009"
-." Generated from HTML by html2man (author: Eric Armstrong)
+.TH idlj 1 "02 Jun 2010"
 
 .LP
 .SH "Name"
@@ -508,6 +507,4 @@
 .RE
 
 .LP
-
-.LP
  
--- a/jdk/src/solaris/doc/sun/man/man1/ja/appletviewer.1	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/solaris/doc/sun/man/man1/ja/appletviewer.1	Wed Jul 21 09:57:21 2010 -0700
@@ -1,4 +1,4 @@
-." Copyright 2002-2006 Sun Microsystems, Inc.  All Rights Reserved.
+." Copyright (c) 1995, 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
@@ -19,8 +19,7 @@
 ." or visit www.oracle.com if you need additional information or have any
 ." questions.
 ."
-.TH appletviewer 1 "04 May 2009"
-." Generated from HTML by html2man (author: Eric Armstrong)
+.TH appletviewer 1 "02 Jun 2010"
 
 .LP
 .SH "åå‰"
@@ -74,6 +73,4 @@
 .LP
 
 .LP
-
-.LP
  
--- a/jdk/src/solaris/doc/sun/man/man1/ja/apt.1	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/solaris/doc/sun/man/man1/ja/apt.1	Wed Jul 21 09:57:21 2010 -0700
@@ -1,4 +1,4 @@
-." Copyright  Sun Microsystems, Inc.  All Rights Reserved.
+." 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
@@ -19,8 +19,7 @@
 ." or visit www.oracle.com if you need additional information or have any
 ." questions.
 ."
-.TH apt 1 "04 May 2009"
-." Generated from HTML by html2man (author: Eric Armstrong)
+.TH apt 1 "02 Jun 2010"
 
 .LP
 .SH "NAME"
--- a/jdk/src/solaris/doc/sun/man/man1/ja/extcheck.1	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/solaris/doc/sun/man/man1/ja/extcheck.1	Wed Jul 21 09:57:21 2010 -0700
@@ -1,4 +1,4 @@
-." Copyright 2002-2006 Sun Microsystems, Inc.  All Rights Reserved.
+." Copyright (c) 1998, 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
@@ -19,8 +19,7 @@
 ." or visit www.oracle.com if you need additional information or have any
 ." questions.
 ."
-.TH extcheck 1 "04 May 2009"
-." Generated from HTML by html2man (author: Eric Armstrong)
+.TH extcheck 1 "02 Jun 2010"
 
 .LP
 .SH "åå‰"
@@ -83,6 +82,4 @@
 .LP
 jar(1)
 .LP
-
-.LP
  
--- a/jdk/src/solaris/doc/sun/man/man1/ja/idlj.1	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/solaris/doc/sun/man/man1/ja/idlj.1	Wed Jul 21 09:57:21 2010 -0700
@@ -1,4 +1,4 @@
-." Copyright 2001-2006 Sun Microsystems, Inc.  All Rights Reserved.
+." Copyright (c) 2001, 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
@@ -19,8 +19,7 @@
 ." or visit www.oracle.com if you need additional information or have any
 ." questions.
 ."
-.TH idlj 1 "04 May 2009"
-." Generated from HTML by html2man (author: Eric Armstrong)
+.TH idlj 1 "02 Jun 2010"
 
 .LP
 .SH "åå‰"
@@ -507,6 +506,4 @@
 .RE
 
 .LP
-
-.LP
  
--- a/jdk/src/solaris/doc/sun/man/man1/ja/jar.1	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/solaris/doc/sun/man/man1/ja/jar.1	Wed Jul 21 09:57:21 2010 -0700
@@ -1,4 +1,4 @@
-." Copyright 2004-2006 Sun Microsystems, Inc.  All Rights Reserved.
+." Copyright (c) 1997, 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
@@ -19,8 +19,7 @@
 ." or visit www.oracle.com if you need additional information or have any
 ." questions.
 ."
-.TH jar 1 "04 May 2009"
-." Generated from HTML by html2man (author: Eric Armstrong)
+.TH jar 1 "02 Jun 2010"
 
 .LP
 .SH "åå‰"
@@ -205,7 +204,7 @@
 
 .LP
 .LP
-Java 2 SDK ã®ãƒãƒ¼ã‚¸ãƒ§ãƒ³ 1.3 以é™ã‹ã‚‰ã€\f2jar\fP ユーティリティー㧠
+JDK ã®ãƒãƒ¼ã‚¸ãƒ§ãƒ³ 1.3 以é™ã‹ã‚‰ã€\f2jar\fP ユーティリティー㧠
 .na
 \f2JarIndex\fP @
 .fi
@@ -717,6 +716,4 @@
 .br
 
 .LP
-pack200(1) 
-.LP
- 
+pack200(1)  
--- a/jdk/src/solaris/doc/sun/man/man1/ja/jarsigner.1	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/solaris/doc/sun/man/man1/ja/jarsigner.1	Wed Jul 21 09:57:21 2010 -0700
@@ -1,4 +1,4 @@
-." Copyright 2004-2006 Sun Microsystems, Inc.  All Rights Reserved.
+." Copyright (c) 1998, 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
@@ -19,8 +19,7 @@
 ." or visit www.oracle.com if you need additional information or have any
 ." questions.
 ."
-.TH jarsigner 1 "04 May 2009"
-." Generated from HTML by html2man (author: Eric Armstrong)
+.TH jarsigner 1 "02 Jun 2010"
 
 .LP
 .SH "åå‰"
@@ -504,7 +503,7 @@
 .nr 44 \n(83+(3*\n(38)
 .nr 84 +\n(44
 .nr TW \n(84
-.if t .if \n(TW>\n(.li .tm Table at line 186 file Input is too wide - \n(TW units
+.if t .if \n(TW>\n(.li .tm Table at line 185 file Input is too wide - \n(TW units
 .fc  
 .nr #T 0-1
 .nr #a 0-1
@@ -1616,6 +1615,4 @@
 .RE
 
 .LP
-
-.LP
  
--- a/jdk/src/solaris/doc/sun/man/man1/ja/java.1	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/solaris/doc/sun/man/man1/ja/java.1	Wed Jul 21 09:57:21 2010 -0700
@@ -1,4 +1,4 @@
-." Copyright 2002-2006 Sun Microsystems, Inc.  All Rights Reserved.
+." Copyright (c) 1994, 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
@@ -19,8 +19,7 @@
 ." or visit www.oracle.com if you need additional information or have any
 ." questions.
 ."
-.TH java 1 "04 May 2009"
-." Generated from HTML by html2man (author: Eric Armstrong)
+.TH java 1 "02 Jun 2010"
 
 .LP
 .SH "åå‰"
@@ -315,19 +314,19 @@
 ãƒãƒƒã‚¯ã‚°ãƒ©ã‚¦ãƒ³ãƒ‰ã‚³ãƒ³ãƒ‘イルを無効ã«ã—ã¾ã™ã€‚通常ã€VM ã§ã¯ã€ãƒãƒƒã‚¯ã‚°ãƒ©ã‚¦ãƒ³ãƒ‰ã‚³ãƒ³ãƒ‘イルãŒçµ‚了ã™ã‚‹ã¾ã§ã€ãƒ¡ã‚½ãƒƒãƒ‰ã‚’ãƒãƒƒã‚¯ã‚°ãƒ©ã‚¦ãƒ³ãƒ‰ã‚¿ã‚¹ã‚¯ã¨ã—ã¦ã‚³ãƒ³ãƒ‘イルã—ã€ã‚¤ãƒ³ã‚¿ãƒ—リタモードã§ãƒ¡ã‚½ãƒƒãƒ‰ã‚’実行ã—ã¾ã™ã€‚\f2\-Xbatch\fP フラグを指定ã™ã‚‹ã¨ã€ãƒãƒƒã‚¯ã‚°ãƒ©ã‚¦ãƒ³ãƒ‰ã‚³ãƒ³ãƒ‘イルãŒç„¡åŠ¹ã«ãªã‚Šã€ã™ã¹ã¦ã®ãƒ¡ã‚½ãƒƒãƒ‰ã®ã‚³ãƒ³ãƒ‘イルãŒå®Œäº†ã™ã‚‹ã¾ã§ãƒ•ã‚©ã‚¢ã‚°ãƒ©ã‚¦ãƒ³ãƒ‰ã‚¿ã‚¹ã‚¯ã¨ã—ã¦å‡¦ç†ã•ã‚Œã¾ã™ã€‚ 
 .TP 3
 \-Xbootclasspath:bootclasspath 
-ブートクラスファイルを探ã™ãƒ‡ã‚£ãƒ¬ã‚¯ãƒˆãƒªã€JAR アーカイブã€ãŠã‚ˆã³ ZIP アーカイブをコロンã§åŒºåˆ‡ã£ãŸãƒªã‚¹ãƒˆã§æŒ‡å®šã—ã¾ã™ã€‚指定ã—ãŸãƒ‘スã«å­˜åœ¨ã™ã‚‹ãƒ–ートクラスファイルãŒã€Java 2 SDK ã«å«ã¾ã‚Œã‚‹ãƒ–ートクラスファイルã®ä»£ã‚ã‚Šã«ä½¿ç”¨ã•ã‚Œã¾ã™ã€‚\f2注: rt.jar 内ã®ã‚¯ãƒ©ã‚¹ã‚’オーãƒãƒ¼ãƒ©ã‚¤ãƒ‰ã™ã‚‹ç›®çš„ã§ã“ã®ã‚ªãƒ—ションを使用ã™ã‚‹ã‚¢ãƒ—リケーションã¯ã€ã‚·ã‚¹ãƒ†ãƒ ã«é…ç½®ã—ãªã„ã§ãã ã•ã„。Java 2 Runtime Environment ãƒã‚¤ãƒŠãƒªã‚³ãƒ¼ãƒ‰ãƒ©ã‚¤ã‚»ãƒ³ã‚¹é•åã«ãªã‚Šã¾ã™ã€‚\fP 
+ブートクラスファイルを探ã™ãƒ‡ã‚£ãƒ¬ã‚¯ãƒˆãƒªã€JAR アーカイブã€ãŠã‚ˆã³ ZIP アーカイブをコロンã§åŒºåˆ‡ã£ãŸãƒªã‚¹ãƒˆã§æŒ‡å®šã—ã¾ã™ã€‚指定ã—ãŸãƒ‘スã«å­˜åœ¨ã™ã‚‹ãƒ–ートクラスファイルãŒã€JDK ã«å«ã¾ã‚Œã‚‹ãƒ–ートクラスファイルã®ä»£ã‚ã‚Šã«ä½¿ç”¨ã•ã‚Œã¾ã™ã€‚\f2注: rt.jar 内ã®ã‚¯ãƒ©ã‚¹ã‚’オーãƒãƒ¼ãƒ©ã‚¤ãƒ‰ã™ã‚‹ç›®çš„ã§ã“ã®ã‚ªãƒ—ションを使用ã™ã‚‹ã‚¢ãƒ—リケーションã¯ã€ã‚·ã‚¹ãƒ†ãƒ ã«é…ç½®ã—ãªã„ã§ãã ã•ã„。Java Runtime Environment ãƒã‚¤ãƒŠãƒªã‚³ãƒ¼ãƒ‰ãƒ©ã‚¤ã‚»ãƒ³ã‚¹é•åã«ãªã‚Šã¾ã™ã€‚\fP 
 .TP 3
 \-Xbootclasspath/a:path 
 ディレクトリã€JAR アーカイブã€ãŠã‚ˆã³ ZIP アーカイブã®ãƒ‘スをコロンã§åŒºåˆ‡ã£ã¦æŒ‡å®šã—ã¾ã™ã€‚ パスã¯ãƒ‡ãƒ•ã‚©ãƒ«ãƒˆã®ãƒ–ートストラップクラスパスã®ã‚ã¨ã«è¿½åŠ ã•ã‚Œã¾ã™ã€‚ 
 .TP 3
 \-Xbootclasspath/p:path 
-ディレクトリã€JAR アーカイブã€ãŠã‚ˆã³ ZIP アーカイブã®ãƒ‘スをコロンã§åŒºåˆ‡ã£ã¦æŒ‡å®šã—ã¾ã™ã€‚ パスã¯ãƒ‡ãƒ•ã‚©ãƒ«ãƒˆã®ãƒ–ートストラップクラスパスã®å‰ã«è¿½åŠ ã•ã‚Œã¾ã™ã€‚\f2注 rt.jar 内ã®ã‚¯ãƒ©ã‚¹ã‚’オーãƒãƒ¼ãƒ©ã‚¤ãƒ‰ã™ã‚‹ç›®çš„ã§ã“ã®ã‚ªãƒ—ションを使用ã™ã‚‹ã‚¢ãƒ—リケーションã¯ã€ã‚·ã‚¹ãƒ†ãƒ ã«é…ç½®ã—ãªã„ã§ãã ã•ã„。Java 2 Runtime Environment ãƒã‚¤ãƒŠãƒªã‚³ãƒ¼ãƒ‰ãƒ©ã‚¤ã‚»ãƒ³ã‚¹é•åã«ãªã‚Šã¾ã™ã€‚\fP 
+ディレクトリã€JAR アーカイブã€ãŠã‚ˆã³ ZIP アーカイブã®ãƒ‘スをコロンã§åŒºåˆ‡ã£ã¦æŒ‡å®šã—ã¾ã™ã€‚ パスã¯ãƒ‡ãƒ•ã‚©ãƒ«ãƒˆã®ãƒ–ートストラップクラスパスã®å‰ã«è¿½åŠ ã•ã‚Œã¾ã™ã€‚\f2注 rt.jar 内ã®ã‚¯ãƒ©ã‚¹ã‚’オーãƒãƒ¼ãƒ©ã‚¤ãƒ‰ã™ã‚‹ç›®çš„ã§ã“ã®ã‚ªãƒ—ションを使用ã™ã‚‹ã‚¢ãƒ—リケーションã¯ã€ã‚·ã‚¹ãƒ†ãƒ ã«é…ç½®ã—ãªã„ã§ãã ã•ã„。Java Runtime Environment ãƒã‚¤ãƒŠãƒªã‚³ãƒ¼ãƒ‰ãƒ©ã‚¤ã‚»ãƒ³ã‚¹é•åã«ãªã‚Šã¾ã™ã€‚\fP 
 .TP 3
 \-Xcheck:jni 
 Java Native Interface (JNI) 機能ã«å¯¾ã—ã¦è¿½åŠ ãƒã‚§ãƒƒã‚¯ã‚’è¡Œã„ã¾ã™ã€‚具体的ã«ã¯ã€Java 仮想マシン㯠JNI è¦æ±‚を処ç†ã™ã‚‹å‰ã«ã€JNI 関数ã«æ¸¡ã•ã‚Œã‚‹ãƒ‘ラメータã¨ã€å®Ÿè¡Œç’°å¢ƒã®ãƒ‡ãƒ¼ã‚¿ã‚’検証ã—ã¾ã™ã€‚無効ãªãƒ‡ãƒ¼ã‚¿ãŒè¦‹ã¤ã‹ã£ãŸå ´åˆã¯ã€ãƒã‚¤ãƒ†ã‚£ãƒ–コードã«å•é¡ŒãŒã‚ã‚‹ã“ã¨ã‚’示ã—ã¦ã„ã‚‹ãŸã‚ã€Java 仮想マシンã¯è‡´å‘½çš„エラーを発生ã—ã¦çµ‚了ã—ã¾ã™ã€‚ã“ã®ã‚ªãƒ—ションを使用ã™ã‚‹ã¨ã€ãƒ‘フォーマンス低下ãŒäºˆæƒ³ã•ã‚Œã¾ã™ã€‚ 
 .TP 3
 \-Xfuture 
-クラスã¨ãƒ•ã‚¡ã‚¤ãƒ«ã®å½¢å¼ã‚’厳密ã«ãƒã‚§ãƒƒã‚¯ã—ã¾ã™ã€‚下ä½äº’æ›æ€§ã‚’ä¿ã¤ãŸã‚ã€Java 2 SDK ã®ä»®æƒ³ãƒžã‚·ãƒ³ãŒå®Ÿè¡Œã™ã‚‹ãƒ‡ãƒ•ã‚©ãƒ«ãƒˆã®å½¢å¼ãƒã‚§ãƒƒã‚¯ã¯ã€JDK ソフトウェアã®ãƒãƒ¼ã‚¸ãƒ§ãƒ³ 1.1.x ãŒå®Ÿè¡Œã™ã‚‹ãƒã‚§ãƒƒã‚¯ã¨åŒç¨‹åº¦ã®åŽ³å¯†ã•ã«ãªã£ã¦ã„ã¾ã™ã€‚\f3\-Xfuture\fP フラグを指定ã™ã‚‹ã¨ã€ã‚¯ãƒ©ã‚¹ãƒ•ã‚¡ã‚¤ãƒ«å½¢å¼ã®ä»•æ§˜ã¸ã®æº–拠を強化ã™ã‚‹ãŸã‚ã®ã‚ˆã‚ŠåŽ³å¯†ãªãƒã‚§ãƒƒã‚¯ãŒæœ‰åŠ¹ã«ãªã‚Šã¾ã™ã€‚Java アプリケーション起動ツールã®å°†æ¥ã®ãƒªãƒªãƒ¼ã‚¹ã§ã¯ã€ã‚ˆã‚ŠåŽ³å¯†ãªãƒã‚§ãƒƒã‚¯ãŒãƒ‡ãƒ•ã‚©ãƒ«ãƒˆã«ãªã‚‹ãŸã‚ã€æ–°ã—ã„コードを開発ã™ã‚‹ã¨ãã«ã¯ã“ã®ãƒ•ãƒ©ã‚°ã‚’使用ã™ã‚‹ã“ã¨ã‚’ãŠå‹§ã‚ã—ã¾ã™ã€‚ 
+クラスã¨ãƒ•ã‚¡ã‚¤ãƒ«ã®å½¢å¼ã‚’厳密ã«ãƒã‚§ãƒƒã‚¯ã—ã¾ã™ã€‚下ä½äº’æ›æ€§ã‚’ä¿ã¤ãŸã‚ã€JDK ã®ä»®æƒ³ãƒžã‚·ãƒ³ãŒå®Ÿè¡Œã™ã‚‹ãƒ‡ãƒ•ã‚©ãƒ«ãƒˆã®å½¢å¼ãƒã‚§ãƒƒã‚¯ã¯ã€JDK ソフトウェアã®ãƒãƒ¼ã‚¸ãƒ§ãƒ³ 1.1.x ãŒå®Ÿè¡Œã™ã‚‹ãƒã‚§ãƒƒã‚¯ã¨åŒç¨‹åº¦ã®åŽ³å¯†ã•ã«ãªã£ã¦ã„ã¾ã™ã€‚\f3\-Xfuture\fP フラグを指定ã™ã‚‹ã¨ã€ã‚¯ãƒ©ã‚¹ãƒ•ã‚¡ã‚¤ãƒ«å½¢å¼ã®ä»•æ§˜ã¸ã®æº–拠を強化ã™ã‚‹ãŸã‚ã®ã‚ˆã‚ŠåŽ³å¯†ãªãƒã‚§ãƒƒã‚¯ãŒæœ‰åŠ¹ã«ãªã‚Šã¾ã™ã€‚Java アプリケーション起動ツールã®å°†æ¥ã®ãƒªãƒªãƒ¼ã‚¹ã§ã¯ã€ã‚ˆã‚ŠåŽ³å¯†ãªãƒã‚§ãƒƒã‚¯ãŒãƒ‡ãƒ•ã‚©ãƒ«ãƒˆã«ãªã‚‹ãŸã‚ã€æ–°ã—ã„コードを開発ã™ã‚‹ã¨ãã«ã¯ã“ã®ãƒ•ãƒ©ã‚°ã‚’使用ã™ã‚‹ã“ã¨ã‚’ãŠå‹§ã‚ã—ã¾ã™ã€‚ 
 .TP 3
 \-Xnoclassgc 
 クラスã®ã‚¬ãƒ™ãƒ¼ã‚¸ã‚³ãƒ¬ã‚¯ã‚·ãƒ§ãƒ³ã‚’無効ã«ã—ã¾ã™ã€‚ã“ã®ã‚ªãƒ—ションを使用ã™ã‚‹ã¨ã€ãƒ­ãƒ¼ãƒ‰æ¸ˆã¿ã‚¯ãƒ©ã‚¹ã‹ã‚‰ãƒ¡ãƒ¢ãƒªãƒ¼ãŒå›žå¾©ã•ã‚Œã‚‹ã“ã¨ãŒãªããªã‚‹ãŸã‚ã€å…¨ä½“çš„ãªãƒ¡ãƒ¢ãƒªãƒ¼ä½¿ç”¨é‡ãŒå¢—大ã—ã¾ã™ã€‚ã“ã®å ´åˆã€ã‚¢ãƒ—リケーションã«ã‚ˆã£ã¦ã¯ OutOfMemoryError ãŒã‚¹ãƒ­ãƒ¼ã•ã‚Œã‚‹å¯èƒ½æ€§ãŒã‚ã‚Šã¾ã™ã€‚ 
@@ -503,6 +502,4 @@
 .RE
 
 .LP
-
-.LP
  
--- a/jdk/src/solaris/doc/sun/man/man1/ja/javac.1	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/solaris/doc/sun/man/man1/ja/javac.1	Wed Jul 21 09:57:21 2010 -0700
@@ -1,4 +1,4 @@
-." Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+." Copyright (c) 1994, 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
@@ -19,8 +19,7 @@
 ." or visit www.oracle.com if you need additional information or have any
 ." questions.
 ."
-.TH javac 1 "04 May 2009"
-." Generated from HTML by html2man (author: Eric Armstrong)
+.TH javac 1 "02 Jun 2010"
 
 .LP
 .SH "åå‰"
@@ -960,6 +959,4 @@
 .RE
 
 .LP
-
-.LP
  
--- a/jdk/src/solaris/doc/sun/man/man1/ja/javadoc.1	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/solaris/doc/sun/man/man1/ja/javadoc.1	Wed Jul 21 09:57:21 2010 -0700
@@ -1,4 +1,4 @@
-." Copyright 2002-2006 Sun Microsystems, Inc.  All Rights Reserved.
+." Copyright (c) 1994, 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
@@ -19,8 +19,7 @@
 ." or visit www.oracle.com if you need additional information or have any
 ." questions.
 ."
-.TH javadoc 1 "04 May 2009"
-." Generated from HTML by html2man (author: Eric Armstrong)
+.TH javadoc 1 "02 Jun 2010"
 .SH "åå‰"
 javadoc \- Java API ドキュメントジェãƒãƒ¬ãƒ¼ã‚¿
 .RS 3
@@ -395,7 +394,7 @@
 .nr 40 \n(79+(0*\n(38)
 .nr 80 +\n(40
 .nr TW \n(80
-.if t .if \n(TW>\n(.li .tm Table at line 353 file Input is too wide - \n(TW units
+.if t .if \n(TW>\n(.li .tm Table at line 352 file Input is too wide - \n(TW units
 .fc  
 .nr #T 0-1
 .nr #a 0-1
@@ -529,7 +528,7 @@
 .nr 40 \n(79+(0*\n(38)
 .nr 80 +\n(40
 .nr TW \n(80
-.if t .if \n(TW>\n(.li .tm Table at line 406 file Input is too wide - \n(TW units
+.if t .if \n(TW>\n(.li .tm Table at line 405 file Input is too wide - \n(TW units
 .fc  
 .nr #T 0-1
 .nr #a 0-1
@@ -1374,7 +1373,7 @@
 .nr 41 \n(80+(3*\n(38)
 .nr 81 +\n(41
 .nr TW \n(81
-.if t .if \n(TW>\n(.li .tm Table at line 1125 file Input is too wide - \n(TW units
+.if t .if \n(TW>\n(.li .tm Table at line 1124 file Input is too wide - \n(TW units
 .fc  
 .nr #T 0-1
 .nr #a 0-1
@@ -2309,7 +2308,7 @@
 .nr 40 \n(79+(0*\n(38)
 .nr 80 +\n(40
 .nr TW \n(80
-.if t .if \n(TW>\n(.li .tm Table at line 1861 file Input is too wide - \n(TW units
+.if t .if \n(TW>\n(.li .tm Table at line 1860 file Input is too wide - \n(TW units
 .fc  
 .nr #T 0-1
 .nr #a 0-1
@@ -2677,7 +2676,7 @@
 .nr 42 \n(81+(3*\n(38)
 .nr 82 +\n(42
 .nr TW \n(82
-.if t .if \n(TW>\n(.li .tm Table at line 1959 file Input is too wide - \n(TW units
+.if t .if \n(TW>\n(.li .tm Table at line 1958 file Input is too wide - \n(TW units
 .fc  
 .nr #T 0-1
 .nr #a 0-1
@@ -3180,7 +3179,7 @@
 .nr 40 \n(79+(0*\n(38)
 .nr 80 +\n(40
 .nr TW \n(80
-.if t .if \n(TW>\n(.li .tm Table at line 2280 file Input is too wide - \n(TW units
+.if t .if \n(TW>\n(.li .tm Table at line 2279 file Input is too wide - \n(TW units
 .fc  
 .nr #T 0-1
 .nr #a 0-1
@@ -3301,7 +3300,7 @@
 .nr 40 \n(79+(0*\n(38)
 .nr 80 +\n(40
 .nr TW \n(80
-.if t .if \n(TW>\n(.li .tm Table at line 2316 file Input is too wide - \n(TW units
+.if t .if \n(TW>\n(.li .tm Table at line 2315 file Input is too wide - \n(TW units
 .fc  
 .nr #T 0-1
 .nr #a 0-1
@@ -3440,7 +3439,7 @@
 .nr 40 \n(79+(0*\n(38)
 .nr 80 +\n(40
 .nr TW \n(80
-.if t .if \n(TW>\n(.li .tm Table at line 2356 file Input is too wide - \n(TW units
+.if t .if \n(TW>\n(.li .tm Table at line 2355 file Input is too wide - \n(TW units
 .fc  
 .nr #T 0-1
 .nr #a 0-1
@@ -3619,7 +3618,7 @@
 .nr 40 \n(79+(0*\n(38)
 .nr 80 +\n(40
 .nr TW \n(80
-.if t .if \n(TW>\n(.li .tm Table at line 2437 file Input is too wide - \n(TW units
+.if t .if \n(TW>\n(.li .tm Table at line 2436 file Input is too wide - \n(TW units
 .fc  
 .nr #T 0-1
 .nr #a 0-1
@@ -3785,7 +3784,7 @@
 .nr 40 \n(79+(0*\n(38)
 .nr 80 +\n(40
 .nr TW \n(80
-.if t .if \n(TW>\n(.li .tm Table at line 2504 file Input is too wide - \n(TW units
+.if t .if \n(TW>\n(.li .tm Table at line 2503 file Input is too wide - \n(TW units
 .fc  
 .nr #T 0-1
 .nr #a 0-1
@@ -4102,7 +4101,7 @@
 .nr 42 \n(81+(3*\n(38)
 .nr 82 +\n(42
 .nr TW \n(82
-.if t .if \n(TW>\n(.li .tm Table at line 2681 file Input is too wide - \n(TW units
+.if t .if \n(TW>\n(.li .tm Table at line 2680 file Input is too wide - \n(TW units
 .fc  
 .nr #T 0-1
 .nr #a 0-1
@@ -4365,7 +4364,7 @@
 .nr 41 \n(80+(3*\n(38)
 .nr 81 +\n(41
 .nr TW \n(81
-.if t .if \n(TW>\n(.li .tm Table at line 2791 file Input is too wide - \n(TW units
+.if t .if \n(TW>\n(.li .tm Table at line 2790 file Input is too wide - \n(TW units
 .fc  
 .nr #T 0-1
 .nr #a 0-1
@@ -5831,5 +5830,4 @@
 .RE
 
 .LP
-.LP
-javadoc ã¯ã€Sun Microsystems, Inc ã®å•†æ¨™ã§ã™ (\f2javadoc\fP コマンド自体ã«ã¯å•†æ¨™ã‚·ãƒ³ãƒœãƒ«ã¯ä¸è¦)。 
+ 
--- a/jdk/src/solaris/doc/sun/man/man1/ja/javah.1	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/solaris/doc/sun/man/man1/ja/javah.1	Wed Jul 21 09:57:21 2010 -0700
@@ -1,4 +1,4 @@
-." Copyright 2002-2006 Sun Microsystems, Inc.  All Rights Reserved.
+." Copyright (c) 1994, 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
@@ -19,8 +19,7 @@
 ." or visit www.oracle.com if you need additional information or have any
 ." questions.
 ."
-.TH javah 1 "04 May 2009"
-." Generated from HTML by html2man (author: Eric Armstrong)
+.TH javah 1 "02 Jun 2010"
 
 .LP
 .SH "åå‰"
@@ -156,6 +155,4 @@
 .LP
 javac(1)ã€java(1)ã€jdb(1)ã€javap(1)ã€javadoc(1)
 .LP
-
-.LP
  
--- a/jdk/src/solaris/doc/sun/man/man1/ja/javap.1	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/solaris/doc/sun/man/man1/ja/javap.1	Wed Jul 21 09:57:21 2010 -0700
@@ -1,4 +1,4 @@
-." Copyright 2002-2006 Sun Microsystems, Inc.  All Rights Reserved.
+." Copyright (c) 1994, 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
@@ -19,8 +19,7 @@
 ." or visit www.oracle.com if you need additional information or have any
 ." questions.
 ."
-.TH javap 1 "04 May 2009"
-." Generated from HTML by html2man (author: Eric Armstrong)
+.TH javap 1 "02 Jun 2010"
 
 .LP
 .SH "åå‰"
@@ -359,6 +358,4 @@
 .LP
 javac(1)〠java(1)ã€jdb(1)ã€javah(1)ã€javadoc(1)
 .LP
-
-.LP
  
--- a/jdk/src/solaris/doc/sun/man/man1/ja/javaws.1	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/solaris/doc/sun/man/man1/ja/javaws.1	Wed Jul 21 09:57:21 2010 -0700
@@ -1,4 +1,4 @@
-." Copyright  Sun Microsystems, Inc.  All Rights Reserved.
+." Copyright (c) 2003, 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
@@ -19,17 +19,12 @@
 ." or visit www.oracle.com if you need additional information or have any
 ." questions.
 ."
-.TH javaws 1 "04 May 2009"
-." Generated from HTML by html2man (author: Eric Armstrong)
-
-.LP
+.TH javaws 1 "02 Jun 2010"
 
 .LP
 .SH "åå‰"
 \f2javaws\fP コマンド行
 .LP
-
-.LP
 .LP
 \ 
 .LP
--- a/jdk/src/solaris/doc/sun/man/man1/ja/jconsole.1	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/solaris/doc/sun/man/man1/ja/jconsole.1	Wed Jul 21 09:57:21 2010 -0700
@@ -1,4 +1,4 @@
-." Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+." 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
@@ -19,8 +19,7 @@
 ." or visit www.oracle.com if you need additional information or have any
 ." questions.
 ."
-.TH jconsole 1 "04 May 2009"
-." Generated from HTML by html2man (author: Eric Armstrong)
+.TH jconsole 1 "02 Jun 2010"
 
 .LP
 .SH "åå‰"
@@ -160,6 +159,4 @@
 .RE
 
 .LP
-
-.LP
  
--- a/jdk/src/solaris/doc/sun/man/man1/ja/jdb.1	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/solaris/doc/sun/man/man1/ja/jdb.1	Wed Jul 21 09:57:21 2010 -0700
@@ -1,4 +1,4 @@
-." Copyright 2002-2006 Sun Microsystems, Inc.  All Rights Reserved.
+." Copyright (c) 1995, 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
@@ -19,8 +19,7 @@
 ." or visit www.oracle.com if you need additional information or have any
 ." questions.
 ."
-.TH jdb 1 "04 May 2009"
-." Generated from HTML by html2man (author: Eric Armstrong)
+.TH jdb 1 "02 Jun 2010"
 
 .LP
 .SH "åå‰"
@@ -364,6 +363,4 @@
 .LP
 javac(1)ã€java(1)ã€javah(1)ã€javap(1)ã€javadoc(1)
 .LP
-
-.LP
  
--- a/jdk/src/solaris/doc/sun/man/man1/ja/jhat.1	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/solaris/doc/sun/man/man1/ja/jhat.1	Wed Jul 21 09:57:21 2010 -0700
@@ -1,4 +1,4 @@
-." Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+." Copyright (c) 2006, 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
@@ -19,8 +19,7 @@
 ." or visit www.oracle.com if you need additional information or have any
 ." questions.
 ."
-.TH jhat 1 "04 May 2009"
-." Generated from HTML by html2man (author: Eric Armstrong)
+.TH jhat 1 "02 Jun 2010"
 
 .LP
 .SH "åå‰"
--- a/jdk/src/solaris/doc/sun/man/man1/ja/jinfo.1	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/solaris/doc/sun/man/man1/ja/jinfo.1	Wed Jul 21 09:57:21 2010 -0700
@@ -1,4 +1,4 @@
-." Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+." 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
@@ -19,8 +19,7 @@
 ." or visit www.oracle.com if you need additional information or have any
 ." questions.
 ."
-.TH jinfo 1 "04 May 2009"
-." Generated from HTML by html2man (author: Eric Armstrong)
+.TH jinfo 1 "02 Jun 2010"
 
 .LP
 .SH "åå‰"
@@ -164,6 +163,4 @@
 .RE
 
 .LP
-
-.LP
  
--- a/jdk/src/solaris/doc/sun/man/man1/ja/jmap.1	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/solaris/doc/sun/man/man1/ja/jmap.1	Wed Jul 21 09:57:21 2010 -0700
@@ -1,4 +1,4 @@
-." Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+." 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
@@ -19,8 +19,7 @@
 ." or visit www.oracle.com if you need additional information or have any
 ." questions.
 ."
-.TH jmap 1 "04 May 2009"
-." Generated from HTML by html2man (author: Eric Armstrong)
+.TH jmap 1 "02 Jun 2010"
 
 .LP
 .SH "åå‰"
@@ -196,6 +195,4 @@
 .RE
 
 .LP
-
-.LP
  
--- a/jdk/src/solaris/doc/sun/man/man1/ja/jps.1	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/solaris/doc/sun/man/man1/ja/jps.1	Wed Jul 21 09:57:21 2010 -0700
@@ -1,4 +1,4 @@
-." Copyright 2003 Sun Microsystems, Inc.  All Rights Reserved.
+." 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
@@ -19,8 +19,7 @@
 ." or visit www.oracle.com if you need additional information or have any
 ." questions.
 ."
-.TH jps 1 "04 May 2009"
-." Generated from HTML by html2man (author: Eric Armstrong)
+.TH jps 1 "02 Jun 2010"
 
 .LP
 .SH "åå‰"
@@ -292,6 +291,4 @@
 .RE
 
 .LP
-
-.LP
  
--- a/jdk/src/solaris/doc/sun/man/man1/ja/jrunscript.1	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/solaris/doc/sun/man/man1/ja/jrunscript.1	Wed Jul 21 09:57:21 2010 -0700
@@ -1,4 +1,4 @@
-." Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+." Copyright (c) 2006, 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
@@ -19,8 +19,7 @@
 ." or visit www.oracle.com if you need additional information or have any
 ." questions.
 ."
-.TH jrunscript 1 "04 May 2009"
-." Generated from HTML by html2man (author: Eric Armstrong)
+.TH jrunscript 1 "02 Jun 2010"
 
 .LP
 .SH "åå‰"
@@ -220,6 +219,4 @@
 .LP
 JavaScript ãŒä½¿ç”¨ã•ã‚Œã‚‹å ´åˆã€jrunscript ã¯ã€æœ€åˆã®ãƒ¦ãƒ¼ã‚¶ãƒ¼å®šç¾©ã‚¹ã‚¯ãƒªãƒ—トを評価ã™ã‚‹å‰ã«ã€ã„ãã¤ã‹ã®çµ„ã¿è¾¼ã¿é–¢æ•°ã‚„組ã¿è¾¼ã¿ã‚ªãƒ–ジェクトをåˆæœŸåŒ–ã—ã¾ã™ã€‚ã“れら㮠JavaScript 組ã¿è¾¼ã¿æ©Ÿèƒ½ã«ã¤ã„ã¦ã¯ã€jsdocs ã‚’å‚ç…§ã—ã¦ãã ã•ã„。
 .LP
-
-.LP
  
--- a/jdk/src/solaris/doc/sun/man/man1/ja/jsadebugd.1	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/solaris/doc/sun/man/man1/ja/jsadebugd.1	Wed Jul 21 09:57:21 2010 -0700
@@ -1,4 +1,4 @@
-." Copyright 2004 Sun Microsystems, Inc.  All Rights Reserved.
+." 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
@@ -19,8 +19,7 @@
 ." or visit www.oracle.com if you need additional information or have any
 ." questions.
 ."
-.TH jsadebugd 1 "04 May 2009"
-." Generated from HTML by html2man (author: Eric Armstrong)
+.TH jsadebugd 1 "02 Jun 2010"
 
 .LP
 .SH "åå‰"
@@ -147,6 +146,4 @@
 .RE
 
 .LP
-
-.LP
  
--- a/jdk/src/solaris/doc/sun/man/man1/ja/jstack.1	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/solaris/doc/sun/man/man1/ja/jstack.1	Wed Jul 21 09:57:21 2010 -0700
@@ -1,4 +1,4 @@
-." Copyright 2004 Sun Microsystems, Inc.  All Rights Reserved.
+." 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
@@ -19,8 +19,7 @@
 ." or visit www.oracle.com if you need additional information or have any
 ." questions.
 ."
-.TH jstack 1 "04 May 2009"
-." Generated from HTML by html2man (author: Eric Armstrong)
+.TH jstack 1 "02 Jun 2010"
 
 .LP
 .SH "åå‰"
@@ -189,6 +188,4 @@
 .LP
 æ··åˆãƒ¢ãƒ¼ãƒ‰ã®ã‚¹ã‚¿ãƒƒã‚¯ãƒˆãƒ¬ãƒ¼ã‚¹ (\-m オプション使用) ã¯ã€ãƒªãƒ¢ãƒ¼ãƒˆãƒ‡ãƒãƒƒã‚°ã‚µãƒ¼ãƒãƒ¼ã§ã¯æ©Ÿèƒ½ã—ã¾ã›ã‚“。
 .LP
-
-.LP
  
--- a/jdk/src/solaris/doc/sun/man/man1/ja/jstat.1	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/solaris/doc/sun/man/man1/ja/jstat.1	Wed Jul 21 09:57:21 2010 -0700
@@ -1,4 +1,4 @@
-." Copyright 2003 Sun Microsystems, Inc.  All Rights Reserved.
+." 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
@@ -19,8 +19,7 @@
 ." or visit www.oracle.com if you need additional information or have any
 ." questions.
 ."
-.TH jstat 1 "04 May 2009"
-." Generated from HTML by html2man (author: Eric Armstrong)
+.TH jstat 1 "02 Jun 2010"
 
 .LP
 .SH "åå‰"
@@ -487,7 +486,7 @@
 .nr 41 \n(80+(3*\n(38)
 .nr 81 +\n(41
 .nr TW \n(81
-.if t .if \n(TW>\n(.li .tm Table at line 260 file Input is too wide - \n(TW units
+.if t .if \n(TW>\n(.li .tm Table at line 259 file Input is too wide - \n(TW units
 .fc  
 .nr #T 0-1
 .nr #a 0-1
@@ -887,7 +886,7 @@
 .nr 41 \n(80+(3*\n(38)
 .nr 81 +\n(41
 .nr TW \n(81
-.if t .if \n(TW>\n(.li .tm Table at line 314 file Input is too wide - \n(TW units
+.if t .if \n(TW>\n(.li .tm Table at line 313 file Input is too wide - \n(TW units
 .fc  
 .nr #T 0-1
 .nr #a 0-1
@@ -1170,7 +1169,7 @@
 .nr 41 \n(80+(3*\n(38)
 .nr 81 +\n(41
 .nr TW \n(81
-.if t .if \n(TW>\n(.li .tm Table at line 350 file Input is too wide - \n(TW units
+.if t .if \n(TW>\n(.li .tm Table at line 349 file Input is too wide - \n(TW units
 .fc  
 .nr #T 0-1
 .nr #a 0-1
@@ -1634,7 +1633,7 @@
 .nr 41 \n(80+(3*\n(38)
 .nr 81 +\n(41
 .nr TW \n(81
-.if t .if \n(TW>\n(.li .tm Table at line 420 file Input is too wide - \n(TW units
+.if t .if \n(TW>\n(.li .tm Table at line 419 file Input is too wide - \n(TW units
 .fc  
 .nr #T 0-1
 .nr #a 0-1
@@ -2258,7 +2257,7 @@
 .nr 41 \n(80+(3*\n(38)
 .nr 81 +\n(41
 .nr TW \n(81
-.if t .if \n(TW>\n(.li .tm Table at line 494 file Input is too wide - \n(TW units
+.if t .if \n(TW>\n(.li .tm Table at line 493 file Input is too wide - \n(TW units
 .fc  
 .nr #T 0-1
 .nr #a 0-1
@@ -2638,7 +2637,7 @@
 .nr 41 \n(80+(3*\n(38)
 .nr 81 +\n(41
 .nr TW \n(81
-.if t .if \n(TW>\n(.li .tm Table at line 517 file Input is too wide - \n(TW units
+.if t .if \n(TW>\n(.li .tm Table at line 516 file Input is too wide - \n(TW units
 .fc  
 .nr #T 0-1
 .nr #a 0-1
@@ -2954,7 +2953,7 @@
 .nr 41 \n(80+(3*\n(38)
 .nr 81 +\n(41
 .nr TW \n(81
-.if t .if \n(TW>\n(.li .tm Table at line 571 file Input is too wide - \n(TW units
+.if t .if \n(TW>\n(.li .tm Table at line 570 file Input is too wide - \n(TW units
 .fc  
 .nr #T 0-1
 .nr #a 0-1
@@ -3409,7 +3408,7 @@
 .nr 41 \n(80+(3*\n(38)
 .nr 81 +\n(41
 .nr TW \n(81
-.if t .if \n(TW>\n(.li .tm Table at line 627 file Input is too wide - \n(TW units
+.if t .if \n(TW>\n(.li .tm Table at line 626 file Input is too wide - \n(TW units
 .fc  
 .nr #T 0-1
 .nr #a 0-1
@@ -3805,7 +3804,7 @@
 .nr 41 \n(80+(3*\n(38)
 .nr 81 +\n(41
 .nr TW \n(81
-.if t .if \n(TW>\n(.li .tm Table at line 669 file Input is too wide - \n(TW units
+.if t .if \n(TW>\n(.li .tm Table at line 668 file Input is too wide - \n(TW units
 .fc  
 .nr #T 0-1
 .nr #a 0-1
@@ -4150,7 +4149,7 @@
 .nr 41 \n(80+(3*\n(38)
 .nr 81 +\n(41
 .nr TW \n(81
-.if t .if \n(TW>\n(.li .tm Table at line 711 file Input is too wide - \n(TW units
+.if t .if \n(TW>\n(.li .tm Table at line 710 file Input is too wide - \n(TW units
 .fc  
 .nr #T 0-1
 .nr #a 0-1
@@ -4495,7 +4494,7 @@
 .nr 41 \n(80+(3*\n(38)
 .nr 81 +\n(41
 .nr TW \n(81
-.if t .if \n(TW>\n(.li .tm Table at line 753 file Input is too wide - \n(TW units
+.if t .if \n(TW>\n(.li .tm Table at line 752 file Input is too wide - \n(TW units
 .fc  
 .nr #T 0-1
 .nr #a 0-1
@@ -4880,7 +4879,7 @@
 .nr 41 \n(80+(3*\n(38)
 .nr 81 +\n(41
 .nr TW \n(81
-.if t .if \n(TW>\n(.li .tm Table at line 803 file Input is too wide - \n(TW units
+.if t .if \n(TW>\n(.li .tm Table at line 802 file Input is too wide - \n(TW units
 .fc  
 .nr #T 0-1
 .nr #a 0-1
@@ -5179,7 +5178,7 @@
 .nr 41 \n(80+(3*\n(38)
 .nr 81 +\n(41
 .nr TW \n(81
-.if t .if \n(TW>\n(.li .tm Table at line 829 file Input is too wide - \n(TW units
+.if t .if \n(TW>\n(.li .tm Table at line 828 file Input is too wide - \n(TW units
 .fc  
 .nr #T 0-1
 .nr #a 0-1
@@ -5462,6 +5461,4 @@
 .RE
 
 .LP
-
-.LP
  
--- a/jdk/src/solaris/doc/sun/man/man1/ja/jstatd.1	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/solaris/doc/sun/man/man1/ja/jstatd.1	Wed Jul 21 09:57:21 2010 -0700
@@ -1,4 +1,4 @@
-." Copyright 2003 Sun Microsystems, Inc.  All Rights Reserved.
+." 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
@@ -19,8 +19,7 @@
 ." or visit www.oracle.com if you need additional information or have any
 ." questions.
 ."
-.TH jstatd 1 "04 May 2009"
-." Generated from HTML by html2man (author: Eric Armstrong)
+.TH jstatd 1 "02 Jun 2010"
 
 .LP
 .SH "åå‰"
@@ -298,6 +297,4 @@
 .RE
 
 .LP
-
-.LP
  
--- a/jdk/src/solaris/doc/sun/man/man1/ja/keytool.1	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/solaris/doc/sun/man/man1/ja/keytool.1	Wed Jul 21 09:57:21 2010 -0700
@@ -1,4 +1,4 @@
-." Copyright 2002-2006 Sun Microsystems, Inc.  All Rights Reserved.
+." Copyright (c) 1998, 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
@@ -19,8 +19,7 @@
 ." or visit www.oracle.com if you need additional information or have any
 ." questions.
 ."
-.TH keytool 1 "04 May 2009"
-." Generated from HTML by html2man (author: Eric Armstrong)
+.TH keytool 1 "02 Jun 2010"
 
 .LP
 .SH "åå‰"
@@ -1643,6 +1642,4 @@
 .RE
 
 .LP
-
-.LP
  
--- a/jdk/src/solaris/doc/sun/man/man1/ja/native2ascii.1	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/solaris/doc/sun/man/man1/ja/native2ascii.1	Wed Jul 21 09:57:21 2010 -0700
@@ -1,4 +1,4 @@
-." Copyright 2002-2006 Sun Microsystems, Inc.  All Rights Reserved.
+." Copyright (c) 2000, 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
@@ -19,8 +19,7 @@
 ." or visit www.oracle.com if you need additional information or have any
 ." questions.
 ."
-.TH native2ascii 1 "04 May 2009"
-." Generated from HTML by html2man (author: Eric Armstrong)
+.TH native2ascii 1 "02 Jun 2010"
 
 .LP
 .SH "åå‰"
@@ -78,6 +77,4 @@
 .RE
 
 .LP
-
-.LP
  
--- a/jdk/src/solaris/doc/sun/man/man1/ja/orbd.1	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/solaris/doc/sun/man/man1/ja/orbd.1	Wed Jul 21 09:57:21 2010 -0700
@@ -1,4 +1,4 @@
-." Copyright 2001-2006 Sun Microsystems, Inc.  All Rights Reserved.
+." Copyright (c) 2001, 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
@@ -19,8 +19,7 @@
 ." or visit www.oracle.com if you need additional information or have any
 ." questions.
 ."
-.TH orbd 1 "04 May 2009"
-." Generated from HTML by html2man (author: Eric Armstrong)
+.TH orbd 1 "02 Jun 2010"
 
 .LP
 .SH "åå‰"
@@ -374,6 +373,4 @@
 .br
 
 .LP
-
-.LP
  
--- a/jdk/src/solaris/doc/sun/man/man1/ja/pack200.1	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/solaris/doc/sun/man/man1/ja/pack200.1	Wed Jul 21 09:57:21 2010 -0700
@@ -1,4 +1,4 @@
-." Copyright  Sun Microsystems, Inc.  All Rights Reserved.
+." 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
@@ -19,8 +19,7 @@
 ." or visit www.oracle.com if you need additional information or have any
 ." questions.
 ."
-.TH pack200 1 "04 May 2009"
-." Generated from HTML by html2man (author: Eric Armstrong)
+.TH pack200 1 "02 Jun 2010"
 
 .LP
 .SH "åå‰"
--- a/jdk/src/solaris/doc/sun/man/man1/ja/policytool.1	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/solaris/doc/sun/man/man1/ja/policytool.1	Wed Jul 21 09:57:21 2010 -0700
@@ -1,4 +1,4 @@
-." Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+." Copyright (c) 2001, 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
@@ -19,8 +19,7 @@
 ." or visit www.oracle.com if you need additional information or have any
 ." questions.
 ."
-.TH policytool 1 "04 May 2009"
-." Generated from HTML by html2man (author: Eric Armstrong)
+.TH policytool 1 "02 Jun 2010"
 
 .LP
 .SH "åå‰"
@@ -105,6 +104,4 @@
 .RE
 
 .LP
-
-.LP
  
--- a/jdk/src/solaris/doc/sun/man/man1/ja/rmic.1	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/solaris/doc/sun/man/man1/ja/rmic.1	Wed Jul 21 09:57:21 2010 -0700
@@ -1,4 +1,4 @@
-." Copyright 2004-2006 Sun Microsystems, Inc.  All Rights Reserved.
+." Copyright (c) 1997, 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
@@ -19,8 +19,7 @@
 ." or visit www.oracle.com if you need additional information or have any
 ." questions.
 ."
-.TH rmic 1 "04 May 2009"
-." Generated from HTML by html2man (author: Eric Armstrong)
+.TH rmic 1 "02 Jun 2010"
 
 .LP
 .SH "åå‰"
@@ -265,6 +264,4 @@
 .fi
 http://java.sun.com/javase/6/docs/technotes/tools/index.html#classpath
 .LP
-
-.LP
  
--- a/jdk/src/solaris/doc/sun/man/man1/ja/rmid.1	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/solaris/doc/sun/man/man1/ja/rmid.1	Wed Jul 21 09:57:21 2010 -0700
@@ -1,4 +1,4 @@
-." Copyright 2004-2006 Sun Microsystems, Inc.  All Rights Reserved.
+." Copyright (c) 1998, 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
@@ -19,8 +19,7 @@
 ." or visit www.oracle.com if you need additional information or have any
 ." questions.
 ."
-.TH rmid 1 "04 May 2009"
-." Generated from HTML by html2man (author: Eric Armstrong)
+.TH rmid 1 "02 Jun 2010"
 
 .LP
 .SH "åå‰"
@@ -354,6 +353,4 @@
 .fi
 http://java.sun.com/javase/6/docs/technotes/tools/index.html#classpathã€java(1)
 .LP
-
-.LP
  
--- a/jdk/src/solaris/doc/sun/man/man1/ja/rmiregistry.1	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/solaris/doc/sun/man/man1/ja/rmiregistry.1	Wed Jul 21 09:57:21 2010 -0700
@@ -1,4 +1,4 @@
-." Copyright 2003-2006 Sun Microsystems, Inc.  All Rights Reserved.
+." Copyright (c) 1997, 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
@@ -19,8 +19,7 @@
 ." or visit www.oracle.com if you need additional information or have any
 ." questions.
 ."
-.TH rmiregistry 1 "04 May 2009"
-." Generated from HTML by html2man (author: Eric Armstrong)
+.TH rmiregistry 1 "02 Jun 2010"
 
 .LP
 .SH "åå‰"
@@ -94,6 +93,4 @@
 .fi
 http://java.sun.com/javase/6/docs/api/java/rmi/Naming.html
 .LP
-
-.LP
  
--- a/jdk/src/solaris/doc/sun/man/man1/ja/schemagen.1	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/solaris/doc/sun/man/man1/ja/schemagen.1	Wed Jul 21 09:57:21 2010 -0700
@@ -1,4 +1,4 @@
-." Copyright  Sun Microsystems, Inc.  All Rights Reserved.
+." Copyright (c) 2005, 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
@@ -19,8 +19,7 @@
 ." or visit www.oracle.com if you need additional information or have any
 ." questions.
 ."
-.TH schemagen 1 "04 May 2009"
-." Generated from HTML by html2man (author: Eric Armstrong)
+.TH schemagen 1 "02 Jun 2010"
 
 .LP
 .SH "åå‰"
--- a/jdk/src/solaris/doc/sun/man/man1/ja/serialver.1	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/solaris/doc/sun/man/man1/ja/serialver.1	Wed Jul 21 09:57:21 2010 -0700
@@ -1,4 +1,4 @@
-." Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+." Copyright (c) 1997, 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
@@ -19,8 +19,7 @@
 ." or visit www.oracle.com if you need additional information or have any
 ." questions.
 ."
-.TH serialver 1 "04 May 2009"
-." Generated from HTML by html2man (author: Eric Armstrong)
+.TH serialver 1 "02 Jun 2010"
 
 .LP
 .SH "åå‰"
@@ -121,6 +120,4 @@
 .fi
 http://java.sun.com/javase/6/docs/api/java/io/ObjectStreamClass.html
 .LP
-
-.LP
  
--- a/jdk/src/solaris/doc/sun/man/man1/ja/servertool.1	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/solaris/doc/sun/man/man1/ja/servertool.1	Wed Jul 21 09:57:21 2010 -0700
@@ -1,4 +1,4 @@
-." Copyright 2001-2006 Sun Microsystems, Inc.  All Rights Reserved.
+." Copyright (c) 2001, 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
@@ -19,8 +19,7 @@
 ." or visit www.oracle.com if you need additional information or have any
 ." questions.
 ."
-.TH servertool 1 "04 May 2009"
-." Generated from HTML by html2man (author: Eric Armstrong)
+.TH servertool 1 "02 Jun 2010"
 
 .LP
 .SH "åå‰"
@@ -125,6 +124,4 @@
 .LP
 
 .LP
-orbd(1) 
-.LP
- 
+orbd(1)  
--- a/jdk/src/solaris/doc/sun/man/man1/ja/tnameserv.1	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/solaris/doc/sun/man/man1/ja/tnameserv.1	Wed Jul 21 09:57:21 2010 -0700
@@ -1,4 +1,4 @@
-." Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+." Copyright (c) 1999, 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
@@ -19,15 +19,12 @@
 ." or visit www.oracle.com if you need additional information or have any
 ." questions.
 ."
-.TH tnameserv 1 "04 May 2009"
-." Generated from HTML by html2man (author: Eric Armstrong)
+.TH tnameserv 1 "02 Jun 2010"
 
 .LP
 .SH "åå‰"
 Java IDL:一時ãƒãƒ¼ãƒ ã‚µãƒ¼ãƒ“ス \- \f2tnameserv\fP
 .LP
-
-.LP
 .LP
 ã“ã®ãƒ‰ã‚­ãƒ¥ãƒ¡ãƒ³ãƒˆã§ã¯ã€Java IDL 一時ãƒãƒ¼ãƒ ã‚µãƒ¼ãƒ“ス \f2tnameserv\fP ã®ä½¿ç”¨æ–¹æ³•ã«ã¤ã„ã¦èª¬æ˜Žã—ã¾ã™ã€‚Java IDL ã«ã¯ã€Object Request Broker Daemon (ORBD) ã‚‚å«ã¾ã‚Œã¦ã„ã¾ã™ã€‚ORBD ã¯ã€ãƒ–ートストラップサービスã€ä¸€æ™‚ãƒãƒ¼ãƒ ã‚µãƒ¼ãƒ“スã€\f3æŒç¶š\fPãƒãƒ¼ãƒ ã‚µãƒ¼ãƒ“スã€ãŠã‚ˆã³ã‚µãƒ¼ãƒãƒ¼ãƒžãƒãƒ¼ã‚¸ãƒ£ãƒ¼ã‚’å«ã‚€ãƒ‡ãƒ¼ãƒ¢ãƒ³ãƒ—ロセスã§ã™ã€‚Java IDL ã®ã™ã¹ã¦ã®ãƒãƒ¥ãƒ¼ãƒˆãƒªã‚¢ãƒ«ã§ã¯ ORBD を使用ã—ã¦ã„ã¾ã™ãŒã€ä¸€æ™‚ãƒãƒ¼ãƒ ã‚µãƒ¼ãƒ“スを使用ã™ã‚‹ä¾‹ã§ã¯ã€\f2orbd\fP ã®ä»£ã‚ã‚Šã« \f2tnameserv\fP を使用ã§ãã¾ã™ã€‚\f2orbd\fP ツールã®è©³ç´°ã«ã¤ã„ã¦ã¯ã€\f2orbd\fP ã® orbd(1)ã¾ãŸã¯
 .na
@@ -499,6 +496,4 @@
 .fi
 
 .LP
-
-.LP
  
--- a/jdk/src/solaris/doc/sun/man/man1/ja/unpack200.1	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/solaris/doc/sun/man/man1/ja/unpack200.1	Wed Jul 21 09:57:21 2010 -0700
@@ -1,4 +1,4 @@
-." Copyright  Sun Microsystems, Inc.  All Rights Reserved.
+." 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
@@ -19,8 +19,7 @@
 ." or visit www.oracle.com if you need additional information or have any
 ." questions.
 ."
-.TH unpack200 1 "04 May 2009"
-." Generated from HTML by html2man (author: Eric Armstrong)
+.TH unpack200 1 "02 Jun 2010"
 
 .LP
 .SH "åå‰"
--- a/jdk/src/solaris/doc/sun/man/man1/ja/wsgen.1	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/solaris/doc/sun/man/man1/ja/wsgen.1	Wed Jul 21 09:57:21 2010 -0700
@@ -1,4 +1,4 @@
-." Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+." Copyright (c) 2005, 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
@@ -19,8 +19,7 @@
 ." or visit www.oracle.com if you need additional information or have any
 ." questions.
 ."
-.TH wsgen 1 "04 May 2009"
-." Generated from HTML by html2man (author: Eric Armstrong)
+.TH wsgen 1 "02 Jun 2010"
 .SH "åå‰"
 wsgen \- XML Web Services (JAX\-WS) 2.0 ã®ãŸã‚ã® Java(TM) API
 .RS 3
@@ -387,7 +386,7 @@
 .nr 41 \n(80+(3*\n(38)
 .nr 81 +\n(41
 .nr TW \n(81
-.if t .if \n(TW>\n(.li .tm Table at line 144 file Input is too wide - \n(TW units
+.if t .if \n(TW>\n(.li .tm Table at line 143 file Input is too wide - \n(TW units
 .fc  
 .nr #T 0-1
 .nr #a 0-1
--- a/jdk/src/solaris/doc/sun/man/man1/ja/wsimport.1	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/solaris/doc/sun/man/man1/ja/wsimport.1	Wed Jul 21 09:57:21 2010 -0700
@@ -1,4 +1,4 @@
-." Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+." Copyright (c) 2005, 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
@@ -19,8 +19,7 @@
 ." or visit www.oracle.com if you need additional information or have any
 ." questions.
 ."
-.TH wsimport 1 "04 May 2009"
-." Generated from HTML by html2man (author: Eric Armstrong)
+.TH wsimport 1 "02 Jun 2010"
 .SH "åå‰"
 wsimport \- XML Web Services (JAX\-WS) 2.0 ã®ãŸã‚ã® Java(TM) API
 .LP
@@ -467,7 +466,7 @@
 .nr 41 \n(80+(3*\n(38)
 .nr 81 +\n(41
 .nr TW \n(81
-.if t .if \n(TW>\n(.li .tm Table at line 164 file Input is too wide - \n(TW units
+.if t .if \n(TW>\n(.li .tm Table at line 163 file Input is too wide - \n(TW units
 .fc  
 .nr #T 0-1
 .nr #a 0-1
--- a/jdk/src/solaris/doc/sun/man/man1/ja/xjc.1	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/solaris/doc/sun/man/man1/ja/xjc.1	Wed Jul 21 09:57:21 2010 -0700
@@ -1,4 +1,4 @@
-." Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+." Copyright (c) 2005, 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
@@ -19,8 +19,7 @@
 ." or visit www.oracle.com if you need additional information or have any
 ." questions.
 ."
-.TH xjc 1 "04 May 2009"
-." Generated from HTML by html2man (author: Eric Armstrong)
+.TH xjc 1 "02 Jun 2010"
 
 .LP
 .ad c
--- a/jdk/src/solaris/doc/sun/man/man1/jar.1	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/solaris/doc/sun/man/man1/jar.1	Wed Jul 21 09:57:21 2010 -0700
@@ -1,4 +1,4 @@
-." Copyright 2004-2006 Sun Microsystems, Inc.  All Rights Reserved.
+." Copyright (c) 1997, 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
@@ -19,8 +19,7 @@
 ." or visit www.oracle.com if you need additional information or have any
 ." questions.
 ."
-.TH jar 1 "04 May 2009"
-." Generated from HTML by html2man (author: Eric Armstrong)
+.TH jar 1 "02 Jun 2010"
 
 .LP
 .SH "Name"
@@ -183,7 +182,7 @@
 
 .LP
 .LP
-Beginning with version 1.3 of the Java 2 SDK, the \f2jar\fP utility supports 
+Beginning with version 1.3 of the JDK, the \f2jar\fP utility supports 
 .na
 \f2JarIndex\fP @
 .fi
@@ -695,6 +694,4 @@
 .br
 
 .LP
-pack200(1) 
-.LP
- 
+pack200(1)  
--- a/jdk/src/solaris/doc/sun/man/man1/jarsigner.1	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/solaris/doc/sun/man/man1/jarsigner.1	Wed Jul 21 09:57:21 2010 -0700
@@ -1,4 +1,4 @@
-." Copyright 2004-2006 Sun Microsystems, Inc.  All Rights Reserved.
+." Copyright (c) 1998, 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
@@ -19,8 +19,7 @@
 ." or visit www.oracle.com if you need additional information or have any
 ." questions.
 ."
-.TH jarsigner 1 "04 May 2009"
-." Generated from HTML by html2man (author: Eric Armstrong)
+.TH jarsigner 1 "02 Jun 2010"
 
 .LP
 .SH "Name"
@@ -246,12 +245,12 @@
 DSA (Digital Signature Algorithm) with the SHA\-1 digest algorithm, or 
 .TP 2
 o
-the RSA algorithm with the SHA\-1 digest algorithm. 
+the RSA algorithm with the SHA\-256 digest algorithm. 
 .RE
 
 .LP
 .LP
-That is, if the signer's public and private keys are DSA keys, \f3jarsigner\fP will sign the JAR file using the "SHA1withDSA" algorithm. If the signer's keys are RSA keys, \f3jarsigner\fP will attempt to sign the JAR file using the "SHA1withRSA" algorithm.
+That is, if the signer's public and private keys are DSA keys, \f3jarsigner\fP will sign the JAR file using the "SHA1withDSA" algorithm. If the signer's keys are RSA keys, \f3jarsigner\fP will attempt to sign the JAR file using the "SHA256withRSA" algorithm.
 .LP
 .LP
 These default signature algorithms can be overridden using the \f2\-sigalg\fP option.
@@ -541,7 +540,7 @@
 .na
 \f2Appendix A\fP @
 .fi
-http://java.sun.com/javase/6/docs/technotes/guides/security/crypto/CryptoSpec.html#AppA of the Java Cryptography Architecture for a list of standard signature algorithm names. This algorithm must be compatible with the private key used to sign the JAR file. If this option is not specified, SHA1withDSA or SHA1withRSA will be used depending on the type of private key. There must either be a statically installed provider supplying an implementation of the specified algorithm or the user must specify one with the \f2\-providerClass\fP option, otherwise the command will not succeed.
+http://java.sun.com/javase/6/docs/technotes/guides/security/crypto/CryptoSpec.html#AppA of the Java Cryptography Architecture for a list of standard signature algorithm names. This algorithm must be compatible with the private key used to sign the JAR file. If this option is not specified, SHA1withDSA or SHA256withRSA will be used depending on the type of private key. There must either be a statically installed provider supplying an implementation of the specified algorithm or the user must specify one with the \f2\-providerClass\fP option, otherwise the command will not succeed.
 .LP
 .RE
 .TP 3
@@ -553,7 +552,7 @@
 .na
 \f2Appendix A\fP @
 .fi
-http://java.sun.com/javase/6/docs/technotes/guides/security/crypto/CryptoSpec.html#AppA of the Java Cryptography Architecture for a list of standard message digest algorithm names. If this option is not specified, SHA\-1 will be used. There must either be a statically installed provider supplying an implementation of the specified algorithm or the user must specify one with the \f2\-providerClass\fP option, otherwise the command will not succeed.
+http://java.sun.com/javase/6/docs/technotes/guides/security/crypto/CryptoSpec.html#AppA of the Java Cryptography Architecture for a list of standard message digest algorithm names. If this option is not specified, SHA\-256 will be used. There must either be a statically installed provider supplying an implementation of the specified algorithm or the user must specify one with the \f2\-providerClass\fP option, otherwise the command will not succeed.
 .LP
 .RE
 .TP 3
@@ -1391,7 +1390,7 @@
 .nr 44 \n(83+(3*\n(38)
 .nr 84 +\n(44
 .nr TW \n(84
-.if t .if \n(TW>\n(.li .tm Table at line 1129 file Input is too wide - \n(TW units
+.if t .if \n(TW>\n(.li .tm Table at line 1128 file Input is too wide - \n(TW units
 .fc  
 .nr #T 0-1
 .nr #a 0-1
@@ -1615,7 +1614,5 @@
 .RE
 
 .LP
-
-.LP
 .RE
  
--- a/jdk/src/solaris/doc/sun/man/man1/java.1	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/solaris/doc/sun/man/man1/java.1	Wed Jul 21 09:57:21 2010 -0700
@@ -1,4 +1,4 @@
-." Copyright 2002-2006 Sun Microsystems, Inc.  All Rights Reserved.
+." Copyright (c) 1994, 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
@@ -19,8 +19,7 @@
 ." or visit www.oracle.com if you need additional information or have any
 ." questions.
 ."
-.TH java 1 "04 May 2009"
-." Generated from HTML by html2man (author: Eric Armstrong)
+.TH java 1 "02 Jun 2010"
 
 .LP
 .SH "Name"
@@ -299,19 +298,19 @@
 Disable background compilation. Normally the VM will compile the method as a background task, running the method in interpreter mode until the background compilation is finished. The \f2\-Xbatch\fP flag disables background compilation so that compilation of all methods proceeds as a foreground task until completed. 
 .TP 3
 \-Xbootclasspath:bootclasspath 
-Specify a colon\-separated list of directories, JAR archives, and ZIP archives to search for boot class files. These are used in place of the boot class files included in the Java 2 SDK. \f2Note: Applications that use this option for the purpose of overriding a class in rt.jar should not be deployed as doing so would contravene the Java 2 Runtime Environment binary code license.\fP 
+Specify a colon\-separated list of directories, JAR archives, and ZIP archives to search for boot class files. These are used in place of the boot class files included in the Java platform JDK. \f2Note: Applications that use this option for the purpose of overriding a class in rt.jar should not be deployed as doing so would contravene the Java Runtime Environment binary code license.\fP 
 .TP 3
 \-Xbootclasspath/a:path 
 Specify a colon\-separated path of directires, JAR archives, and ZIP archives to append to the default bootstrap class path. 
 .TP 3
 \-Xbootclasspath/p:path 
-Specify a colon\-separated path of directires, JAR archives, and ZIP archives to prepend in front of the default bootstrap class path. \f2Note: Applications that use this option for the purpose of overriding a class in rt.jar should not be deployed as doing so would contravene the Java 2 Runtime Environment binary code license.\fP 
+Specify a colon\-separated path of directires, JAR archives, and ZIP archives to prepend in front of the default bootstrap class path. \f2Note: Applications that use this option for the purpose of overriding a class in rt.jar should not be deployed as doing so would contravene the Java Runtime Environment binary code license.\fP 
 .TP 3
 \-Xcheck:jni 
 Perform additional checks for Java Native Interface (JNI) functions. Specifically, the Java Virtual Machine validates the parameters passed to the JNI function as well as the runtime environment data before processing the JNI request. Any invalid data encountered indicates a problem in the native code, and the Java Virtual Machine will terminate with a fatal error in such cases. Expect a performance degradation when this option is used. 
 .TP 3
 \-Xfuture 
-Perform strict class\-file format checks. For purposes of backwards compatibility, the default format checks performed by the Java 2 SDK's virtual machine are no stricter than the checks performed by 1.1.x versions of the JDK software. The \f3\-Xfuture\fP flag turns on stricter class\-file format checks that enforce closer conformance to the class\-file format specification. Developers are encouraged to use this flag when developing new code because the stricter checks will become the default in future releases of the Java application launcher. 
+Perform strict class\-file format checks. For purposes of backwards compatibility, the default format checks performed by the JDK's virtual machine are no stricter than the checks performed by 1.1.x versions of the JDK software. The \f3\-Xfuture\fP flag turns on stricter class\-file format checks that enforce closer conformance to the class\-file format specification. Developers are encouraged to use this flag when developing new code because the stricter checks will become the default in future releases of the Java application launcher. 
 .TP 3
 \-Xnoclassgc 
 Disable class garbage collection. Use of this option will prevent memory recovery from loaded classes thus increasing overall memory usage. This could cause OutOfMemoryError to be thrown in some applications. 
@@ -487,6 +486,4 @@
 .RE
 
 .LP
-
-.LP
  
--- a/jdk/src/solaris/doc/sun/man/man1/javac.1	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/solaris/doc/sun/man/man1/javac.1	Wed Jul 21 09:57:21 2010 -0700
@@ -1,4 +1,4 @@
-." Copyright 2000-2006 Sun Microsystems, Inc.  All Rights Reserved.
+." Copyright (c) 1994, 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
@@ -19,8 +19,7 @@
 ." or visit www.oracle.com if you need additional information or have any
 ." questions.
 ."
-.TH javac 1 "04 May 2009"
-." Generated from HTML by html2man (author: Eric Armstrong)
+.TH javac 1 "02 Jun 2010"
 
 .LP
 .SH "Name"
@@ -938,6 +937,4 @@
 .RE
 
 .LP
-
-.LP
  
--- a/jdk/src/solaris/doc/sun/man/man1/javadoc.1	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/solaris/doc/sun/man/man1/javadoc.1	Wed Jul 21 09:57:21 2010 -0700
@@ -1,4 +1,4 @@
-." Copyright 2002-2006 Sun Microsystems, Inc.  All Rights Reserved.
+." Copyright (c) 1994, 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
@@ -19,8 +19,7 @@
 ." or visit www.oracle.com if you need additional information or have any
 ." questions.
 ."
-.TH javadoc 1 "04 May 2009"
-." Generated from HTML by html2man (author: Eric Armstrong)
+.TH javadoc 1 "02 Jun 2010"
 .SH "Name"
 javadoc \- The Java API Documentation Generator
 .RS 3
@@ -395,7 +394,7 @@
 .nr 40 \n(79+(0*\n(38)
 .nr 80 +\n(40
 .nr TW \n(80
-.if t .if \n(TW>\n(.li .tm Table at line 353 file Input is too wide - \n(TW units
+.if t .if \n(TW>\n(.li .tm Table at line 352 file Input is too wide - \n(TW units
 .fc  
 .nr #T 0-1
 .nr #a 0-1
@@ -529,7 +528,7 @@
 .nr 40 \n(79+(0*\n(38)
 .nr 80 +\n(40
 .nr TW \n(80
-.if t .if \n(TW>\n(.li .tm Table at line 406 file Input is too wide - \n(TW units
+.if t .if \n(TW>\n(.li .tm Table at line 405 file Input is too wide - \n(TW units
 .fc  
 .nr #T 0-1
 .nr #a 0-1
@@ -1351,7 +1350,7 @@
 .nr 41 \n(80+(3*\n(38)
 .nr 81 +\n(41
 .nr TW \n(81
-.if t .if \n(TW>\n(.li .tm Table at line 1123 file Input is too wide - \n(TW units
+.if t .if \n(TW>\n(.li .tm Table at line 1122 file Input is too wide - \n(TW units
 .fc  
 .nr #T 0-1
 .nr #a 0-1
@@ -2080,7 +2079,7 @@
 .nr 40 \n(79+(0*\n(38)
 .nr 80 +\n(40
 .nr TW \n(80
-.if t .if \n(TW>\n(.li .tm Table at line 1666 file Input is too wide - \n(TW units
+.if t .if \n(TW>\n(.li .tm Table at line 1665 file Input is too wide - \n(TW units
 .fc  
 .nr #T 0-1
 .nr #a 0-1
@@ -2426,7 +2425,7 @@
 .nr 42 \n(81+(3*\n(38)
 .nr 82 +\n(42
 .nr TW \n(82
-.if t .if \n(TW>\n(.li .tm Table at line 1742 file Input is too wide - \n(TW units
+.if t .if \n(TW>\n(.li .tm Table at line 1741 file Input is too wide - \n(TW units
 .fc  
 .nr #T 0-1
 .nr #a 0-1
@@ -2829,7 +2828,7 @@
 .nr 40 \n(79+(0*\n(38)
 .nr 80 +\n(40
 .nr TW \n(80
-.if t .if \n(TW>\n(.li .tm Table at line 1963 file Input is too wide - \n(TW units
+.if t .if \n(TW>\n(.li .tm Table at line 1962 file Input is too wide - \n(TW units
 .fc  
 .nr #T 0-1
 .nr #a 0-1
@@ -2946,7 +2945,7 @@
 .nr 40 \n(79+(0*\n(38)
 .nr 80 +\n(40
 .nr TW \n(80
-.if t .if \n(TW>\n(.li .tm Table at line 1995 file Input is too wide - \n(TW units
+.if t .if \n(TW>\n(.li .tm Table at line 1994 file Input is too wide - \n(TW units
 .fc  
 .nr #T 0-1
 .nr #a 0-1
@@ -3065,7 +3064,7 @@
 .nr 40 \n(79+(0*\n(38)
 .nr 80 +\n(40
 .nr TW \n(80
-.if t .if \n(TW>\n(.li .tm Table at line 2029 file Input is too wide - \n(TW units
+.if t .if \n(TW>\n(.li .tm Table at line 2028 file Input is too wide - \n(TW units
 .fc  
 .nr #T 0-1
 .nr #a 0-1
@@ -3225,7 +3224,7 @@
 .nr 40 \n(79+(0*\n(38)
 .nr 80 +\n(40
 .nr TW \n(80
-.if t .if \n(TW>\n(.li .tm Table at line 2104 file Input is too wide - \n(TW units
+.if t .if \n(TW>\n(.li .tm Table at line 2103 file Input is too wide - \n(TW units
 .fc  
 .nr #T 0-1
 .nr #a 0-1
@@ -3369,7 +3368,7 @@
 .nr 40 \n(79+(0*\n(38)
 .nr 80 +\n(40
 .nr TW \n(80
-.if t .if \n(TW>\n(.li .tm Table at line 2163 file Input is too wide - \n(TW units
+.if t .if \n(TW>\n(.li .tm Table at line 2162 file Input is too wide - \n(TW units
 .fc  
 .nr #T 0-1
 .nr #a 0-1
@@ -3674,7 +3673,7 @@
 .nr 42 \n(81+(3*\n(38)
 .nr 82 +\n(42
 .nr TW \n(82
-.if t .if \n(TW>\n(.li .tm Table at line 2341 file Input is too wide - \n(TW units
+.if t .if \n(TW>\n(.li .tm Table at line 2340 file Input is too wide - \n(TW units
 .fc  
 .nr #T 0-1
 .nr #a 0-1
@@ -3937,7 +3936,7 @@
 .nr 41 \n(80+(3*\n(38)
 .nr 81 +\n(41
 .nr TW \n(81
-.if t .if \n(TW>\n(.li .tm Table at line 2451 file Input is too wide - \n(TW units
+.if t .if \n(TW>\n(.li .tm Table at line 2450 file Input is too wide - \n(TW units
 .fc  
 .nr #T 0-1
 .nr #a 0-1
@@ -5422,9 +5421,53 @@
 .RE
 
 .LP
+.LP
+.TS
+.if \n+(b.=1 .nr d. \n(.c-\n(c.-1
+.de 35
+.ps \n(.s
+.vs \n(.vu
+.in \n(.iu
+.if \n(.u .fi
+.if \n(.j .ad
+.if \n(.j=0 .na
+..
+.nf
+.nr #~ 0
+.if n .nr #~ 0.6n
+.ds #d .d
+.if \(ts\n(.z\(ts\(ts .ds #d nl
+.fc
+.nr 33 \n(.s
+.rm 80
+.nr 80 0
+.80
+.rm 80
+.nr 38 1n
+.nr 79 0
+.nr 40 \n(79+(0*\n(38)
+.nr 80 +\n(40
+.nr TW \n(80
+.if t .if \n(TW>\n(.li .tm Table at line 3869 file Input is too wide - \n(TW units
+.fc  
+.nr #T 0-1
+.nr #a 0-1
+.eo
+.de T#
+.ds #d .d
+.if \(ts\n(.z\(ts\(ts .ds #d nl
+.mk ##
+.nr ## -1v
+.ls 1
+.ls
+..
+.ec
+.fc
+.nr T. 1
+.T# 1
+.35
+.TE
+.if \n-(b.=0 .nr c. \n(.c-\n(d.-3
 
 .LP
-.LP
-Javadoc is a trademark of Sun Microsystems, Inc. (The \f2javadoc\fP command itself does not require the trademark symbol.)
-.LP
  
--- a/jdk/src/solaris/doc/sun/man/man1/javah.1	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/solaris/doc/sun/man/man1/javah.1	Wed Jul 21 09:57:21 2010 -0700
@@ -1,4 +1,4 @@
-." Copyright 2002-2006 Sun Microsystems, Inc.  All Rights Reserved.
+." Copyright (c) 1994, 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
@@ -19,8 +19,7 @@
 ." or visit www.oracle.com if you need additional information or have any
 ." questions.
 ."
-.TH javah 1 "04 May 2009"
-." Generated from HTML by html2man (author: Eric Armstrong)
+.TH javah 1 "02 Jun 2010"
 
 .LP
 .SH "Name"
@@ -156,6 +155,4 @@
 .LP
 javac(1), java(1), jdb(1), javap(1), javadoc(1)
 .LP
-
-.LP
  
--- a/jdk/src/solaris/doc/sun/man/man1/javap.1	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/solaris/doc/sun/man/man1/javap.1	Wed Jul 21 09:57:21 2010 -0700
@@ -1,4 +1,4 @@
-." Copyright 2002-2006 Sun Microsystems, Inc.  All Rights Reserved.
+." Copyright (c) 1994, 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
@@ -19,8 +19,7 @@
 ." or visit www.oracle.com if you need additional information or have any
 ." questions.
 ."
-.TH javap 1 "04 May 2009"
-." Generated from HTML by html2man (author: Eric Armstrong)
+.TH javap 1 "02 Jun 2010"
 
 .LP
 .SH "Name"
@@ -356,6 +355,4 @@
 .LP
 javac(1), java(1), jdb(1), javah(1), javadoc(1)
 .LP
-
-.LP
  
--- a/jdk/src/solaris/doc/sun/man/man1/javaws.1	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/solaris/doc/sun/man/man1/javaws.1	Wed Jul 21 09:57:21 2010 -0700
@@ -1,4 +1,4 @@
-." Copyright 2003-2006 Sun Microsystems, Inc.  All Rights Reserved.
+." Copyright (c) 2003, 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
@@ -19,17 +19,12 @@
 ." or visit www.oracle.com if you need additional information or have any
 ." questions.
 ."
-.TH javaws 1 "04 May 2009"
-." Generated from HTML by html2man (author: Eric Armstrong)
-
-.LP
+.TH javaws 1 "02 Jun 2010"
 
 .LP
 .SH "Name"
 \f2javaws\fP Command Line
 .LP
-
-.LP
 .LP
 \ 
 .LP
@@ -360,6 +355,4 @@
 .LP
 .RE
 .RE
-
-.LP
  
--- a/jdk/src/solaris/doc/sun/man/man1/jconsole.1	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/solaris/doc/sun/man/man1/jconsole.1	Wed Jul 21 09:57:21 2010 -0700
@@ -1,4 +1,4 @@
-." Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+." 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
@@ -19,8 +19,7 @@
 ." or visit www.oracle.com if you need additional information or have any
 ." questions.
 ."
-.TH jconsole 1 "04 May 2009"
-." Generated from HTML by html2man (author: Eric Armstrong)
+.TH jconsole 1 "02 Jun 2010"
 
 .LP
 .SH "Name"
@@ -141,6 +140,4 @@
 .RE
 
 .LP
-
-.LP
  
--- a/jdk/src/solaris/doc/sun/man/man1/jdb.1	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/solaris/doc/sun/man/man1/jdb.1	Wed Jul 21 09:57:21 2010 -0700
@@ -1,4 +1,4 @@
-." Copyright 2002-2006 Sun Microsystems, Inc.  All Rights Reserved.
+." Copyright (c) 1995, 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
@@ -19,8 +19,7 @@
 ." or visit www.oracle.com if you need additional information or have any
 ." questions.
 ."
-.TH jdb 1 "04 May 2009"
-." Generated from HTML by html2man (author: Eric Armstrong)
+.TH jdb 1 "02 Jun 2010"
 
 .LP
 .SH "Name"
@@ -364,6 +363,4 @@
 .LP
 javac(1), java(1), javah(1), javap(1), javadoc(1).
 .LP
-
-.LP
  
--- a/jdk/src/solaris/doc/sun/man/man1/jhat.1	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/solaris/doc/sun/man/man1/jhat.1	Wed Jul 21 09:57:21 2010 -0700
@@ -1,4 +1,4 @@
-." Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+." Copyright (c) 2006, 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
@@ -19,8 +19,7 @@
 ." or visit www.oracle.com if you need additional information or have any
 ." questions.
 ."
-.TH jhat 1 "04 May 2009"
-." Generated from HTML by html2man (author: Eric Armstrong)
+.TH jhat 1 "02 Jun 2010"
 
 .LP
 .SH "Name"
--- a/jdk/src/solaris/doc/sun/man/man1/jinfo.1	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/solaris/doc/sun/man/man1/jinfo.1	Wed Jul 21 09:57:21 2010 -0700
@@ -1,4 +1,4 @@
-." Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+." 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
@@ -19,8 +19,7 @@
 ." or visit www.oracle.com if you need additional information or have any
 ." questions.
 ."
-.TH jinfo 1 "04 May 2009"
-." Generated from HTML by html2man (author: Eric Armstrong)
+.TH jinfo 1 "02 Jun 2010"
 
 .LP
 .SH "Name"
@@ -148,6 +147,4 @@
 .RE
 
 .LP
-
-.LP
  
--- a/jdk/src/solaris/doc/sun/man/man1/jmap.1	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/solaris/doc/sun/man/man1/jmap.1	Wed Jul 21 09:57:21 2010 -0700
@@ -1,4 +1,4 @@
-." Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+." 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
@@ -19,8 +19,7 @@
 ." or visit www.oracle.com if you need additional information or have any
 ." questions.
 ."
-.TH jmap 1 "04 May 2009"
-." Generated from HTML by html2man (author: Eric Armstrong)
+.TH jmap 1 "02 Jun 2010"
 
 .LP
 .SH "Name"
@@ -168,6 +167,4 @@
 .RE
 
 .LP
-
-.LP
  
--- a/jdk/src/solaris/doc/sun/man/man1/jps.1	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/solaris/doc/sun/man/man1/jps.1	Wed Jul 21 09:57:21 2010 -0700
@@ -1,4 +1,4 @@
-." Copyright 2003 Sun Microsystems, Inc.  All Rights Reserved.
+." 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
@@ -19,8 +19,7 @@
 ." or visit www.oracle.com if you need additional information or have any
 ." questions.
 ."
-.TH jps 1 "04 May 2009"
-." Generated from HTML by html2man (author: Eric Armstrong)
+.TH jps 1 "02 Jun 2010"
 
 .LP
 .SH "Name"
@@ -264,6 +263,4 @@
 .RE
 
 .LP
-
-.LP
  
--- a/jdk/src/solaris/doc/sun/man/man1/jrunscript.1	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/solaris/doc/sun/man/man1/jrunscript.1	Wed Jul 21 09:57:21 2010 -0700
@@ -1,4 +1,4 @@
-." Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+." Copyright (c) 2006, 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
@@ -19,8 +19,7 @@
 ." or visit www.oracle.com if you need additional information or have any
 ." questions.
 ."
-.TH jrunscript 1 "04 May 2009"
-." Generated from HTML by html2man (author: Eric Armstrong)
+.TH jrunscript 1 "02 Jun 2010"
 
 .LP
 .SH "Name"
@@ -195,6 +194,4 @@
 .LP
 If JavaScript is used, then before evaluating any user defined script, jrunscript initializes certain built\-in functions and objects. These JavaScript built\-ins are documented in jsdocs.
 .LP
-
-.LP
  
--- a/jdk/src/solaris/doc/sun/man/man1/jsadebugd.1	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/solaris/doc/sun/man/man1/jsadebugd.1	Wed Jul 21 09:57:21 2010 -0700
@@ -1,4 +1,4 @@
-." Copyright 2004 Sun Microsystems, Inc.  All Rights Reserved.
+." 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
@@ -19,8 +19,7 @@
 ." or visit www.oracle.com if you need additional information or have any
 ." questions.
 ."
-.TH jsadebugd 1 "04 May 2009"
-." Generated from HTML by html2man (author: Eric Armstrong)
+.TH jsadebugd 1 "02 Jun 2010"
 
 .LP
 .SH "Name"
@@ -134,6 +133,4 @@
 .RE
 
 .LP
-
-.LP
  
--- a/jdk/src/solaris/doc/sun/man/man1/jstack.1	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/solaris/doc/sun/man/man1/jstack.1	Wed Jul 21 09:57:21 2010 -0700
@@ -1,4 +1,4 @@
-." Copyright 2004 Sun Microsystems, Inc.  All Rights Reserved.
+." 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
@@ -19,8 +19,7 @@
 ." or visit www.oracle.com if you need additional information or have any
 ." questions.
 ."
-.TH jstack 1 "04 May 2009"
-." Generated from HTML by html2man (author: Eric Armstrong)
+.TH jstack 1 "02 Jun 2010"
 
 .LP
 .SH "Name"
@@ -160,6 +159,4 @@
 .LP
 Mixed mode stack trace, the \-m option, does not work with the remote debug server.
 .LP
-
-.LP
  
--- a/jdk/src/solaris/doc/sun/man/man1/jstat.1	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/solaris/doc/sun/man/man1/jstat.1	Wed Jul 21 09:57:21 2010 -0700
@@ -1,4 +1,4 @@
-." Copyright 2003 Sun Microsystems, Inc.  All Rights Reserved.
+." 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
@@ -19,8 +19,7 @@
 ." or visit www.oracle.com if you need additional information or have any
 ." questions.
 ."
-.TH jstat 1 "04 May 2009"
-." Generated from HTML by html2man (author: Eric Armstrong)
+.TH jstat 1 "02 Jun 2010"
 
 .LP
 .SH "Name"
@@ -458,7 +457,7 @@
 .nr 41 \n(80+(3*\n(38)
 .nr 81 +\n(41
 .nr TW \n(81
-.if t .if \n(TW>\n(.li .tm Table at line 231 file Input is too wide - \n(TW units
+.if t .if \n(TW>\n(.li .tm Table at line 230 file Input is too wide - \n(TW units
 .fc  
 .nr #T 0-1
 .nr #a 0-1
@@ -826,7 +825,7 @@
 .nr 41 \n(80+(3*\n(38)
 .nr 81 +\n(41
 .nr TW \n(81
-.if t .if \n(TW>\n(.li .tm Table at line 281 file Input is too wide - \n(TW units
+.if t .if \n(TW>\n(.li .tm Table at line 280 file Input is too wide - \n(TW units
 .fc  
 .nr #T 0-1
 .nr #a 0-1
@@ -1083,7 +1082,7 @@
 .nr 41 \n(80+(3*\n(38)
 .nr 81 +\n(41
 .nr TW \n(81
-.if t .if \n(TW>\n(.li .tm Table at line 317 file Input is too wide - \n(TW units
+.if t .if \n(TW>\n(.li .tm Table at line 316 file Input is too wide - \n(TW units
 .fc  
 .nr #T 0-1
 .nr #a 0-1
@@ -1547,7 +1546,7 @@
 .nr 41 \n(80+(3*\n(38)
 .nr 81 +\n(41
 .nr TW \n(81
-.if t .if \n(TW>\n(.li .tm Table at line 387 file Input is too wide - \n(TW units
+.if t .if \n(TW>\n(.li .tm Table at line 386 file Input is too wide - \n(TW units
 .fc  
 .nr #T 0-1
 .nr #a 0-1
@@ -2171,7 +2170,7 @@
 .nr 41 \n(80+(3*\n(38)
 .nr 81 +\n(41
 .nr TW \n(81
-.if t .if \n(TW>\n(.li .tm Table at line 461 file Input is too wide - \n(TW units
+.if t .if \n(TW>\n(.li .tm Table at line 460 file Input is too wide - \n(TW units
 .fc  
 .nr #T 0-1
 .nr #a 0-1
@@ -2551,7 +2550,7 @@
 .nr 41 \n(80+(3*\n(38)
 .nr 81 +\n(41
 .nr TW \n(81
-.if t .if \n(TW>\n(.li .tm Table at line 484 file Input is too wide - \n(TW units
+.if t .if \n(TW>\n(.li .tm Table at line 483 file Input is too wide - \n(TW units
 .fc  
 .nr #T 0-1
 .nr #a 0-1
@@ -2867,7 +2866,7 @@
 .nr 41 \n(80+(3*\n(38)
 .nr 81 +\n(41
 .nr TW \n(81
-.if t .if \n(TW>\n(.li .tm Table at line 538 file Input is too wide - \n(TW units
+.if t .if \n(TW>\n(.li .tm Table at line 537 file Input is too wide - \n(TW units
 .fc  
 .nr #T 0-1
 .nr #a 0-1
@@ -3322,7 +3321,7 @@
 .nr 41 \n(80+(3*\n(38)
 .nr 81 +\n(41
 .nr TW \n(81
-.if t .if \n(TW>\n(.li .tm Table at line 594 file Input is too wide - \n(TW units
+.if t .if \n(TW>\n(.li .tm Table at line 593 file Input is too wide - \n(TW units
 .fc  
 .nr #T 0-1
 .nr #a 0-1
@@ -3718,7 +3717,7 @@
 .nr 41 \n(80+(3*\n(38)
 .nr 81 +\n(41
 .nr TW \n(81
-.if t .if \n(TW>\n(.li .tm Table at line 636 file Input is too wide - \n(TW units
+.if t .if \n(TW>\n(.li .tm Table at line 635 file Input is too wide - \n(TW units
 .fc  
 .nr #T 0-1
 .nr #a 0-1
@@ -4063,7 +4062,7 @@
 .nr 41 \n(80+(3*\n(38)
 .nr 81 +\n(41
 .nr TW \n(81
-.if t .if \n(TW>\n(.li .tm Table at line 678 file Input is too wide - \n(TW units
+.if t .if \n(TW>\n(.li .tm Table at line 677 file Input is too wide - \n(TW units
 .fc  
 .nr #T 0-1
 .nr #a 0-1
@@ -4408,7 +4407,7 @@
 .nr 41 \n(80+(3*\n(38)
 .nr 81 +\n(41
 .nr TW \n(81
-.if t .if \n(TW>\n(.li .tm Table at line 720 file Input is too wide - \n(TW units
+.if t .if \n(TW>\n(.li .tm Table at line 719 file Input is too wide - \n(TW units
 .fc  
 .nr #T 0-1
 .nr #a 0-1
@@ -4793,7 +4792,7 @@
 .nr 41 \n(80+(3*\n(38)
 .nr 81 +\n(41
 .nr TW \n(81
-.if t .if \n(TW>\n(.li .tm Table at line 770 file Input is too wide - \n(TW units
+.if t .if \n(TW>\n(.li .tm Table at line 769 file Input is too wide - \n(TW units
 .fc  
 .nr #T 0-1
 .nr #a 0-1
@@ -5092,7 +5091,7 @@
 .nr 41 \n(80+(3*\n(38)
 .nr 81 +\n(41
 .nr TW \n(81
-.if t .if \n(TW>\n(.li .tm Table at line 796 file Input is too wide - \n(TW units
+.if t .if \n(TW>\n(.li .tm Table at line 795 file Input is too wide - \n(TW units
 .fc  
 .nr #T 0-1
 .nr #a 0-1
@@ -5375,6 +5374,4 @@
 .RE
 
 .LP
-
-.LP
  
--- a/jdk/src/solaris/doc/sun/man/man1/jstatd.1	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/solaris/doc/sun/man/man1/jstatd.1	Wed Jul 21 09:57:21 2010 -0700
@@ -1,4 +1,4 @@
-." Copyright 2003 Sun Microsystems, Inc.  All Rights Reserved.
+." 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
@@ -19,8 +19,7 @@
 ." or visit www.oracle.com if you need additional information or have any
 ." questions.
 ."
-.TH jstatd 1 "04 May 2009"
-." Generated from HTML by html2man (author: Eric Armstrong)
+.TH jstatd 1 "02 Jun 2010"
 
 .LP
 .SH "Name"
@@ -269,6 +268,4 @@
 .RE
 
 .LP
-
-.LP
  
--- a/jdk/src/solaris/doc/sun/man/man1/keytool.1	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/solaris/doc/sun/man/man1/keytool.1	Wed Jul 21 09:57:21 2010 -0700
@@ -1,4 +1,4 @@
-." Copyright 2002-2006 Sun Microsystems, Inc.  All Rights Reserved.
+." Copyright (c) 1998, 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
@@ -19,8 +19,7 @@
 ." or visit www.oracle.com if you need additional information or have any
 ." questions.
 ."
-.TH keytool 1 "04 May 2009"
-." Generated from HTML by html2man (author: Eric Armstrong)
+.TH keytool 1 "02 Jun 2010"
 
 .LP
 .SH "Name"
@@ -150,7 +149,9 @@
 .fl
 \-keysize
 .fl
-    1024 (when using \fP\f3\-genkeypair\fP\f3)
+    2048 (when using \fP\f3\-genkeypair\fP\f3 and \-keyalg is "RSA")
+.fl
+    1024 (when using \fP\f3\-genkeypair\fP\f3 and \-keyalg is "DSA")
 .fl
     56 (when using \fP\f3\-genseckey\fP\f3 and \-keyalg is "DES")
 .fl
@@ -186,7 +187,7 @@
 .fi
 
 .LP
-In generating a public/private key pair, the signature algorithm (\f2\-sigalg\fP option) is derived from the algorithm of the underlying private key: If the underlying private key is of type "DSA", the \f2\-sigalg\fP option defaults to "SHA1withDSA", and if the underlying private key is of type "RSA", \f2\-sigalg\fP defaults to "SHA1withRSA". Please consult the 
+In generating a public/private key pair, the signature algorithm (\f2\-sigalg\fP option) is derived from the algorithm of the underlying private key: If the underlying private key is of type "DSA", the \f2\-sigalg\fP option defaults to "SHA1withDSA", and if the underlying private key is of type "RSA", \f2\-sigalg\fP defaults to "SHA256withRSA". Please consult the 
 .na
 \f2Java Cryptography Architecture API Specification & Reference\fP @
 .fi
@@ -477,7 +478,7 @@
 .nr 41 \n(80+(3*\n(38)
 .nr 81 +\n(41
 .nr TW \n(81
-.if t .if \n(TW>\n(.li .tm Table at line 288 file Input is too wide - \n(TW units
+.if t .if \n(TW>\n(.li .tm Table at line 289 file Input is too wide - \n(TW units
 .fc  
 .nr #T 0-1
 .nr #a 0-1
@@ -664,6 +665,9 @@
 .LP
 The subjectKeyIdentifier extension is always created. For non self\-signed certificates, the authorityKeyIdentifier is always created.
 .LP
+.LP
+\f3Note:\fP Users should be aware that some combinations of extensions (and other certificate fields) may not conform to the Internet standard. See Warning Regarding Certificate Conformance for details.
+.LP
 .RE
 .RE
 .RE
@@ -679,12 +683,14 @@
 .LP
 .RS 3
 .TP 3
-\-gencert {\-infile infile} {\-outfile outfile} {\-ext ext}* {\-rfc} {\-alias alias} {\-sigalg sigalg} {\-validity valDays} {\-storetype storetype} {\-keystore keystore} [\-storepass storepass] [\-keypass keypass] {\-providerClass provider_class_name {\-providerArg provider_arg}} {\-v} {\-protected} {\-Jjavaoption} 
+\-gencert {\-infile infile} {\-outfile outfile} {\-dname dname} {\-ext ext}* {\-rfc} {\-alias alias} {\-sigalg sigalg} {\-validity valDays} {\-storetype storetype} {\-keystore keystore} [\-storepass storepass] [\-keypass keypass] {\-providerClass provider_class_name {\-providerArg provider_arg}} {\-v} {\-protected} {\-Jjavaoption} 
 .LP
 Generates a certificate as a response to a certificate request file (which can be created by the \f2keytool \-certreq\fP command). The command reads the request from infile (if omitted, from the standard input), signs it using alias's private key, and output the X.509 certificate into outfile (if omitted, to the standard output). If \f2\-rfc\fP is specified, output format is BASE64\-encoded PEM; otherwise, a binary DER is created. 
 .LP
 \f2sigalg\fP specifies the algorithm that should be used to sign the certificate. valDays tells the number of days for which the certificate should be considered valid. 
 .LP
+If \f2dname\fP is provided, it's used as the subject of the generated certificate. Otherwise, the one from the certificate request is used. 
+.LP
 \f2ext\fP shows what X.509 extensions will be embedded in the certificate. Read Common Options for the grammar of \f2\-ext\fP.  
 .TP 3
 \-genkeypair {\-alias alias} {\-keyalg keyalg} {\-keysize keysize} {\-sigalg sigalg} [\-dname dname] [\-keypass keypass] {\-startdate value} {\-validity valDays} {\-storetype storetype} {\-keystore keystore} [\-storepass storepass] {\-providerClass provider_class_name {\-providerArg provider_arg}} {\-v} {\-protected} {\-Jjavaoption} 
@@ -845,13 +851,13 @@
 .LP
 .RS 3
 .TP 3
-\-certreq {\-alias alias} {\-sigalg sigalg} {\-file certreq_file} [\-keypass keypass] {\-storetype storetype} {\-keystore keystore} [\-storepass storepass] {\-providerName provider_name} {\-providerClass provider_class_name {\-providerArg provider_arg}} {\-v} {\-protected} {\-Jjavaoption} 
+\-certreq {\-alias alias} {\-dname dname} {\-sigalg sigalg} {\-file certreq_file} [\-keypass keypass] {\-storetype storetype} {\-keystore keystore} [\-storepass storepass] {\-providerName provider_name} {\-providerClass provider_class_name {\-providerArg provider_arg}} {\-v} {\-protected} {\-Jjavaoption} 
 .LP
 Generates a Certificate Signing Request (CSR), using the PKCS#10 format. 
 .LP
 A CSR is intended to be sent to a certificate authority (CA). The CA will authenticate the certificate requestor (usually off\-line) and will return a certificate or certificate chain, used to replace the existing certificate chain (which initially consists of a self\-signed certificate) in the keystore. 
 .LP
-The private key and X.500 Distinguished Name associated with \f2alias\fP are used to create the PKCS#10 certificate request. In order to access the private key, the appropriate password must be provided, since private keys are protected in the keystore with a password. If \f2keypass\fP is not provided at the command line, and is different from the password used to protect the integrity of the keystore, the user is prompted for it. 
+The private key associated with \f2alias\fP is used to create the PKCS#10 certificate request. In order to access the private key, the appropriate password must be provided, since private keys are protected in the keystore with a password. If \f2keypass\fP is not provided at the command line, and is different from the password used to protect the integrity of the keystore, the user is prompted for it. If dname is provided, it's used as the subject in the CSR. Otherwise, the X.500 Distinguished Name associated with alias is used. 
 .LP
 \f2sigalg\fP specifies the algorithm that should be used to sign the CSR. 
 .LP
@@ -2069,6 +2075,10 @@
 .fl
          SHA1: 20:B6:17:FA:EF:E5:55:8A:D0:71:1F:E8:D6:9D:C0:37:13:0E:5E:FE
 .fl
+         SHA256: 90:7B:70:0A:EA:DC:16:79:92:99:41:FF:8A:FE:EB:90:
+.fl
+                 17:75:E0:90:B2:24:4D:3A:2A:16:A6:E4:11:0F:67:A4
+.fl
 \fP
 .fi
 
@@ -2094,6 +2104,20 @@
 If you don't specify a required password option on a command line, you will be prompted for it.
 .LP
 .RE
+.SS 
+Warning Regarding Certificate Conformance
+.LP
+.RS 3
+
+.LP
+.LP
+The Internet standard 
+.na
+\f2RFC 5280\fP @
+.fi
+http://tools.ietf.org/rfc/rfc5280.txt has defined a profile on conforming X.509 certificates, which includes what values and value combinations are valid for certificate fields and extensions. \f3keytool\fP has not enforced all these rules so it can generate certificates which do not conform to the standard, and these certificates might be rejected by JRE or other applications. Users should make sure that they provide the correct options for \f2\-dname\fP, \f2\-ext\fP, etc.
+.LP
+.RE
 .SH "SEE ALSO"
 .LP
 
@@ -2176,6 +2200,4 @@
 .RE
 
 .LP
-
-.LP
  
--- a/jdk/src/solaris/doc/sun/man/man1/native2ascii.1	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/solaris/doc/sun/man/man1/native2ascii.1	Wed Jul 21 09:57:21 2010 -0700
@@ -1,4 +1,4 @@
-." Copyright 2002-2006 Sun Microsystems, Inc.  All Rights Reserved.
+." Copyright (c) 1997, 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
@@ -19,8 +19,7 @@
 ." or visit www.oracle.com if you need additional information or have any
 ." questions.
 ."
-.TH native2ascii 1 "04 May 2009"
-." Generated from HTML by html2man (author: Eric Armstrong)
+.TH native2ascii 1 "02 Jun 2010"
 
 .LP
 .SH "Name"
@@ -78,6 +77,4 @@
 .RE
 
 .LP
-
-.LP
  
--- a/jdk/src/solaris/doc/sun/man/man1/orbd.1	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/solaris/doc/sun/man/man1/orbd.1	Wed Jul 21 09:57:21 2010 -0700
@@ -1,4 +1,4 @@
-." Copyright 2001-2006 Sun Microsystems, Inc.  All Rights Reserved.
+." Copyright (c) 2001, 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
@@ -19,8 +19,7 @@
 ." or visit www.oracle.com if you need additional information or have any
 ." questions.
 ."
-.TH orbd 1 "04 May 2009"
-." Generated from HTML by html2man (author: Eric Armstrong)
+.TH orbd 1 "02 Jun 2010"
 
 .LP
 .SH "Name"
@@ -374,6 +373,4 @@
 .br
 
 .LP
-
-.LP
  
--- a/jdk/src/solaris/doc/sun/man/man1/pack200.1	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/solaris/doc/sun/man/man1/pack200.1	Wed Jul 21 09:57:21 2010 -0700
@@ -1,4 +1,4 @@
-." Copyright 2004-2006 Sun Microsystems, Inc.  All Rights Reserved.
+." 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
@@ -19,8 +19,7 @@
 ." or visit www.oracle.com if you need additional information or have any
 ." questions.
 ."
-.TH pack200 1 "04 May 2009"
-." Generated from HTML by html2man (author: Eric Armstrong)
+.TH pack200 1 "02 Jun 2010"
 
 .LP
 .SH "Name"
@@ -422,6 +421,4 @@
 .LP
 The Java SE API Specification provided with the JDK is the superseding authority, in case of discrepancies.
 .LP
-
-.LP
  
--- a/jdk/src/solaris/doc/sun/man/man1/policytool.1	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/solaris/doc/sun/man/man1/policytool.1	Wed Jul 21 09:57:21 2010 -0700
@@ -1,4 +1,4 @@
-." Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+." Copyright (c) 2001, 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
@@ -19,8 +19,7 @@
 ." or visit www.oracle.com if you need additional information or have any
 ." questions.
 ."
-.TH policytool 1 "04 May 2009"
-." Generated from HTML by html2man (author: Eric Armstrong)
+.TH policytool 1 "02 Jun 2010"
 
 .LP
 .SH "Name"
@@ -89,6 +88,4 @@
 .RE
 
 .LP
-
-.LP
  
--- a/jdk/src/solaris/doc/sun/man/man1/rmic.1	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/solaris/doc/sun/man/man1/rmic.1	Wed Jul 21 09:57:21 2010 -0700
@@ -1,4 +1,4 @@
-." Copyright 2004-2006 Sun Microsystems, Inc.  All Rights Reserved.
+." Copyright (c) 1997, 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
@@ -19,8 +19,7 @@
 ." or visit www.oracle.com if you need additional information or have any
 ." questions.
 ."
-.TH rmic 1 "04 May 2009"
-." Generated from HTML by html2man (author: Eric Armstrong)
+.TH rmic 1 "02 Jun 2010"
 
 .LP
 .SH "Name"
@@ -266,6 +265,4 @@
 .fi
 http://java.sun.com/javase/6/docs/technotes/tools/index.html#classpath
 .LP
-
-.LP
  
--- a/jdk/src/solaris/doc/sun/man/man1/rmid.1	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/solaris/doc/sun/man/man1/rmid.1	Wed Jul 21 09:57:21 2010 -0700
@@ -1,4 +1,4 @@
-." Copyright 2004-2006 Sun Microsystems, Inc.  All Rights Reserved.
+." Copyright (c) 1998, 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
@@ -19,8 +19,7 @@
 ." or visit www.oracle.com if you need additional information or have any
 ." questions.
 ."
-.TH rmid 1 "04 May 2009"
-." Generated from HTML by html2man (author: Eric Armstrong)
+.TH rmid 1 "02 Jun 2010"
 
 .LP
 .SH "Name"
@@ -348,6 +347,4 @@
 .fi
 http://java.sun.com/javase/6/docs/technotes/tools/index.html#classpath, java(1)
 .LP
-
-.LP
  
--- a/jdk/src/solaris/doc/sun/man/man1/rmiregistry.1	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/solaris/doc/sun/man/man1/rmiregistry.1	Wed Jul 21 09:57:21 2010 -0700
@@ -1,4 +1,4 @@
-." Copyright 2003-2006 Sun Microsystems, Inc.  All Rights Reserved.
+." Copyright (c) 1997, 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
@@ -19,8 +19,7 @@
 ." or visit www.oracle.com if you need additional information or have any
 ." questions.
 ."
-.TH rmiregistry 1 "04 May 2009"
-." Generated from HTML by html2man (author: Eric Armstrong)
+.TH rmiregistry 1 "02 Jun 2010"
 
 .LP
 .SH "Name"
@@ -94,6 +93,4 @@
 .fi
 http://java.sun.com/javase/6/docs/api/java/rmi/Naming.html
 .LP
-
-.LP
  
--- a/jdk/src/solaris/doc/sun/man/man1/schemagen.1	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/solaris/doc/sun/man/man1/schemagen.1	Wed Jul 21 09:57:21 2010 -0700
@@ -1,4 +1,4 @@
-." Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+." Copyright (c) 2005, 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
@@ -19,8 +19,7 @@
 ." or visit www.oracle.com if you need additional information or have any
 ." questions.
 ."
-.TH schemagen 1 "04 May 2009"
-." Generated from HTML by html2man (author: Eric Armstrong)
+.TH schemagen 1 "02 Jun 2010"
 
 .LP
 .SH "Name"
@@ -129,6 +128,4 @@
 .RE
 
 .LP
-
-.LP
  
--- a/jdk/src/solaris/doc/sun/man/man1/serialver.1	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/solaris/doc/sun/man/man1/serialver.1	Wed Jul 21 09:57:21 2010 -0700
@@ -1,4 +1,4 @@
-." Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+." Copyright (c) 1997, 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
@@ -19,8 +19,7 @@
 ." or visit www.oracle.com if you need additional information or have any
 ." questions.
 ."
-.TH serialver 1 "04 May 2009"
-." Generated from HTML by html2man (author: Eric Armstrong)
+.TH serialver 1 "02 Jun 2010"
 
 .LP
 .SH "Name"
@@ -121,6 +120,4 @@
 .fi
 http://java.sun.com/javase/6/docs/api/java/io/ObjectStreamClass.html
 .LP
-
-.LP
  
--- a/jdk/src/solaris/doc/sun/man/man1/servertool.1	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/solaris/doc/sun/man/man1/servertool.1	Wed Jul 21 09:57:21 2010 -0700
@@ -1,4 +1,4 @@
-." Copyright 2001-2006 Sun Microsystems, Inc.  All Rights Reserved.
+." Copyright (c) 2001, 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
@@ -19,8 +19,7 @@
 ." or visit www.oracle.com if you need additional information or have any
 ." questions.
 ."
-.TH servertool 1 "04 May 2009"
-." Generated from HTML by html2man (author: Eric Armstrong)
+.TH servertool 1 "02 Jun 2010"
 
 .LP
 .SH "Name"
@@ -125,6 +124,4 @@
 .LP
 
 .LP
-orbd(1) 
-.LP
- 
+orbd(1)  
--- a/jdk/src/solaris/doc/sun/man/man1/tnameserv.1	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/solaris/doc/sun/man/man1/tnameserv.1	Wed Jul 21 09:57:21 2010 -0700
@@ -1,4 +1,4 @@
-." Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+." Copyright (c) 1999, 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
@@ -19,15 +19,12 @@
 ." or visit www.oracle.com if you need additional information or have any
 ." questions.
 ."
-.TH tnameserv 1 "04 May 2009"
-." Generated from HTML by html2man (author: Eric Armstrong)
+.TH tnameserv 1 "02 Jun 2010"
 
 .LP
 .SH "Name"
 Java IDL: Transient Naming Service \- \f2tnameserv\fP
 .LP
-
-.LP
 .LP
 This document discusses using the Java IDL Transient Naming Service, \f2tnameserv\fP. Java IDL also includes the Object Request Broker Daemon (ORBD). ORBD is a daemon process containing a Bootstrap Service, a Transient Naming Service, a \f3Persistent\fP Naming Service, and a Server Manager. The Java IDL tutorials all use ORBD, however, you can substitute \f2tnameserv\fP for \f2orbd\fP in any of the examples that use a Transient Naming Service. For documentation on the \f2orbd\fP tool, link to its orbd(1) or the 
 .na
@@ -499,6 +496,4 @@
 .fi
 
 .LP
-
-.LP
  
--- a/jdk/src/solaris/doc/sun/man/man1/unpack200.1	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/solaris/doc/sun/man/man1/unpack200.1	Wed Jul 21 09:57:21 2010 -0700
@@ -1,4 +1,4 @@
-." Copyright 2004-2006 Sun Microsystems, Inc.  All Rights Reserved.
+." 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
@@ -19,8 +19,7 @@
 ." or visit www.oracle.com if you need additional information or have any
 ." questions.
 ."
-.TH unpack200 1 "04 May 2009"
-." Generated from HTML by html2man (author: Eric Armstrong)
+.TH unpack200 1 "02 Jun 2010"
 
 .LP
 .SH "Name"
@@ -190,6 +189,4 @@
 .LP
 The Java SE API Specification provided with the JDK is the superseding authority, in case of discrepancies.
 .LP
-
-.LP
  
--- a/jdk/src/solaris/doc/sun/man/man1/wsgen.1	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/solaris/doc/sun/man/man1/wsgen.1	Wed Jul 21 09:57:21 2010 -0700
@@ -1,4 +1,4 @@
-." Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+." Copyright (c) 2005, 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
@@ -19,8 +19,7 @@
 ." or visit www.oracle.com if you need additional information or have any
 ." questions.
 ."
-.TH wsgen 1 "04 May 2009"
-." Generated from HTML by html2man (author: Eric Armstrong)
+.TH wsgen 1 "02 Jun 2010"
 .SH "Name"
 wsgen \- Java(TM) API for XML Web Services (JAX\-WS) 2.0
 .RS 3
@@ -355,7 +354,7 @@
 .nr 41 \n(80+(3*\n(38)
 .nr 81 +\n(41
 .nr TW \n(81
-.if t .if \n(TW>\n(.li .tm Table at line 140 file Input is too wide - \n(TW units
+.if t .if \n(TW>\n(.li .tm Table at line 139 file Input is too wide - \n(TW units
 .fc  
 .nr #T 0-1
 .nr #a 0-1
--- a/jdk/src/solaris/doc/sun/man/man1/wsimport.1	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/solaris/doc/sun/man/man1/wsimport.1	Wed Jul 21 09:57:21 2010 -0700
@@ -1,4 +1,4 @@
-." Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
+." Copyright (c) 2005, 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
@@ -19,8 +19,7 @@
 ." or visit www.oracle.com if you need additional information or have any
 ." questions.
 ."
-.TH wsimport 1 "04 May 2009"
-." Generated from HTML by html2man (author: Eric Armstrong)
+.TH wsimport 1 "02 Jun 2010"
 .SH "Name"
 wsimport \- Java(TM) API for XML Web Services (JAX\-WS) 2.0
 .LP
@@ -419,7 +418,7 @@
 .nr 41 \n(80+(3*\n(38)
 .nr 81 +\n(41
 .nr TW \n(81
-.if t .if \n(TW>\n(.li .tm Table at line 158 file Input is too wide - \n(TW units
+.if t .if \n(TW>\n(.li .tm Table at line 157 file Input is too wide - \n(TW units
 .fc  
 .nr #T 0-1
 .nr #a 0-1
--- a/jdk/src/solaris/doc/sun/man/man1/xjc.1	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/solaris/doc/sun/man/man1/xjc.1	Wed Jul 21 09:57:21 2010 -0700
@@ -1,4 +1,4 @@
-." Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
+." Copyright (c) 2005, 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
@@ -19,8 +19,7 @@
 ." or visit www.oracle.com if you need additional information or have any
 ." questions.
 ."
-.TH xjc 1 "04 May 2009"
-." Generated from HTML by html2man (author: Eric Armstrong)
+.TH xjc 1 "02 Jun 2010"
 
 .LP
 .ad c
@@ -285,6 +284,4 @@
 .RE
 
 .LP
-
-.LP
  
--- a/jdk/src/solaris/native/java/net/NetworkInterface.c	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/solaris/native/java/net/NetworkInterface.c	Wed Jul 21 09:57:21 2010 -0700
@@ -23,6 +23,7 @@
  * questions.
  */
 
+
 #include <errno.h>
 #include <strings.h>
 #include <netinet/in.h>
@@ -33,23 +34,23 @@
 #include <arpa/inet.h>
 #include <net/if.h>
 #include <net/if_arp.h>
+
 #ifdef __solaris__
 #include <sys/dlpi.h>
 #include <fcntl.h>
 #include <stropts.h>
+#include <sys/sockio.h>
 #endif
+
 #ifdef __linux__
 #include <sys/ioctl.h>
 #include <bits/ioctls.h>
 #include <linux/sockios.h>
 #include <sys/utsname.h>
 #include <stdio.h>
-#else
-#include <sys/sockio.h>
 #endif
 
 #ifdef __linux__
-#define ifr_index ifr_ifindex
 #define _PATH_PROCNET_IFINET6           "/proc/net/if_inet6"
 #endif
 
@@ -108,20 +109,41 @@
 static jfieldID ni_ib4broadcastID;
 static jfieldID ni_ib4maskID;
 
+/** Private methods declarations **/
 static jobject createNetworkInterface(JNIEnv *env, netif *ifs);
+static int     getFlags0(JNIEnv *env, jstring  ifname);
 
-static netif *enumInterfaces(JNIEnv *env);
-static netif *enumIPv4Interfaces(JNIEnv *env, netif *ifs);
+static netif  *enumInterfaces(JNIEnv *env);
+static netif  *enumIPv4Interfaces(JNIEnv *env, int sock, netif *ifs);
+
 #ifdef AF_INET6
-static netif *enumIPv6Interfaces(JNIEnv *env, netif *ifs);
+static netif  *enumIPv6Interfaces(JNIEnv *env, int sock, netif *ifs);
 #endif
 
-static netif *addif(JNIEnv *env, netif *ifs, char *if_name, int index,
-                    int family, struct sockaddr *new_addrP, int new_addrlen,
-                    short prefix);
-static void freeif(netif *ifs);
-static struct sockaddr *getBroadcast(JNIEnv *env, const char *ifname);
-static short getSubnet(JNIEnv *env, const char *ifname);
+static netif  *addif(JNIEnv *env, int sock, const char * if_name, netif *ifs, struct sockaddr* ifr_addrP, int family, short prefix);
+static void    freeif(netif *ifs);
+
+static int     openSocket(JNIEnv *env, int proto);
+static int     openSocketWithFallback(JNIEnv *env, const char *ifname);
+
+
+static struct  sockaddr *getBroadcast(JNIEnv *env, int sock, const char *name, struct sockaddr *brdcast_store);
+static short   getSubnet(JNIEnv *env, int sock, const char *ifname);
+static int     getIndex(int sock, const char *ifname);
+
+static int     getFlags(JNIEnv *env, int sock, const char *ifname);
+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);
+
+
+
+#ifdef __solaris__
+static netif *enumIPvXInterfaces(JNIEnv *env, int sock, netif *ifs, int family);
+static int    getMacFromDevice(JNIEnv *env, const char* ifname, unsigned char* retbuf);
+#endif
+
+
+/******************* Java entry points *****************************/
 
 /*
  * Class:     java_net_NetworkInterface
@@ -172,7 +194,7 @@
 
     netif *ifs, *curr;
     jboolean isCopy;
-    const char* name_utf = (*env)->GetStringUTFChars(env, name, &isCopy);
+    const char* name_utf;
     jobject obj = NULL;
 
     ifs = enumInterfaces(env);
@@ -180,6 +202,8 @@
         return NULL;
     }
 
+    name_utf = (*env)->GetStringUTFChars(env, name, &isCopy);
+
     /*
      * Search the list of interface based on name
      */
@@ -253,12 +277,13 @@
     (JNIEnv *env, jclass cls, jobject iaObj) {
 
     netif *ifs, *curr;
+
 #ifdef AF_INET6
-    int family = (*env)->GetIntField(env, iaObj, ni_iafamilyID) == IPv4?
-        AF_INET : AF_INET6;
+    int family = (  (*env)->GetIntField(env, iaObj, ni_iafamilyID) == IPv4 ) ? AF_INET : AF_INET6;
 #else
-    int family = AF_INET;
+    int family =  AF_INET;
 #endif
+
     jobject obj = NULL;
     jboolean match = JNI_FALSE;
 
@@ -390,18 +415,169 @@
     return netIFArr;
 }
 
+
+/*
+ * Class:     java_net_NetworkInterface
+ * Method:    isUp0
+ * Signature: (Ljava/lang/String;I)Z
+ */
+JNIEXPORT jboolean JNICALL Java_java_net_NetworkInterface_isUp0(JNIEnv *env, jclass cls, jstring name, jint index) {
+    int ret = getFlags0(env, name);
+    return ((ret & IFF_UP) && (ret & IFF_RUNNING)) ? JNI_TRUE :  JNI_FALSE;
+}
+
+/*
+ * Class:     java_net_NetworkInterface
+ * Method:    isP2P0
+ * Signature: (Ljava/lang/String;I)Z
+ */
+JNIEXPORT jboolean JNICALL Java_java_net_NetworkInterface_isP2P0(JNIEnv *env, jclass cls, jstring name, jint index) {
+    int ret = getFlags0(env, name);
+    return (ret & IFF_POINTOPOINT) ? JNI_TRUE :  JNI_FALSE;
+}
+
+/*
+ * Class:     java_net_NetworkInterface
+ * Method:    isLoopback0
+ * Signature: (Ljava/lang/String;I)Z
+ */
+JNIEXPORT jboolean JNICALL Java_java_net_NetworkInterface_isLoopback0(JNIEnv *env, jclass cls, jstring name, jint index) {
+    int ret = getFlags0(env, name);
+    return (ret & IFF_LOOPBACK) ? JNI_TRUE :  JNI_FALSE;
+}
+
+/*
+ * Class:     java_net_NetworkInterface
+ * Method:    supportsMulticast0
+ * Signature: (Ljava/lang/String;I)Z
+ */
+JNIEXPORT jboolean JNICALL Java_java_net_NetworkInterface_supportsMulticast0(JNIEnv *env, jclass cls, jstring name, jint index) {
+    int ret = getFlags0(env, name);
+    return (ret & IFF_MULTICAST) ? JNI_TRUE :  JNI_FALSE;
+}
+
+/*
+ * Class:     java_net_NetworkInterface
+ * Method:    getMacAddr0
+ * Signature: ([bLjava/lang/String;I)[b
+ */
+JNIEXPORT jbyteArray JNICALL Java_java_net_NetworkInterface_getMacAddr0(JNIEnv *env, jclass class, jbyteArray addrArray, jstring name, jint index) {
+    jint addr;
+    jbyte caddr[4];
+    struct in_addr iaddr;
+    jbyteArray ret = NULL;
+    unsigned char mac[16];
+    int len;
+    int sock;
+    jboolean isCopy;
+    const char* name_utf;
+
+    name_utf = (*env)->GetStringUTFChars(env, name, &isCopy);
+
+    if ((sock =openSocketWithFallback(env, name_utf)) < 0) {
+       (*env)->ReleaseStringUTFChars(env, name, name_utf);
+       return JNI_FALSE;
+    }
+
+
+    if (!IS_NULL(addrArray)) {
+       (*env)->GetByteArrayRegion(env, addrArray, 0, 4, caddr);
+       addr = ((caddr[0]<<24) & 0xff000000);
+       addr |= ((caddr[1] <<16) & 0xff0000);
+       addr |= ((caddr[2] <<8) & 0xff00);
+       addr |= (caddr[3] & 0xff);
+       iaddr.s_addr = htonl(addr);
+       len = getMacAddress(env, sock, name_utf, &iaddr, mac);
+    } else {
+       len = getMacAddress(env, sock, name_utf,NULL, mac);
+    }
+    if (len > 0) {
+       ret = (*env)->NewByteArray(env, len);
+       if (IS_NULL(ret)) {
+          /* we may have memory to free at the end of this */
+          goto fexit;
+       }
+       (*env)->SetByteArrayRegion(env, ret, 0, len, (jbyte *) (mac));
+    }
+ fexit:
+   /* release the UTF string and interface list */
+   (*env)->ReleaseStringUTFChars(env, name, name_utf);
+
+   close(sock);
+   return ret;
+}
+
+/*
+ * Class:       java_net_NetworkInterface
+ * Method:      getMTU0
+ * Signature:   ([bLjava/lang/String;I)I
+ */
+
+JNIEXPORT jint JNICALL Java_java_net_NetworkInterface_getMTU0(JNIEnv *env, jclass class, jstring name, jint index) {
+    jboolean isCopy;
+    int ret = -1;
+    int sock;
+    const char* name_utf;
+
+    name_utf = (*env)->GetStringUTFChars(env, name, &isCopy);
+
+    if ((sock =openSocketWithFallback(env, name_utf)) < 0) {
+       (*env)->ReleaseStringUTFChars(env, name, name_utf);
+       return JNI_FALSE;
+    }
+
+    ret = getMTU(env, sock, name_utf);
+
+    (*env)->ReleaseStringUTFChars(env, name, name_utf);
+
+    close(sock);
+    return ret;
+}
+
+/*** Private methods definitions ****/
+
+static int getFlags0(JNIEnv *env, jstring name) {
+    jboolean isCopy;
+    int ret, sock;
+    const char* name_utf;
+
+    name_utf = (*env)->GetStringUTFChars(env, name, &isCopy);
+
+    if ((sock = openSocketWithFallback(env, name_utf)) < 0) {
+        (*env)->ReleaseStringUTFChars(env, name, name_utf);
+         return -1;
+    }
+
+    name_utf = (*env)->GetStringUTFChars(env, name, &isCopy);
+
+    ret = getFlags(env, sock, name_utf);
+
+    close(sock);
+    (*env)->ReleaseStringUTFChars(env, name, name_utf);
+
+    if (ret < 0) {
+        NET_ThrowByNameWithLastError(env, JNU_JAVANETPKG "SocketException", "IOCTL  SIOCGLIFFLAGS failed");
+        return -1;
+    }
+
+    return ret;
+}
+
+
+
+
 /*
  * Create a NetworkInterface object, populate the name and index, and
  * populate the InetAddress array based on the IP addresses for this
  * interface.
  */
-jobject createNetworkInterface(JNIEnv *env, netif *ifs)
-{
+jobject createNetworkInterface(JNIEnv *env, netif *ifs) {
     jobject netifObj;
     jobject name;
     jobjectArray addrArr;
     jobjectArray bindArr;
     jobjectArray childArr;
+    netaddr *addrs;
     jint addr_index, addr_count, bind_index;
     jint child_count, child_index;
     netaddr *addrP;
@@ -441,7 +617,7 @@
 
     bindArr = (*env)->NewObjectArray(env, addr_count, ni_ibcls, NULL);
     if (bindArr == NULL) {
-      return NULL;
+       return NULL;
     }
     addrP = ifs->addr;
     addr_index = 0;
@@ -453,23 +629,22 @@
         if (addrP->family == AF_INET) {
             iaObj = (*env)->NewObject(env, ni_ia4cls, ni_ia4ctrID);
             if (iaObj) {
-                 (*env)->SetIntField(env, iaObj, ni_iaaddressID,
-                     htonl(((struct sockaddr_in*)addrP->addr)->sin_addr.s_addr));
+                 (*env)->SetIntField(env, iaObj, ni_iaaddressID, htonl(((struct sockaddr_in*)addrP->addr)->sin_addr.s_addr));
             }
             ibObj = (*env)->NewObject(env, ni_ibcls, ni_ibctrID);
             if (ibObj) {
-              (*env)->SetObjectField(env, ibObj, ni_ibaddressID, iaObj);
-              if (addrP->brdcast) {
-                jobject ia2Obj = NULL;
-                ia2Obj = (*env)->NewObject(env, ni_ia4cls, ni_ia4ctrID);
-                if (ia2Obj) {
-                  (*env)->SetIntField(env, ia2Obj, ni_iaaddressID,
-                                      htonl(((struct sockaddr_in*)addrP->brdcast)->sin_addr.s_addr));
-                  (*env)->SetObjectField(env, ibObj, ni_ib4broadcastID, ia2Obj);
-                  (*env)->SetShortField(env, ibObj, ni_ib4maskID, addrP->mask);
-                }
-              }
-              (*env)->SetObjectArrayElement(env, bindArr, bind_index++, ibObj);
+                 (*env)->SetObjectField(env, ibObj, ni_ibaddressID, iaObj);
+                 if (addrP->brdcast) {
+                    jobject ia2Obj = NULL;
+                    ia2Obj = (*env)->NewObject(env, ni_ia4cls, ni_ia4ctrID);
+                    if (ia2Obj) {
+                       (*env)->SetIntField(env, ia2Obj, ni_iaaddressID,
+                                                               htonl(((struct sockaddr_in*)addrP->brdcast)->sin_addr.s_addr));
+                       (*env)->SetObjectField(env, ibObj, ni_ib4broadcastID, ia2Obj);
+                       (*env)->SetShortField(env, ibObj, ni_ib4maskID, addrP->mask);
+                    }
+                 }
+                 (*env)->SetObjectArrayElement(env, bindArr, bind_index++, ibObj);
             }
         }
 
@@ -483,14 +658,10 @@
                     return NULL;
                 }
                 (*env)->SetByteArrayRegion(env, ipaddress, 0, 16,
-                    (jbyte *)&(((struct sockaddr_in6*)addrP->addr)->sin6_addr));
-#ifdef __linux__
-                if (!kernelIsV22()) {
-                    scope = ((struct sockaddr_in6*)addrP->addr)->sin6_scope_id;
-                }
-#else
+                                                                        (jbyte *)&(((struct sockaddr_in6*)addrP->addr)->sin6_addr));
+
                 scope = ((struct sockaddr_in6*)addrP->addr)->sin6_scope_id;
-#endif
+
                 if (scope != 0) { /* zero is default value, no need to set */
                     (*env)->SetIntField(env, iaObj, ia6_scopeidID, scope);
                     (*env)->SetBooleanField(env, iaObj, ia6_scopeidsetID, JNI_TRUE);
@@ -500,9 +671,9 @@
             }
             ibObj = (*env)->NewObject(env, ni_ibcls, ni_ibctrID);
             if (ibObj) {
-              (*env)->SetObjectField(env, ibObj, ni_ibaddressID, iaObj);
-              (*env)->SetShortField(env, ibObj, ni_ib4maskID, addrP->mask);
-              (*env)->SetObjectArrayElement(env, bindArr, bind_index++, ibObj);
+                (*env)->SetObjectField(env, ibObj, ni_ibaddressID, iaObj);
+                (*env)->SetShortField(env, ibObj, ni_ib4maskID, addrP->mask);
+                (*env)->SetObjectArrayElement(env, bindArr, bind_index++, ibObj);
             }
         }
 #endif
@@ -521,13 +692,13 @@
     child_count = 0;
     childP = ifs->childs;
     while (childP) {
-      child_count++;
-      childP = childP->next;
+        child_count++;
+        childP = childP->next;
     }
 
     childArr = (*env)->NewObjectArray(env, child_count, ni_class, NULL);
     if (childArr == NULL) {
-      return NULL;
+        return NULL;
     }
 
     /*
@@ -539,7 +710,7 @@
     while(childP) {
       tmp = createNetworkInterface(env, childP);
       if (tmp == NULL) {
-        return NULL;
+         return NULL;
       }
       (*env)->SetObjectField(env, tmp, ni_parentID, netifObj);
       (*env)->SetObjectArrayElement(env, childArr, child_index++, tmp);
@@ -558,294 +729,56 @@
  */
 static netif *enumInterfaces(JNIEnv *env) {
     netif *ifs;
+    int sock;
 
     /*
      * Enumerate IPv4 addresses
      */
-    ifs = enumIPv4Interfaces(env, NULL);
-    if (ifs == NULL) {
-        if ((*env)->ExceptionOccurred(env)) {
-            return NULL;
-        }
+
+    sock = openSocket(env, AF_INET);
+    if (sock < 0 && (*env)->ExceptionOccurred(env)) {
+        return NULL;
     }
 
+    ifs = enumIPv4Interfaces(env, sock, NULL);
+    close(sock);
+
+    if (ifs == NULL && (*env)->ExceptionOccurred(env)) {
+        return NULL;
+    }
+
+    /* return partial list if exception occure in the middle of process ???*/
+
     /*
      * If IPv6 is available then enumerate IPv6 addresses.
      */
 #ifdef AF_INET6
-    if (ipv6_available()) {
-        ifs = enumIPv6Interfaces(env, ifs);
+        sock =  openSocket(env, AF_INET6);
+        if (sock < 0 && (*env)->ExceptionOccurred(env)) {
+            freeif(ifs);
+            return NULL;
+        }
+
+        ifs = enumIPv6Interfaces(env, sock, ifs);
+        close(sock);
 
         if ((*env)->ExceptionOccurred(env)) {
             freeif(ifs);
             return NULL;
         }
-    }
 #endif
 
     return ifs;
 }
 
-
-/*
- * Enumerates and returns all IPv4 interfaces
- */
-static netif *enumIPv4Interfaces(JNIEnv *env, netif *ifs) {
-    int sock;
-    struct ifconf ifc;
-    struct ifreq *ifreqP;
-    char *buf;
-    int numifs;
-    unsigned i;
-    unsigned bufsize;
-
-    sock = JVM_Socket(AF_INET, SOCK_DGRAM, 0);
-    if (sock < 0) {
-        /*
-         * If EPROTONOSUPPORT is returned it means we don't have
-         * IPv4 support so don't throw an exception.
-         */
-        if (errno != EPROTONOSUPPORT) {
-            NET_ThrowByNameWithLastError(env , JNU_JAVANETPKG "SocketException",
-                             "Socket creation failed");
-        }
-        return ifs;
-    }
-
-#ifdef __linux__
-    /* need to do a dummy SIOCGIFCONF to determine the buffer size.
-     * SIOCGIFCOUNT doesn't work
-     */
-    ifc.ifc_buf = NULL;
-    if (ioctl(sock, SIOCGIFCONF, (char *)&ifc) < 0) {
-        NET_ThrowByNameWithLastError(env , JNU_JAVANETPKG "SocketException",
-                         "ioctl SIOCGIFCONF failed");
-        close(sock);
-        return ifs;
-    }
-    bufsize = ifc.ifc_len;
-#else
-    if (ioctl(sock, SIOCGIFNUM, (char *)&numifs) < 0) {
-        NET_ThrowByNameWithLastError(env , JNU_JAVANETPKG "SocketException",
-                         "ioctl SIOCGIFNUM failed");
-        close(sock);
-        return ifs;
-    }
-    bufsize = numifs * sizeof (struct ifreq);
-#endif /* __linux__ */
-
-    buf = (char *)malloc(bufsize);
-    if (!buf) {
-        JNU_ThrowOutOfMemoryError(env, "heap allocation failed");
-        (void) close(sock);
-        return ifs;
-    }
-    ifc.ifc_len = bufsize;
-    ifc.ifc_buf = buf;
-    if (ioctl(sock, SIOCGIFCONF, (char *)&ifc) < 0) {
-        NET_ThrowByNameWithLastError(env , JNU_JAVANETPKG "SocketException",
-                         "ioctl SIOCGIFCONF failed");
-        (void) close(sock);
-        (void) free(buf);
-        return ifs;
-    }
-
-    /*
-     * Iterate through each interface
-     */
-    ifreqP = ifc.ifc_req;
-    for (i=0; i<ifc.ifc_len/sizeof (struct ifreq); i++, ifreqP++) {
-        int index;
-        struct ifreq if2;
-
-        memset((char *)&if2, 0, sizeof(if2));
-        strcpy(if2.ifr_name, ifreqP->ifr_name);
-
-        /*
-         * Try to get the interface index
-         * (Not supported on Solaris 2.6 or 7)
-         */
-        if (ioctl(sock, SIOCGIFINDEX, (char *)&if2) >= 0) {
-            index = if2.ifr_index;
-        } else {
-            index = -1;
-        }
-
-        /*
-         * Add to the list
-         */
-        ifs = addif(env, ifs, ifreqP->ifr_name, index, AF_INET,
-                    (struct sockaddr *)&(ifreqP->ifr_addr),
-                    sizeof(struct sockaddr_in), 0);
-
-        /*
-         * If an exception occurred then free the list
-         */
-        if ((*env)->ExceptionOccurred(env)) {
-            close(sock);
-            free(buf);
-            freeif(ifs);
-            return NULL;
-        }
-    }
-
-    /*
-     * Free socket and buffer
-     */
-    close(sock);
-    free(buf);
-    return ifs;
-}
-
-
-#if defined(__solaris__) && defined(AF_INET6)
-/*
- * Enumerates and returns all IPv6 interfaces on Solaris
- */
-static netif *enumIPv6Interfaces(JNIEnv *env, netif *ifs) {
-    int sock;
-    struct lifconf ifc;
-    struct lifreq *ifr;
-    int n;
-    char *buf;
-    struct lifnum numifs;
-    unsigned bufsize;
-
-    sock = JVM_Socket(AF_INET6, SOCK_DGRAM, 0);
-    if (sock < 0) {
-        NET_ThrowByNameWithLastError(env , JNU_JAVANETPKG "SocketException",
-                         "Failed to create IPv6 socket");
-        return ifs;
-    }
-
-    /*
-     * Get the interface count
-     */
-    numifs.lifn_family = AF_UNSPEC;
-    numifs.lifn_flags = 0;
-    if (ioctl(sock, SIOCGLIFNUM, (char *)&numifs) < 0) {
-        NET_ThrowByNameWithLastError(env , JNU_JAVANETPKG "SocketException",
-                         "ioctl SIOCGLIFNUM failed");
-        close(sock);
-        return ifs;
-    }
-
-    /*
-     *  Enumerate the interface configurations
-     */
-    bufsize = numifs.lifn_count * sizeof (struct lifreq);
-    buf = (char *)malloc(bufsize);
-    if (!buf) {
-        JNU_ThrowOutOfMemoryError(env, "heap allocation failed");
-        (void) close(sock);
-        return ifs;
-    }
-    ifc.lifc_family = AF_UNSPEC;
-    ifc.lifc_flags = 0;
-    ifc.lifc_len = bufsize;
-    ifc.lifc_buf = buf;
-    if (ioctl(sock, SIOCGLIFCONF, (char *)&ifc) < 0) {
-        NET_ThrowByNameWithLastError(env , JNU_JAVANETPKG "SocketException",
-                         "ioctl SIOCGLIFCONF failed");
-        close(sock);
-        free(buf);
-        return ifs;
-    }
-
-    /*
-     * Iterate through each interface
-     */
-    ifr = ifc.lifc_req;
-    for (n=0; n<numifs.lifn_count; n++, ifr++) {
-        int index = -1;
-        struct lifreq if2;
-
-        /*
-         * Ignore non-IPv6 addresses
-         */
-        if (ifr->lifr_addr.ss_family != AF_INET6) {
-            continue;
-        }
-
-        /*
-         * Get the index
-         */
-        memset((char *)&if2, 0, sizeof(if2));
-        strcpy(if2.lifr_name, ifr->lifr_name);
-        if (ioctl(sock, SIOCGLIFINDEX, (char *)&if2) >= 0) {
-            struct sockaddr_in6 *s6= (struct sockaddr_in6 *)&(ifr->lifr_addr);
-            index = if2.lifr_index;
-            s6->sin6_scope_id = index;
-        }
-
-        /* add to the list */
-        ifs = addif(env, ifs, ifr->lifr_name, index, AF_INET6,
-                    (struct sockaddr *)&(ifr->lifr_addr),
-                    sizeof(struct sockaddr_in6), (short) ifr->lifr_addrlen);
-
-        /*
-         * If an exception occurred we return
-         */
-        if ((*env)->ExceptionOccurred(env)) {
-            close(sock);
-            free(buf);
-            return ifs;
-        }
-
-    }
-
-    close(sock);
-    free(buf);
-    return ifs;
-
-}
-#endif
-
-
-#if defined(__linux__) && defined(AF_INET6)
-/*
- * Enumerates and returns all IPv6 interfaces on Linux
- */
-static netif *enumIPv6Interfaces(JNIEnv *env, netif *ifs) {
-    FILE *f;
-    char addr6[40], devname[20];
-    char addr6p[8][5];
-    int plen, scope, dad_status, if_idx;
-    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",
-                      addr6p[0], addr6p[1], addr6p[2], addr6p[3],
-                      addr6p[4], addr6p[5], addr6p[6], addr6p[7],
-                  &if_idx, &plen, &scope, &dad_status, devname) != EOF) {
-            struct sockaddr_in6 addr;
-
-            sprintf(addr6, "%s:%s:%s:%s:%s:%s:%s:%s",
-                    addr6p[0], addr6p[1], addr6p[2], addr6p[3],
-                    addr6p[4], addr6p[5], addr6p[6], addr6p[7]);
-            inet_pton(AF_INET6, addr6, ipv6addr);
-
-            memset(&addr, 0, sizeof(struct sockaddr_in6));
-            memcpy((void*)addr.sin6_addr.s6_addr, (const void*)ipv6addr, 16);
-            addr.sin6_scope_id = if_idx;
-
-            ifs = addif(env, ifs, devname, if_idx, AF_INET6,
-                        (struct sockaddr *)&addr,
-                        sizeof(struct sockaddr_in6), plen);
-
-            /*
-             * If an exception occurred then return the list as is.
-             */
-            if ((*env)->ExceptionOccurred(env)) {
-                fclose(f);
-                return ifs;
-            }
-        }
-        fclose(f);
-    }
-    return ifs;
-}
-#endif
+#define CHECKED_MALLOC3(_pointer,_type,_size) \
+       do{ \
+        _pointer = (_type)malloc( _size ); \
+        if (_pointer == NULL) { \
+            JNU_ThrowOutOfMemoryError(env, "heap allocation failed"); \
+            return ifs; /* return untouched list */ \
+        } \
+       } while(0)
 
 
 /*
@@ -853,52 +786,43 @@
  */
 void freeif(netif *ifs) {
     netif *currif = ifs;
+    netif *child = NULL;
 
     while (currif != NULL) {
         netaddr *addrP = currif->addr;
         while (addrP != NULL) {
             netaddr *next = addrP->next;
-            if (addrP->addr != NULL)
-                free(addrP->addr);
-            if (addrP->brdcast != NULL)
-                free(addrP->brdcast);
             free(addrP);
             addrP = next;
-        }
-
-        free(currif->name);
+         }
 
-        /*
-         * Don't forget to free the sub-interfaces.
-         */
-        if (currif->childs != NULL) {
-          freeif(currif->childs);
-        }
+            /*
+            * Don't forget to free the sub-interfaces.
+            */
+          if (currif->childs != NULL) {
+                freeif(currif->childs);
+          }
 
-        ifs = currif->next;
-        free(currif);
-        currif = ifs;
+          ifs = currif->next;
+          free(currif);
+          currif = ifs;
     }
 }
 
-/*
- * Add an interface to the list. If known interface just link
- * a new netaddr onto the list. If new interface create new
- * netif structure.
- */
-netif *addif(JNIEnv *env, netif *ifs, char *if_name, int index, int family,
-             struct sockaddr *new_addrP, int new_addrlen, short prefix) {
-  netif *currif = ifs, *parent;
+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];
-    char vname[LIFNAMSIZ];
-#else
-    char name[IFNAMSIZ];
-    char vname[IFNAMSIZ];
-#endif
-    char *unit;
+
+    #ifdef __solaris__
+    char name[LIFNAMSIZ],  vname[LIFNAMSIZ];
+    #else
+    char name[IFNAMSIZ],  vname[IFNAMSIZ];
+    #endif
+
+    char  *name_colonP;
+    int mask;
     int isVirtual = 0;
+    int addr_size;
 
     /*
      * If the interface name is a logical interface then we
@@ -908,107 +832,63 @@
      * logical interfaces.
      */
     strcpy(name, if_name);
+    *vname = 0;
 
     /*
      * Create and populate the netaddr node. If allocation fails
      * return an un-updated list.
      */
-    addrP = (netaddr *)malloc(sizeof(netaddr));
-    if (addrP) {
-        addrP->addr = (struct sockaddr *)malloc(new_addrlen);
-        if (addrP->addr == NULL) {
-            free(addrP);
-            addrP = NULL;
-        }
-    }
-    if (addrP == NULL) {
-        JNU_ThrowOutOfMemoryError(env, "heap allocation failed");
-        return ifs; /* return untouched list */
-    }
-    memcpy(addrP->addr, new_addrP, new_addrlen);
+    /*Allocate for addr and brdcast at once*/
+
+#ifdef AF_INET6
+    addr_size = (family == AF_INET) ? sizeof(struct sockaddr_in) : sizeof(struct sockaddr_in6);
+#else
+    addr_size = sizeof(struct sockaddr_in);
+#endif
+
+    CHECKED_MALLOC3(addrP, netaddr *, sizeof(netaddr)+2*addr_size);
+    addrP->addr = (struct sockaddr *)( (char *) addrP+sizeof(netaddr) );
+    memcpy(addrP->addr, ifr_addrP, addr_size);
+
     addrP->family = family;
-
     addrP->brdcast = NULL;
     addrP->mask = prefix;
+    addrP->next = 0;
     if (family == AF_INET) {
       /*
        * Deal with brodcast addr & subnet mask
        */
-      addrP->brdcast = getBroadcast(env, name);
-      if (addrP->brdcast) {
-        addrP->mask = getSubnet(env, name);
-      }
-    }
+       struct sockaddr * brdcast_to = (struct sockaddr *) ((char *) addrP + sizeof(netaddr) + addr_size);
+       addrP->brdcast = getBroadcast(env, sock, name,  brdcast_to );
 
-    vname[0] = 0;
-    unit = strchr(name, ':');
-    if (unit != NULL) {
+       if (addrP->brdcast && (mask = getSubnet(env, sock, name)) != -1) {
+           addrP->mask = mask;
+       }
+     }
+
+    /**
+     * Deal with virtual interface with colon notaion e.g. eth0:1
+     */
+    name_colonP = strchr(name, ':');
+    if (name_colonP != NULL) {
       /**
        * This is a virtual interface. If we are able to access the parent
        * we need to create a new entry if it doesn't exist yet *and* update
        * the 'parent' interface with the new records.
        */
-      struct ifreq if2;
-      int sock;
-      int len;
-
-      sock = JVM_Socket(AF_INET, SOCK_DGRAM, 0);
-      if (sock < 0) {
-        NET_ThrowByNameWithLastError(env, JNU_JAVANETPKG "SocketException",
-                                     "Socket creation failed");
-        return ifs; /* return untouched list */
-      }
-
-      len = unit - name;
-      if (len > 0) {
-        // temporarily use vname to hold the parent name of the interface
-        // instead of creating another buffer.
-        memcpy(&vname, name, len);
-        vname[len] = '\0';
-
-        memset((char *) &if2, 0, sizeof(if2));
-        strcpy(if2.ifr_name, vname);
-
-        if (ioctl(sock, SIOCGIFFLAGS, (char *)&if2) >= 0) {
-           // Got access to parent, so create it if necessary.
-           strcpy(vname, name);
-           *unit = '\0';
-        } else {
-#if defined(__solaris__) && defined(AF_INET6)
-          struct   lifreq lifr;
-          memset((char *) &lifr, 0, sizeof(lifr));
-          strcpy(lifr.lifr_name, vname);
-
-          /* Try with an IPv6 socket in case the interface has only IPv6
-           * addresses assigned to it */
-          close(sock);
-          sock = JVM_Socket(AF_INET6, SOCK_DGRAM, 0);
-
-          if (sock < 0) {
-            NET_ThrowByNameWithLastError(env, JNU_JAVANETPKG "SocketException",
-                                         "Socket creation failed");
-            return ifs; /* return untouched list */
-          }
-
-          if (ioctl(sock, SIOCGLIFFLAGS, (char *)&lifr) >= 0) {
-            // Got access to parent, so create it if necessary.
-            strcpy(vname, name);
-            *unit = '\0';
-          } else {
+        *name_colonP = 0;
+        if (getFlags(env,sock,name) < 0) {
             // failed to access parent interface do not create parent.
             // We are a virtual interface with no parent.
             isVirtual = 1;
-            vname[0] = 0;
-          }
-#else
-          // failed to access parent interface do not create parent.
-          // We are a virtual interface with no parent.
-          isVirtual = 1;
-          vname[0] = 0;
-#endif
+            *name_colonP = ':';
         }
-      }
-      close(sock);
+        else{
+           // Got access to parent, so create it if necessary.
+           // Save original name to vname and truncate name by ':'
+            memcpy(vname, name, sizeof(vname) );
+            vname[name_colonP - name] = ':';
+        }
     }
 
     /*
@@ -1028,24 +908,15 @@
      * insert it onto the list.
      */
     if (currif == NULL) {
-        currif = (netif *)malloc(sizeof(netif));
-        if (currif) {
-            currif->name = strdup(name);
-            if (currif->name == NULL) {
-                free(currif);
-                currif = NULL;
-            }
-        }
-        if (currif == NULL) {
-            JNU_ThrowOutOfMemoryError(env, "heap allocation failed");
-            return ifs;
-        }
-        currif->index = index;
-        currif->addr = NULL;
-        currif->childs = NULL;
-        currif->virtual = isVirtual;
-        currif->next = ifs;
-        ifs = currif;
+         CHECKED_MALLOC3(currif, netif *, sizeof(netif)+IFNAMSIZ );
+         currif->name = (char *) currif+sizeof(netif);
+         strcpy(currif->name, name);
+         currif->index = getIndex(sock, name);
+         currif->addr = NULL;
+         currif->childs = NULL;
+         currif->virtual = isVirtual;
+         currif->next = ifs;
+         ifs = currif;
     }
 
     /*
@@ -1060,161 +931,251 @@
      * Let's deal with the virtual interface now.
      */
     if (vname[0]) {
-      netaddr *tmpaddr;
+        netaddr *tmpaddr;
 
-      currif = parent->childs;
+        currif = parent->childs;
 
-      while (currif != NULL) {
-        if (strcmp(vname, currif->name) == 0) {
-          break;
-        }
-        currif = currif->next;
-      }
-      if (currif == NULL) {
-        currif = (netif *)malloc(sizeof(netif));
-        if (currif) {
-          currif->name = strdup(vname);
-          if (currif->name == NULL) {
-            free(currif);
-            currif = NULL;
-          }
-        }
-        if (currif == NULL) {
-          JNU_ThrowOutOfMemoryError(env, "heap allocation failed");
-          return ifs;
+        while (currif != NULL) {
+            if (strcmp(vname, currif->name) == 0) {
+                break;
+            }
+            currif = currif->next;
         }
-        currif->index = index;
-        currif->addr = NULL;
-        /* Need to duplicate the addr entry? */
-        currif->virtual = 1;
-        currif->childs = NULL;
-        currif->next = parent->childs;
-        parent->childs = currif;
-      }
+
+        if (currif == NULL) {
+            CHECKED_MALLOC3(currif, netif *, sizeof(netif)+ IFNAMSIZ );
+            currif->name = (char *) currif + sizeof(netif);
+            strcpy(currif->name, vname);
+            currif->index = getIndex(sock, vname);
+            currif->addr = NULL;
+           /* Need to duplicate the addr entry? */
+            currif->virtual = 1;
+            currif->childs = NULL;
+            currif->next = parent->childs;
+            parent->childs = currif;
+        }
 
-      tmpaddr = (netaddr *) malloc(sizeof(netaddr));
-      if (tmpaddr == NULL) {
-        JNU_ThrowOutOfMemoryError(env, "heap allocation failed");
-        return ifs;
-      }
-      memcpy(tmpaddr, addrP, sizeof(netaddr));
-      /**
-       * Let's duplicate the address and broadcast address structures
-       * if there are any.
-       */
-      if (addrP->addr != NULL) {
-        tmpaddr->addr = malloc(new_addrlen);
-        if (tmpaddr->addr != NULL)
-          memcpy(tmpaddr->addr, addrP->addr, new_addrlen);
-      }
-      if (addrP->brdcast != NULL) {
-        tmpaddr->brdcast = malloc(new_addrlen);
-        if (tmpaddr->brdcast != NULL)
-          memcpy(tmpaddr->brdcast, addrP->brdcast, new_addrlen);
-      }
-      tmpaddr->next = currif->addr;
-      currif->addr = tmpaddr;
+        CHECKED_MALLOC3(tmpaddr, netaddr *, sizeof(netaddr)+2*addr_size);
+        memcpy(tmpaddr, addrP, sizeof(netaddr));
+        if (addrP->addr != NULL) {
+            tmpaddr->addr = (struct sockaddr *) ( (char*)tmpaddr + sizeof(netaddr) ) ;
+            memcpy(tmpaddr->addr, addrP->addr, addr_size);
+        }
+
+        if (addrP->brdcast != NULL) {
+            tmpaddr->brdcast = (struct sockaddr *) ((char *) tmpaddr + sizeof(netaddr)+addr_size);
+            memcpy(tmpaddr->brdcast, addrP->brdcast, addr_size);
+        }
+
+        tmpaddr->next = currif->addr;
+        currif->addr = tmpaddr;
     }
 
     return ifs;
 }
 
-/**
- * Get flags from a NetworkInterface.
+/* Open socket for further ioct calls
+ * proto is AF_INET/AF_INET6
  */
-static short getFlags(JNIEnv *env, jstring name) {
-  int sock;
-  struct ifreq if2;
-  jboolean isCopy;
-  const char* name_utf;
-  short ret = -1;
+static int  openSocket(JNIEnv *env, int proto){
+    int sock;
+
+    if ((sock = JVM_Socket(proto, SOCK_DGRAM, 0)) < 0) {
+        /*
+         * If EPROTONOSUPPORT is returned it means we don't have
+         * support  for this proto so don't throw an exception.
+         */
+        if (errno != EPROTONOSUPPORT) {
+            NET_ThrowByNameWithLastError(env , JNU_JAVANETPKG "SocketException", "Socket creation failed");
+        }
+        return -1;
+    }
 
-  sock = JVM_Socket(AF_INET, SOCK_DGRAM, 0);
-  if (sock < 0) {
-    NET_ThrowByNameWithLastError(env, JNU_JAVANETPKG "SocketException",
-                                 "Socket creation failed");
-    return -1;
-  }
+    return sock;
+}
+
+
+/** Linux **/
+#ifdef __linux__
+/* Open socket for further ioct calls, try v4 socket first and
+ * if it falls return v6 socket
+ */
+
+#ifdef AF_INET6
+static int openSocketWithFallback(JNIEnv *env, const char *ifname){
+    int sock;
+    struct ifreq if2;
 
-  name_utf = (*env)->GetStringUTFChars(env, name, &isCopy);
-  memset((char *) &if2, 0, sizeof(if2));
-  strcpy(if2.ifr_name, name_utf);
+     if ((sock = JVM_Socket(AF_INET, SOCK_DGRAM, 0)) < 0) {
+         if (errno == EPROTONOSUPPORT){
+              if ( (sock = JVM_Socket(AF_INET6, SOCK_DGRAM, 0)) < 0 ){
+                 NET_ThrowByNameWithLastError(env , JNU_JAVANETPKG "SocketException", "IPV6 Socket creation failed");
+                 return -1;
+              }
+         }
+         else{ // errno is not NOSUPPORT
+             NET_ThrowByNameWithLastError(env , JNU_JAVANETPKG "SocketException", "IPV4 Socket creation failed");
+             return -1;
+         }
+   }
+
+     /* Linux starting from 2.6.? kernel allows ioctl call with either IPv4 or IPv6 socket regardless of type
+        of address of an interface */
+
+       return sock;
+}
+
+#else
+static int openSocketWithFallback(JNIEnv *env, const char *ifname){
+    return openSocket(env,AF_INET);
+}
+#endif
 
-  if (ioctl(sock, SIOCGIFFLAGS, (char *)&if2) >= 0) {
-    ret = if2.ifr_flags;
-  } else {
-#if defined(__solaris__) && defined(AF_INET6)
-    /* Try with an IPv6 socket in case the interface has only IPv6 addresses assigned to it */
-    struct lifreq lifr;
+static netif *enumIPv4Interfaces(JNIEnv *env, int sock, netif *ifs) {
+    struct ifconf ifc;
+    struct ifreq *ifreqP;
+    char *buf;
+    int numifs;
+    unsigned i;
+
 
-    close(sock);
-    sock = JVM_Socket(AF_INET6, SOCK_DGRAM, 0);
+    /* need to do a dummy SIOCGIFCONF to determine the buffer size.
+     * SIOCGIFCOUNT doesn't work
+     */
+    ifc.ifc_buf = NULL;
+    if (ioctl(sock, SIOCGIFCONF, (char *)&ifc) < 0) {
+        NET_ThrowByNameWithLastError(env , JNU_JAVANETPKG "SocketException", "ioctl SIOCGIFCONF failed");
+        return ifs;
+    }
 
-    if (sock < 0) {
-      (*env)->ReleaseStringUTFChars(env, name, name_utf);
-      NET_ThrowByNameWithLastError(env, JNU_JAVANETPKG "SocketException",
-                                  "Socket creation failed");
-      return -1;
+    CHECKED_MALLOC3(buf,char *, ifc.ifc_len);
+
+    ifc.ifc_buf = buf;
+    if (ioctl(sock, SIOCGIFCONF, (char *)&ifc) < 0) {
+        NET_ThrowByNameWithLastError(env , JNU_JAVANETPKG "SocketException", "ioctl SIOCGIFCONF failed");
+        (void) free(buf);
+        return ifs;
     }
 
-    memset((caddr_t)&lifr, 0, sizeof(lifr));
-    strcpy((caddr_t)&(lifr.lifr_name), name_utf);
+    /*
+     * Iterate through each interface
+     */
+    ifreqP = ifc.ifc_req;
+    for (i=0; i<ifc.ifc_len/sizeof (struct ifreq); i++, ifreqP++) {
+        /*
+         * Add to the list
+         */
+        ifs = addif(env, sock, ifreqP->ifr_name, ifs, (struct sockaddr *) & (ifreqP->ifr_addr), AF_INET, 0);
 
-    if (ioctl(sock, SIOCGLIFFLAGS, (char *)&lifr) >= 0) {
-      ret = lifr.lifr_flags;
-    } else {
-      NET_ThrowByNameWithLastError(env, JNU_JAVANETPKG "SocketException",
-                               "IOCTL failed");
+        /*
+         * If an exception occurred then free the list
+         */
+        if ((*env)->ExceptionOccurred(env)) {
+            free(buf);
+            freeif(ifs);
+            return NULL;
+        }
     }
-#else
-    NET_ThrowByNameWithLastError(env, JNU_JAVANETPKG "SocketException",
-                                 "IOCTL failed");
+
+    /*
+     * Free socket and buffer
+     */
+    free(buf);
+    return ifs;
+}
+
+
+/*
+ * Enumerates and returns all IPv6 interfaces on Linux
+ */
+
+#ifdef AF_INET6
+static netif *enumIPv6Interfaces(JNIEnv *env, int sock, netif *ifs) {
+    FILE *f;
+    char addr6[40], devname[20];
+    char addr6p[8][5];
+    int plen, scope, dad_status, if_idx;
+    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",
+                         addr6p[0], addr6p[1], addr6p[2], addr6p[3], addr6p[4], addr6p[5], addr6p[6], addr6p[7],
+                         &if_idx, &plen, &scope, &dad_status, devname) != EOF) {
+
+            struct netif *ifs_ptr = NULL;
+            struct netif *last_ptr = NULL;
+            struct sockaddr_in6 addr;
+
+            sprintf(addr6, "%s:%s:%s:%s:%s:%s:%s:%s",
+                           addr6p[0], addr6p[1], addr6p[2], addr6p[3], addr6p[4], addr6p[5], addr6p[6], addr6p[7]);
+            inet_pton(AF_INET6, addr6, ipv6addr);
+
+            memset(&addr, 0, sizeof(struct sockaddr_in6));
+            memcpy((void*)addr.sin6_addr.s6_addr, (const void*)ipv6addr, 16);
+
+            addr.sin6_scope_id = if_idx;
+
+            ifs = addif(env, sock, devname, ifs, (struct sockaddr *)&addr, AF_INET6, plen);
+
+
+            /*
+             * If an exception occurred then return the list as is.
+             */
+            if ((*env)->ExceptionOccurred(env)) {
+                fclose(f);
+                return ifs;
+            }
+       }
+       fclose(f);
+    }
+    return ifs;
+}
 #endif
-  }
-  close(sock);
-  /* release the UTF string and interface list */
-  (*env)->ReleaseStringUTFChars(env, name, name_utf);
+
 
-  return ret;
+static int getIndex(int sock, const char *name){
+     /*
+      * Try to get the interface index
+      * (Not supported on Solaris 2.6 or 7)
+      */
+    struct ifreq if2;
+    strcpy(if2.ifr_name, name);
+
+    if (ioctl(sock, SIOCGIFINDEX, (char *)&if2) < 0) {
+        return -1;
+    }
+
+    return if2.ifr_ifindex;
 }
 
 /**
  * Returns the IPv4 broadcast address of a named interface, if it exists.
  * Returns 0 if it doesn't have one.
  */
-static struct sockaddr *getBroadcast(JNIEnv *env, const char *ifname) {
-  int sock;
+static struct sockaddr *getBroadcast(JNIEnv *env, int sock, const char *ifname, struct sockaddr *brdcast_store) {
   struct sockaddr *ret = NULL;
   struct ifreq if2;
-  short flag = 0;
-
-  sock = JVM_Socket(AF_INET, SOCK_DGRAM, 0);
-  if (sock < 0) {
-    NET_ThrowByNameWithLastError(env, JNU_JAVANETPKG "SocketException",
-                                 "Socket creation failed");
-    return ret;
-  }
 
   memset((char *) &if2, 0, sizeof(if2));
   strcpy(if2.ifr_name, ifname);
+
   /* Let's make sure the interface does have a broadcast address */
-  if (ioctl(sock, SIOCGIFFLAGS, (char *)&if2) >= 0) {
-    flag = if2.ifr_flags;
-  } else {
-    NET_ThrowByNameWithLastError(env, JNU_JAVANETPKG "SocketException",
-                                 "IOCTL failed");
+  if (ioctl(sock, SIOCGIFFLAGS, (char *)&if2)  < 0) {
+      NET_ThrowByNameWithLastError(env, JNU_JAVANETPKG "SocketException", "IOCTL  SIOCGIFFLAGS failed");
+      return ret;
   }
-  if (flag & IFF_BROADCAST) {
-    /* It does, let's retrieve it*/
-    if (ioctl(sock, SIOCGIFBRDADDR, (char *)&if2) >= 0) {
-      ret = (struct sockaddr*) malloc(sizeof(struct sockaddr));
+
+  if (if2.ifr_flags & IFF_BROADCAST) {
+      /* It does, let's retrieve it*/
+      if (ioctl(sock, SIOCGIFBRDADDR, (char *)&if2) < 0) {
+          NET_ThrowByNameWithLastError(env, JNU_JAVANETPKG "SocketException", "IOCTL SIOCGIFBRDADDR failed");
+          return ret;
+      }
+
+      ret = brdcast_store;
       memcpy(ret, &if2.ifr_broadaddr, sizeof(struct sockaddr));
-    } else {
-      NET_ThrowByNameWithLastError(env, JNU_JAVANETPKG "SocketException",
-                                   "IOCTL failed");
-    }
   }
-  close(sock);
+
   return ret;
 }
 
@@ -1222,39 +1183,314 @@
  * Returns the IPv4 subnet prefix length (aka subnet mask) for the named
  * interface, if it has one, otherwise return -1.
  */
-static short getSubnet(JNIEnv *env, const char *ifname) {
-  int sock;
-  unsigned int mask;
-  short ret;
-  struct ifreq if2;
+static short getSubnet(JNIEnv *env, int sock, const char *ifname) {
+    unsigned int mask;
+    short ret;
+    struct ifreq if2;
+
+    memset((char *) &if2, 0, sizeof(if2));
+    strcpy(if2.ifr_name, ifname);
+
+    if (ioctl(sock, SIOCGIFNETMASK, (char *)&if2) < 0) {
+        NET_ThrowByNameWithLastError(env, JNU_JAVANETPKG "SocketException", "IOCTL SIOCGIFNETMASK failed");
+        return -1;
+    }
+
+    mask = ntohl(((struct sockaddr_in*)&(if2.ifr_addr))->sin_addr.s_addr);
+    ret = 0;
+    while (mask) {
+       mask <<= 1;
+       ret++;
+    }
+
+    return ret;
+}
+
+/**
+ * Get the Hardware address (usually MAC address) for the named interface.
+ * return puts the data in buf, and returns the length, in byte, of the
+ * MAC address. Returns -1 if there is no hardware address on that interface.
+ */
+static int getMacAddress(JNIEnv *env, int sock, const char* ifname, const struct in_addr* addr, unsigned char *buf) {
+    static struct ifreq ifr;
+    int i;
 
-  sock = JVM_Socket(AF_INET, SOCK_DGRAM, 0);
-  if (sock < 0) {
-    NET_ThrowByNameWithLastError(env, JNU_JAVANETPKG "SocketException",
-                                 "Socket creation failed");
+    strcpy(ifr.ifr_name, ifname);
+    if (ioctl(sock, SIOCGIFHWADDR, &ifr) < 0) {
+        NET_ThrowByNameWithLastError(env, JNU_JAVANETPKG "SocketException", "IOCTL SIOCGIFHWADDR failed");
+        return -1;
+    }
+
+    memcpy(buf, &ifr.ifr_hwaddr.sa_data, IFHWADDRLEN);
+
+   /*
+    * All bytes to 0 means no hardware address.
+    */
+
+    for (i = 0; i < IFHWADDRLEN; i++) {
+        if (buf[i] != 0)
+            return IFHWADDRLEN;
+    }
+
     return -1;
-  }
+}
+
+static int getMTU(JNIEnv *env, int sock,  const char *ifname) {
+    struct ifreq if2;
+
+    memset((char *) &if2, 0, sizeof(if2));
+    strcpy(if2.ifr_name, ifname);
+
+    if (ioctl(sock, SIOCGIFMTU, (char *)&if2) < 0) {
+        NET_ThrowByNameWithLastError(env, JNU_JAVANETPKG "SocketException", "IOCTL SIOCGIFMTU failed");
+        return -1;
+    }
+
+    return  if2.ifr_mtu;
+}
+
+static int getFlags(JNIEnv *env, int sock, const char *ifname) {
+  struct ifreq if2;
+  int ret = -1;
 
   memset((char *) &if2, 0, sizeof(if2));
   strcpy(if2.ifr_name, ifname);
-  if (ioctl(sock, SIOCGIFNETMASK, (char *)&if2) >= 0) {
-    mask = ntohl(((struct sockaddr_in*)&(if2.ifr_addr))->sin_addr.s_addr);
-    ret = 0;
-    while (mask) {
-      mask <<= 1;
-      ret++;
+
+  if (ioctl(sock, SIOCGIFFLAGS, (char *)&if2) < 0){
+      return -1;
+  }
+
+  return if2.ifr_flags;
+}
+
+#endif
+
+/** Solaris **/
+#ifdef __solaris__
+/* Open socket for further ioct calls, try v4 socket first and
+ * if it falls return v6 socket
+ */
+
+#ifdef AF_INET6
+static int openSocketWithFallback(JNIEnv *env, const char *ifname){
+    int sock, alreadyV6 = 0;
+    struct lifreq if2;
+
+     if ((sock = JVM_Socket(AF_INET, SOCK_DGRAM, 0)) < 0) {
+         if (errno == EPROTONOSUPPORT){
+              if ( (sock = JVM_Socket(AF_INET6, SOCK_DGRAM, 0)) < 0 ){
+                 NET_ThrowByNameWithLastError(env , JNU_JAVANETPKG "SocketException", "IPV6 Socket creation failed");
+                 return -1;
+              }
+
+              alreadyV6=1;
+         }
+         else{ // errno is not NOSUPPORT
+             NET_ThrowByNameWithLastError(env , JNU_JAVANETPKG "SocketException", "IPV4 Socket creation failed");
+             return -1;
+         }
+   }
+
+     /**
+      * Solaris requires that we have IPv6 socket to query an
+      * interface without IPv4 address - check it here
+      * POSIX 1 require the kernell to return ENOTTY if the call is
+      * unappropriate for device e.g. NETMASK for device having IPv6
+      * only address but not all devices follows the standart so
+      * fallback on any error.  It's not an ecology friendly but more
+      * reliable.
+      */
+
+    if (! alreadyV6 ){
+        memset((char *) &if2, 0, sizeof(if2));
+        strcpy(if2.lifr_name, ifname);
+        if (ioctl(sock, SIOCGLIFNETMASK, (char *)&if2) < 0) {
+                close(sock);
+                if ( (sock = JVM_Socket(AF_INET6, SOCK_DGRAM, 0)) < 0 ){
+                      NET_ThrowByNameWithLastError(env , JNU_JAVANETPKG "SocketException", "IPV6 Socket creation failed");
+                      return -1;
+                }
+        }
     }
-    close(sock);
-    return ret;
-  }
-  NET_ThrowByNameWithLastError(env, JNU_JAVANETPKG "SocketException",
-                               "IOCTL failed");
-  close(sock);
-  return -1;
+
+    return sock;
+}
+
+#else
+static int openSocketWithFallback(JNIEnv *env, const char *ifname){
+    return openSocket(env,AF_INET);
+}
+#endif
+
+/*
+ * Enumerates and returns all IPv4 interfaces
+ * (linux verison)
+ */
+
+static netif *enumIPv4Interfaces(JNIEnv *env, int sock, netif *ifs) {
+     return enumIPvXInterfaces(env,sock, ifs, AF_INET);
 }
 
-#ifdef __solaris__
-#define DEV_PREFIX      "/dev/"
+#ifdef AF_INET6
+static netif *enumIPv6Interfaces(JNIEnv *env, int sock, netif *ifs) {
+    return enumIPvXInterfaces(env,sock, ifs, AF_INET6);
+}
+#endif
+
+/*
+   Enumerates and returns all interfaces on Solaris
+   use the same code for IPv4 and IPv6
+ */
+static netif *enumIPvXInterfaces(JNIEnv *env, int sock, netif *ifs, int family) {
+    struct lifconf ifc;
+    struct lifreq *ifr;
+    int n;
+    char *buf;
+    struct lifnum numifs;
+    unsigned bufsize;
+
+    /*
+     * Get the interface count
+     */
+    numifs.lifn_family = family;
+    numifs.lifn_flags = 0;
+    if (ioctl(sock, SIOCGLIFNUM, (char *)&numifs) < 0) {
+        NET_ThrowByNameWithLastError(env , JNU_JAVANETPKG "SocketException", "ioctl SIOCGLIFNUM failed");
+        return ifs;
+    }
+
+    /*
+     *  Enumerate the interface configurations
+     */
+    bufsize = numifs.lifn_count * sizeof (struct lifreq);
+    CHECKED_MALLOC3(buf, char *, bufsize);
+
+    ifc.lifc_family = family;
+    ifc.lifc_flags = 0;
+    ifc.lifc_len = bufsize;
+    ifc.lifc_buf = buf;
+    if (ioctl(sock, SIOCGLIFCONF, (char *)&ifc) < 0) {
+        NET_ThrowByNameWithLastError(env , JNU_JAVANETPKG "SocketException", "ioctl SIOCGLIFCONF failed");
+        free(buf);
+        return ifs;
+    }
+
+    /*
+     * Iterate through each interface
+     */
+    ifr = ifc.lifc_req;
+    for (n=0; n<numifs.lifn_count; n++, ifr++) {
+        int index = -1;
+        struct lifreq if2;
+
+        /*
+        * Ignore either IPv4 or IPv6 addresses
+        */
+        if (ifr->lifr_addr.ss_family != family) {
+            continue;
+        }
+
+#ifdef AF_INET6
+        if (ifr->lifr_addr.ss_family == AF_INET6) {
+            struct sockaddr_in6 *s6= (struct sockaddr_in6 *)&(ifr->lifr_addr);
+            s6->sin6_scope_id = getIndex(sock, ifr->lifr_name);
+        }
+#endif
+
+        /* add to the list */
+        ifs = addif(env, sock,ifr->lifr_name, ifs, (struct sockaddr *)&(ifr->lifr_addr),family, (short) ifr->lifr_addrlen);
+
+        /*
+        * If an exception occurred we return immediately
+        */
+        if ((*env)->ExceptionOccurred(env)) {
+            free(buf);
+            return ifs;
+        }
+
+   }
+
+    free(buf);
+    return ifs;
+}
+
+static int getIndex(int sock, const char *name){
+   /*
+    * Try to get the interface index
+    * (Not supported on Solaris 2.6 or 7)
+    */
+    struct lifreq if2;
+    strcpy(if2.lifr_name, name);
+
+    if (ioctl(sock, SIOCGLIFINDEX, (char *)&if2) < 0) {
+        return -1;
+    }
+
+    return if2.lifr_index;
+}
+
+/**
+ * Returns the IPv4 broadcast address of a named interface, if it exists.
+ * Returns 0 if it doesn't have one.
+ */
+static struct sockaddr *getBroadcast(JNIEnv *env, int sock, const char *ifname, struct sockaddr *brdcast_store) {
+    struct sockaddr *ret = NULL;
+    struct lifreq if2;
+
+    memset((char *) &if2, 0, sizeof(if2));
+    strcpy(if2.lifr_name, ifname);
+
+    /* Let's make sure the interface does have a broadcast address */
+    if (ioctl(sock, SIOCGLIFFLAGS, (char *)&if2)  < 0) {
+        NET_ThrowByNameWithLastError(env, JNU_JAVANETPKG "SocketException", "IOCTL  SIOCGLIFFLAGS failed");
+        return ret;
+    }
+
+    if (if2.lifr_flags & IFF_BROADCAST) {
+        /* It does, let's retrieve it*/
+        if (ioctl(sock, SIOCGLIFBRDADDR, (char *)&if2) < 0) {
+            NET_ThrowByNameWithLastError(env, JNU_JAVANETPKG "SocketException", "IOCTL SIOCGLIFBRDADDR failed");
+            return ret;
+        }
+
+        ret = brdcast_store;
+        memcpy(ret, &if2.lifr_broadaddr, sizeof(struct sockaddr));
+    }
+
+    return ret;
+}
+
+/**
+ * Returns the IPv4 subnet prefix length (aka subnet mask) for the named
+ * interface, if it has one, otherwise return -1.
+ */
+static short getSubnet(JNIEnv *env, int sock, const char *ifname) {
+    unsigned int mask;
+    short ret;
+    struct lifreq if2;
+
+    memset((char *) &if2, 0, sizeof(if2));
+    strcpy(if2.lifr_name, ifname);
+
+    if (ioctl(sock, SIOCGLIFNETMASK, (char *)&if2) < 0) {
+        NET_ThrowByNameWithLastError(env, JNU_JAVANETPKG "SocketException", "IOCTL SIOCGLIFNETMASK failed");
+        return -1;
+    }
+
+    mask = ntohl(((struct sockaddr_in*)&(if2.lifr_addr))->sin_addr.s_addr);
+    ret = 0;
+
+    while (mask) {
+       mask <<= 1;
+       ret++;
+    }
+
+    return ret;
+}
+
+
+
+#define DEV_PREFIX  "/dev/"
 
 /**
  * Solaris specific DLPI code to get hardware address from a device.
@@ -1262,306 +1498,147 @@
  * privileges (i.e. be root).
  */
 static int getMacFromDevice(JNIEnv *env, const char* ifname, unsigned char* retbuf) {
-  char style1dev[MAXPATHLEN];
-  int fd;
-  dl_phys_addr_req_t dlpareq;
-  dl_phys_addr_ack_t *dlpaack;
-  struct strbuf msg;
-  char buf[128];
-  int flags = 0;
+    char style1dev[MAXPATHLEN];
+    int fd;
+    dl_phys_addr_req_t dlpareq;
+    dl_phys_addr_ack_t *dlpaack;
+    struct strbuf msg;
+    char buf[128];
+    int flags = 0;
+
+   /**
+    * Device is in /dev
+    * e.g.: /dev/bge0
+    */
+    strcpy(style1dev, DEV_PREFIX);
+    strcat(style1dev, ifname);
+    if ((fd = open(style1dev, O_RDWR)) < 0) {
+        /*
+         * Can't open it. We probably are missing the privilege.
+         * We'll have to try something else
+         */
+         return 0;
+    }
+
+    dlpareq.dl_primitive = DL_PHYS_ADDR_REQ;
+    dlpareq.dl_addr_type = DL_CURR_PHYS_ADDR;
 
-  /**
-   * Device is in /dev
-   * e.g.: /dev/bge0
-   */
-  strcpy(style1dev, DEV_PREFIX);
-  strcat(style1dev, ifname);
-  if ((fd = open(style1dev, O_RDWR)) == -1) {
-    /*
-     * Can't open it. We probably are missing the privilege.
-     * We'll have to try something else
-     */
-    return 0;
-  }
-  dlpareq.dl_primitive = DL_PHYS_ADDR_REQ;
-  dlpareq.dl_addr_type = DL_CURR_PHYS_ADDR;
-  msg.buf = (char *)&dlpareq;
-  msg.len = DL_PHYS_ADDR_REQ_SIZE;
-  if (putmsg(fd, &msg, NULL, 0) < 0) {
-    NET_ThrowByNameWithLastError(env, JNU_JAVANETPKG "SocketException",
-                                 "putmsg failed");
-    return -1;
-  }
-  dlpaack = (dl_phys_addr_ack_t *)buf;
-  msg.buf = (char *)buf;
-  msg.len = 0;
-  msg.maxlen = sizeof (buf);
-  if (getmsg(fd, &msg, NULL, &flags) < 0) {
-    NET_ThrowByNameWithLastError(env, JNU_JAVANETPKG "SocketException",
-                                 "getmsg failed");
-    return -1;
-  }
-  if (msg.len < DL_PHYS_ADDR_ACK_SIZE ||
-      dlpaack->dl_primitive != DL_PHYS_ADDR_ACK) {
-    JNU_ThrowByName(env, JNU_JAVANETPKG "SocketException",
-                    "Couldn't obtain phys addr\n");
-    return -1;
-  }
+    msg.buf = (char *)&dlpareq;
+    msg.len = DL_PHYS_ADDR_REQ_SIZE;
+
+    if (putmsg(fd, &msg, NULL, 0) < 0) {
+        NET_ThrowByNameWithLastError(env, JNU_JAVANETPKG "SocketException", "putmsg failed");
+        return -1;
+    }
+
+    dlpaack = (dl_phys_addr_ack_t *)buf;
 
-  memcpy(retbuf, &buf[dlpaack->dl_addr_offset], dlpaack->dl_addr_length);
-  return dlpaack->dl_addr_length;
+    msg.buf = (char *)buf;
+    msg.len = 0;
+    msg.maxlen = sizeof (buf);
+    if (getmsg(fd, &msg, NULL, &flags) < 0) {
+        NET_ThrowByNameWithLastError(env, JNU_JAVANETPKG "SocketException", "getmsg failed");
+        return -1;
+    }
+
+    if (msg.len < DL_PHYS_ADDR_ACK_SIZE || dlpaack->dl_primitive != DL_PHYS_ADDR_ACK) {
+        JNU_ThrowByName(env, JNU_JAVANETPKG "SocketException", "Couldn't obtain phys addr\n");
+        return -1;
+    }
+
+    memcpy(retbuf, &buf[dlpaack->dl_addr_offset], dlpaack->dl_addr_length);
+    return dlpaack->dl_addr_length;
 }
-#endif
 
 /**
  * Get the Hardware address (usually MAC address) for the named interface.
  * return puts the data in buf, and returns the length, in byte, of the
  * MAC address. Returns -1 if there is no hardware address on that interface.
  */
-int getMacAddress(JNIEnv *env, const struct in_addr* addr, const char* ifname,
-                  unsigned char *buf) {
-  int sock;
-#ifdef __linux__
-  static struct ifreq ifr;
-  int i;
+static int getMacAddress(JNIEnv *env, int sock, const char *ifname,  const struct in_addr* addr, unsigned char *buf) {
+    struct arpreq arpreq;
+    struct sockaddr_in* sin;
+    struct sockaddr_in ipAddr;
+    int len, i;
+
+   /**
+    * On Solaris we have to use DLPI, but it will only work if we have
+    * privileged access (i.e. root). If that fails, we try a lookup
+    * in the ARP table, which requires an IPv4 address.
+    */
+    if ((len = getMacFromDevice(env, ifname, buf))  == 0) {
+        /*DLPI failed - trying to do arp lookup*/
+
+       if (addr == NULL) {
+          /**
+           * No IPv4 address for that interface, so can't do an ARP lookup.
+           */
+           return -1;
+      }
 
-  sock = JVM_Socket(AF_INET, SOCK_DGRAM, 0);
+      len = 6; //???
+
+      sin = (struct sockaddr_in *) &arpreq.arp_pa;
+      memset((char *) &arpreq, 0, sizeof(struct arpreq));
+      ipAddr.sin_port = 0;
+      ipAddr.sin_family = AF_INET;
+      memcpy(&ipAddr.sin_addr, addr, sizeof(struct in_addr));
+      memcpy(&arpreq.arp_pa, &ipAddr, sizeof(struct sockaddr_in));
+      arpreq.arp_flags= ATF_PUBL;
 
-  if (sock < 0) {
-    NET_ThrowByNameWithLastError(env, JNU_JAVANETPKG "SocketException",
-                                 "Socket creation failed");
-    return -1;
+      if (ioctl(sock, SIOCGARP, &arpreq) < 0) {
+          if (errno != ENXIO) {
+              // "No such device or address" means no hardware address, so it's
+              // normal don't throw an exception
+              NET_ThrowByNameWithLastError(env, JNU_JAVANETPKG "SocketException", "IOCTL failed");
+              return -1;
+          }
+     }
+
+     memcpy(buf, &arpreq.arp_ha.sa_data[0], len );
   }
 
-  strcpy(ifr.ifr_name, ifname);
-
-  if (ioctl(sock, SIOCGIFHWADDR, &ifr) < 0) {
-    fprintf(stderr, "SIOCIFHWADDR: %s\n",
-            strerror(errno));
-    close(sock);
-    return -1;
-  }
-  memcpy(buf, &ifr.ifr_hwaddr.sa_data, IFHWADDRLEN);
-  close(sock);
-  for (i = 0; i < IFHWADDRLEN; i++) {
-    if (buf[i] != 0)
-      return IFHWADDRLEN;
-  }
-  /*
-   * All bytes to 0 means no hardware address.
-   */
-  return -1;
-#else
-  struct arpreq arpreq;
-  struct sockaddr_in* sin;
-  struct sockaddr_in ipAddr;
-  int len;
-
-  /**
-   * On Solaris we have to use DLPI, but it will only work if we have
-   * privileged access (i.e. root). If that fails, we try a lookup
-   * in the ARP table, which requires an IPv4 address.
-   */
-  if ((len = getMacFromDevice(env, ifname, buf)) > 0) {
-    return len;
-  }
-  if (addr == NULL) {
-    /**
-     * No IPv4 address for that interface, so can't do an ARP lookup.
+    /*
+     * All bytes to 0 means no hardware address.
      */
-    return -1;
-  }
-  sin = (struct sockaddr_in *) &arpreq.arp_pa;
-  memset((char *) &arpreq, 0, sizeof(struct arpreq));
-  ipAddr.sin_port = 0;
-  ipAddr.sin_family = AF_INET;
-  memcpy(&ipAddr.sin_addr, addr, sizeof(struct in_addr));
-  memcpy(&arpreq.arp_pa, &ipAddr, sizeof(struct sockaddr_in));
-  arpreq.arp_flags= ATF_PUBL;
-  sock = JVM_Socket(AF_INET, SOCK_DGRAM, 0);
-
-  if (sock < 0) {
-    NET_ThrowByNameWithLastError(env, JNU_JAVANETPKG "SocketException",
-                                 "Socket creation failed");
-    return -1;
-  }
 
-  if (ioctl(sock, SIOCGARP, &arpreq) >= 0) {
-    close(sock);
-    memcpy(buf, &arpreq.arp_ha.sa_data[0], 6);
-    return 6;
-  }
-
-  if (errno != ENXIO) {
-    // "No such device or address" means no hardware address, so it's
-    // normal don't throw an exception
-    NET_ThrowByNameWithLastError(env, JNU_JAVANETPKG "SocketException",
-                                 "IOCTL failed");
-  }
-  close(sock);
-#endif
-  return -1;
-}
-
-/*
- * Class:     java_net_NetworkInterface
- * Method:    isUp0
- * Signature: (Ljava/lang/String;I)Z
- */
-JNIEXPORT jboolean JNICALL Java_java_net_NetworkInterface_isUp0
-    (JNIEnv *env, jclass cls, jstring name, jint index) {
-    short val;
+    for (i = 0; i < len; i++) {
+      if (buf[i] != 0)
+         return len;
+    }
 
-    val = getFlags(env, name);
-    if ( (val & IFF_UP) && (val &  IFF_RUNNING))
-      return JNI_TRUE;
-    return JNI_FALSE;
-}
-
-/*
- * Class:     java_net_NetworkInterface
- * Method:    isP2P0
- * Signature: (Ljava/lang/String;I)Z
- */
-JNIEXPORT jboolean JNICALL Java_java_net_NetworkInterface_isP2P0
-    (JNIEnv *env, jclass cls, jstring name, jint index) {
-    if (getFlags(env, name) & IFF_POINTOPOINT)
-      return JNI_TRUE;
-    return JNI_FALSE;
-}
-
-/*
- * Class:     java_net_NetworkInterface
- * Method:    isLoopback0
- * Signature: (Ljava/lang/String;I)Z
- */
-JNIEXPORT jboolean JNICALL Java_java_net_NetworkInterface_isLoopback0
-    (JNIEnv *env, jclass cls, jstring name, jint index) {
-    if (getFlags(env, name) & IFF_LOOPBACK)
-      return JNI_TRUE;
-    return JNI_FALSE;
+    return -1;
 }
 
-/*
- * Class:     java_net_NetworkInterface
- * Method:    supportsMulticast0
- * Signature: (Ljava/lang/String;I)Z
- */
-JNIEXPORT jboolean JNICALL Java_java_net_NetworkInterface_supportsMulticast0
-(JNIEnv *env, jclass cls, jstring name, jint index) {
-  short val;
+static int getMTU(JNIEnv *env, int sock,  const char *ifname) {
+    struct lifreq if2;
 
-  val = getFlags(env, name);
-  if (val & IFF_MULTICAST)
-    return JNI_TRUE;
-  return JNI_FALSE;
-}
+    memset((char *) &if2, 0, sizeof(if2));
+    strcpy(if2.lifr_name, ifname);
 
-/*
- * Class:     java_net_NetworkInterface
- * Method:    getMacAddr0
- * Signature: ([bLjava/lang/String;I)[b
- */
-JNIEXPORT jbyteArray JNICALL Java_java_net_NetworkInterface_getMacAddr0(JNIEnv *env, jclass class, jbyteArray addrArray, jstring name, jint index) {
-  jint addr;
-  jbyte caddr[4];
-  struct in_addr iaddr;
-  jbyteArray ret = NULL;
-  unsigned char mac[16];
-  int len;
-  jboolean isCopy;
-  const char* name_utf = (*env)->GetStringUTFChars(env, name, &isCopy);
+    if (ioctl(sock, SIOCGLIFMTU, (char *)&if2) < 0) {
+        NET_ThrowByNameWithLastError(env, JNU_JAVANETPKG "SocketException", "IOCTL SIOCGLIFMTU failed");
+        return -1;
+    }
 
-  if (!IS_NULL(addrArray)) {
-    (*env)->GetByteArrayRegion(env, addrArray, 0, 4, caddr);
-    addr = ((caddr[0]<<24) & 0xff000000);
-    addr |= ((caddr[1] <<16) & 0xff0000);
-    addr |= ((caddr[2] <<8) & 0xff00);
-    addr |= (caddr[3] & 0xff);
-    iaddr.s_addr = htonl(addr);
-    len = getMacAddress(env, &iaddr, name_utf, mac);
-  } else {
-    len = getMacAddress(env, NULL, name_utf, mac);
-  }
-  if (len > 0) {
-    ret = (*env)->NewByteArray(env, len);
-    if (IS_NULL(ret)) {
-      /* we may have memory to free at the end of this */
-      goto fexit;
-    }
-    (*env)->SetByteArrayRegion(env, ret, 0, len, (jbyte *) (mac));
-  }
- fexit:
-  /* release the UTF string and interface list */
-  (*env)->ReleaseStringUTFChars(env, name, name_utf);
-  return ret;
+    return  if2.lifr_mtu;
 }
 
-/*
- * Class:       java_net_NetworkInterface
- * Method:      getMTU0
- * Signature:   ([bLjava/lang/String;I)I
- */
 
-JNIEXPORT jint JNICALL Java_java_net_NetworkInterface_getMTU0(JNIEnv *env, jclass class, jstring name, jint index) {
-  jboolean isCopy;
-  int sock;
-  struct ifreq if2;
-  int ret = -1;
-  const char* name_utf = (*env)->GetStringUTFChars(env, name, &isCopy);
-
-  sock = JVM_Socket(AF_INET, SOCK_DGRAM, 0);
-  if (sock < 0) {
-    NET_ThrowByNameWithLastError(env, JNU_JAVANETPKG "SocketException",
-                                 "Socket creation failed");
-  } else {
-
-#ifdef __linux__
-    memset((char *) &if2, 0, sizeof(if2));
-    strcpy(if2.ifr_name, name_utf);
+static int getFlags(JNIEnv *env, int sock, const char *ifname) {
+     struct   lifreq lifr;
+     memset((caddr_t)&lifr, 0, sizeof(lifr));
+     strcpy((caddr_t)&(lifr.lifr_name), ifname);
 
-    if (ioctl(sock, SIOCGIFMTU, (char *)&if2) >= 0) {
-      ret= if2.ifr_mtu;
-    } else {
-      NET_ThrowByNameWithLastError(env, JNU_JAVANETPKG "SocketException",
-                                   "IOCTL failed");
-    }
-#else /* Solaris */
-    struct   lifreq lifr;
-    memset((caddr_t)&lifr, 0, sizeof(lifr));
-    strcpy((caddr_t)&(lifr.lifr_name), name_utf);
-    if (ioctl(sock, SIOCGLIFMTU, (caddr_t)&lifr) >= 0) {
-      ret = lifr.lifr_mtu;
-#ifdef AF_INET6
-    } else {
-      /* Try wIth an IPv6 socket in case the interface has only IPv6 addresses assigned to it */
-      close(sock);
-      sock = JVM_Socket(AF_INET6, SOCK_DGRAM, 0);
+     if (ioctl(sock, SIOCGLIFFLAGS, (char *)&lifr) < 0) {
+         NET_ThrowByNameWithLastError(env, JNU_JAVANETPKG "SocketException", "IOCTL SIOCGLIFFLAGS failed");
+         return -1;
+     }
 
-      if (sock < 0) {
-        (*env)->ReleaseStringUTFChars(env, name, name_utf);
-        NET_ThrowByNameWithLastError(env, JNU_JAVANETPKG "SocketException",
-                                     "Socket creation failed");
-        return -1;
-      }
+     return  lifr.lifr_flags;
+}
+
 
-      if (ioctl(sock, SIOCGLIFMTU, (caddr_t)&lifr) >= 0) {
-        ret = lifr.lifr_mtu;
-      } else {
-        NET_ThrowByNameWithLastError(env, JNU_JAVANETPKG "SocketException",
-                                     "IOCTL failed");
-      }
-    }
-#else
-    } else {
-        NET_ThrowByNameWithLastError(env, JNU_JAVANETPKG "SocketException",
-                                     "IOCTL failed");
-    }
 #endif
-#endif
-    close(sock);
-  }
-  /* release the UTF string and interface list */
-  (*env)->ReleaseStringUTFChars(env, name, name_utf);
-  return ret;
-}
+
+
--- a/jdk/src/solaris/native/sun/awt/sun_awt_X11_GtkFileDialogPeer.c	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/solaris/native/sun/awt/sun_awt_X11_GtkFileDialogPeer.c	Wed Jul 21 09:57:21 2010 -0700
@@ -42,6 +42,29 @@
             filename);
 }
 
+static void quit(gboolean isSignalHandler)
+{
+    if (dialog != NULL)
+    {
+        // Callbacks from GTK signals are made within the GTK lock
+        // So, within a signal handler there is no need to call
+        // gdk_threads_enter() / fp_gdk_threads_leave()
+        if (!isSignalHandler) {
+            fp_gdk_threads_enter();
+        }
+
+        fp_gtk_widget_hide (dialog);
+        fp_gtk_widget_destroy (dialog);
+
+        fp_gtk_main_quit ();
+        dialog = NULL;
+
+        if (!isSignalHandler) {
+            fp_gdk_threads_leave();
+        }
+    }
+}
+
 /*
  * Class:     sun_awt_X11_GtkFileDialogPeer
  * Method:    quit
@@ -50,14 +73,7 @@
 JNIEXPORT void JNICALL Java_sun_awt_X11_GtkFileDialogPeer_quit
 (JNIEnv * env, jobject jpeer)
 {
-    if (dialog != NULL)
-    {
-        fp_gtk_widget_hide (dialog);
-        fp_gtk_widget_destroy (dialog);
-
-        fp_gtk_main_quit ();
-        dialog = NULL;
-    }
+    quit(FALSE);
 }
 
 /**
@@ -143,7 +159,7 @@
             jfilenames);
     fp_g_free(current_folder);
 
-    Java_sun_awt_X11_GtkFileDialogPeer_quit(NULL, NULL);
+    quit(TRUE);
 }
 
 /*
@@ -162,7 +178,6 @@
         (*env)->GetJavaVM(env, &jvm);
     }
 
-    fp_gdk_threads_init();
     fp_gdk_threads_enter();
 
     const char *title = (*env)->GetStringUTFChars(env, jtitle, 0);
--- a/jdk/src/solaris/native/sun/java2d/opengl/GLXSurfaceData.c	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/solaris/native/sun/java2d/opengl/GLXSurfaceData.c	Wed Jul 21 09:57:21 2010 -0700
@@ -65,6 +65,11 @@
 
     J2dTraceLn(J2D_TRACE_INFO, "GLXSurfaceData_initOps");
 
+    if (oglsdo == NULL) {
+        JNU_ThrowOutOfMemoryError(env, "Initialization of SurfaceData failed.");
+        return;
+    }
+
     if (glxsdo == NULL) {
         JNU_ThrowOutOfMemoryError(env, "creating native GLX ops");
         return;
--- a/jdk/src/solaris/native/sun/java2d/x11/X11SurfaceData.c	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/solaris/native/sun/java2d/x11/X11SurfaceData.c	Wed Jul 21 09:57:21 2010 -0700
@@ -71,7 +71,7 @@
 extern AwtGraphicsConfigDataPtr
     getGraphicsConfigFromComponentPeer(JNIEnv *env, jobject this);
 extern struct X11GraphicsConfigIDs x11GraphicsConfigIDs;
-static jint X11SD_InitWindow(JNIEnv *env, X11SDOps *xsdo);
+
 static int X11SD_FindClip(SurfaceDataBounds *b, SurfaceDataBounds *bounds,
                           X11SDOps *xsdo);
 static int X11SD_ClipToRoot(SurfaceDataBounds *b, SurfaceDataBounds *bounds,
@@ -97,6 +97,54 @@
 
 #endif /* !HEADLESS */
 
+jboolean XShared_initIDs(JNIEnv *env, jboolean allowShmPixmaps)
+{
+#ifndef HEADLESS
+   union {
+        char c[4];
+        int i;
+    } endian;
+
+    endian.i = 0xff000000;
+    nativeByteOrder = (endian.c[0]) ? MSBFirst : LSBFirst;
+
+    dgaAvailable = JNI_FALSE;
+
+    cachedXImage = NULL;
+
+    if (sizeof(X11RIPrivate) > SD_RASINFO_PRIVATE_SIZE) {
+        JNU_ThrowInternalError(env, "Private RasInfo structure too large!");
+        return JNI_FALSE;
+    }
+
+#ifdef MITSHM
+    if (getenv("NO_AWT_MITSHM") == NULL &&
+        getenv("NO_J2D_MITSHM") == NULL) {
+        char * force;
+        TryInitMITShm(env, &useMitShmExt, &useMitShmPixmaps);
+
+        if(allowShmPixmaps) {
+          useMitShmPixmaps = (useMitShmPixmaps == CAN_USE_MITSHM);
+          force = getenv("J2D_PIXMAPS");
+          if (force != NULL) {
+              if (useMitShmPixmaps && (strcmp(force, "shared") == 0)) {
+                  forceSharedPixmaps = JNI_TRUE;
+              } else if (strcmp(force, "server") == 0) {
+                  useMitShmPixmaps = JNI_FALSE;
+              }
+          }
+        }else {
+          useMitShmPixmaps = JNI_FALSE;
+        }
+    }
+
+    return JNI_TRUE;
+#endif /* MITSHM */
+
+#endif /* !HEADLESS */
+}
+
+
 /*
  * Class:     sun_java2d_x11_X11SurfaceData
  * Method:    initIDs
@@ -107,30 +155,17 @@
                                            jclass XORComp, jboolean tryDGA)
 {
 #ifndef HEADLESS
+  if(XShared_initIDs(env, JNI_TRUE))
+  {
     void *lib = 0;
 
-    union {
-        char c[4];
-        int i;
-    } endian;
-
-    endian.i = 0xff000000;
-    nativeByteOrder = (endian.c[0]) ? MSBFirst : LSBFirst;
-
-    cachedXImage = NULL;
-
-    if (sizeof(X11RIPrivate) > SD_RASINFO_PRIVATE_SIZE) {
-        JNU_ThrowInternalError(env, "Private RasInfo structure too large!");
-        return;
-    }
-
     xorCompClass = (*env)->NewGlobalRef(env, XORComp);
 
     if (tryDGA && (getenv("NO_J2D_DGA") == NULL)) {
     /* we use RTLD_NOW because of bug 4032715 */
         lib = dlopen("libsunwjdga.so", RTLD_NOW);
     }
-    dgaAvailable = JNI_FALSE;
+
     if (lib != NULL) {
         JDgaStatus ret = JDGA_FAILED;
         void *sym = dlsym(lib, "JDgaLibInit");
@@ -149,24 +184,7 @@
             lib = NULL;
         }
     }
-
-#ifdef MITSHM
-    if (getenv("NO_AWT_MITSHM") == NULL &&
-        getenv("NO_J2D_MITSHM") == NULL) {
-        char * force;
-        TryInitMITShm(env, &useMitShmExt, &useMitShmPixmaps);
-        useMitShmPixmaps = (useMitShmPixmaps == CAN_USE_MITSHM);
-        force = getenv("J2D_PIXMAPS");
-        if (force != NULL) {
-            if (useMitShmPixmaps && (strcmp(force, "shared") == 0)) {
-                forceSharedPixmaps = JNI_TRUE;
-            } else if (strcmp(force, "server") == 0) {
-                useMitShmPixmaps = JNI_FALSE;
-            }
-        }
-    }
-#endif /* MITSHM */
-
+  }
 #endif /* !HEADLESS */
 }
 
@@ -176,7 +194,7 @@
  * Signature: ()Z
  */
 JNIEXPORT jboolean JNICALL
-Java_sun_java2d_x11_X11SurfaceData_isDrawableValid(JNIEnv *env, jobject this)
+Java_sun_java2d_x11_XSurfaceData_isDrawableValid(JNIEnv *env, jobject this)
 {
     jboolean ret = JNI_FALSE;
 
@@ -194,6 +212,21 @@
 }
 
 /*
+ * Class: sun_java2d_x11_X11SurfaceData
+ * Method: isShmPMAvailable
+ * Signature: ()Z
+ */
+JNIEXPORT jboolean JNICALL
+Java_sun_java2d_x11_X11SurfaceData_isShmPMAvailable(JNIEnv *env, jobject this)
+{
+#if defined(HEADLESS) || !defined(MITSHM)
+    return JNI_FALSE;
+#else
+    return useMitShmPixmaps;
+#endif /* HEADLESS, MITSHM */
+}
+
+/*
  * Class:     sun_java2d_x11_X11SurfaceData
  * Method:    isDgaAvailable
  * Signature: ()Z
@@ -208,35 +241,22 @@
 #endif /* HEADLESS */
 }
 
-
-/*
- * Class:     sun_java2d_x11_X11SurfaceData
- * Method:    isShmPMAvailable
- * Signature: ()Z
- */
-JNIEXPORT jboolean JNICALL
-Java_sun_java2d_x11_X11SurfaceData_isShmPMAvailable(JNIEnv *env, jobject this)
-{
-#if defined(HEADLESS) || !defined(MITSHM)
-    return JNI_FALSE;
-#else
-    return useMitShmPixmaps;
-#endif /* HEADLESS, MITSHM */
-}
-
-
 /*
  * Class:     sun_java2d_x11_X11SurfaceData
  * Method:    initOps
  * Signature: (Ljava/lang/Object;I)V
  */
 JNIEXPORT void JNICALL
-Java_sun_java2d_x11_X11SurfaceData_initOps(JNIEnv *env, jobject xsd,
+Java_sun_java2d_x11_XSurfaceData_initOps(JNIEnv *env, jobject xsd,
                                            jobject peer,
                                            jobject graphicsConfig, jint depth)
 {
 #ifndef HEADLESS
     X11SDOps *xsdo = (X11SDOps*)SurfaceData_InitOps(env, xsd, sizeof(X11SDOps));
+    if (xsdo == NULL) {
+        JNU_ThrowOutOfMemoryError(env, "Initialization of SurfaceData failed.");
+        return;
+    }
     xsdo->sdOps.Lock = X11SD_Lock;
     xsdo->sdOps.GetRasInfo = X11SD_GetRasInfo;
     xsdo->sdOps.Unlock = X11SD_Unlock;
@@ -304,6 +324,8 @@
     } else {
         xsdo->pixelmask = 0xff;
     }
+
+    xsdo->xrPic = None;
 #endif /* !HEADLESS */
 }
 
@@ -313,7 +335,7 @@
  * Signature: ()V
  */
 JNIEXPORT void JNICALL
-Java_sun_java2d_x11_X11SurfaceData_flushNativeSurface(JNIEnv *env, jobject xsd)
+Java_sun_java2d_x11_XSurfaceData_flushNativeSurface(JNIEnv *env, jobject xsd)
 {
 #ifndef HEADLESS
     SurfaceDataOps *ops = SurfaceData_GetOps(env, xsd);
@@ -384,6 +406,11 @@
         XFreeGC(awt_display, xsdo->cachedGC);
         xsdo->cachedGC = NULL;
     }
+
+    if(xsdo->xrPic != None) {
+      XRenderFreePicture(awt_display, xsdo->xrPic);
+    }
+
     AWT_UNLOCK();
 #endif /* !HEADLESS */
 }
@@ -393,7 +420,7 @@
  * Signature: ()V
  */
 JNIEXPORT void JNICALL
-Java_sun_java2d_x11_X11SurfaceData_setInvalid(JNIEnv *env, jobject xsd)
+Java_sun_java2d_x11_XSurfaceData_setInvalid(JNIEnv *env, jobject xsd)
 {
 #ifndef HEADLESS
     X11SDOps *xsdo = (X11SDOps *) SurfaceData_GetOps(env, xsd);
@@ -404,6 +431,63 @@
 #endif /* !HEADLESS */
 }
 
+
+jboolean XShared_initSurface(JNIEnv *env, X11SDOps *xsdo, jint depth, jint width, jint height, jlong drawable)
+{
+#ifndef HEADLESS
+
+    if (drawable != (jlong)0) {
+        /* Double-buffering */
+        xsdo->drawable = drawable;
+        xsdo->isPixmap = JNI_FALSE;
+    } else {
+        xsdo->isPixmap = JNI_TRUE;
+        /* REMIND: workaround for bug 4420220 on pgx32 boards:
+           don't use DGA with pixmaps unless USE_DGA_PIXMAPS is set.
+         */
+        xsdo->dgaAvailable = useDGAWithPixmaps;
+
+        xsdo->pmWidth = width;
+        xsdo->pmHeight = height;
+
+#ifdef MITSHM
+        xsdo->shmPMData.pmSize = width * height * depth;
+        xsdo->shmPMData.pixelsReadThreshold = width * height / 8;
+        if (forceSharedPixmaps) {
+            AWT_LOCK();
+            xsdo->drawable = X11SD_CreateSharedPixmap(xsdo);
+            AWT_UNLOCK();
+            if (xsdo->drawable) {
+                xsdo->shmPMData.usingShmPixmap = JNI_TRUE;
+                xsdo->shmPMData.shmPixmap = xsdo->drawable;
+                return JNI_TRUE;
+            }
+        }
+#endif /* MITSHM */
+
+        AWT_LOCK();
+        xsdo->drawable =
+            XCreatePixmap(awt_display,
+                          RootWindow(awt_display,
+                                     xsdo->configData->awt_visInfo.screen),
+                          width, height, depth);
+        AWT_UNLOCK();
+#ifdef MITSHM
+        xsdo->shmPMData.usingShmPixmap = JNI_FALSE;
+        xsdo->shmPMData.pixmap = xsdo->drawable;
+#endif /* MITSHM */
+    }
+    if (xsdo->drawable == 0) {
+        JNU_ThrowOutOfMemoryError(env,
+                                  "Can't create offscreen surface");
+        return JNI_FALSE;
+    }
+
+    return JNI_TRUE;
+#endif /* !HEADLESS */
+}
+
+
 /*
  * Class:     sun_java2d_x11_X11SurfaceData
  * Method:    initSurface
@@ -428,51 +512,8 @@
        8-bit visuals */
     xsdo->cData = xsdo->configData->color_data;
 
-    if (drawable != (jlong)0) {
-        /* Double-buffering */
-        xsdo->drawable = drawable;
-        xsdo->isPixmap = JNI_FALSE;
-    } else {
-        xsdo->isPixmap = JNI_TRUE;
-        /* REMIND: workaround for bug 4420220 on pgx32 boards:
-           don't use DGA with pixmaps unless USE_DGA_PIXMAPS is set.
-         */
-        xsdo->dgaAvailable = useDGAWithPixmaps;
-
-        xsdo->pmWidth = width;
-        xsdo->pmHeight = height;
-
-#ifdef MITSHM
-        xsdo->shmPMData.pmSize = width * height * depth;
-        xsdo->shmPMData.pixelsReadThreshold = width * height / 8;
-        if (forceSharedPixmaps) {
-            AWT_LOCK();
-            xsdo->drawable = X11SD_CreateSharedPixmap(xsdo);
-            AWT_UNLOCK();
-            if (xsdo->drawable) {
-                xsdo->shmPMData.usingShmPixmap = JNI_TRUE;
-                xsdo->shmPMData.shmPixmap = xsdo->drawable;
-                return;
-            }
-        }
-#endif /* MITSHM */
-
-        AWT_LOCK();
-        xsdo->drawable =
-            XCreatePixmap(awt_display,
-                          RootWindow(awt_display,
-                                     xsdo->configData->awt_visInfo.screen),
-                          width, height, depth);
-        AWT_UNLOCK();
-#ifdef MITSHM
-        xsdo->shmPMData.usingShmPixmap = JNI_FALSE;
-        xsdo->shmPMData.pixmap = xsdo->drawable;
-#endif /* MITSHM */
-    }
-    if (xsdo->drawable == 0) {
-        JNU_ThrowOutOfMemoryError(env,
-                                  "Can't create offscreen surface");
-    }
+    XShared_initSurface(env, xsdo, depth, width, height, drawable);
+    xsdo->xrPic = NULL;
 #endif /* !HEADLESS */
 }
 
@@ -718,7 +759,7 @@
 }
 #endif /* MITSHM */
 
-static jint X11SD_InitWindow(JNIEnv *env, X11SDOps *xsdo)
+jint X11SD_InitWindow(JNIEnv *env, X11SDOps *xsdo)
 {
     if (xsdo->isPixmap == JNI_TRUE) {
         return SD_FAILURE;
@@ -1568,7 +1609,7 @@
  * Signature: (I)J
  */
 JNIEXPORT jlong JNICALL
-Java_sun_java2d_x11_X11SurfaceData_XCreateGC
+Java_sun_java2d_x11_XSurfaceData_XCreateGC
     (JNIEnv *env, jclass xsd, jlong pXSData)
 {
     jlong ret;
@@ -1598,7 +1639,7 @@
  * Signature: (JIIIILsun/java2d/pipe/Region;)V
  */
 JNIEXPORT void JNICALL
-Java_sun_java2d_x11_X11SurfaceData_XResetClip
+Java_sun_java2d_x11_XSurfaceData_XResetClip
     (JNIEnv *env, jclass xsd, jlong xgc)
 {
 #ifndef HEADLESS
@@ -1613,7 +1654,7 @@
  * Signature: (JIIIILsun/java2d/pipe/Region;)V
  */
 JNIEXPORT void JNICALL
-Java_sun_java2d_x11_X11SurfaceData_XSetClip
+Java_sun_java2d_x11_XSurfaceData_XSetClip
     (JNIEnv *env, jclass xsd, jlong xgc,
      jint x1, jint y1, jint x2, jint y2,
      jobject complexclip)
@@ -1688,7 +1729,7 @@
  * Signature: (JZ)V
  */
 JNIEXPORT void JNICALL
-Java_sun_java2d_x11_X11SurfaceData_XSetGraphicsExposures
+Java_sun_java2d_x11_XSurfaceData_XSetGraphicsExposures
     (JNIEnv *env, jclass xsd, jlong xgc, jboolean needExposures)
 {
 #ifndef HEADLESS
--- a/jdk/src/solaris/native/sun/java2d/x11/X11SurfaceData.h	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/solaris/native/sun/java2d/x11/X11SurfaceData.h	Wed Jul 21 09:57:21 2010 -0700
@@ -30,6 +30,8 @@
 
 #include <jdga.h>
 
+#include <X11/extensions/Xrender.h>
+
 /**
  * This include file contains support declarations for loops using the
  * X11 extended SurfaceData interface to talk to an X11 drawable from
@@ -110,6 +112,7 @@
     jboolean            isBgInitialized; /* whether the bg pixel is valid */
     jint                pmWidth;       /* width, height of the */
     jint                pmHeight;      /* pixmap */
+    Picture             xrPic;
 #ifdef MITSHM
     ShmPixmapData       shmPMData;     /* data for switching between shm/nonshm pixmaps*/
 #endif /* MITSHM */
@@ -136,6 +139,9 @@
 void     X11SD_DirectRenderNotify(JNIEnv *env, X11SDOps *xsdo);
 #endif /* !HEADLESS */
 
+jboolean XShared_initIDs(JNIEnv *env, jboolean allowShmPixmaps);
+jboolean XShared_initSurface(JNIEnv *env, X11SDOps *xsdo, jint depth, jint width, jint height, jlong drawable);
+
 /*
  * This function returns a pointer to a native X11SDOps structure
  * for accessing the indicated X11 SurfaceData Java object.  It
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/src/solaris/native/sun/java2d/x11/XRBackendNative.c	Wed Jul 21 09:57:21 2010 -0700
@@ -0,0 +1,784 @@
+/*
+ * Copyright 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.
+ */
+
+#include "X11SurfaceData.h"
+#include <jni.h>
+#include <math.h>
+#include "Region.h"
+#include "fontscalerdefs.h"
+
+#include <X11/extensions/Xrender.h>
+
+#ifndef X_RenderCreateLinearGradient
+typedef struct _XLinearGradient {
+    XPointFixed p1;
+    XPointFixed p2;
+} XLinearGradient;
+#endif
+
+#ifndef X_RenderCreateRadialGradient
+typedef struct _XCircle {
+    XFixed x;
+    XFixed y;
+    XFixed radius;
+} XCircle;
+
+typedef struct _XRadialGradient {
+    XCircle inner;
+    XCircle outer;
+} XRadialGradient;
+#endif
+
+#ifdef __solaris__
+/* Solaris 10 will not have these symbols at runtime */
+#include <dlfcn.h>
+#include <link.h>
+
+typedef Picture (*XRenderCreateLinearGradientFuncType)
+                                     (Display *dpy,
+                                     const XLinearGradient *gradient,
+                                     const XFixed *stops,
+                                     const XRenderColor *colors,
+                                     int nstops);
+
+typedef Picture (*XRenderCreateRadialGradientFuncType)
+                                     (Display *dpy,
+                                     const XRadialGradient *gradient,
+                                     const XFixed *stops,
+                                     const XRenderColor *colors,
+                                     int nstops);
+
+static
+XRenderCreateLinearGradientFuncType XRenderCreateLinearGradientFunc = NULL;
+static
+ XRenderCreateRadialGradientFuncType XRenderCreateRadialGradientFunc = NULL;
+#endif
+
+#define BUILD_TRANSFORM_MATRIX(TRANSFORM, M00, M01, M02, M10, M11, M12)                        \
+    {                                                                                          \
+      TRANSFORM.matrix[0][0] = M00;                                                            \
+      TRANSFORM.matrix[0][1] = M01;                                                            \
+      TRANSFORM.matrix[0][2] = M02;                                                            \
+      TRANSFORM.matrix[1][0] = M10;                                                            \
+      TRANSFORM.matrix[1][1] = M11;                                                            \
+      TRANSFORM.matrix[1][2] = M12;                                                            \
+      TRANSFORM.matrix[2][0] = 0;                                                              \
+      TRANSFORM.matrix[2][1] = 0;                                                              \
+      TRANSFORM.matrix[2][2] = 1<<16;                                                          \
+    }
+
+
+static jboolean IsXRenderAvailable() {
+
+    void *xrenderlib;
+
+    int major_opcode, first_event, first_error;
+
+    if (!XQueryExtension(awt_display, "RENDER",
+                         &major_opcode, &first_event, &first_error)) {
+        return JNI_FALSE;
+    }
+
+#ifdef __solaris__
+    xrenderlib = dlopen("libXrender.so",RTLD_GLOBAL|RTLD_LAZY);
+    if (xrenderlib != NULL) {
+
+        XRenderCreateLinearGradientFunc =
+            (XRenderCreateLinearGradientFuncType)
+            dlsym(xrenderlib, "XRenderCreateLinearGradient");
+
+        XRenderCreateRadialGradientFunc =
+            (XRenderCreateRadialGradientFuncType)
+            dlsym(xrenderlib, "XRenderCreateRadialGradient");
+
+        if (XRenderCreateLinearGradientFunc == NULL ||
+            XRenderCreateRadialGradientFunc == NULL)
+        {
+            dlclose(xrenderlib);
+            return JNI_FALSE;
+        }
+    }
+#endif
+    return JNI_TRUE;
+}
+/*
+ * Class:     sun_awt_X11GraphicsEnvironment
+ * Method:    initGLX
+ * Signature: ()Z
+ */
+JNIEXPORT jboolean JNICALL
+Java_sun_awt_X11GraphicsEnvironment_initXRender
+ (JNIEnv *env, jclass x11ge)
+{
+#ifndef HEADLESS
+    static jboolean xrenderAvailable = JNI_FALSE;
+    static jboolean firstTime = JNI_TRUE;
+
+    if (firstTime) {
+        AWT_LOCK();
+        xrenderAvailable = IsXRenderAvailable();
+        AWT_UNLOCK();
+        firstTime = JNI_FALSE;
+    }
+    return xrenderAvailable;
+#else
+    return JNI_FALSE;
+#endif /* !HEADLESS */
+}
+
+
+JNIEXPORT void JNICALL
+Java_sun_java2d_xr_XRBackendNative_initIDs(JNIEnv *env, jclass cls) {
+    char *maskData;
+    XImage* defaultImg;
+    jfieldID maskImgID;
+    jlong fmt8 =
+        ptr_to_jlong(XRenderFindStandardFormat(awt_display, PictStandardA8));
+    jlong fmt32 =
+       ptr_to_jlong(XRenderFindStandardFormat(awt_display, PictStandardARGB32));
+    jfieldID a8ID = (*env)->GetStaticFieldID(env, cls, "FMTPTR_A8", "J");
+    jfieldID argb32ID = (*env)->GetStaticFieldID(env, cls, "FMTPTR_ARGB32", "J");
+
+    (*env)->SetStaticLongField(env, cls, a8ID, fmt8);
+    (*env)->SetStaticLongField(env, cls, argb32ID, fmt32);
+
+    maskData = (char *) malloc(32*32);
+    if (maskData == NULL) {
+       return;
+    }
+
+    defaultImg = XCreateImage(awt_display, NULL, 8, ZPixmap, 0, maskData, 32, 32, 8, 0);
+    defaultImg->data = maskData; //required?
+    maskImgID = (*env)->GetStaticFieldID(env, cls, "MASK_XIMG", "J");
+    (*env)->SetStaticLongField(env, cls, maskImgID, ptr_to_jlong(defaultImg));
+}
+
+JNIEXPORT void JNICALL
+Java_sun_java2d_xr_XRBackendNative_freeGC
+ (JNIEnv *env, jobject this, jlong gc) {
+    XFreeGC(awt_display, (GC) jlong_to_ptr(gc));
+}
+
+JNIEXPORT jlong JNICALL
+Java_sun_java2d_xr_XRBackendNative_createGC
+ (JNIEnv *env, jobject this, jint drawable) {
+  GC xgc = XCreateGC(awt_display, (Drawable) drawable, 0L, NULL);
+  return ptr_to_jlong(xgc);
+}
+
+JNIEXPORT jint JNICALL
+Java_sun_java2d_xr_XRBackendNative_createPixmap(JNIEnv *env, jobject this,
+                                                jint drawable, jint depth,
+                                                jint width, jint height) {
+    return (jint) XCreatePixmap(awt_display, (Drawable) drawable,
+                                width, height, depth);
+}
+
+JNIEXPORT jint JNICALL
+Java_sun_java2d_xr_XRBackendNative_createPictureNative
+ (JNIEnv *env, jclass cls, jint drawable, jlong formatPtr) {
+  XRenderPictureAttributes pict_attr;
+  return XRenderCreatePicture(awt_display, (Drawable) drawable,
+                              (XRenderPictFormat *) jlong_to_ptr(formatPtr),
+                               0, &pict_attr);
+}
+
+JNIEXPORT void JNICALL
+Java_sun_java2d_xr_XRBackendNative_freePicture
+ (JNIEnv *env, jobject this, jint picture) {
+      XRenderFreePicture(awt_display, (Picture) picture);
+}
+
+JNIEXPORT void JNICALL
+Java_sun_java2d_xr_XRBackendNative_freePixmap
+ (JNIEnv *env, jobject this, jint pixmap) {
+   XFreePixmap(awt_display, (Pixmap) pixmap);
+}
+
+JNIEXPORT void JNICALL
+Java_sun_java2d_xr_XRBackendNative_setPictureRepeat
+ (JNIEnv *env, jobject this, jint picture, jint repeat) {
+    XRenderPictureAttributes pict_attr;
+    pict_attr.repeat = repeat;
+    XRenderChangePicture (awt_display, (Picture) picture, CPRepeat, &pict_attr);
+}
+
+
+JNIEXPORT void JNICALL
+Java_sun_java2d_xr_XRBackendNative_setGCExposures
+ (JNIEnv *env, jobject this, jlong gc, jboolean exposure) {
+    XSetGraphicsExposures(awt_display,
+                         (GC) jlong_to_ptr(gc), exposure ? True : False); //TODO: ????
+}
+
+JNIEXPORT void JNICALL
+Java_sun_java2d_xr_XRBackendNative_setGCForeground
+ (JNIEnv *env, jobject this, jlong gc, jint pixel) {
+    XSetForeground(awt_display, (GC) jlong_to_ptr(gc), (unsigned long) pixel);
+}
+
+
+JNIEXPORT void JNICALL
+Java_sun_java2d_xr_XRBackendNative_copyArea
+ (JNIEnv *env, jobject this, jint src, jint dst, jlong gc,
+  jint srcx, jint srcy, jint width, jint height, jint dstx, jint dsty) {
+    XCopyArea(awt_display, (Drawable) src, (Drawable) dst,
+             (GC) jlong_to_ptr(gc), srcx, srcy, width, height, dstx, dsty);
+}
+
+JNIEXPORT void JNICALL
+Java_sun_java2d_xr_XRBackendNative_renderComposite
+ (JNIEnv *env, jobject this, jbyte op, jint src, jint mask, jint dst,
+  jint srcX, jint srcY, jint maskX, jint maskY,
+  jint dstX, jint dstY, jint width, jint height) {
+    XRenderComposite (awt_display, op,
+                      (Picture)src, (Picture)mask, (Picture)dst,
+                       srcX, srcY, maskX, maskY, dstX, dstY, width, height);
+}
+
+JNIEXPORT void JNICALL
+Java_sun_java2d_xr_XRBackendNative_renderRectangle
+ (JNIEnv *env, jobject this, jint dst, jbyte op,
+  jshort red, jshort green, jshort blue, jshort alpha,
+  jint x, jint y, jint width, jint height) {
+    XRenderColor color;
+    color.alpha = alpha;
+    color.red = red;
+    color.green = green;
+    color.blue = blue;
+    XRenderFillRectangle(awt_display, op, (Picture) dst, &color,
+                         x, y, width, height);
+}
+
+JNIEXPORT void JNICALL
+Java_sun_java2d_xr_XRBackendNative_XRenderRectanglesNative
+ (JNIEnv *env, jclass xsd, jint dst, jbyte op,
+  jshort red, jshort green, jshort blue, jshort alpha,
+  jintArray rectArray, jint rectCnt) {
+    int i;
+    jint* rects;
+    XRectangle *xRects;
+    XRectangle sRects[256];
+
+    XRenderColor color;
+    color.alpha = alpha;
+    color.red = red;
+    color.green = green;
+    color.blue = blue;
+
+    if (rectCnt <= 256) {
+      xRects = &sRects[0];
+    } else {
+      xRects = (XRectangle *) malloc(sizeof(XRectangle) * rectCnt);
+      if (xRects == NULL) {
+        return;
+      }
+    }
+
+    if ((rects = (jint *) (*env)->GetPrimitiveArrayCritical(env, rectArray, NULL)) == NULL) {
+      return;
+    }
+
+    for (i=0; i < rectCnt; i++) {
+      xRects[i].x = rects[i*4 + 0];
+      xRects[i].y = rects[i*4 + 1];
+      xRects[i].width = rects[i*4 + 2];
+      xRects[i].height = rects[i*4 + 3];
+    }
+
+    XRenderFillRectangles(awt_display, op,
+                          (Picture) dst, &color, xRects, rectCnt);
+
+    (*env)->ReleasePrimitiveArrayCritical(env, rectArray, rects, JNI_ABORT);
+    if (xRects != &sRects[0]) {
+      free(xRects);
+    }
+}
+
+JNIEXPORT void JNICALL
+Java_sun_java2d_xr_XRBackendNative_XRSetTransformNative
+ (JNIEnv *env, jclass xsd, jint pic,
+  jint m00, jint m01, jint m02, jint m10, jint m11, jint m12) {
+
+  XTransform tr;
+  BUILD_TRANSFORM_MATRIX(tr, m00, m01, m02, m10, m11, m12);
+  XRenderSetPictureTransform (awt_display, (Picture) pic, &tr);
+}
+
+JNIEXPORT jint JNICALL
+Java_sun_java2d_xr_XRBackendNative_XRCreateLinearGradientPaintNative
+    (JNIEnv *env, jclass xsd, jfloatArray fractionsArray,
+     jshortArray pixelsArray, jint x1, jint y1, jint x2, jint y2,
+     jint numStops, jint repeat,
+     jint m00, jint m01, jint m02, jint m10, jint m11, jint m12) {
+   jint i;
+   jshort* pixels;
+   jfloat* fractions;
+   XTransform tr;
+   XRenderPictureAttributes pict_attr;
+   Picture gradient = 0;
+   XRenderColor *colors;
+   XFixed *stops;
+   XLinearGradient grad;
+
+   if ((pixels = (jshort *)
+        (*env)->GetPrimitiveArrayCritical(env, pixelsArray, NULL)) == NULL) {
+       return -1;
+   }
+   if ((fractions = (jfloat *)
+       (*env)->GetPrimitiveArrayCritical(env, fractionsArray, NULL)) == NULL) {
+       (*env)->ReleasePrimitiveArrayCritical(env,
+                                              pixelsArray, pixels, JNI_ABORT);
+       return -1;
+   }
+
+    grad.p1.x = x1;
+    grad.p1.y = y1;
+    grad.p2.x = x2;
+    grad.p2.y = y2;
+
+    /*TODO optimized & malloc check*/
+    colors = (XRenderColor *) malloc(numStops * sizeof(XRenderColor));
+    stops =  (XFixed *) malloc(numStops * sizeof(XFixed));
+
+    for (i=0; i < numStops; i++) {
+      stops[i] = XDoubleToFixed(fractions[i]);
+      colors[i].alpha = pixels[i*4 + 0];
+      colors[i].red = pixels[i*4 + 1];
+      colors[i].green = pixels[i*4 + 2];
+      colors[i].blue = pixels[i*4 + 3];
+    }
+#ifdef __solaris__
+    if (XRenderCreateLinearGradientFunc!=NULL) {
+      gradient = (*XRenderCreateLinearGradientFunc)(awt_display, &grad, stops, colors, numStops);
+    }
+#else
+    gradient = XRenderCreateLinearGradient(awt_display, &grad, stops, colors, numStops);
+#endif
+    free(colors);
+    free(stops);
+
+   (*env)->ReleasePrimitiveArrayCritical(env, pixelsArray, pixels, JNI_ABORT);
+   (*env)->ReleasePrimitiveArrayCritical(env, fractionsArray, fractions, JNI_ABORT);
+
+    if (gradient != 0) {
+        BUILD_TRANSFORM_MATRIX(tr, m00, m01, m02, m10, m11, m12);
+        XRenderSetPictureTransform (awt_display, gradient, &tr);
+        pict_attr.repeat = repeat;
+        XRenderChangePicture (awt_display, gradient, CPRepeat, &pict_attr);
+    }
+
+   return (jint) gradient;
+}
+
+
+JNIEXPORT jint JNICALL
+Java_sun_java2d_xr_XRBackendNative_XRCreateRadialGradientPaintNative
+    (JNIEnv *env, jclass xsd, jfloatArray fractionsArray,
+     jshortArray pixelsArray, jint numStops,
+     jint innerRadius, jint outerRadius, jint repeat,
+     jint m00, jint m01, jint m02, jint m10, jint m11, jint m12) {
+   jint i;
+   jshort* pixels;
+   jfloat* fractions;
+   XTransform tr;
+   XRenderPictureAttributes pict_attr;
+   Picture gradient = 0;
+   XRenderColor *colors;
+   XFixed *stops;
+   XRadialGradient grad;
+
+
+   if ((pixels =
+       (jshort *)(*env)->GetPrimitiveArrayCritical(env, pixelsArray, NULL)) == NULL) {
+       return -1;
+   }
+   if ((fractions = (jfloat *)
+        (*env)->GetPrimitiveArrayCritical(env, fractionsArray, NULL)) == NULL) {
+       (*env)->ReleasePrimitiveArrayCritical(env,
+                                             pixelsArray, pixels, JNI_ABORT);
+       return -1; //TODO release pixels first
+   }
+
+    grad.inner.x = 0;
+    grad.inner.y = 0;
+    grad.inner.radius = innerRadius;
+    grad.outer.x = 0;
+    grad.outer.y = 0;
+    grad.outer.radius = outerRadius;
+
+    /*TODO optimized & malloc check*/
+    colors = (XRenderColor *) malloc(numStops * sizeof(XRenderColor));
+    stops =  (XFixed *) malloc(numStops * sizeof(XFixed));
+
+    for (i=0; i < numStops; i++) {
+      stops[i] = XDoubleToFixed(fractions[i]);
+      colors[i].alpha = pixels[i*4 + 0];
+      colors[i].red = pixels[i*4 + 1];
+      colors[i].green = pixels[i*4 + 2];
+      colors[i].blue = pixels[i*4 + 3];
+    }
+#ifdef __solaris__
+    if (XRenderCreateRadialGradientFunc != NULL) {
+        gradient = (jint) (*XRenderCreateRadialGradientFunc)(awt_display, &grad, stops, colors, numStops);
+    }
+#else
+    gradient = (jint) XRenderCreateRadialGradient(awt_display, &grad, stops, colors, numStops);
+#endif
+    free(colors);
+    free(stops);
+
+   (*env)->ReleasePrimitiveArrayCritical(env, pixelsArray, pixels, JNI_ABORT);
+   (*env)->ReleasePrimitiveArrayCritical(env, fractionsArray, fractions, JNI_ABORT);
+
+
+    if (gradient != 0) {
+        BUILD_TRANSFORM_MATRIX(tr, m00, m01, m02, m10, m11, m12);
+        XRenderSetPictureTransform (awt_display, gradient, &tr);
+        pict_attr.repeat = repeat;
+        XRenderChangePicture (awt_display, gradient, CPRepeat, &pict_attr);
+    }
+
+   return (jint) gradient;
+}
+
+JNIEXPORT void JNICALL
+Java_sun_java2d_xr_XRBackendNative_setFilter
+ (JNIEnv *env, jobject this, jint picture, jint filter) {
+
+  char * filterName = "fast";
+
+  switch(filter) {
+    case 0:
+      filterName = "fast";
+      break;
+
+    case 1:
+      filterName = "good";
+      break;
+
+    case 2:
+      filterName = "best";
+      break;
+  }
+
+    XRenderSetPictureFilter(awt_display, (Picture) picture, filterName, NULL, 0);
+}
+
+JNIEXPORT void JNICALL
+Java_sun_java2d_xr_XRBackendNative_XRSetClipNative
+    (JNIEnv *env, jclass xsd, jlong dst,
+     jint x1, jint y1, jint x2, jint y2,
+     jobject complexclip, jboolean isGC)
+{
+    int numrects;
+    XRectangle rects[256];
+    XRectangle *pRect = rects;
+
+    numrects = RegionToYXBandedRectangles(env,
+            x1, y1, x2, y2, complexclip,
+            &pRect, 256);
+
+    if (isGC == JNI_TRUE) {
+      if (dst != (jlong) 0) {
+          XSetClipRectangles(awt_display, (GC) jlong_to_ptr(dst), 0, 0, pRect, numrects, YXBanded);
+      }
+    } else {
+       XRenderSetPictureClipRectangles (awt_display, (Picture) dst, 0, 0, pRect, numrects);
+    }
+
+    if (pRect != rects) {
+        free(pRect);
+    }
+}
+
+JNIEXPORT void JNICALL
+Java_sun_java2d_xr_XRBackendNative_putMaskNative
+ (JNIEnv *env, jclass cls, jint drawable, jlong gc, jbyteArray imageData,
+  jint sx, jint sy, jint dx, jint dy, jint width, jint height,
+  jint maskOff, jint maskScan, jfloat ea, jlong imgPtr) {
+
+    int line, pix;
+    char *mask;
+    char *defaultData;
+    XImage *defaultImg, *img;
+    jboolean imageFits;
+
+    if ((mask = (char *)
+         (*env)->GetPrimitiveArrayCritical(env, imageData, NULL)) == NULL) {
+        return;
+     }
+
+    defaultImg = (XImage *) jlong_to_ptr(imgPtr);
+
+    if (ea != 1.0f) {
+        for (line=0; line < height; line++) {
+            for (pix=0; pix < width; pix++) {
+                int index = maskScan*line + pix + maskOff;
+                mask[index] = (((unsigned char) mask[index])*ea);
+            }
+        }
+    }
+
+    /*
+    * 1. If existing XImage and supplied buffer match, only adjust the data pointer
+    * 2. If existing XImage is large enough to hold the data but does not match in
+    *    scan the data is copied to fit the XImage.
+    * 3. If data is larger than the existing XImage a new temporary XImage is
+    *    allocated.
+    * The default XImage is optimized for the AA tiles, which are currently 32x32.
+    */
+    defaultData = defaultImg->data;
+    img = defaultImg;
+    imageFits = defaultImg->width >= width && defaultImg->height >= height;
+
+    if (imageFits &&
+        maskOff == defaultImg->xoffset && maskScan == defaultImg->bytes_per_line) {
+        defaultImg->data = mask;
+    } else {
+        if (imageFits) {
+            for (line=0; line < height; line++) {
+                for (pix=0; pix < width; pix++) {
+                    img->data[line*img->bytes_per_line + pix] =
+                        (unsigned char) (mask[maskScan*line + pix + maskOff]);
+                }
+            }
+        } else {
+            img = XCreateImage(awt_display, NULL, 8, ZPixmap,
+                               maskOff, mask, maskScan, height, 8, 0);
+        }
+    }
+
+    XPutImage(awt_display, (Pixmap) drawable, (GC) jlong_to_ptr(gc),
+              img, 0, 0, 0, 0, width, height);
+    (*env)->ReleasePrimitiveArrayCritical(env, imageData, mask, JNI_ABORT);
+
+    if (img != defaultImg) {
+        img->data = NULL;
+        XDestroyImage(img);
+    }
+    defaultImg->data = defaultData;
+}
+
+JNIEXPORT void JNICALL
+Java_sun_java2d_xr_XRBackendNative_XRAddGlyphsNative
+ (JNIEnv *env, jclass cls, jint glyphSet,
+  jlongArray glyphInfoPtrsArray, jint glyphCnt,
+  jbyteArray pixelDataArray, int pixelDataLength) {
+    jlong *glyphInfoPtrs;
+    unsigned char *pixelData;
+    int i;
+
+    XGlyphInfo *xginfo = (XGlyphInfo *) malloc(sizeof(XGlyphInfo) * glyphCnt);
+    Glyph *gid = (Glyph *) malloc(sizeof(Glyph) * glyphCnt);
+
+    if (xginfo == NULL || gid == NULL) {
+      return;
+    }
+
+    if ((glyphInfoPtrs = (jlong *) (*env)->GetPrimitiveArrayCritical(env, glyphInfoPtrsArray, NULL)) == NULL) {
+        return;
+    }
+
+    if ((pixelData = (unsigned char *)
+        (*env)->GetPrimitiveArrayCritical(env, pixelDataArray, NULL)) == NULL) {
+        (*env)->ReleasePrimitiveArrayCritical(env,
+                                  glyphInfoPtrsArray, glyphInfoPtrs, JNI_ABORT);
+        return;
+    }
+
+    for (i=0; i < glyphCnt; i++) {
+      GlyphInfo *jginfo = (GlyphInfo *) jlong_to_ptr(glyphInfoPtrs[i]);
+
+      gid[i] = (Glyph) (0xffffffff & ((unsigned int) jginfo->cellInfo));
+      xginfo[i].x = (-jginfo->topLeftX);
+      xginfo[i].y = (-jginfo->topLeftY);
+      xginfo[i].width = jginfo->width;
+      xginfo[i].height = jginfo->height;
+      xginfo[i].xOff = round(jginfo->advanceX);
+      xginfo[i].yOff = round(jginfo->advanceY);
+    }
+
+    XRenderAddGlyphs(awt_display, glyphSet, &gid[0], &xginfo[0], glyphCnt,
+                     pixelData, pixelDataLength);
+
+    (*env)->ReleasePrimitiveArrayCritical(env, glyphInfoPtrsArray, glyphInfoPtrs, JNI_ABORT);
+    (*env)->ReleasePrimitiveArrayCritical(env, pixelDataArray, pixelData, JNI_ABORT);
+
+    free(xginfo);
+    free(gid);
+}
+
+JNIEXPORT void JNICALL
+Java_sun_java2d_xr_XRBackendNative_XRFreeGlyphsNative
+ (JNIEnv *env, jclass cls, jint glyphSet, jintArray gidArray, jint glyphCnt) {
+    jint *gids;
+    int i;
+
+    if ((gids = (jint *) (*env)->GetPrimitiveArrayCritical(env, gidArray, NULL)) == NULL) {
+        return;
+    }
+
+    XRenderFreeGlyphs (awt_display, (GlyphSet) glyphSet, (Glyph *) gids, glyphCnt);
+
+    (*env)->ReleasePrimitiveArrayCritical(env, gidArray, gids, JNI_ABORT);
+}
+
+JNIEXPORT jint JNICALL
+Java_sun_java2d_xr_XRBackendNative_XRenderCreateGlyphSetNative
+ (JNIEnv *env, jclass cls, jlong format) {
+  return XRenderCreateGlyphSet(awt_display, (XRenderPictFormat *) jlong_to_ptr(format));
+}
+
+JNIEXPORT void JNICALL
+Java_sun_java2d_xr_XRBackendNative_XRenderCompositeTextNative
+ (JNIEnv *env, jclass cls, jint op, jint src, jint dst, jlong maskFmt,
+  jintArray eltArray, jintArray  glyphIDArray, jint eltCnt, jint glyphCnt) {
+    jint i;
+    jint *ids;
+    jint *elts;
+    XGlyphElt32 *xelts;
+    Glyph *xids;
+    XGlyphElt32 selts[24];
+    Glyph sids[256];
+    int charCnt = 0;
+
+    if (eltCnt <= 24) {
+      xelts = &selts[0];
+    }else {
+      xelts = (XGlyphElt32 *) malloc(sizeof(XGlyphElt32) * eltCnt);
+    }
+
+    if (glyphCnt <= 256) {
+      xids = &sids[0];
+    }else {
+      xids = (Glyph *) malloc(sizeof(Glyph) * glyphCnt);
+    }
+
+    if ((ids = (jint *) (*env)->GetPrimitiveArrayCritical(env, glyphIDArray, NULL)) == NULL) {
+      return;
+    }
+    if ((elts = (jint *)
+          (*env)->GetPrimitiveArrayCritical(env, eltArray, NULL)) == NULL) {
+        (*env)->ReleasePrimitiveArrayCritical(env,
+                                              glyphIDArray, ids, JNI_ABORT);
+      return;
+    }
+
+    for (i=0; i < glyphCnt; i++) {
+      xids[i] = (Glyph) ids[i];
+    }
+
+    for (i=0; i < eltCnt; i++) {
+      xelts[i].nchars = elts[i*4 + 0];
+      xelts[i].xOff = elts[i*4 + 1];
+      xelts[i].yOff = elts[i*4 + 2];
+      xelts[i].glyphset = (GlyphSet) elts[i*4 + 3];
+      xelts[i].chars = (unsigned int *) &xids[charCnt];
+
+      charCnt += xelts[i].nchars;
+    }
+
+    XRenderCompositeText32(awt_display, op, (Picture) src, (Picture) dst,
+                           (XRenderPictFormat *) jlong_to_ptr(maskFmt),
+                            0, 0, 0, 0, xelts, eltCnt);
+
+    (*env)->ReleasePrimitiveArrayCritical(env, glyphIDArray, ids, JNI_ABORT);
+    (*env)->ReleasePrimitiveArrayCritical(env, eltArray, elts, JNI_ABORT);
+
+    if (xelts != &selts[0]) {
+      free(xelts);
+    }
+
+    if (xids != &sids[0]) {
+      free(xids);
+    }
+}
+
+JNIEXPORT void JNICALL
+Java_sun_java2d_xr_XRBackendNative_setGCMode
+ (JNIEnv *env, jobject this, jlong gc, jboolean copy) {
+  GC xgc = (GC) jlong_to_ptr(gc);
+
+  if (copy == JNI_TRUE) {
+    XSetFunction(awt_display, xgc, GXcopy);
+  } else {
+    XSetFunction(awt_display, xgc, GXxor);
+  }
+}
+
+JNIEXPORT void JNICALL
+Java_sun_java2d_xr_XRBackendNative_GCRectanglesNative
+ (JNIEnv *env, jclass xsd, jint dst, jlong gc,
+  jintArray rectArray, jint rectCnt) {
+    int i;
+    jint* rects;
+    XRectangle *xRects;
+    XRectangle sRects[256];
+
+    if (rectCnt <= 256) {
+      xRects = &sRects[0];
+    } else {
+      xRects = (XRectangle *) malloc(sizeof(XRectangle) * rectCnt);
+      if (xRects == NULL) {
+        return;
+      }
+    }
+
+    if ((rects = (jint *) (*env)->GetPrimitiveArrayCritical(env, rectArray, NULL)) == NULL) {
+      return;
+    }
+
+    for (i=0; i < rectCnt; i++) {
+      xRects[i].x = rects[i*4 + 0];
+      xRects[i].y = rects[i*4 + 1];
+      xRects[i].width = rects[i*4 + 2];
+      xRects[i].height = rects[i*4 + 3];
+    }
+
+    XFillRectangles(awt_display, (Drawable) dst, (GC) jlong_to_ptr(gc), xRects, rectCnt);
+
+    (*env)->ReleasePrimitiveArrayCritical(env, rectArray, rects, JNI_ABORT);
+    if (xRects != &sRects[0]) {
+      free(xRects);
+    }
+}
+
+JNIEXPORT void JNICALL
+Java_sun_java2d_xr_XRBackendNative_renderCompositeTrapezoidsNative
+ (JNIEnv *env, jclass cls, jbyte op, jint src, jlong maskFmt,
+ jint dst, jint srcX, jint srcY, jintArray  trapArray) {
+    jint *traps;
+
+    if ((traps = (jint *) (*env)->GetPrimitiveArrayCritical(env, trapArray, NULL)) == NULL) {
+      return;
+    }
+
+    XRenderCompositeTrapezoids(awt_display, op, (Picture) src, (Picture) dst,
+                               (XRenderPictFormat *) jlong_to_ptr(maskFmt),
+                               srcX, srcY, (XTrapezoid *) (traps+5), traps[0]);
+
+    (*env)->ReleasePrimitiveArrayCritical(env, trapArray, traps, JNI_ABORT);
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/src/solaris/native/sun/java2d/x11/XRSurfaceData.c	Wed Jul 21 09:57:21 2010 -0700
@@ -0,0 +1,116 @@
+/*
+ * Copyright 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.
+ */
+
+#include "GraphicsPrimitiveMgr.h"
+#include "Region.h"
+#include "Trace.h"
+#include "X11SurfaceData.h"
+
+/*#include <xcb/xcb.h>*/
+#include <Xrender.h>
+
+#ifndef RepeatNone  /* added in 0.10 */
+#define RepeatNone    0
+#define RepeatNormal  1
+#define RepeatPad     2
+#define RepeatReflect 3
+#endif
+
+
+#include <sys/uio.h>
+#include <dlfcn.h>
+#include <setjmp.h>
+
+#ifndef HEADLESS
+jfieldID pictID;
+jfieldID xidID;
+jfieldID blitMaskPMID;
+jfieldID blitMaskPictID;
+#endif /* !HEADLESS */
+
+JNIEXPORT void JNICALL
+   Java_sun_java2d_xr_XRSurfaceData_initXRPicture(JNIEnv *env, jobject xsd,
+                                                  jlong pXSData,
+                                                  jint pictFormat)
+{
+#ifndef HEADLESS
+
+  X11SDOps *xsdo;
+  XRenderPictFormat *fmt;
+
+  J2dTraceLn(J2D_TRACE_INFO, "in XRSurfaceData_initXRender");
+
+  xsdo = (X11SDOps *) jlong_to_ptr(pXSData);
+  if (xsdo == NULL) {
+      return;
+  }
+
+  if (xsdo->xrPic == None) {
+      XRenderPictureAttributes pict_attr;
+      pict_attr.repeat = RepeatNone;
+      fmt = XRenderFindStandardFormat(awt_display, pictFormat);
+      xsdo->xrPic =
+         XRenderCreatePicture(awt_display, xsdo->drawable, fmt,
+                              CPRepeat, &pict_attr);
+  }
+
+  (*env)->SetIntField (env, xsd, pictID, xsdo->xrPic);
+  (*env)->SetIntField (env, xsd, xidID, xsdo->drawable);
+#endif /* !HEADLESS */
+}
+
+JNIEXPORT void JNICALL
+Java_sun_java2d_xr_XRSurfaceData_initIDs(JNIEnv *env, jclass xsd)
+{
+#ifndef HEADLESS
+  J2dTraceLn(J2D_TRACE_INFO, "in XRSurfaceData_initIDs");
+
+  pictID = (*env)->GetFieldID(env, xsd, "picture", "I");
+  xidID = (*env)->GetFieldID(env, xsd, "xid", "I");
+
+  XShared_initIDs(env, JNI_FALSE);
+#endif /* !HEADLESS */
+}
+
+
+JNIEXPORT void JNICALL
+Java_sun_java2d_xr_XRSurfaceData_XRInitSurface(JNIEnv *env, jclass xsd,
+                                               jint depth,
+                                               jint width, jint height,
+                                               jlong drawable, jint pictFormat)
+{
+#ifndef HEADLESS
+    X11SDOps *xsdo;
+
+    J2dTraceLn(J2D_TRACE_INFO, "in XRSurfaceData_initSurface");
+
+    xsdo = X11SurfaceData_GetOps(env, xsd);
+    if (xsdo == NULL) {
+        return;
+    }
+
+    XShared_initSurface(env, xsdo, depth, width, height, drawable);
+#endif /* !HEADLESS */
+}
--- a/jdk/src/windows/bin/java_md.c	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/windows/bin/java_md.c	Wed Jul 21 09:57:21 2010 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -80,26 +80,22 @@
  *
  */
 void
-CreateExecutionEnvironment(int *_argc,
-                           char ***_argv,
-                           char jrepath[],
-                           jint so_jrepath,
-                           char jvmpath[],
-                           jint so_jvmpath,
-                           char **original_argv) {
+CreateExecutionEnvironment(int *pargc, char ***pargv,
+                           char *jrepath, jint so_jrepath,
+                           char *jvmpath, jint so_jvmpath) {
     char * jvmtype;
     int i = 0;
-    char** pargv = *_argv;
     int running = CURRENT_DATA_MODEL;
 
     int wanted = running;
 
-    for (i = 0; i < *_argc ; i++) {
-        if (JLI_StrCmp(pargv[i], "-J-d64") == 0 || JLI_StrCmp(pargv[i], "-d64") == 0) {
+    char** argv = *pargv;
+    for (i = 0; i < *pargc ; i++) {
+        if (JLI_StrCmp(argv[i], "-J-d64") == 0 || JLI_StrCmp(argv[i], "-d64") == 0) {
             wanted = 64;
             continue;
         }
-        if (JLI_StrCmp(pargv[i], "-J-d32") == 0 || JLI_StrCmp(pargv[i], "-d32") == 0) {
+        if (JLI_StrCmp(argv[i], "-J-d32") == 0 || JLI_StrCmp(argv[i], "-d32") == 0) {
             wanted = 32;
             continue;
         }
@@ -123,7 +119,12 @@
         JLI_ReportErrorMessage(CFG_ERROR7);
         exit(1);
     }
-    jvmtype = CheckJvmType(_argc, _argv, JNI_FALSE);
+
+    jvmtype = CheckJvmType(pargc, pargv, JNI_FALSE);
+    if (JLI_StrCmp(jvmtype, "ERROR") == 0) {
+        JLI_ReportErrorMessage(CFG_ERROR9);
+        exit(4);
+    }
 
     jvmpath[0] = '\0';
     if (!GetJVMPath(jrepath, jvmtype, jvmpath, so_jvmpath)) {
@@ -131,7 +132,6 @@
         exit(4);
     }
     /* If we got here, jvmpath has been correctly initialized. */
-
 }
 
 
@@ -203,19 +203,21 @@
     PREJVMSTART PreJVMStart;
     struct stat s;
 
+    /* Make sure the jrepath contains something */
+    if (jrepath[0] == NULL) {
+        return;
+    }
     /* 32 bit windows only please */
-    if (strcmp(GetArch(), "i386") != 0 ) {
+    if (JLI_StrCmp(GetArch(), "i386") != 0 ) {
         return;
     }
     /* Does our bundle directory exist ? */
-    strcpy(tmpbuf, jrepath);
-    strcat(tmpbuf, "\\lib\\bundles");
+    JLI_Snprintf(tmpbuf, sizeof(tmpbuf), "%s\\lib\\bundles", jrepath);
     if (stat(tmpbuf, &s) != 0) {
         return;
     }
     /* Does our jkernel dll exist ? */
-    strcpy(tmpbuf, jrepath);
-    strcat(tmpbuf, "\\bin\\jkernel.dll");
+    JLI_Snprintf(tmpbuf, sizeof(tmpbuf), "%s\\bin\\jkernel.dll", jrepath);
     if (stat(tmpbuf, &s) != 0) {
         return;
     }
@@ -249,30 +251,30 @@
 
     if (GetApplicationHome(path, pathsize)) {
         /* Is JRE co-located with the application? */
-        sprintf(javadll, "%s\\bin\\" JAVA_DLL, path);
+        JLI_Snprintf(javadll, sizeof(javadll), "%s\\bin\\" JAVA_DLL, path);
         if (stat(javadll, &s) == 0) {
-            goto found;
+            JLI_TraceLauncher("JRE path is %s\n", path);
+            return JNI_TRUE;
         }
 
         /* Does this app ship a private JRE in <apphome>\jre directory? */
-        sprintf(javadll, "%s\\jre\\bin\\" JAVA_DLL, path);
+        JLI_Snprintf(javadll, sizeof (javadll), "%s\\jre\\bin\\" JAVA_DLL, path);
         if (stat(javadll, &s) == 0) {
             JLI_StrCat(path, "\\jre");
-            goto found;
+            JLI_TraceLauncher("JRE path is %s\n", path);
+            return JNI_TRUE;
         }
     }
 
     /* Look for a public JRE on this machine. */
     if (GetPublicJREHome(path, pathsize)) {
-        goto found;
+        JLI_TraceLauncher("JRE path is %s\n", path);
+        return JNI_TRUE;
     }
 
     JLI_ReportErrorMessage(JRE_ERROR8 JAVA_DLL);
     return JNI_FALSE;
 
- found:
-    JLI_TraceLauncher("JRE path is %s\n", path);
-    return JNI_TRUE;
 }
 
 /*
@@ -286,9 +288,9 @@
 {
     struct stat s;
     if (JLI_StrChr(jvmtype, '/') || JLI_StrChr(jvmtype, '\\')) {
-        sprintf(jvmpath, "%s\\" JVM_DLL, jvmtype);
+        JLI_Snprintf(jvmpath, jvmpathsize, "%s\\" JVM_DLL, jvmtype);
     } else {
-        sprintf(jvmpath, "%s\\bin\\%s\\" JVM_DLL, jrepath, jvmtype);
+        JLI_Snprintf(jvmpath, jvmpathsize, "%s\\bin\\%s\\" JVM_DLL, jrepath, jvmtype);
     }
     if (stat(jvmpath, &s) == 0) {
         return JNI_TRUE;
--- a/jdk/src/windows/classes/java/lang/ProcessImpl.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/windows/classes/java/lang/ProcessImpl.java	Wed Jul 21 09:57:21 2010 -0700
@@ -159,7 +159,7 @@
         new java.security.PrivilegedAction<Void>() {
         public Void run() {
             if (stdHandles[0] == -1L)
-                stdin_stream = new ProcessBuilder.NullOutputStream();
+                stdin_stream = ProcessBuilder.NullOutputStream.INSTANCE;
             else {
                 FileDescriptor stdin_fd = new FileDescriptor();
                 fdAccess.setHandle(stdin_fd, stdHandles[0]);
@@ -168,7 +168,7 @@
             }
 
             if (stdHandles[1] == -1L)
-                stdout_stream = new ProcessBuilder.NullInputStream();
+                stdout_stream = ProcessBuilder.NullInputStream.INSTANCE;
             else {
                 FileDescriptor stdout_fd = new FileDescriptor();
                 fdAccess.setHandle(stdout_fd, stdHandles[1]);
@@ -177,7 +177,7 @@
             }
 
             if (stdHandles[2] == -1L)
-                stderr_stream = new ProcessBuilder.NullInputStream();
+                stderr_stream = ProcessBuilder.NullInputStream.INSTANCE;
             else {
                 FileDescriptor stderr_fd = new FileDescriptor();
                 fdAccess.setHandle(stderr_fd, stdHandles[2]);
--- a/jdk/src/windows/classes/sun/nio/ch/WindowsSelectorImpl.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/windows/classes/sun/nio/ch/WindowsSelectorImpl.java	Wed Jul 21 09:57:21 2010 -0700
@@ -312,14 +312,17 @@
         private int processSelectedKeys(long updateCount) {
             int numKeysUpdated = 0;
             numKeysUpdated += processFDSet(updateCount, readFds,
-                                           PollArrayWrapper.POLLIN);
+                                           PollArrayWrapper.POLLIN,
+                                           false);
             numKeysUpdated += processFDSet(updateCount, writeFds,
                                            PollArrayWrapper.POLLCONN |
-                                           PollArrayWrapper.POLLOUT);
+                                           PollArrayWrapper.POLLOUT,
+                                           false);
             numKeysUpdated += processFDSet(updateCount, exceptFds,
                                            PollArrayWrapper.POLLIN |
                                            PollArrayWrapper.POLLCONN |
-                                           PollArrayWrapper.POLLOUT);
+                                           PollArrayWrapper.POLLOUT,
+                                           true);
             return numKeysUpdated;
         }
 
@@ -331,7 +334,9 @@
          *
          * me.updateCount <= me.clearedCount <= updateCount
          */
-        private int processFDSet(long updateCount, int[] fds, int rOps) {
+        private int processFDSet(long updateCount, int[] fds, int rOps,
+                                 boolean isExceptFds)
+        {
             int numKeysUpdated = 0;
             for (int i = 1; i <= fds[0]; i++) {
                 int desc = fds[i];
@@ -347,6 +352,17 @@
                 if (me == null)
                     continue;
                 SelectionKeyImpl sk = me.ski;
+
+                // The descriptor may be in the exceptfds set because there is
+                // OOB data queued to the socket. If there is OOB data then it
+                // is discarded and the key is not added to the selected set.
+                if (isExceptFds &&
+                    (sk.channel() instanceof SocketChannelImpl) &&
+                    discardUrgentData(desc))
+                {
+                    continue;
+                }
+
                 if (selectedKeys.contains(sk)) { // Key in selected set
                     if (me.clearedCount != updateCount) {
                         if (sk.channel.translateAndSetReadyOps(rOps, sk) &&
@@ -460,6 +476,8 @@
 
     private native void resetWakeupSocket0(int wakeupSourceFd);
 
+    private native boolean discardUrgentData(int fd);
+
     // We increment this counter on each call to updateSelectedKeys()
     // each entry in  SubSelector.fdsMap has a memorized value of
     // updateCount. When we increment numKeysUpdated we set updateCount
--- a/jdk/src/windows/native/sun/font/fontpath.c	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/windows/native/sun/font/fontpath.c	Wed Jul 21 09:57:21 2010 -0700
@@ -154,7 +154,7 @@
     fullname = JNU_NewStringPlatform(env, lpelfe->elfFullName);
     fullnameLC = (*env)->CallObjectMethod(env, fullname,
                                           fmi->toLowerCaseMID, fmi->locale);
-    (*env)->CallObjectMethod(env, fmi->list, fmi->addMID, fullname);
+    (*env)->CallBooleanMethod(env, fmi->list, fmi->addMID, fullname);
     (*env)->CallObjectMethod(env, fmi->fontToFamilyMap,
                              fmi->putMID, fullnameLC, fmi->family);
     return 1;
@@ -238,7 +238,7 @@
                                  wcslen((LPWSTR)lpelfe->elfFullName));
     fullnameLC = (*env)->CallObjectMethod(env, fullname,
                                           fmi->toLowerCaseMID, fmi->locale);
-    (*env)->CallObjectMethod(env, fmi->list, fmi->addMID, fullname);
+    (*env)->CallBooleanMethod(env, fmi->list, fmi->addMID, fullname);
     (*env)->CallObjectMethod(env, fmi->fontToFamilyMap,
                              fmi->putMID, fullnameLC, fmi->family);
     return 1;
--- a/jdk/src/windows/native/sun/java2d/opengl/WGLSurfaceData.c	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/windows/native/sun/java2d/opengl/WGLSurfaceData.c	Wed Jul 21 09:57:21 2010 -0700
@@ -66,6 +66,10 @@
 
     J2dTraceLn(J2D_TRACE_INFO, "WGLSurfaceData_initOps");
 
+    if (oglsdo == NULL) {
+        JNU_ThrowOutOfMemoryError(env, "Initialization of SurfaceData failed.");
+        return;
+    }
     if (wglsdo == NULL) {
         JNU_ThrowOutOfMemoryError(env, "creating native wgl ops");
         return;
--- a/jdk/src/windows/native/sun/java2d/windows/GDIWindowSurfaceData.cpp	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/windows/native/sun/java2d/windows/GDIWindowSurfaceData.cpp	Wed Jul 21 09:57:21 2010 -0700
@@ -363,6 +363,10 @@
 {
     J2dTraceLn(J2D_TRACE_INFO, "GDIWindowSurfaceData_initOps");
     GDIWinSDOps *wsdo = (GDIWinSDOps *)SurfaceData_InitOps(env, wsd, sizeof(GDIWinSDOps));
+    if (wsdo == NULL) {
+        JNU_ThrowOutOfMemoryError(env, "Initialization of SurfaceData failed.");
+        return;
+    }
     wsdo->sdOps.Lock = GDIWinSD_Lock;
     wsdo->sdOps.GetRasInfo = GDIWinSD_GetRasInfo;
     wsdo->sdOps.Unlock = GDIWinSD_Unlock;
--- a/jdk/src/windows/native/sun/nio/ch/DatagramChannelImpl.c	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/windows/native/sun/nio/ch/DatagramChannelImpl.c	Wed Jul 21 09:57:21 2010 -0700
@@ -120,6 +120,12 @@
     rv = connect((SOCKET)fd, (struct sockaddr *)&sa, sa_len);
     if (rv == SOCKET_ERROR) {
         handleSocketError(env, WSAGetLastError());
+    } else {
+        /* Disable WSAECONNRESET errors as socket is no longer connected */
+        BOOL enable = FALSE;
+        DWORD bytesReturned = 0;
+        WSAIoctl((SOCKET)fd, SIO_UDP_CONNRESET, &enable, sizeof(enable),
+                 NULL, 0, &bytesReturned, NULL, NULL);
     }
 }
 
--- a/jdk/src/windows/native/sun/nio/ch/Net.c	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/windows/native/sun/nio/ch/Net.c	Wed Jul 21 09:57:21 2010 -0700
@@ -67,6 +67,14 @@
 #define COPY_INET6_ADDRESS(env, source, target) \
     (*env)->GetByteArrayRegion(env, source, 0, 16, target)
 
+/**
+ * Enable or disable receipt of WSAECONNRESET errors.
+ */
+static void setConnectionReset(SOCKET s, BOOL enable) {
+    DWORD bytesReturned = 0;
+    WSAIoctl(s, SIO_UDP_CONNRESET, &enable, sizeof(enable),
+             NULL, 0, &bytesReturned, NULL, NULL);
+}
 
 
 JNIEXPORT void JNICALL
@@ -109,6 +117,12 @@
             setsockopt(s, IPPROTO_IPV6, IPV6_V6ONLY,
                        (const char *)&opt, sizeof(opt));
         }
+
+        /* Disable WSAECONNRESET errors for initially unconnected UDP sockets */
+        if (!stream) {
+            setConnectionReset(s, FALSE);
+        }
+
     } else {
         NET_ThrowNew(env, WSAGetLastError(), "socket");
     }
@@ -149,12 +163,13 @@
     SOCKETADDRESS sa;
     int rv;
     int sa_len;
+    SOCKET s = (SOCKET)fdval(env, fdo);
 
     if (NET_InetAddressToSockaddr(env, iao, port, (struct sockaddr *)&sa, &sa_len, preferIPv6) != 0) {
         return IOS_THROWN;
     }
 
-    rv = connect(fdval(env, fdo), (struct sockaddr *)&sa, sa_len);
+    rv = connect(s, (struct sockaddr *)&sa, sa_len);
     if (rv != 0) {
         int err = WSAGetLastError();
         if (err == WSAEINPROGRESS || err == WSAEWOULDBLOCK) {
@@ -162,6 +177,13 @@
         }
         NET_ThrowNew(env, err, "connect");
         return IOS_THROWN;
+    } else {
+        /* Enable WSAECONNRESET errors when a UDP socket is connected */
+        int type = 0, optlen = sizeof(type);
+        rv = getsockopt(s, SOL_SOCKET, SO_TYPE, (char*)&type, &optlen);
+        if (rv == 0 && type == SOCK_DGRAM) {
+            setConnectionReset(s, TRUE);
+        }
     }
     return 1;
 }
--- a/jdk/src/windows/native/sun/nio/ch/SocketDispatcher.c	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/windows/native/sun/nio/ch/SocketDispatcher.c	Wed Jul 21 09:57:21 2010 -0700
@@ -50,6 +50,10 @@
     jint fd = fdval(env, fdo);
     WSABUF buf;
 
+    /* limit size */
+    if (len > MAX_BUFFER_SIZE)
+        len = MAX_BUFFER_SIZE;
+
     /* destination buffer and size */
     buf.buf = (char *)address;
     buf.len = (u_long)len;
@@ -86,6 +90,7 @@
     jint fd = fdval(env, fdo);
     struct iovec *iovp = (struct iovec *)address;
     WSABUF *bufs = malloc(len * sizeof(WSABUF));
+    jint rem = MAX_BUFFER_SIZE;
 
     if (bufs == 0) {
         JNU_ThrowOutOfMemoryError(env, 0);
@@ -98,8 +103,16 @@
 
     /* copy iovec into WSABUF */
     for(i=0; i<len; i++) {
+        jint iov_len = iovp[i].iov_len;
+        if (iov_len > rem)
+            iov_len = rem;
         bufs[i].buf = (char *)iovp[i].iov_base;
-        bufs[i].len = (u_long)iovp[i].iov_len;
+        bufs[i].len = (u_long)iov_len;
+        rem -= iov_len;
+        if (rem == 0) {
+            len = i+1;
+            break;
+        }
     }
 
     /* read into the buffers */
@@ -136,6 +149,10 @@
     jint fd = fdval(env, fdo);
     WSABUF buf;
 
+    /* limit size */
+    if (len > MAX_BUFFER_SIZE)
+        len = MAX_BUFFER_SIZE;
+
     /* copy iovec into WSABUF */
     buf.buf = (char *)address;
     buf.len = (u_long)len;
@@ -171,6 +188,7 @@
     jint fd = fdval(env, fdo);
     struct iovec *iovp = (struct iovec *)address;
     WSABUF *bufs = malloc(len * sizeof(WSABUF));
+    jint rem = MAX_BUFFER_SIZE;
 
     if (bufs == 0) {
         JNU_ThrowOutOfMemoryError(env, 0);
@@ -183,8 +201,16 @@
 
     /* copy iovec into WSABUF */
     for(i=0; i<len; i++) {
+        jint iov_len = iovp[i].iov_len;
+        if (iov_len > rem)
+            iov_len = rem;
         bufs[i].buf = (char *)iovp[i].iov_base;
-        bufs[i].len = (u_long)iovp[i].iov_len;
+        bufs[i].len = (u_long)iov_len;
+        rem -= iov_len;
+        if (rem == 0) {
+            len = i+1;
+            break;
+        }
     }
 
     /* read into the buffers */
--- a/jdk/src/windows/native/sun/nio/ch/WindowsSelectorImpl.c	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/windows/native/sun/nio/ch/WindowsSelectorImpl.c	Wed Jul 21 09:57:21 2010 -0700
@@ -214,3 +214,19 @@
         recv(scinFd, bytes, WAKEUP_SOCKET_BUF_SIZE, 0);
     }
 }
+
+JNIEXPORT jboolean JNICALL
+Java_sun_nio_ch_WindowsSelectorImpl_discardUrgentData(JNIEnv* env, jobject this,
+                                                      jint s)
+{
+    char data[8];
+    jboolean discarded = JNI_FALSE;
+    int n;
+    do {
+        n = recv(s, &data, sizeof(data), MSG_OOB);
+        if (n > 0) {
+            discarded = JNI_TRUE;
+        }
+    } while (n > 0);
+    return discarded;
+}
--- a/jdk/src/windows/native/sun/nio/ch/nio_util.h	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/src/windows/native/sun/nio/ch/nio_util.h	Wed Jul 21 09:57:21 2010 -0700
@@ -25,6 +25,14 @@
 
 #include "jni.h"
 
+/**
+ * The maximum buffer size for WSASend/WSARecv. Microsoft recommendation for
+ * blocking operations is to use buffers no larger than 64k. We need the
+ * maximum to be less than 128k to support asynchronous close on Windows
+ * Server 2003 and newer editions of Windows.
+ */
+#define MAX_BUFFER_SIZE             ((128*1024)-1)
+
 jint fdval(JNIEnv *env, jobject fdo);
 jlong handleval(JNIEnv *env, jobject fdo);
 jboolean isNT();
--- a/jdk/test/Makefile	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/test/Makefile	Wed Jul 21 09:57:21 2010 -0700
@@ -37,11 +37,14 @@
 AWK       = awk
 CAT       = cat
 CD        = cd
+CHMOD     = chmod
 CP        = cp
 CUT       = cut
+DIRNAME   = dirname
 ECHO      = echo
 EGREP     = egrep
 EXPAND    = expand
+FIND      = find
 MKDIR     = mkdir
 PWD       = pwd
 SED       = sed
@@ -76,21 +79,25 @@
   endif
   OS_VERSION := $(shell $(UNAME) -r)
 endif
-ifndef OS_NAME
-  ifneq ($(PROCESSOR_IDENTIFIER), )
-    OS_NAME = windows
-    SLASH_JAVA = J:
-    # A variety of ways to say X64 arch :^(
-    OS_ARCH:=$(word 1, $(PROCESSOR_IDENTIFIER))
-    EXESUFFIX = .exe
-    # These need to be different depending on MKS or CYGWIN
-    ifeq ($(findstring cygdrive,$(shell ($(CD) C:/ && $(PWD)))), )
-      GETMIXEDPATH  = dosname -s
-      OS_VERSION   := $(shell $(UNAME) -r)
-    else
-      GETMIXEDPATH  = cygpath -m -s
-      OS_VERSION   := $(shell $(UNAME) -s | $(CUT) -d'-' -f2)
-    endif
+ifeq ($(OS_NAME),)
+  OS_NAME = windows
+  # GNU Make or MKS overrides $(PROCESSOR_ARCHITECTURE) to always
+  # return "x86". Use the first word of $(PROCESSOR_IDENTIFIER) instead.
+  ifeq ($(PROCESSOR_IDENTIFIER),)
+    PROC_ARCH:=$(shell $(UNAME) -m)
+  else
+    PROC_ARCH:=$(word 1, $(PROCESSOR_IDENTIFIER))
+  endif
+  OS_ARCH:=$(PROC_ARCH)
+  SLASH_JAVA = J:
+  EXESUFFIX = .exe
+  # These need to be different depending on MKS or CYGWIN
+  ifeq ($(findstring cygdrive,$(shell ($(CD) C:/ && $(PWD)))), )
+    GETMIXEDPATH  = dosname -s
+    OS_VERSION   := $(shell $(UNAME) -r)
+  else
+    GETMIXEDPATH  = cygpath -m -s
+    OS_VERSION   := $(shell $(UNAME) -s | $(CUT) -d'-' -f2)
   endif
 endif
 
@@ -107,22 +114,27 @@
 #OS_ARCH2-x64:=amd64
 
 # Try and use the arch names consistently
-OS_ARCH:=$(subst x64,$(OS_ARCH_X64_NAME),$(OS_ARCH))
-OS_ARCH:=$(subst X64,$(OS_ARCH_X64_NAME),$(OS_ARCH))
-OS_ARCH:=$(subst AMD64,$(OS_ARCH_X64_NAME),$(OS_ARCH))
-OS_ARCH:=$(subst amd64,$(OS_ARCH_X64_NAME),$(OS_ARCH))
-OS_ARCH:=$(subst x86_64,$(OS_ARCH_X64_NAME),$(OS_ARCH))
-OS_ARCH:=$(subst EM64T,$(OS_ARCH_X64_NAME),$(OS_ARCH))
-OS_ARCH:=$(subst em64t,$(OS_ARCH_X64_NAME),$(OS_ARCH))
-OS_ARCH:=$(subst intel64,$(OS_ARCH_X64_NAME),$(OS_ARCH))
-OS_ARCH:=$(subst Intel64,$(OS_ARCH_X64_NAME),$(OS_ARCH))
-OS_ARCH:=$(subst INTEL64,$(OS_ARCH_X64_NAME),$(OS_ARCH))
-OS_ARCH:=$(subst IA64,ia64,$(OS_ARCH))
-OS_ARCH:=$(subst X86,i586,$(OS_ARCH))
-OS_ARCH:=$(subst x86,i586,$(OS_ARCH))
-OS_ARCH:=$(subst i386,i586,$(OS_ARCH))
-OS_ARCH:=$(subst i486,i586,$(OS_ARCH))
-OS_ARCH:=$(subst i686,i586,$(OS_ARCH))
+OS_ARCH:=$(patsubst x64,$(OS_ARCH_X64_NAME),$(OS_ARCH))
+OS_ARCH:=$(patsubst X64,$(OS_ARCH_X64_NAME),$(OS_ARCH))
+OS_ARCH:=$(patsubst AMD64,$(OS_ARCH_X64_NAME),$(OS_ARCH))
+OS_ARCH:=$(patsubst amd64,$(OS_ARCH_X64_NAME),$(OS_ARCH))
+OS_ARCH:=$(patsubst x86_64,$(OS_ARCH_X64_NAME),$(OS_ARCH))
+OS_ARCH:=$(patsubst 8664,$(OS_ARCH_X64_NAME),$(OS_ARCH))
+OS_ARCH:=$(patsubst EM64T,$(OS_ARCH_X64_NAME),$(OS_ARCH))
+OS_ARCH:=$(patsubst em64t,$(OS_ARCH_X64_NAME),$(OS_ARCH))
+OS_ARCH:=$(patsubst intel64,$(OS_ARCH_X64_NAME),$(OS_ARCH))
+OS_ARCH:=$(patsubst Intel64,$(OS_ARCH_X64_NAME),$(OS_ARCH))
+OS_ARCH:=$(patsubst INTEL64,$(OS_ARCH_X64_NAME),$(OS_ARCH))
+OS_ARCH:=$(patsubst IA64,ia64,$(OS_ARCH))
+OS_ARCH:=$(patsubst X86,i586,$(OS_ARCH))
+OS_ARCH:=$(patsubst x86,i586,$(OS_ARCH))
+OS_ARCH:=$(patsubst i386,i586,$(OS_ARCH))
+OS_ARCH:=$(patsubst i486,i586,$(OS_ARCH))
+OS_ARCH:=$(patsubst i686,i586,$(OS_ARCH))
+OS_ARCH:=$(patsubst 386,i586,$(OS_ARCH))
+OS_ARCH:=$(patsubst 486,i586,$(OS_ARCH))
+OS_ARCH:=$(patsubst 586,i586,$(OS_ARCH))
+OS_ARCH:=$(patsubst 686,i586,$(OS_ARCH))
 
 # Default  ARCH_DATA_MODEL settings
 ARCH_DATA_MODEL-i586 = 32
@@ -234,6 +246,11 @@
   endif
 endif
 
+# Macro to run make and set the shared library permissions
+define SharedLibraryPermissions
+$(MAKE) SHARED_LIBRARY_DIR=$1 UNIQUE_DIR=$@ shared_library_permissions
+endef
+
 # Expect JPRT to set JPRT_ARCHIVE_BUNDLE (path to zip bundle for results)
 ARCHIVE_BUNDLE = $(ABS_TEST_OUTPUT_DIR)/ARCHIVE_BUNDLE.zip
 ifdef JPRT_ARCHIVE_BUNDLE
@@ -242,7 +259,7 @@
 
 # How to create the test bundle (pass or fail, we want to create this)
 #   Follow command with ";$(BUNDLE_UP_AND_EXIT)", so it always gets executed.
-ZIP_UP_RESULTS = ( $(MKDIR) -p `dirname $(ARCHIVE_BUNDLE)`     \
+ZIP_UP_RESULTS = ( $(MKDIR) -p `$(DIRNAME) $(ARCHIVE_BUNDLE)`     \
 	           && $(CD) $(ABS_TEST_OUTPUT_DIR)             \
 	           && $(ZIP) -q -r $(ARCHIVE_BUNDLE) . )
 SUMMARY_TXT = $(shell $(GETMIXEDPATH) "$(ABS_TEST_OUTPUT_DIR)")/JTreport/text/summary.txt
@@ -290,7 +307,7 @@
     passc="`$(CAT) $(PASSLIST)    | $(WC) -l | $(AWK) '{print $$1;}'`"; \
     failc="`$(CAT) $(FAILLIST)    | $(WC) -l | $(AWK) '{print $$1;}'`"; \
     exclc="`$(CAT) $(EXCLUDELIST) | $(WC) -l | $(AWK) '{print $$1;}'`"; \
-    $(ECHO) "TEST STATS: run=$${runc}  pass=$${passc}  fail=$${failc}  excluded=$${exclc}" \
+    $(ECHO) "TEST STATS: name=$(UNIQUE_DIR)  run=$${runc}  pass=$${passc}  fail=$${failc}  excluded=$${exclc}" \
       >> $(STATS_TXT); \
   else \
     $(ECHO) "Missing file: $${_summary}" >> $(STATS_TXT); \
@@ -309,7 +326,7 @@
 # Prep for output
 prep: clean
 	@$(MKDIR) -p $(ABS_TEST_OUTPUT_DIR)
-	@$(MKDIR) -p `dirname $(ARCHIVE_BUNDLE)`
+	@$(MKDIR) -p `$(DIRNAME) $(ARCHIVE_BUNDLE)`
 
 # Cleanup
 clean:
@@ -359,7 +376,7 @@
 $(EXCLUDELIST): $(PROBLEM_LISTS) $(TESTDIRS)
 	@$(RM) $@ $@.temp1 $@.temp2
 	@(($(CAT) $(PROBLEM_LISTS) | $(EGREP) -- '$(OS_NAME)-all'          ) ;\
-	  ($(CAT) $(PROBLEM_LISTS) | $(EGREP) -- '$(OS_NAME)-$(OS_ARCH)'   ) ;\
+	  ($(CAT) $(PROBLEM_LISTS) | $(EGREP) -- '$(PLATFORM_OS)'          ) ;\
 	  ($(CAT) $(PROBLEM_LISTS) | $(EGREP) -- '$(OS_NAME)-$(OS_ARCH2)'  ) ;\
 	  ($(CAT) $(PROBLEM_LISTS) | $(EGREP) -- '$(OS_NAME)-$(OS_VERSION)') ;\
 	  ($(CAT) $(PROBLEM_LISTS) | $(EGREP) -- 'generic-$(OS_ARCH)'      ) ;\
@@ -478,18 +495,17 @@
 jdk_nio1: java/nio/file
 	$(call RunSamevmBatch)
 
-# Stable othervm testruns (minus items from PROBLEM_LIST)
-#   Using samevm has serious problems with these tests
+# Stable samevm testruns (minus items from PROBLEM_LIST)
 JDK_ALL_TARGETS += jdk_nio2
 jdk_nio2: java/nio/Buffer java/nio/ByteOrder \
           java/nio/channels java/nio/BufferPoolMXBean java/nio/MappedByteBuffer
-	$(call RunOthervmBatch)
+	$(call SharedLibraryPermissions,java/nio/channels)
+	$(call RunSamevmBatch)
 
-# Stable othervm testruns (minus items from PROBLEM_LIST)
-#   Using samevm has serious problems with these tests
+# Stable samevm testruns (minus items from PROBLEM_LIST)
 JDK_ALL_TARGETS += jdk_nio3
 jdk_nio3: com/sun/nio sun/nio
-	$(call RunOthervmBatch)
+	$(call RunSamevmBatch)
 
 # All nio tests
 jdk_nio: jdk_nio1 jdk_nio2 jdk_nio3
@@ -516,6 +532,7 @@
 #   Using samevm has serious problems with these tests
 JDK_ALL_TARGETS += jdk_security3
 jdk_security3: com/sun/security lib/security javax/security sun/security
+	$(call SharedLibraryPermissions,sun/security)
 	$(call RunOthervmBatch)
 
 # All security tests
@@ -542,7 +559,8 @@
 #   Using samevm has serious problems with these tests
 JDK_ALL_TARGETS += jdk_tools2
 jdk_tools2: com/sun/tools sun/jvmstat sun/tools tools vm com/sun/servicetag com/sun/tracing
-	$(call RunOthervmBatch)
+	$(call SharedLibraryPermissions,tools/launcher)
+	$(call RunSamevmBatch)
 
 # All tools tests
 jdk_tools: jdk_tools1 jdk_tools2
@@ -611,7 +629,26 @@
 	  ) ; $(BUNDLE_UP_AND_EXIT)                                          \
 	) 2>&1 | $(TEE) $(ABS_TEST_OUTPUT_DIR)/output.txt ; $(TESTEXIT)
 
-PHONY_LIST += jtreg_tests
+# Rule that may change execute permissions on shared library files.
+#  Files in repositories should never have execute permissions, but there
+#  are some tests that have pre-built shared libraries, and these windows
+#  dll files must have execute permission. Adding execute permission
+#  may happen automatically on windows when using certain versions of mercurial
+#  but it cannot be guaranteed. And blindly adding execute permission might
+#  be seen as a mercurial 'change', so we avoid adding execute permission to
+#  repository files. But testing from a plain source tree needs the chmod a+rx.
+#  Used on select directories and applying the chmod to all shared libraries
+#  not just dll files. On windows, this may not work with MKS if the files
+#  were installed with CYGWIN unzip or untar (MKS chmod may not do anything).
+#  And with CYGWIN and sshd service, you may need CYGWIN=ntsec for this to work.
+#
+shared_library_permissions: $(SHARED_LIBRARY_DIR)
+	if [ ! -d $(TEST_ROOT)/../.hg ] ; then                          \
+	  $(FIND) $< \( -name \*.dll -o -name \*.DLL -o -name \*.so \)  \
+	        -exec $(CHMOD) a+rx {} \; ;                             \
+        fi
+
+PHONY_LIST += jtreg_tests shared_library_permissions
 
 ################################################################
 
@@ -644,7 +681,7 @@
 # perftest to collect statistics  
 
 # Expect JPRT to set JPRT_PACKTEST_HOME.
-PERFTEST_HOME = ${TEST_ROOT}/perf
+PERFTEST_HOME = $(TEST_ROOT)/perf
 ifdef JPRT_PERFTEST_HOME
   PERFTEST_HOME = $(JPRT_PERFTEST_HOME)
 endif
--- a/jdk/test/ProblemList.txt	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/test/ProblemList.txt	Wed Jul 21 09:57:21 2010 -0700
@@ -174,10 +174,6 @@
 java/beans/XMLEncoder/Test4625418.java				solaris-sparc
 
 # Problems with samevm and setting security manager (speculation partially)
-java/beans/Beans/Test4080522.java				generic-all
-java/beans/EventHandler/Test6277246.java			generic-all
-java/beans/EventHandler/Test6277266.java			generic-all
-java/beans/Introspector/Test6277246.java			generic-all
 java/beans/Introspector/4168475/Test4168475.java		generic-all
 java/beans/Introspector/4520754/Test4520754.java		generic-all
 java/beans/Introspector/6380849/TestBeanInfo.java		generic-all
@@ -191,233 +187,14 @@
 
 ############################################################################
 
-# jdk_io
-
-# Many of these tests have a tendency to leave input streams open, which
-#  will cause following tests to be failures when used in samevm mode.
-
-# Should be othervm, or corrected for samevm, fails with samevm:
-java/io/BufferedReader/BigMark.java			 	generic-all
-java/io/BufferedReader/ReadLineSync.java		 	generic-all
-
-# One of these is leaving "a.ser" file open, windows samevm
-java/io/Serializable/duplicateSerialFields/Setup.java		generic-all
-java/io/Serializable/duplicateSerialFields/Test.java		generic-all
-
-# One of these leaving foo.ser open, windows samevm problem
-java/io/Serializable/enum/constantSubclasses/Read.java		generic-all
-java/io/Serializable/enum/constantSubclasses/Write.java		generic-all
-java/io/Serializable/enum/missingConstant/Read.java		generic-all
-java/io/Serializable/enum/missingConstant/Write.java		generic-all
-
-# This is leaving subtest1.tmp open, windows samevm problem
-java/io/Serializable/oldTests/AnnotateClass.java		generic-all
-
-# One or more of these leave a piotest* file open, windows samevm
-java/io/Serializable/oldTests/ArrayFields.java			generic-all
-java/io/Serializable/oldTests/ArraysOfArrays.java		generic-all
-java/io/Serializable/oldTests/BinaryTree.java			generic-all
-java/io/Serializable/oldTests/CircularList.java			generic-all
-java/io/Serializable/oldTests/SerializeWithException.java	generic-all
-java/io/Serializable/oldTests/SimpleArrays.java			generic-all
-java/io/Serializable/oldTests/WritePrimitive.java		generic-all
-
-# Missing close on file 0.ser, windows samevm
-java/io/Serializable/enum/badResolve/Read.java			generic-all
-java/io/Serializable/enum/badResolve/Write.java			generic-all
-
-# One of these tests is leaving parents.ser open, windows samevm
-java/io/Serializable/parents/EvolvedClass.java			generic-all
-java/io/Serializable/parents/OriginalClass.java			generic-all
-
-# One of these tests is leaving file foo.ser and/or bar.ser open, windows samevm
-java/io/Serializable/fieldTypeString/Read.java			generic-all
-java/io/Serializable/fieldTypeString/Write.java			generic-all
-
-# One of these tests is leaving tmp.ser file open, windows samevm
-java/io/Serializable/ClassCastExceptionDetail/Read.java		generic-all
-java/io/Serializable/ClassCastExceptionDetail/Write.java	generic-all
-java/io/Serializable/GetField/Read.java				generic-all
-java/io/Serializable/GetField/Read2.java			generic-all
-java/io/Serializable/GetField/Write.java			generic-all
-java/io/Serializable/PutField/Read.java				generic-all
-java/io/Serializable/PutField/Read2.java			generic-all
-java/io/Serializable/PutField/Write.java			generic-all
-java/io/Serializable/PutField/Write2.java			generic-all
-java/io/Serializable/arraySuidConflict/Read.java		generic-all
-java/io/Serializable/arraySuidConflict/Write.java		generic-all
-java/io/Serializable/backRefCNFException/Read.java		generic-all
-java/io/Serializable/backRefCNFException/Write.java		generic-all
-java/io/Serializable/class/Test.java				generic-all
-java/io/Serializable/evolution/AddedExternField/ReadAddedField.java generic-all
-java/io/Serializable/evolution/AddedExternField/WriteAddedField.java generic-all
-java/io/Serializable/evolution/AddedExternField/run.sh		generic-all
-java/io/Serializable/evolution/AddedField/ReadAddedField.java	generic-all
-java/io/Serializable/evolution/AddedField/WriteAddedField.java	generic-all
-java/io/Serializable/evolution/AddedSuperClass/ReadAddedSuperClass.java	generic-all
-java/io/Serializable/evolution/AddedSuperClass/ReadAddedSuperClass2.java generic-all
-java/io/Serializable/evolution/AddedSuperClass/WriteAddedSuperClass.java generic-all
-java/io/Serializable/proxy/skipMissing/Read.java		generic-all
-java/io/Serializable/proxy/skipMissing/Write.java		generic-all
-java/io/Serializable/readObjectNoData/Read.java			generic-all
-java/io/Serializable/readObjectNoData/Write.java		generic-all
-java/io/Serializable/skipWriteObject/Read.java			generic-all
-java/io/Serializable/skipWriteObject/Write.java			generic-all
-java/io/Serializable/skippedObjCNFException/Read.java		generic-all
-java/io/Serializable/skippedObjCNFException/Write.java		generic-all
-java/io/Serializable/stopCustomDeserialization/Read.java	generic-all
-java/io/Serializable/stopCustomDeserialization/Write.java	generic-all
-java/io/Serializable/unresolvedClassDesc/Read.java		generic-all
-java/io/Serializable/unresolvedClassDesc/Write.java		generic-all
-java/io/Serializable/unshared/Read.java				generic-all
-java/io/Serializable/unshared/Write.java			generic-all
-java/io/Serializable/wrongReturnTypes/Read.java			generic-all
-java/io/Serializable/wrongReturnTypes/Write.java		generic-all
-
-# Windows samevm issues? triggers other tests to fail, missing close() on f.txt?
-java/io/DataInputStream/OpsAfterClose.java		 	generic-all
-
-# Windows 32bit samevm failure: RuntimeException: File.getFreeSpace() failed
-java/io/File/MaxPathLength.java					generic-all
-
-# Should be othervm, or corrected for samevm, fails with samevm:
-java/io/File/DeleteOnExit.java				 	generic-all
-java/io/File/DeleteOnExitLong.java			 	generic-all
-java/io/File/DeleteOnExitNPE.java			 	generic-all
-java/io/File/IsHidden.java				 	generic-all
-java/io/FileDescriptor/FileChannelFDTest.java		 	generic-all
-java/io/FileDescriptor/Finalize.java			 	generic-all
-java/io/FileInputStream/FinalizeShdCallClose.java	 	generic-all
-
-# Known to cause samevm issues on windows, other tests fail, missing close()?
-java/io/FileInputStream/OpsAfterClose.java		 	generic-all
-
-# Should be othervm, or corrected for samevm, fails with samevm:
-java/io/FileOutputStream/FinalizeShdCallClose.java	 	generic-all
-
-# Known to cause samevm issues on windows, other tests fail, missing close()?
-java/io/FileOutputStream/OpsAfterClose.java		 	generic-all
-
-# Windows samevm issues? triggers other tests to fail, missing close() on f.txt?
-java/io/InputStream/OpsAfterClose.java			 	generic-all
-
-# Missing close() on x.ReadBounds file? Windows samevm issues
-java/io/InputStream/ReadParams.java			 	generic-all
-
-# Known to cause samevm issues on windows, other tests fail, missing close()?
-java/io/InputStreamReader/GrowAfterEOF.java		 	generic-all
-
-# Should be othervm, or corrected for samevm, fails with samevm:
-java/io/ObjectInputStream/ResolveProxyClass.java	 	generic-all
-
-# Not doing a close() on x.ParameterCheck file? windows samevm cascade error
-java/io/RandomAccessFile/ParameterCheck.java                    generic-all
-
-# Not doing a close on x.ReadLine file? windows cascade samevm problems
-java/io/RandomAccessFile/ReadLine.java				generic-all
-
-# Not doing close on file input x.WriteByteChars, windows samevm problems
-java/io/RandomAccessFile/WriteBytesChars.java			generic-all
-
-# Not doing close on file input x.WriteUTF, windows samevm problems
-java/io/RandomAccessFile/WriteUTF.java                          generic-all
-
-# Possibly, not doing a close() on input.txt, windows samevm issues.
-java/io/RandomAccessFile/skipBytes/SkipBytes.java	 	generic-all
-java/io/readBytes/MemoryLeak.java			 	generic-all
-java/io/readBytes/ReadBytesBounds.java			 	generic-all 
-
-# Missing close on fields.ser, windows samevm
-java/io/Serializable/checkModifiers/CheckModifiers.java		generic-all
-
-# Should be othervm, or corrected for samevm, fails with samevm:
-java/io/Serializable/auditStreamSubclass/AuditStreamSubclass.java generic-all
-java/io/Serializable/proxy/Basic.java			 	generic-all
-
-# Possibly not doing a close() on input.txt, windows samevm issues.
-java/io/StreamTokenizer/Comment.java			 	generic-all
-
-############################################################################
-
 # jdk_lang
 
-# Some of these tests (like java/lang/management) may just need to be marked
-#   othervm, but that is partially speculation.
-
-# Samevm failure on OpenSolaris, security manager?
-java/lang/ClassLoader/UninitializedParent.java			generic-all
-
 # Times out on solaris 10 sparc
 java/lang/ClassLoader/Assert.java				generic-all
 
-# Fedora 9 X64, RuntimeException: MyThread expected to be blocked on lock, but got null
-java/lang/management/ThreadMXBean/ThreadStateTest.java 		generic-all
-
-# RuntimeException: Uptime of the JVM is more than 30 minutes (32 minutes).
-java/lang/management/RuntimeMXBean/UpTime.java			generic-all
-
-# Times out on solaris sparc occasionally, in samevm mode
-java/lang/Runtime/exec/ExecWithDir.java				generic-all
-java/lang/ProcessBuilder/Basic.java				generic-all
-
 # Solaris sparc, samevm, java.lang.Exception: Read from closed pipe hangs
 java/lang/Runtime/exec/SleepyCat.java				generic-all
 
-# Need to be marked othervm, or changed to be samevm safe
-java/lang/annotation/ParameterAnnotations.java			generic-all
-
-# Need to be marked othervm, or changed to be samevm safe
-java/lang/ClassLoader/defineClass/DefineClassByteBuffer.java	generic-all
-java/lang/ClassLoader/findSystemClass/Loader.java		generic-all
-
-# Fedora 9 32bit, -client, samevm, Error while cleaning up threads after test
-java/lang/management/ThreadMXBean/Locks.java			generic-all
-
-# Need to be marked othervm, or changed to be samevm safe
-java/lang/management/ClassLoadingMXBean/LoadCounts.java		generic-all
-java/lang/management/ManagementFactory/MBeanServerMXBeanUnsupportedTest.java generic-all
-java/lang/management/ManagementFactory/MXBeanProxyTest.java	generic-all
-java/lang/management/ManagementFactory/ThreadMXBeanProxy.java	generic-all
-java/lang/management/MemoryMXBean/CollectionUsageThreshold.java	generic-all
-java/lang/management/MemoryMXBean/GetMBeanInfo.java		generic-all
-java/lang/management/MemoryMXBean/LowMemoryTest.java		generic-all
-java/lang/management/MemoryMXBean/MemoryManagement.java		generic-all
-java/lang/management/MemoryMXBean/MemoryTest.java		generic-all
-java/lang/management/MemoryMXBean/Pending.java			generic-all
-
-# Problematic on all platforms (even as othervm)
-java/lang/management/MemoryMXBean/ResetPeakMemoryUsage.java 	generic-all
-
-# Causes jtreg exit samevm issues due to non-String object in system properties
-java/lang/management/RuntimeMXBean/GetSystemProperties.java 	generic-all
-
-# Need to be marked othervm, or changed to be samevm safe
-java/lang/management/RuntimeMXBean/PropertiesTest.java		generic-all
-java/lang/management/ThreadMXBean/AllThreadIds.java		generic-all
-java/lang/management/ThreadMXBean/EnableTest.java		generic-all
-java/lang/management/ThreadMXBean/FindMonitorDeadlock.java	generic-all
-java/lang/management/ThreadMXBean/LockingThread.java		generic-all
-java/lang/management/ThreadMXBean/MonitorDeadlock.java		generic-all
-java/lang/management/ThreadMXBean/MyOwnSynchronizer.java	generic-all
-java/lang/management/ThreadMXBean/SharedSynchronizer.java	generic-all
-java/lang/management/ThreadMXBean/SynchronizerLockingThread.java generic-all
-java/lang/management/ThreadMXBean/ThreadCounts.java		generic-all
-
-# Need to be marked othervm, or changed to be samevm safe
-java/lang/reflect/Proxy/Boxing.java				generic-all
-java/lang/reflect/Proxy/ClassRestrictions.java			generic-all
-java/lang/reflect/Proxy/returnTypes/Test.java			generic-all
-
-# Need to be marked othervm, or changed to be samevm safe
-java/lang/Runtime/exec/LotsOfOutput.java			generic-all
-java/lang/System/ExitFinalizersAndJIT.java			generic-all
-java/lang/System/finalization/FinThreads.java			generic-all
-java/lang/System/IgnoreNullSecurityManager.java			generic-all
-java/lang/Thread/GenerifyStackTraces.java			generic-all
-java/lang/Thread/StackTraces.java				generic-all
-java/lang/ThreadGroup/Daemon.java				generic-all
-java/lang/ThreadGroup/NullThreadName.java			generic-all
-
 # Times out on solaris sparc -server
 java/lang/ThreadLocal/MemoryLeak.java			 	solaris-all
 
@@ -431,6 +208,12 @@
 
 # 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
+
 # Fails on linux: KO: StringMonitor notification missed or not emitted
 javax/management/monitor/NonComparableAttributeValueTest.java	generic-all
 
@@ -512,9 +295,6 @@
 
 # jdk_misc
 
-# On Windows com.sun.java.swing.plaf.gtk does not exist, always fails there
-com/sun/java/swing/plaf/gtk/Test6635110.java		 	windows-all
-
 # Need to be marked othervm, or changed to be samevm safe
 com/sun/jndi/ldap/ReadTimeoutTest.java				generic-all
 com/sun/jndi/rmi/registry/RegistryContext/UnbindIdempotent.java	generic-all
@@ -596,9 +376,6 @@
 #   Interrupted or IO exception, maybe writing to non-unique named file?
 com/sun/net/httpserver/bugs/B6373555.java			generic-all
 
-# Fails on OpenSolaris, BindException unexpected 
-java/net/BindException/Test.java				generic-all
-
 # Fails on OpenSolaris, times out
 java/net/MulticastSocket/SetOutgoingIf.java			generic-all
 
@@ -724,48 +501,46 @@
 
 ############################################################################
 
+# jdk_io
+
+# 6962637
+java/io/File/MaxPathLength.java                                 windows-all
+
+############################################################################
+
 # jdk_nio
 
-# Suspect many of these tests auffer from using fixed ports, no concrete 
-#   evidence.
+# 6944810
+java/nio/channels/FileChannel/ReleaseOnCloseDeadlock.java       windows-all
 
-# Failing on Solaris x86 and Linux x86, filed 6934585
-java/nio/channels/AsynchronousSocketChannel/Basic.java		generic-all
+# 6963118
+java/nio/channels/Selector/Wakeup.java                          windows-all
 
-# Occasionally Failing with java.lang.AssertionError on Windows X64
-#  at sun.nio.ch.PendingIoCache.clearPendingIoMap(PendingIoCache.java:144)
-#java/nio/channels/FileChannel/ReleaseOnCloseDeadlock.java	windows-all
+# The asynchronous I/O implementation on Windows requires Windows XP or newer.
+# We can remove the following once all Windows 2000 machines have been
+# decommissioned.
+java/nio/channels/AsynchronousChannelGroup/Basic.java           windows-5.0
+java/nio/channels/AsynchronousChannelGroup/GroupOfOne.java      windows-5.0
+java/nio/channels/AsynchronousChannelGroup/Identity.java        windows-5.0
+java/nio/channels/AsynchronousChannelGroup/Restart.java         windows-5.0
+java/nio/channels/AsynchronousChannelGroup/Unbounded.java       windows-5.0
+java/nio/channels/AsynchronousDatagramChannel/Basic.java        windows-5.0
+java/nio/channels/AsynchronousFileChannel/Lock.java             windows-5.0
+java/nio/channels/AsynchronousServerSocketChannel/Basic.java    windows-5.0
+java/nio/channels/AsynchronousServerSocketChannel/WithSecurityManager.java windows-5.0
+java/nio/channels/AsynchronousSocketChannel/Basic.java          windows-5.0
+java/nio/channels/AsynchronousSocketChannel/DieBeforeComplete.java windows-5.0
+java/nio/channels/AsynchronousSocketChannel/Leaky.java          windows-5.0
+java/nio/channels/AsynchronousSocketChannel/StressLoopback.java windows-5.0
+java/nio/channels/Channels/Basic2.java                          windows-5.0
 
-# Some kind of sleep/wake problem on Windows X64
-java/nio/channels/Selector/Wakeup.java				windows-all
+# 6959891
+com/sun/nio/sctp/SctpChannel/SocketOptionTests.java
 
 # Fails with -ea -esa, Assertion error, but only on Solaris 10 machines?
 com/sun/nio/sctp/SctpChannel/Send.java				generic-all
 com/sun/nio/sctp/SctpChannel/Shutdown.java			generic-all
 
-# Fails on Windows 2000, Can't delete test directory .\x.SetLastModified.dir
-#    at SetLastModified.main(SetLastModified.java:107)
-java/io/File/SetLastModified.java                               generic-all
-
-# Fails on Solaris 10 x64, address already in use
-java/nio/channels/DatagramChannel/SRTest.java			generic-all
-
-# Fails on Solaris 10 x86, times out
-java/nio/channels/DatagramChannel/Sender.java			generic-all
-
-# Fails on Fedora 9 x86, address in use
-java/nio/channels/Selector/SelectWrite.java			generic-all
-
-# Fails on Fedora 9 32bit times out
-java/nio/channels/DatagramChannel/EmptyBuffer.java		generic-all
-
-# Fails on Windows 2000, ExceptionInInitializerError
-#   in WindowsAsynchronousServerSocketChannelImpl.java:316
-java/nio/channels/AsynchronousChannelGroup/Unbounded.java	generic-all
-
-# Fails on Windows 2000,  times out
-java/nio/channels/FileChannel/Transfer.java			generic-all
-
 # Fails on OpenSolaris, IllegalStateException: Cannot add or remove addresses 
 #    from a channel that is bound to the wildcard address
 com/sun/nio/sctp/SctpChannel/Bind.java				generic-all
@@ -773,21 +548,6 @@
 # Failed on OpenSolaris, java.lang.AssertionError: Unknown event type
 com/sun/nio/sctp/SctpChannel/Receive.java			generic-all
 
-# Triggers a hotspot crash on Fedora 9 32bit -server and Windows X64  samevm
-sun/nio/cs/TestUTF8.java					generic-all
-
-# Solaris sparc, socket timeout
-java/nio/channels/spi/SelectorProvider/inheritedChannel/run_tests.sh generic-all
-
-# Runtime exception on windows X64, samevm mode
-java/nio/channels/Selector/WakeupNow.java			generic-all
-
-# Occasional errors, solarix x86, address already in use, othervm mode
-java/nio/channels/Selector/SelectorTest.java			generic-all
-
-# Fails on Linux Fedora 9 X64
-sun/nio/cs/FindDecoderBugs.java					generic-all
-
 # Solaris 11 gave assert error and "connection refused", samevm issues?
 com/sun/nio/sctp/SctpServerChannel/NonBlockingAccept.java 	generic-all
 
@@ -798,72 +558,6 @@
 com/sun/nio/sctp/SctpMultiChannel/Send.java			generic-all
 com/sun/nio/sctp/SctpMultiChannel/SocketOptionTests.java	generic-all
 
-# Linux 64bit failures. too many files open
-java/nio/channels/Selector/HelperSlowToDie.java			generic-all
-
-# Timeouts etc. on Window
-java/nio/channels/AsyncCloseAndInterrupt.java		 	windows-all
-
-# Gets java.lang.ExceptionInInitializerError on windows: (Windows 2000 only?)
-java/nio/channels/AsynchronousChannelGroup/Basic.java	 	windows-5.0
-java/nio/channels/AsynchronousChannelGroup/GroupOfOne.java 	windows-5.0
-java/nio/channels/AsynchronousChannelGroup/Identity.java 	windows-5.0
-java/nio/channels/AsynchronousChannelGroup/Restart.java 	windows-5.0
-java/nio/channels/AsynchronousDatagramChannel/Basic.java 	windows-5.0
-java/nio/channels/AsynchronousFileChannel/Lock.java	 	windows-5.0
-java/nio/channels/AsynchronousServerSocketChannel/Basic.java 	windows-5.0
-java/nio/channels/AsynchronousServerSocketChannel/WithSecurityManager.java windows-5.0
-java/nio/channels/AsynchronousSocketChannel/Basic.java	 	windows-5.0
-java/nio/channels/AsynchronousSocketChannel/DieBeforeComplete.java windows-5.0
-java/nio/channels/AsynchronousSocketChannel/Leaky.java	 	windows-5.0
-java/nio/channels/AsynchronousSocketChannel/StressLoopback.java windows-5.0
-java/nio/channels/Channels/Basic2.java			 	windows-5.0
-
-# Solaris sparc timeout
-java/nio/channels/DatagramChannel/Connect.java		 	generic-all
-
-# Solaris i586 timeouts
-java/nio/channels/DatagramChannel/EmptyBuffer.java	 	solaris-all
-
-# Failed loopback connection? On windows 32bit? 
-#   Considered a stress test, can consume all resources.
-java/nio/channels/Selector/LotsOfChannels.java		 	generic-all
-
-# Solaris sparcv9, just fails with exception
-java/nio/channels/Selector/OpRead.java			 	solaris-sparc
-
-# Windows i586 client, crashed hotspot? Unpredictable
-#   Considered a stress test, can consume all resources.
-java/nio/channels/Selector/RegAfterPreClose.java	 	generic-all
-
-# Solaris i586, cannot assign address, samevm issues
-java/nio/channels/Selector/SelectorLimit.java		 	generic-all
-
-# Socket timeout windows X64
-java/nio/channels/ServerSocketChannel/AdaptServerSocket.java 	windows-all
-
-# Timeouts etc. on Window
-java/nio/channels/SocketChannel/ConnectState.java	 	windows-all
-java/nio/channels/SocketChannel/FinishConnect.java	 	windows-all
-
-# Need to be marked othervm, or changed to be samevm safe
-java/nio/channels/SocketChannel/OpenLeak.java			generic-all
-
-# Gets java.net.BindException alot (static port number?)
-java/nio/channels/SocketChannel/VectorIO.java		 	generic-all
-
-# Solaris i586 java.net.BindExceptions
-java/nio/channels/SocketChannel/VectorParams.java	 	solaris-all
-
-# Linux i586 address already in use, samevm issues
-java/nio/channels/SocketChannel/Write.java		 	generic-all
-
-# Fails on all platforms due to overlap of JDK jar file contents:
-sun/nio/cs/Test4200310.sh				 	generic-all
-
-# Depends on motif packages that do not exist all the time:
-sun/nio/cs/TestX11CNS.java				 	generic-all
-
 ############################################################################
 
 # jdk_rmi
@@ -935,6 +629,19 @@
 
 # jdk_security
 
+# Filed 6951285, not sure how often this fails, last was Linux 64bit Fedora 9
+sun/security/krb5/auto/MaxRetries.java				generic-all
+
+# Filed 6950930, fails on windows 32bit c1 and windows 64bit
+sun/security/krb5/auto/IgnoreChannelBinding.java		windows-all
+
+# Filed 6950931, failing on all windows systems
+sun/security/tools/jarsigner/crl.sh				windows-all
+
+# Filed 6950929, only seemed to fail on solaris sparcv9 (-d64)
+#   Failed on Linux -server 32bit too, making generic
+sun/security/krb5/auto/BadKdc4.java				generic-all
+
 # Failing on Solaris i586, 3/9/2010, not a -samevm issue (jdk_security3)
 sun/security/pkcs11/Secmod/AddPrivateKey.java			solaris-i586
 sun/security/pkcs11/ec/ReadCertificates.java			solaris-i586
@@ -986,12 +693,6 @@
 # Fails on Windows 2000, ExceptionInInitializerError
 sun/security/mscapi/AccessKeyStore.sh				generic-all
 
-# Fails on Windows 2000, UnsatisfiedLinkError: libnspr4.dll: Access is denied
-sun/security/pkcs11/KeyAgreement/TestDH.java			generic-all
-
-# Fails on Windows 2000, UnsatisfiedLinkError: libnspr4.dll: Access is denied
-sun/security/pkcs11/fips/ClientJSSEServerJSSE.java		generic-all
-
 # Fails on Solaris 10, KrbException: Additional pre-authentication required (25)
 sun/security/krb5/auto/basic.sh					generic-all
 
@@ -1022,10 +723,6 @@
 # Othervm, sparc, NoRouteToHostException: Cannot assign requested address
 sun/security/ssl/javax/net/ssl/NewAPIs/SessionCacheSizeTests.java generic-all
 
-# ProviderException: sun.security.pkcs11.wrapper.PKCS11Exception: CKR_DEVICE_ERROR
-#    Does not seem to run on windows machines? dll missing? 
-sun/security/pkcs11/rsa/TestKeyPairGenerator.java		generic-all
-
 # Times out on windows X64, othervm mode
 #    Solaris sparc and sparcv9 -server, timeout
 sun/security/ssl/javax/net/ssl/NewAPIs/SessionTimeOutTests.java	generic-all
@@ -1041,7 +738,6 @@
 sun/security/tools/jarsigner/oldsig.sh				generic-all
 
 # Various failures on Linux Fedora 9 X64, othervm mode
-#   Does not seem to run on windows machines? dll missing? 
 sun/security/ssl/sanity/interop/ClientJSSEServerJSSE.java	generic-all
 
 # Linux i586 -server, buffer too short to hold shared secret?
@@ -1078,9 +774,6 @@
 java/security/UnresolvedPermission/AccessorMethods.java		generic-all
 java/security/UnresolvedPermission/Equals.java			generic-all
 
-# Do not seem to run on windows machines? dll missing? 
-sun/security/krb5/auto/IgnoreChannelBinding.java	 	windows-all
-
 # Fails on OpenSolaris, missing classes, slow on Solaris sparc
 sun/security/ec/TestEC.java					generic-all
 
@@ -1088,65 +781,12 @@
 sun/security/mscapi/IsSunMSCAPIAvailable.sh		 	windows-x64
 sun/security/mscapi/RSAEncryptDecrypt.sh		 	windows-x64
 
-# Do not seem to run on windows machines? dll missing? 
-sun/security/pkcs11/Cipher/ReinitCipher.java		 	windows-all
-sun/security/pkcs11/Cipher/TestRSACipher.java		 	windows-all
-sun/security/pkcs11/Cipher/TestRSACipherWrap.java	 	windows-all
-sun/security/pkcs11/Cipher/TestSymmCiphers.java 	 	windows-all
-sun/security/pkcs11/Cipher/TestSymmCiphersNoPad.java	 	windows-all
-
-# Do not seem to run on windows machines? dll missing? 
-sun/security/pkcs11/ec/ReadCertificates.java		 	windows-all
-sun/security/pkcs11/ec/ReadPKCS12.java			 	windows-all
-sun/security/pkcs11/ec/TestCurves.java			 	windows-all
-sun/security/pkcs11/ec/TestECDH.java			 	windows-all
-sun/security/pkcs11/ec/TestECDSA.java			 	windows-all
-sun/security/pkcs11/ec/TestECGenSpec.java		 	windows-all
-sun/security/pkcs11/ec/TestKeyFactory.java		 	windows-all
-sun/security/pkcs11/fips/TrustManagerTest.java		 	windows-all
-
-# Do not seem to run on windows machines? dll missing? 
-sun/security/pkcs11/KeyAgreement/TestShort.java 	 	windows-all
-sun/security/pkcs11/KeyGenerator/DESParity.java 	 	windows-all
-
 # Exception in test solaris-sparc -client -server, no windows
-sun/security/pkcs11/KeyGenerator/TestKeyGenerator.java	windows-all solaris-all
-
-# Do not seem to run on windows machines? dll missing? 
-sun/security/pkcs11/KeyStore/Basic.sh			 	windows-all
-sun/security/pkcs11/KeyStore/ClientAuth.sh		 	windows-all
+sun/security/pkcs11/KeyGenerator/TestKeyGenerator.java	        solaris-all
 
 # Solaris sparc client, fails to compile?
 sun/security/pkcs11/KeyStore/SecretKeysBasic.sh 	 	solaris-all
 
-# Do not seem to run on windows machines? dll missing? 
-sun/security/pkcs11/Mac/ReinitMac.java			 	windows-all
-sun/security/pkcs11/MessageDigest/ByteBuffers.java	 	windows-all
-sun/security/pkcs11/MessageDigest/DigestKAT.java	 	windows-all
-sun/security/pkcs11/MessageDigest/ReinitDigest.java	 	windows-all
-sun/security/pkcs11/Provider/ConfigQuotedString.sh	 	windows-all
-sun/security/pkcs11/Provider/Login.sh			 	windows-all
-sun/security/pkcs11/rsa/KeyWrap.java			 	windows-all
-sun/security/pkcs11/rsa/TestCACerts.java		 	windows-all
-sun/security/pkcs11/rsa/TestKeyFactory.java		 	windows-all
-sun/security/pkcs11/rsa/TestSignatures.java		 	windows-all
-sun/security/pkcs11/SampleTest.java			 	windows-all
-sun/security/pkcs11/Secmod/AddPrivateKey.java		 	windows-all
-sun/security/pkcs11/Secmod/AddTrustedCert.java		 	windows-all
-sun/security/pkcs11/Secmod/Crypto.java			 	windows-all
-sun/security/pkcs11/Secmod/GetPrivateKey.java		 	windows-all
-sun/security/pkcs11/Secmod/JksSetPrivateKey.java	 	windows-all
-sun/security/pkcs11/Secmod/TrustAnchors.java		 	windows-all
-sun/security/pkcs11/SecureRandom/Basic.java		 	windows-all
-sun/security/pkcs11/Serialize/SerializeProvider.java	 	windows-all
-sun/security/pkcs11/Signature/ByteBuffers.java		 	windows-all
-sun/security/pkcs11/Signature/ReinitSignature.java	 	windows-all
-sun/security/pkcs11/Signature/TestDSA.java		 	windows-all
-sun/security/pkcs11/tls/TestKeyMaterial.java		 	windows-all
-sun/security/pkcs11/tls/TestMasterSecret.java		 	windows-all
-sun/security/pkcs11/tls/TestPremaster.java		 	windows-all
-sun/security/pkcs11/tls/TestPRF.java			 	windows-all
-
 # Fails on OpenSolaris java.net.BindException: Address already in use
 sun/security/pkcs11/sslecc/ClientJSSEServerJSSE.java		generic-all
 
@@ -1168,9 +808,6 @@
 
 # jdk_swing (not using samevm)
 
-# Fails on solaris 10 sparc, throws RuntimeException that just says "failed"
-javax/swing/JLabel/6501991/bug6501991.java			generic-all
-
 # Fails on solaris 11 i586, with othervm
 javax/swing/JFileChooser/6570445/bug6570445.java		generic-all
 javax/swing/JFileChooser/6738668/bug6738668.java		generic-all
@@ -1188,94 +825,6 @@
 
 # jdk_tools
 
-# Some of the tools tests kind of require "othervm" or if they don't will
-#  always be firing up another VM anyway due to the nature of tools testing.
-#  So most if not all tools tests are now being run with "othervm" mode.
-#  Some of these tools tests have a tendency to use fixed ports, bad idea.
-
-# Fails with -ea -esa on Solaris, Assertion error (Solaris specific test)
-com/sun/tracing/BasicFunctionality.java				generic-all
-
-# Fails on Fedora 9 32bit, jps output differs problem
-sun/tools/jstatd/jstatdDefaults.sh				generic-all
-
-# Fails on Linux Fedora 9 32bit, Could not read data for remote JVM 16133
-#       jstat output differs from expected output
-sun/tools/jstatd/jstatdExternalRegistry.sh			generic-all
-
-# Output of jps differs from expected output.
-#   Invalid argument count on solaris-sparc and x64
-sun/tools/jstatd/jstatdPort.sh					generic-all
-
-# othervm mode, Could not synchronize with target
-sun/tools/jps/jps-l_1.sh					generic-all
-sun/tools/jps/jps-l_2.sh					generic-all
-sun/tools/jps/jps-lm.sh						generic-all
-sun/tools/jps/jps-Vvml_2.sh					generic-all
-sun/tools/jps/jps-m_2.sh					generic-all
-
-# Fails on Solaris 10 sparcv9, shell exits with 1
-#  Turning off use of shared archive because of choice of garbage collector or large pages 
-#  Could not synchronize with target
-sun/tools/jps/jps-v_1.sh					generic-all
-
-# Fails on OpenSolaris "Could not synchronize with target"
-sun/tools/jps/jps-Defaults.sh					generic-all
-sun/tools/jps/jps-V_2.sh					generic-all
-sun/tools/jps/jps-Vm_2.sh					generic-all
-sun/tools/jps/jps-Vvm.sh					generic-all
-sun/tools/jps/jps-Vvml.sh					generic-all
-sun/tools/jps/jps-m.sh						generic-all
-
-# Server name error, port 2098 problem?
-sun/tools/jstatd/jstatdServerName.sh				generic-all
-
-# These tests fail on solaris sparc, all the time
-com/sun/servicetag/DeleteServiceTag.java			generic-all
-com/sun/servicetag/DuplicateNotFound.java			generic-all
-com/sun/servicetag/FindServiceTags.java				generic-all
-com/sun/servicetag/InstanceUrnCheck.java			generic-all
-com/sun/servicetag/InvalidRegistrationData.java			generic-all
-com/sun/servicetag/InvalidServiceTag.java			generic-all
-com/sun/servicetag/JavaServiceTagTest.java			generic-all
-com/sun/servicetag/JavaServiceTagTest1.java			generic-all
-com/sun/servicetag/NewRegistrationData.java			generic-all
-com/sun/servicetag/SystemRegistryTest.java			generic-all
-com/sun/servicetag/TestLoadFromXML.java				generic-all
-com/sun/servicetag/UpdateServiceTagTest.java			generic-all
-com/sun/servicetag/ValidRegistrationData.java			generic-all
-
-# Problems on windows, jmap.exe hangs?
-com/sun/tools/attach/BasicTests.sh				windows-all
-
-# Fails on Solaris 10 sparc, in othervm mode, throws unexpected exception
-sun/jvmstat/monitor/MonitoredVm/CR6672135.java			generic-all
-
-# Unexpected Monitor Exception, solaris sparc -client
-sun/jvmstat/monitor/MonitoredVm/MonitorVmStartTerminate.sh	generic-all
-
-# Problems on windows, jmap.exe hangs? (these run jmap)
-sun/tools/jmap/Basic.sh						windows-all
-
-# Invalid argument count on solaris-sparc and x64
-sun/tools/jstatd/jstatdDefaults.sh			 	solaris-all
-
-# Solaris sparcv9, jps output does not match, x64 different
-sun/tools/jstatd/jstatdExternalRegistry.sh		 	solaris-all
-
-# Solaris 10 sparc 32bit -client, java.lang.AssertionError: Some tests failed
-tools/jar/JarEntryTime.java					generic-all
-
-# Times out on sparc?
-tools/launcher/VersionCheck.java				generic-all
-
-# These tests fail on solaris sparc, all the time
-tools/jar/ChangeDir.java					generic-all
-
-# Cannot write jar
-#  Also, possible problems on windows, jmap.exe hangs? 
-tools/jar/index/MetaInf.java				 	windows-all
-
 ############################################################################
 
 # jdk_util
@@ -1284,12 +833,6 @@
 #   11 separate stacktraces created... file reuse problem?
 java/util/zip/ZipFile/ReadLongZipFileName.java			generic-all
 
-# Recent failure on all platforms
-sun/util/resources/TimeZone/Bug6317929.java			generic-all
-
-# Fails with -ea -esa on all platforms with Assertion error
-java/util/ResourceBundle/Test4300693.java			generic-all
-
 # Failing on all -client 32bit platforms starting with b77? See 6908348.
 java/util/concurrent/BlockingQueue/CancelledProducerConsumerLoops.java generic-all
 
@@ -1317,39 +860,7 @@
 java/util/Formatter/Constructors.java				generic-all
 
 # Need to be marked othervm, or changed to be samevm safe
-java/util/Locale/Bug4175998Test.java				generic-all
-java/util/Locale/Bug4184873Test.java				generic-all
-java/util/Locale/LocaleTest.java				generic-all
-
-# Need to be marked othervm, or changed to be samevm safe
-java/util/logging/GetGlobalTest.java				generic-all
-java/util/logging/LoggerSubclass.java				generic-all
-java/util/logging/LoggingDeadlock.java				generic-all
-java/util/logging/LoggingDeadlock2.java 			generic-all
-java/util/logging/LoggingMXBeanTest.java			generic-all
-java/util/logging/LoggingMXBeanTest2.java			generic-all
-java/util/logging/LoggingNIOChange.java 			generic-all
-java/util/logging/ParentLoggersTest.java			generic-all
-
-# Need to be marked othervm, or changed to be samevm safe
-java/util/ResourceBundle/Bug4168625Test.java			generic-all
-java/util/ResourceBundle/Bug6359330.java			generic-all
-java/util/ResourceBundle/TestBug4179766.java			generic-all
-
-# Need to be marked othervm, or changed to be samevm safe
 java/util/WeakHashMap/GCDuringIteration.java			generic-all
 
-# Possible missing input stream close()? Causes samevm issues on windows
-java/util/zip/InfoZip.java				 	generic-all
-
-# Missing a close() on file Test0.zip? windows samevm cascade problem
-java/util/zip/ZipFile/Comment.java                              generic-all
-
-# Suspect missing close() on bad*.zip files, windows cascade errors with samevm
-java/util/zip/ZipFile/CorruptedZipFiles.java			generic-all
-
-# Should be samevm but causes problems with samevm, no details:
-java/util/zip/ZipFile/ManyEntries.java			 	generic-all
-
 ############################################################################
 
--- a/jdk/test/com/sun/java/swing/plaf/gtk/Test6635110.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/test/com/sun/java/swing/plaf/gtk/Test6635110.java	Wed Jul 21 09:57:21 2010 -0700
@@ -28,7 +28,6 @@
    @run main Test6635110
 */
 
-import com.sun.java.swing.plaf.gtk.GTKLookAndFeel;
 import javax.swing.*;
 import java.awt.*;
 import java.awt.image.BufferedImage;
@@ -59,7 +58,12 @@
     }
 
     public static void main(String[] args) throws Exception {
-        UIManager.setLookAndFeel(new GTKLookAndFeel());
+        try {
+            UIManager.setLookAndFeel("com.sun.java.swing.plaf.gtk.GTKLookAndFeel");
+        } catch (Exception e) {
+            System.out.println("GTKLookAndFeel cannot be set, skipping this test");
+            return;
+        }
         SwingUtilities.invokeAndWait(new Test6635110());
     }
 }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/com/sun/java/swing/plaf/gtk/Test6963870.java	Wed Jul 21 09:57:21 2010 -0700
@@ -0,0 +1,72 @@
+/*
+ * 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 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.
+ */
+
+/* @test
+   @bug 6963870
+   @summary Tests that GTKPainter.ListTableFocusBorder.getBorderInsets()
+            doesn't return null
+   @author Peter Zhelezniakov
+   @run main Test6963870
+*/
+
+import java.awt.Insets;
+import javax.swing.SwingUtilities;
+import javax.swing.UIManager;
+import javax.swing.border.Border;
+
+public class Test6963870 implements Runnable {
+
+    final static String[] UI_NAMES = {
+        "List.focusCellHighlightBorder",
+        "List.focusSelectedCellHighlightBorder",
+        "List.noFocusBorder",
+        "Table.focusCellHighlightBorder",
+        "Table.focusSelectedCellHighlightBorder",
+    };
+
+    public void run() {
+        for (String uiName: UI_NAMES) {
+            test(uiName);
+        }
+    }
+
+    void test(String uiName) {
+        Border b = UIManager.getBorder(uiName);
+        Insets i = b.getBorderInsets(null);
+        if (i == null) {
+            throw new RuntimeException("getBorderInsets() returns null for " + uiName);
+        }
+    }
+
+    public static void main(String[] args) throws Exception {
+        try {
+            UIManager.setLookAndFeel("com.sun.java.swing.plaf.gtk.GTKLookAndFeel");
+        } catch (Exception e) {
+            System.out.println("GTKLookAndFeel cannot be set, skipping this test");
+            return;
+        }
+
+        SwingUtilities.invokeAndWait(new Test6963870());
+    }
+}
+
--- a/jdk/test/com/sun/jdi/PopAndInvokeTest.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/test/com/sun/jdi/PopAndInvokeTest.java	Wed Jul 21 09:57:21 2010 -0700
@@ -24,6 +24,7 @@
 /**
  *  @test
  *  @bug 6517249
+ *  @ignore 6951287
  *  @summary JDWP: Cannot do an invokeMethod after a popFrames operation
  *
  *  @author jjh
--- a/jdk/test/com/sun/servicetag/FindServiceTags.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/test/com/sun/servicetag/FindServiceTags.java	Wed Jul 21 09:57:21 2010 -0700
@@ -56,8 +56,17 @@
     private static int expectedUrnCount = 3;
 
     public static void main(String[] argv) throws Exception {
-        registry = Util.getSvcTagClientRegistry();
+        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);
@@ -95,7 +104,6 @@
                 tags.size());
         }
 
-        System.out.println("Test passed.");
     }
 
     private static void findServiceTags(String productUrn) throws Exception {
--- a/jdk/test/com/sun/servicetag/JavaServiceTagTest1.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/test/com/sun/servicetag/JavaServiceTagTest1.java	Wed Jul 21 09:57:21 2010 -0700
@@ -31,7 +31,7 @@
  *          are both created correctly.
  * @author  Mandy Chung
  *
- * @run build JavaServiceTagTest1
+ * @run build JavaServiceTagTest1 SvcTagClient Util
  * @run main JavaServiceTagTest1
  */
 
@@ -46,6 +46,16 @@
     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");
@@ -54,8 +64,6 @@
         svcTagFile = new File(registrationDir, "servicetag");
         svcTagFile.delete();
 
-        registry = Util.getSvcTagClientRegistry();
-
         // verify that only one service tag is created
         ServiceTag st1 = testJavaServiceTag("Test1");
 
--- a/jdk/test/com/sun/servicetag/SystemRegistryTest.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/test/com/sun/servicetag/SystemRegistryTest.java	Wed Jul 21 09:57:21 2010 -0700
@@ -50,8 +50,16 @@
 
     private static Registry registry;
     public static void main(String[] argv) throws Exception {
-        registry = Util.getSvcTagClientRegistry();
+        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);
--- a/jdk/test/com/sun/servicetag/Util.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/test/com/sun/servicetag/Util.java	Wed Jul 21 09:57:21 2010 -0700
@@ -219,25 +219,25 @@
     }
 
     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");
-
-        // clean up registry.xml
-        String regDir = System.getProperty("test.classes");
-        File registryFile = new File(regDir, "registry.xml");
-        if (registryFile.exists()) {
-            registryFile.delete();
-        }
+        registryFile = f;
 
         String stclientCmd = Util.getSvcClientCommand(registryFile.getCanonicalPath());
         System.out.println("stclient cmd: " + stclientCmd);
@@ -247,4 +247,17 @@
         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/jdk/test/com/sun/tools/attach/BasicTests.sh	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/test/com/sun/tools/attach/BasicTests.sh	Wed Jul 21 09:57:21 2010 -0700
@@ -37,6 +37,21 @@
   exit 1
 fi
 
+# Windows 2000 is a problem here, so we skip it, see 6962615
+osrev=`uname -a`
+if [ "`echo ${osrev} | grep 'CYGWIN'`" != "" ] ; then
+  if [ "`echo ${osrev} | grep '5.0'`" != "" ] ; then
+     echo "Treating as a pass, not testing Windows 2000"
+     exit 0
+  fi
+fi
+if [ "`echo ${osrev} | grep 'Windows'`" != "" ] ; then
+  if [ "`echo ${osrev} | grep '5 00'`" != "" ] ; then
+     echo "Treating as a pass, not testing Windows 2000"
+     exit 0
+  fi
+fi
+
 . ${TESTSRC}/CommonSetup.sh
 . ${TESTSRC}/ApplicationSetup.sh
 . ${TESTSRC}/AgentSetup.sh
--- a/jdk/test/com/sun/tracing/BasicFunctionality.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/test/com/sun/tracing/BasicFunctionality.java	Wed Jul 21 09:57:21 2010 -0700
@@ -24,6 +24,7 @@
 /**
  * @test
  * @bug 6537506
+ * @ignore 6962535
  * @summary Basic unit test for tracing framework
  */
 
--- a/jdk/test/java/awt/EventDispatchThread/HandleExceptionOnEDT/HandleExceptionOnEDT.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/test/java/awt/EventDispatchThread/HandleExceptionOnEDT/HandleExceptionOnEDT.java	Wed Jul 21 09:57:21 2010 -0700
@@ -1,3 +1,26 @@
+/*
+ * 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 6304473 6727884
--- a/jdk/test/java/awt/EventDispatchThread/LoopRobustness/LoopRobustness.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/test/java/awt/EventDispatchThread/LoopRobustness/LoopRobustness.java	Wed Jul 21 09:57:21 2010 -0700
@@ -34,35 +34,40 @@
 
 import java.awt.*;
 import java.awt.event.*;
-import java.lang.Math;
+
+import sun.awt.SunToolkit;
+
 import test.java.awt.regtesthelpers.Util;
 
 public class LoopRobustness {
-    static int clicks = 0;
+
     final static long TIMEOUT = 5000;
     final static Object LOCK = new Object();
-    static volatile boolean notifyOccur = false;
 
-    public static void main(String [] args)  {
+    public static int clicks = 0;
+    public static volatile boolean notifyOccured = false;
+    public static volatile boolean otherExceptionsCaught = false;
+
+    public static void main(String [] args) throws Exception {
         ThreadGroup mainThreadGroup = Thread.currentThread().getThreadGroup();
 
         long at;
         //wait for a TIMEOUT giving a chance to a new Thread above to accomplish its stuff.
-        synchronized (LoopRobustness.LOCK){
+        synchronized (LoopRobustness.LOCK) {
             new Thread(new TestThreadGroup(mainThreadGroup, "TestGroup"), new Impl()).start();
             at = System.currentTimeMillis();
             try {
-                while(!notifyOccur && System.currentTimeMillis() - at < TIMEOUT) {
+                while (!notifyOccured && (System.currentTimeMillis() - at < TIMEOUT)) {
                     LoopRobustness.LOCK.wait(1000);
                 }
-            } catch(InterruptedException e){
+            } catch (InterruptedException e) {
                 throw new RuntimeException("Test interrupted.", e);
             }
         }
 
-        if( !notifyOccur){
+        if (!notifyOccured) {
             //notify doesn't occur after a reasonable time.
-            throw new RuntimeException("Test failed. Second Thread didn't notify MainThread.");
+            throw new RuntimeException("Test FAILED: second thread hasn't notified MainThread");
         }
 
         //now wait for two clicks
@@ -75,7 +80,10 @@
             }
         }
         if (clicks != 2) {
-            throw new RuntimeException("robot should press button twice");
+            throw new RuntimeException("Test FAILED: robot should press button twice");
+        }
+        if (otherExceptionsCaught) {
+            throw new RuntimeException("Test FAILED: unexpected exceptions caught");
         }
     }
 }
@@ -83,18 +91,11 @@
 class Impl implements Runnable{
     static Robot robot;
     public void run() {
+        SunToolkit.createNewAppContext();
+
         Button b = new Button("Press me to test the AWT-Event Queue thread");
         Frame lr = new Frame("ROBUST FRAME");
-        /* Must load Toolkit on this thread only, rather then on Main.
-           If load on Main (on the parent ThreadGroup of current ThreadGroup) then
-           EDT will be created on Main thread and supplied with it's own exceptionHandler,
-           which just throws an Exception and terminates current thread.
-           The test implies that EDT is created on the child ThreadGroup (testThreadGroup)
-           which is supplied with its own uncaughtException().
-        */
-        Toolkit.getDefaultToolkit();
         lr.setBounds(100, 100, 300, 100);
-
         b.addActionListener(new ActionListener() {
                 public void actionPerformed(ActionEvent e) {
                     LoopRobustness.clicks++;
@@ -107,40 +108,46 @@
 
         try {
             robot = new Robot();
-        } catch(AWTException e){
+        } catch (AWTException e) {
             throw new RuntimeException("Test interrupted.", e);
         }
         Util.waitForIdle(robot);
 
         synchronized (LoopRobustness.LOCK){
             LoopRobustness.LOCK.notify();
-            LoopRobustness.notifyOccur = true;
+            LoopRobustness.notifyOccured = true;
         }
 
         int i = 0;
-        while(i < 2){
+        while (i < 2) {
             robot.mouseMove(b.getLocationOnScreen().x + b.getWidth()/2,
-                            b.getLocationOnScreen().y + b.getHeight()/2 );
+                            b.getLocationOnScreen().y + b.getHeight()/2);
+            Util.waitForIdle(robot);
             robot.mousePress(InputEvent.BUTTON1_MASK);
-            //                robot.delay(10);
+            Util.waitForIdle(robot);
             robot.mouseRelease(InputEvent.BUTTON1_MASK);
+            Util.waitForIdle(robot);
             i++;
-            robot.delay(1000);
         }
     }
 }
 
 class TestThreadGroup extends ThreadGroup {
-    TestThreadGroup(ThreadGroup threadGroup, String name){
+    TestThreadGroup(ThreadGroup threadGroup, String name) {
         super(threadGroup, name);
     }
 
-    public void uncaughtException(Thread exitedThread, Throwable e) {
-        e.printStackTrace();
-        if ((e instanceof ExceptionInInitializerError) || (e instanceof
-                NoClassDefFoundError)){
-            throw new RuntimeException("Test failed: other Exceptions were thrown ", e);
+    public void uncaughtException(Thread thread, Throwable e) {
+        System.out.println("Exception caught: " + e);
+        e.printStackTrace(System.out);
+        System.out.flush();
+        if ((e instanceof ExceptionInInitializerError) ||
+            (e instanceof NoClassDefFoundError))
+        {
+            // These two are expected
+            return;
         }
+        LoopRobustness.otherExceptionsCaught = true;
     }
 }
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/awt/EventDispatchThread/PreserveDispathThread/PreserveDispatchThread.java	Wed Jul 21 09:57:21 2010 -0700
@@ -0,0 +1,224 @@
+/*
+ * 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 6424157
+  @author Artem Ananiev: area=eventqueue
+  @run main PreserveDispatchThread
+*/
+
+import java.awt.*;
+import java.awt.event.*;
+
+public class PreserveDispatchThread {
+
+    private static volatile Frame f;
+    private static volatile Dialog d;
+
+    private static volatile boolean isEDT = true;
+
+    public static void main(String[] args) throws Exception {
+        f = new Frame("F");
+        f.setSize(320, 340);
+        f.setLocationRelativeTo(null);
+        f.setVisible(true);
+
+        try {
+            test1();
+            if (!isEDT) {
+                throw new RuntimeException("Test FAILED (test1): event dispatch thread is changed");
+            }
+
+            test2();
+            if (!isEDT) {
+                throw new RuntimeException("Test FAILED (test2): event dispatch thread is changed");
+            }
+
+            test3();
+            if (!isEDT) {
+                throw new RuntimeException("Test FAILED (test3): event dispatch thread is changed");
+            }
+        } finally {
+            if (d != null) {
+                d.dispose();
+            }
+            f.dispose();
+        }
+    }
+
+    /*
+     * Tests that push/pop doesn't change the dispatch thread if
+     * called on EDT.
+     */
+    private static void test1() throws Exception {
+        EventQueue.invokeAndWait(new Runnable() {
+            @Override
+            public void run() {
+                TestEventQueue teq = new TestEventQueue();
+                EventQueue seq = Toolkit.getDefaultToolkit().getSystemEventQueue();
+                try {
+                    seq.push(teq);
+                    d = new TestDialog();
+                    d.setVisible(true);
+                    checkEDT();
+                } finally {
+                    teq.pop();
+                }
+                checkEDT();
+            }
+        });
+    }
+
+    /*
+     * Tests that push/pop doesn't change the dispatch thread if
+     * called on the main thread.
+     */
+    private static void test2() throws Exception {
+        TestEventQueue teq = new TestEventQueue();
+        EventQueue seq = Toolkit.getDefaultToolkit().getSystemEventQueue();
+        try {
+            seq.push(teq);
+            EventQueue.invokeAndWait(new Runnable() {
+                @Override
+                public void run() {
+                    checkEDT();
+                    d = new TestDialog();
+                    d.setVisible(true);
+                    checkEDT();
+                }
+            });
+        } finally {
+            teq.pop();
+        }
+    }
+
+    private static final Object test3Lock = new Object();
+    private static boolean test3Sync = false;
+
+    /*
+     * A complex test: several nested invokeLater() are called and
+     * in every runnable a check for EDT is performed. At the ent
+     * of the test we wait for all the runnables to be processed
+     * and the dialog is disposed; otherwise the last EDT check can
+     * be later than this method returns and the whole test is passed.
+     */
+    private static void test3() throws Exception {
+        EventQueue.invokeLater(new Runnable() {
+            @Override
+            public void run() {
+                d = new Dialog(f, true);
+                d.setSize(240, 180);
+                d.setLocationRelativeTo(f);
+                EventQueue.invokeLater(new Runnable() {
+                    @Override
+                    public void run() {
+                        d.setVisible(true);
+                        checkEDT();
+                    }
+                });
+                EventQueue.invokeLater(new Runnable() {
+                    @Override
+                    public void run() {
+                        TestEventQueue teq = new TestEventQueue();
+                        EventQueue seq = Toolkit.getDefaultToolkit().getSystemEventQueue();
+                        try {
+                            seq.push(teq);
+                            checkEDT();
+                            EventQueue.invokeLater(new Runnable() {
+                                @Override
+                                public void run() {
+                                    d.dispose();
+                                    checkEDT();
+                                    synchronized (test3Lock) {
+                                        test3Sync = true;
+                                        test3Lock.notify();
+                                    }
+                                }
+                            });
+                        } finally {
+                            teq.pop();
+                        }
+                        checkEDT();
+                    }
+                });
+                checkEDT();
+            }
+        });
+        synchronized (test3Lock) {
+            while (!test3Sync) {
+                try {
+                    test3Lock.wait();
+                } catch (InterruptedException ie) {
+                    break;
+                }
+            }
+        }
+        // Make sure all the nested invokeLater/invokeAndWait are processed
+        EventQueue.invokeAndWait(new Runnable() {
+            @Override
+            public void run() {
+            }
+        });
+    }
+
+    private static void checkEDT() {
+        isEDT = isEDT && EventQueue.isDispatchThread();
+    }
+
+    private static class TestEventQueue extends EventQueue {
+        public TestEventQueue() {
+            super();
+        }
+        public void pop() {
+            super.pop();
+        }
+    }
+
+    private static class TestDialog extends Dialog {
+        private volatile boolean dialogShown = false;
+        private volatile boolean paintCalled = false;
+        public TestDialog() {
+            super(f, true);
+            setSize(240, 180);
+            setLocationRelativeTo(f);
+            addComponentListener(new ComponentAdapter() {
+                @Override
+                public void componentShown(ComponentEvent e) {
+                    if (paintCalled) {
+                        dispose();
+                    }
+                    dialogShown = true;
+                }
+            });
+        }
+        @Override
+        public void paint(Graphics g) {
+            if (dialogShown) {
+                dispose();
+            }
+            paintCalled = true;
+        }
+    }
+
+}
--- a/jdk/test/java/awt/EventQueue/PushPopDeadlock2/PushPopTest.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/test/java/awt/EventQueue/PushPopDeadlock2/PushPopTest.java	Wed Jul 21 09:57:21 2010 -0700
@@ -43,6 +43,7 @@
         Runnable dummy = new Runnable() {
                 public void run() {
                     System.err.println("Dummy is here.");
+                    System.err.flush();
                 }
             };
         EventQueue seq = Toolkit.getDefaultToolkit().getSystemEventQueue();
@@ -58,10 +59,11 @@
         Runnable runnable = new Runnable() {
                 public void run() {
                     System.err.println("Dummy from SunToolkit");
+                    System.err.flush();
                 }
             };
         InvocationEvent ie = new InvocationEvent(eq2, runnable, null, false);
-        System.err.println(ie);
+//        System.err.println(ie);
         SunToolkit.postEvent(SunToolkit.targetToAppContext(frame), ie);
         eq1.pop();
         frame.dispose();
@@ -70,14 +72,14 @@
 
 class MyEventQueue1 extends EventQueue {
 
-    public void pop() throws EmptyStackException {
+    public void pop() {
         super.pop();
     }
 }
 
 class MyEventQueue2 extends EventQueue {
 
-    protected void pop() throws EmptyStackException {
+    protected void pop() {
         System.err.println("pop2()");
         Thread.dumpStack();
         try {
@@ -85,7 +87,8 @@
                     public void run() {
                         Runnable runnable = new Runnable() {
                                 public void run() {
-                                    System.err.println("Dummy from here");
+                                    System.err.println("Dummy from pop");
+                                    System.err.flush();
                                 }
                              };
                         InvocationEvent ie = new InvocationEvent(MyEventQueue2.this, runnable, null, false);
--- a/jdk/test/java/awt/FileDialog/FilenameFilterTest/FilenameFilterTest.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/test/java/awt/FileDialog/FilenameFilterTest/FilenameFilterTest.java	Wed Jul 21 09:57:21 2010 -0700
@@ -83,6 +83,12 @@
         if (fd == null) {
             throw new RuntimeException("fd is null (very unexpected thing :(");
         }
+        //Wait a little; some native dialog implementations may take a while
+        //to initialize and call the filter. See 6959787 for an example.
+        try {
+            Thread.sleep(5000);
+        } catch (Exception ex) {
+        }
         fd.dispose();
         if (!filter_was_called) {
             throw new RuntimeException("Filter was not called");
--- a/jdk/test/java/awt/FontClass/FontPrivilege.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/test/java/awt/FontClass/FontPrivilege.java	Wed Jul 21 09:57:21 2010 -0700
@@ -23,7 +23,7 @@
 
 /*
  * @test
- * @bug 5010310 6319835 6904882
+ * @bug 5010310 6319835 6904882 6968373
  * @summary test fonts can be created in the presence of a security manager
  * @run main/othervm/secure=java.lang.SecurityManager FontPrivilege
  */
--- a/jdk/test/java/beans/Beans/Test4080522.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/test/java/beans/Beans/Test4080522.java	Wed Jul 21 09:57:21 2010 -0700
@@ -29,6 +29,7 @@
  *          Beans.setGuiAvailable
  *          Introspector.setBeanInfoSearchPath
  *          PropertyEditorManager.setEditorSearchPath
+ * @run main/othervm Test4080522
  * @author Graham Hamilton
  */
 
--- a/jdk/test/java/beans/EventHandler/Test6277246.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/test/java/beans/EventHandler/Test6277246.java	Wed Jul 21 09:57:21 2010 -0700
@@ -25,6 +25,7 @@
  * @test
  * @bug 6277246
  * @summary Tests problem with java.beans use of reflection
+ * @run main/othervm Test6277246
  * @author Jeff Nisewanger
  */
 
--- a/jdk/test/java/beans/EventHandler/Test6277266.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/test/java/beans/EventHandler/Test6277266.java	Wed Jul 21 09:57:21 2010 -0700
@@ -25,6 +25,7 @@
  * @test
  * @bug 6277266
  * @summary Tests access control issue in EventHandler
+ * @run main/othervm Test6277266
  * @author Jeff Nisewanger
  */
 
--- a/jdk/test/java/beans/Introspector/Test6277246.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/test/java/beans/Introspector/Test6277246.java	Wed Jul 21 09:57:21 2010 -0700
@@ -25,6 +25,7 @@
  * @test
  * @bug 6277246
  * @summary Tests problem with java.beans use of reflection
+ * @run main/othervm Test6277246
  * @author Jeff Nisewanger
  */
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/beans/Introspector/Test6707234.java	Wed Jul 21 09:57:21 2010 -0700
@@ -0,0 +1,52 @@
+/*
+ * 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 6707234
+ * @summary Tests setter in a complex bean
+ * @author Sergey Malenkov
+ */
+
+public class Test6707234 {
+    public static void main(String[] args) {
+        if (null == BeanUtils.getPropertyDescriptor(C.class, "number").getWriteMethod()) {
+            throw new Error("no write method");
+        }
+    }
+
+    public interface I {
+        void setNumber(Object number);
+        Number getNumber();
+    }
+
+    public class C implements I {
+        public void setNumber(Object value) {
+        }
+        public void setNumber(Long value) {
+        }
+        public Long getNumber() {
+            return null;
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/beans/Introspector/Test6963811.java	Wed Jul 21 09:57:21 2010 -0700
@@ -0,0 +1,78 @@
+/*
+ * 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 6963811
+ * @summary Tests deadlock in Introspector
+ * @author Sergey Malenkov
+ */
+
+import java.beans.Introspector;
+import java.beans.SimpleBeanInfo;
+
+public class Test6963811 implements Runnable {
+    private final long time;
+    private final boolean sync;
+
+    public Test6963811(long time, boolean sync) {
+        this.time = time;
+        this.sync = sync;
+    }
+
+    public void run() {
+        try {
+            Thread.sleep(this.time); // increase the chance of the deadlock
+            Introspector.getBeanInfo(
+                    this.sync ? Super.class : Sub.class,
+                    this.sync ? null : Object.class);
+        }
+        catch (Exception exception) {
+            exception.printStackTrace();
+        }
+    }
+
+    public static void main(String[] args) throws Exception {
+        Thread[] threads = new Thread[2];
+        for (int i = 0; i < threads.length; i++) {
+            threads[i] = new Thread(new Test6963811(0L, i > 0));
+            threads[i].start();
+            Thread.sleep(500L); // increase the chance of the deadlock
+        }
+        for (Thread thread : threads) {
+            thread.join();
+        }
+    }
+
+    public static class Super {
+    }
+
+    public static class Sub extends Super {
+    }
+
+    public static class SubBeanInfo extends SimpleBeanInfo {
+        public SubBeanInfo() {
+            new Test6963811(1000L, true).run();
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/beans/PropertyEditor/Test6963811.java	Wed Jul 21 09:57:21 2010 -0700
@@ -0,0 +1,83 @@
+/*
+ * 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 6963811
+ * @summary Tests deadlock in PropertyEditorManager
+ * @author Sergey Malenkov
+ */
+
+import java.beans.PropertyEditorManager;
+import sun.beans.editors.StringEditor;
+
+public class Test6963811 implements Runnable {
+    private final long time;
+    private final boolean sync;
+
+    public Test6963811(long time, boolean sync) {
+        this.time = time;
+        this.sync = sync;
+    }
+
+    public void run() {
+        try {
+            Thread.sleep(this.time); // increase the chance of the deadlock
+            if (this.sync) {
+                synchronized (Test6963811.class) {
+                    PropertyEditorManager.findEditor(Super.class);
+                }
+            }
+            else {
+                PropertyEditorManager.findEditor(Sub.class);
+            }
+        }
+        catch (Exception exception) {
+            exception.printStackTrace();
+        }
+    }
+
+    public static void main(String[] args) throws Exception {
+        Thread[] threads = new Thread[2];
+        for (int i = 0; i < threads.length; i++) {
+            threads[i] = new Thread(new Test6963811(0L, i > 0));
+            threads[i].start();
+            Thread.sleep(500L); // increase the chance of the deadlock
+        }
+        for (Thread thread : threads) {
+            thread.join();
+        }
+    }
+
+    public static class Super {
+    }
+
+    public static class Sub extends Super {
+    }
+
+    public static class SubEditor extends StringEditor {
+        public SubEditor() {
+            new Test6963811(1000L, true).run();
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/beans/XMLEncoder/Test6963811.java	Wed Jul 21 09:57:21 2010 -0700
@@ -0,0 +1,84 @@
+/*
+ * 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 6963811
+ * @summary Tests deadlock in Encoder
+ * @author Sergey Malenkov
+ */
+
+import java.beans.Encoder;
+import java.beans.DefaultPersistenceDelegate;
+
+public class Test6963811 implements Runnable {
+    private static final Encoder ENCODER = new Encoder();
+    private final long time;
+    private final boolean sync;
+
+    public Test6963811(long time, boolean sync) {
+        this.time = time;
+        this.sync = sync;
+    }
+
+    public void run() {
+        try {
+            Thread.sleep(this.time); // increase the chance of the deadlock
+            if (this.sync) {
+                synchronized (Test6963811.class) {
+                    ENCODER.getPersistenceDelegate(Super.class);
+                }
+            }
+            else {
+                ENCODER.getPersistenceDelegate(Sub.class);
+            }
+        }
+        catch (Exception exception) {
+            exception.printStackTrace();
+        }
+    }
+
+    public static void main(String[] args) throws Exception {
+        Thread[] threads = new Thread[2];
+        for (int i = 0; i < threads.length; i++) {
+            threads[i] = new Thread(new Test6963811(0L, i > 0));
+            threads[i].start();
+            Thread.sleep(500L); // increase the chance of the deadlock
+        }
+        for (Thread thread : threads) {
+            thread.join();
+        }
+    }
+
+    public static class Super {
+    }
+
+    public static class Sub extends Super {
+    }
+
+    public static class SubPersistenceDelegate extends DefaultPersistenceDelegate {
+        public SubPersistenceDelegate() {
+            new Test6963811(1000L, true).run();
+        }
+    }
+}
--- a/jdk/test/java/beans/XMLEncoder/java_awt_GridBagConstraints.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/test/java/beans/XMLEncoder/java_awt_GridBagConstraints.java	Wed Jul 21 09:57:21 2010 -0700
@@ -55,7 +55,6 @@
     }
 
     protected GridBagConstraints getAnotherObject() {
-        return null; // TODO: could not update property
-        // return new GridBagConstraints();
+        return new GridBagConstraints();
     }
 }
--- a/jdk/test/java/dyn/MethodHandlesTest.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/test/java/dyn/MethodHandlesTest.java	Wed Jul 21 09:57:21 2010 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2009, 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
@@ -26,19 +26,18 @@
 /* @test
  * @summary unit tests for java.dyn.MethodHandles
  * @compile -XDinvokedynamic MethodHandlesTest.java
- * @run junit/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableInvokeDynamic jdk.java.dyn.MethodHandlesTest
+ * @run junit/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableInvokeDynamic test.java.dyn.MethodHandlesTest
  */
 
-package jdk.java.dyn;
+package test.java.dyn;
 
 import java.dyn.*;
 import java.dyn.MethodHandles.Lookup;
 import java.lang.reflect.*;
 import java.util.*;
-import java.util.logging.Level;
-import java.util.logging.Logger;
 import org.junit.*;
 import static org.junit.Assert.*;
+import static org.junit.Assume.*;
 
 
 /**
@@ -47,7 +46,11 @@
  */
 public class MethodHandlesTest {
     // How much output?
-    static int verbosity = 1;
+    static int verbosity = 0;
+    static {
+        String vstr = System.getProperty("test.java.dyn.MethodHandlesTest.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
@@ -57,55 +60,82 @@
 
     // Set true to test more calls.  If false, some tests are just
     // lookups, without exercising the actual method handle.
-    static boolean DO_MORE_CALLS = false;
+    static boolean DO_MORE_CALLS = true;
 
 
     @Test
     public void testFirst() throws Throwable {
         verbosity += 9; try {
             // left blank for debugging
-        } finally { verbosity -= 9; }
+        } 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")
+    @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 {
-        testInsertArguments(0, 0, MAX_ARG_INCREASE+1);
+        // ValueConversions.varargsArray: UnsupportedOperationException: NYI: cannot form a varargs array of length 13
+        testInsertArguments(0, 0, MAX_ARG_INCREASE+10);
     }
     static final int MAX_ARG_INCREASE = 3;
 
     public MethodHandlesTest() {
     }
 
+    @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("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;
     @After
     public void printCounts() {
-        if (verbosity >= 1 && (posTests | negTests) != 0) {
+        if (verbosity >= 2 && (posTests | negTests) != 0) {
             System.out.println();
             if (posTests != 0)  System.out.println("=== "+testName+": "+posTests+" positive test cases run");
             if (negTests != 0)  System.out.println("=== "+testName+": "+negTests+" negative test cases run");
+            allPosTests += posTests;
+            allNegTests += negTests;
+            posTests = negTests = 0;
         }
     }
     void countTest(boolean positive) {
@@ -115,7 +145,7 @@
     void countTest() { countTest(true); }
     void startTest(String name) {
         if (testName != null)  printCounts();
-        if (verbosity >= 0)
+        if (verbosity >= 1)
             System.out.println(name);
         posTests = negTests = 0;
         testName = name;
@@ -125,11 +155,17 @@
     public static void setUpClass() throws Exception {
         calledLog.clear();
         calledLog.add(null);
-        nextArg = 1000000;
+        nextArgVal = INITIAL_ARG_VAL;
     }
 
     @AfterClass
     public static void tearDownClass() throws Exception {
+        int posTests = allPosTests, negTests = allNegTests;
+        if (verbosity >= 2 && (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>();
@@ -144,18 +180,17 @@
     static void assertCalled(String name, Object... args) {
         Object expected = logEntry(name, args);
         Object actual   = calledLog.get(calledLog.size() - 1);
-        if (expected.equals(actual))  return;
+        if (expected.equals(actual) && verbosity < 9)  return;
         System.out.println("assertCalled "+name+":");
         System.out.println("expected:   "+expected);
         System.out.println("actual:     "+actual);
         System.out.println("ex. types:  "+getClasses(expected));
         System.out.println("act. types: "+getClasses(actual));
-        assertEquals("previous method call types", expected, actual);
         assertEquals("previous method call", expected, actual);
     }
     static void printCalled(MethodHandle target, String name, Object... args) {
-        if (verbosity >= 2)
-            System.out.println("calling "+logEntry(name, args)+" on "+target);
+        if (verbosity >= 3)
+            System.out.println("calling MH="+target+" to "+name+Arrays.toString(args));
     }
 
     static Object castToWrapper(Object value, Class<?> dst) {
@@ -188,11 +223,40 @@
         return null;
     }
 
-    static int nextArg;
+    static final int ONE_MILLION = (1000*1000),  // first int value
+                     TEN_BILLION = (10*1000*1000*1000),  // scale factor to reach upper 32 bits
+                     INITIAL_ARG_VAL = ONE_MILLION << 1;  // <<1 makes space for sign bit;
+    static long nextArgVal;
+    static long nextArg(boolean moreBits) {
+        long val = nextArgVal++;
+        long sign = -(val & 1); // alternate signs
+        val >>= 1;
+        if (moreBits)
+            // Guarantee some bits in the high word.
+            // In any case keep the decimal representation simple-looking,
+            // with lots of zeroes, so as not to make the printed decimal
+            // strings unnecessarily noisy.
+            val += (val % ONE_MILLION) * TEN_BILLION;
+        return val ^ sign;
+    }
+    static int nextArg() {
+        // Produce a 32-bit result something like ONE_MILLION+(smallint).
+        // Example: 1_000_042.
+        return (int) nextArg(false);
+    }
+    static long nextArg(Class<?> kind) {
+        if (kind == long.class   || kind == Long.class ||
+            kind == double.class || kind == Double.class)
+            // produce a 64-bit result something like
+            // ((TEN_BILLION+1) * (ONE_MILLION+(smallint)))
+            // Example: 10_000_420_001_000_042.
+            return nextArg(true);
+        return (long) nextArg();
+    }
+
     static Object randomArg(Class<?> param) {
-        Object wrap = castToWrapperOrNull(nextArg, param);
+        Object wrap = castToWrapperOrNull(nextArg(param), param);
         if (wrap != null) {
-            nextArg++;
             return wrap;
         }
 //        import sun.dyn.util.Wrapper;
@@ -202,7 +266,7 @@
 //        if (wrap != Wrapper.OBJECT)
 //            return wrap.wrap(nextArg++);
         if (param.isInterface() || param.isAssignableFrom(String.class))
-            return "#"+(nextArg++);
+            return "#"+nextArg();
         else
             try {
                 return param.newInstance();
@@ -277,7 +341,7 @@
     // Subject methods...
     static class Example implements IntExample {
         final String name;
-        public Example() { name = "Example#"+(nextArg++); }
+        public Example() { name = "Example#"+nextArg(); }
         protected Example(String name) { this.name = name; }
         protected Example(int x) { this(); called("protected <init>", this, x); }
         @Override public String toString() { return name; }
@@ -301,43 +365,56 @@
         public static Object   s5(long x, int y) { return called("s5", x, y); }
         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); }
+
+        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()); }
     }
     static class SubExample extends Example {
         @Override public void  v0()     { called("Sub/v0", this); }
         @Override void         pkg_v0() { called("Sub/pkg_v0", this); }
         private      SubExample(int x)  { called("<init>", this, x); }
-        public SubExample() { super("SubExample#"+(nextArg++)); }
+        public SubExample() { super("SubExample#"+nextArg()); }
     }
     public static interface IntExample {
         public void            v0();
         static class Impl implements IntExample {
             public void        v0()     { called("Int/v0", this); }
             final String name;
-            public Impl() { name = "Example#"+(nextArg++); }
+            public Impl() { name = "Impl#"+nextArg(); }
+            @Override public String toString() { return name; }
         }
     }
 
     static final Object[][][] ACCESS_CASES = {
-        { { false, PUBLIC }, { false, PACKAGE }, { false, PRIVATE } },
-        { { false, PUBLIC }, { false, PACKAGE }, { true,  PRIVATE } },
-        { { false, PUBLIC }, { true,  PACKAGE }, { true,  PRIVATE } },
-        { { true,  PUBLIC }, { true,  PACKAGE }, { true,  PRIVATE } },
+        { { 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
     };
 
-    static Object[][] accessCases(Class<?> defc, String name) {
-        if (name.contains("pri_")) {
-            return ACCESS_CASES[1]; // PRIVATE only
-        } else if (name.contains("pkg_")) {
-            return ACCESS_CASES[2]; // not PUBLIC
+    static Object[][] accessCases(Class<?> defc, String name, boolean isSpecial) {
+        Object[][] cases;
+        if (name.contains("pri_") || isSpecial) {
+            cases = ACCESS_CASES[1]; // PRIVATE only
+        } else if (name.contains("pkg_") || !Modifier.isPublic(defc.getModifiers())) {
+            cases = ACCESS_CASES[2]; // not PUBLIC
         } else {
             assertTrue(name.indexOf('_') < 0);
             boolean pubc = Modifier.isPublic(defc.getModifiers());
             if (pubc)
-                return ACCESS_CASES[3]; // all access levels
-            return ACCESS_CASES[2]; // PACKAGE but not PUBLIC
+                cases = ACCESS_CASES[3]; // all access levels
+            else
+                cases = ACCESS_CASES[2]; // PACKAGE but not PUBLIC
         }
+        if (defc != Example.class && cases[cases.length-1][1] == EXAMPLE)
+            cases = Arrays.copyOfRange(cases, 0, cases.length-1);
+        return cases;
+    }
+    static Object[][] accessCases(Class<?> defc, String name) {
+        return accessCases(defc, name, false);
     }
 
     @Test
@@ -374,12 +451,13 @@
         MethodHandle target = null;
         RuntimeException noAccess = null;
         try {
+            if (verbosity >= 4)  System.out.println("lookup via "+lookup+" of "+defc+" "+name+type);
             target = lookup.findStatic(defc, name, type);
         } catch (NoAccessException ex) {
             noAccess = ex;
         }
-        if (verbosity >= 2)
-            System.out.println("findStatic "+lookup+": "+defc+"."+name+"/"+type+" => "+target
+        if (verbosity >= 3)
+            System.out.println("findStatic "+lookup+": "+defc.getName()+"."+name+"/"+type+" => "+target
                     +(noAccess == null ? "" : " !! "+noAccess));
         if (positive && noAccess != null)  throw noAccess;
         assertEquals(positive ? "positive test" : "negative test erroneously passed", positive, target != null);
@@ -391,7 +469,8 @@
         printCalled(target, name, args);
         target.invokeVarargs(args);
         assertCalled(name, args);
-        System.out.print(':');
+        if (verbosity >= 1)
+            System.out.print(':');
     }
 
     @Test
@@ -436,21 +515,20 @@
         MethodHandle target = null;
         RuntimeException noAccess = null;
         try {
+            if (verbosity >= 4)  System.out.println("lookup via "+lookup+" of "+defc+" "+name+type);
             target = lookup.findVirtual(defc, methodName, type);
         } catch (NoAccessException ex) {
             noAccess = ex;
         }
-        if (verbosity >= 2)
-            System.out.println("findVirtual "+lookup+": "+defc+"."+name+"/"+type+" => "+target
+        if (verbosity >= 3)
+            System.out.println("findVirtual "+lookup+": "+defc.getName()+"."+name+"/"+type+" => "+target
                     +(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
         Class<?>[] paramsWithSelf = cat(array(Class[].class, (Class)defc), params);
         MethodType typeWithSelf = MethodType.methodType(ret, paramsWithSelf);
-        MethodType ttype = target.type();
-        ttype = ttype.changeParameterType(0, defc); // FIXME: test this
-        assertEquals(typeWithSelf, ttype);
+        assertEquals(typeWithSelf, target.type());
         assertTrue(target.toString().contains(methodName));  // rough check
         if (!DO_MORE_CALLS && lookup != PRIVATE)  return;
         Object[] argsWithSelf = randomArgs(paramsWithSelf);
@@ -458,52 +536,61 @@
         printCalled(target, name, argsWithSelf);
         target.invokeVarargs(argsWithSelf);
         assertCalled(name, argsWithSelf);
-        System.out.print(':');
+        if (verbosity >= 1)
+            System.out.print(':');
     }
 
     @Test
     public void testFindSpecial() throws Throwable {
         if (CAN_SKIP_WORKING)  return;
         startTest("findSpecial");
-        testFindSpecial(Example.class, void.class, "v0");
-        testFindSpecial(Example.class, void.class, "pkg_v0");
-        testFindSpecial(false, PRIVATE, Example.class, void.class, "<init>", int.class);
-        testFindSpecial(false, PRIVATE, Example.class, void.class, "bogus");
+        testFindSpecial(SubExample.class, Example.class, void.class, "v0");
+        testFindSpecial(SubExample.class, Example.class, void.class, "pkg_v0");
+        // Do some negative testing:
+        for (Lookup lookup : new Lookup[]{ PRIVATE, EXAMPLE, PACKAGE, PUBLIC }) {
+            testFindSpecial(false, lookup, Object.class, Example.class, void.class, "v0");
+            testFindSpecial(false, lookup, SubExample.class, Example.class, void.class, "<init>", int.class);
+            testFindSpecial(false, lookup, SubExample.class, Example.class, void.class, "s0");
+            testFindSpecial(false, lookup, SubExample.class, Example.class, void.class, "bogus");
+        }
     }
 
-    void testFindSpecial(Class<?> defc, Class<?> ret, String name, Class<?>... params) throws Throwable {
-        testFindSpecial(true,  PRIVATE, defc, ret, name, params);
-        testFindSpecial(false, PACKAGE, defc, ret, name, params);
-        testFindSpecial(false, PUBLIC,  defc, ret, name, params);
+    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);
     }
-    void testFindSpecial(boolean positive, Lookup lookup, Class<?> defc, Class<?> ret, String name, Class<?>... params) throws Throwable {
+    void testFindSpecial(boolean positive, Lookup lookup, Class<?> specialCaller,
+                         Class<?> defc, Class<?> ret, String name, Class<?>... params) throws Throwable {
         countTest(positive);
         MethodType type = MethodType.methodType(ret, params);
         MethodHandle target = null;
         RuntimeException noAccess = null;
         try {
-            target = lookup.findSpecial(defc, name, type, defc);
+            if (verbosity >= 4)  System.out.println("lookup via "+lookup+" of "+defc+" "+name+type);
+            target = lookup.findSpecial(defc, name, type, specialCaller);
         } catch (NoAccessException ex) {
             noAccess = ex;
         }
-        if (verbosity >= 2)
-            System.out.println("findSpecial "+defc+"."+name+"/"+type+" => "+target
-                    +(noAccess == null ? "" : " !! "+noAccess));
+        if (verbosity >= 3)
+            System.out.println("findSpecial from "+specialCaller.getName()+" to "+defc.getName()+"."+name+"/"+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
-        Class<?>[] paramsWithSelf = cat(array(Class[].class, (Class)defc), params);
+        assertEquals(specialCaller, target.type().parameterType(0));
+        assertEquals(type,          target.type().dropParameterTypes(0,1));
+        Class<?>[] paramsWithSelf = cat(array(Class[].class, (Class)specialCaller), params);
         MethodType typeWithSelf = MethodType.methodType(ret, paramsWithSelf);
-        MethodType ttype = target.type();
-        ttype = ttype.changeParameterType(0, defc); // FIXME: test this
-        assertEquals(typeWithSelf, ttype);
         assertTrue(target.toString().contains(name));  // rough check
-        if (!DO_MORE_CALLS && lookup != PRIVATE)  return;
+        if (!DO_MORE_CALLS && lookup != PRIVATE && lookup != EXAMPLE)  return;
         Object[] args = randomArgs(paramsWithSelf);
         printCalled(target, name, args);
         target.invokeVarargs(args);
         assertCalled(name, args);
-        System.out.print(':');
     }
 
     @Test
@@ -538,11 +625,12 @@
         MethodHandle target = null;
         RuntimeException noAccess = null;
         try {
+            if (verbosity >= 4)  System.out.println("lookup via "+lookup+" of "+defc+" "+name+type);
             target = lookup.bind(receiver, methodName, type);
         } catch (NoAccessException ex) {
             noAccess = ex;
         }
-        if (verbosity >= 2)
+        if (verbosity >= 3)
             System.out.println("bind "+receiver+"."+name+"/"+type+" => "+target
                     +(noAccess == null ? "" : " !! "+noAccess));
         if (positive && noAccess != null)  throw noAccess;
@@ -554,7 +642,8 @@
         target.invokeVarargs(args);
         Object[] argsWithReceiver = cat(array(Object[].class, receiver), args);
         assertCalled(name, argsWithReceiver);
-        System.out.print(':');
+        if (verbosity >= 1)
+            System.out.print(':');
     }
 
     @Test
@@ -567,10 +656,10 @@
 
         testUnreflect(Example.class, true, Object.class, "s1", Object.class);
         testUnreflect(Example.class, true, Object.class, "s2", int.class);
-        //testUnreflect(Example.class, true, Object.class, "s3", long.class);
-        //testUnreflect(Example.class, true, Object.class, "s4", int.class, int.class);
-        //testUnreflect(Example.class, true, Object.class, "s5", long.class, int.class);
-        //testUnreflect(Example.class, true, Object.class, "s6", int.class, long.class);
+        testUnreflect(Example.class, true, Object.class, "s3", long.class);
+        testUnreflect(Example.class, true, Object.class, "s4", int.class, int.class);
+        testUnreflect(Example.class, true, Object.class, "s5", long.class, int.class);
+        testUnreflect(Example.class, true, Object.class, "s6", int.class, long.class);
 
         testUnreflect(Example.class, false, void.class, "v0");
         testUnreflect(Example.class, false, void.class, "pkg_v0");
@@ -584,10 +673,17 @@
 
     void testUnreflect(Class<?> defc, boolean isStatic, Class<?> ret, String name, Class<?>... params) throws Throwable {
         for (Object[] ac : accessCases(defc, name)) {
-            testUnreflect((Boolean)ac[0], (Lookup)ac[1], defc, isStatic, ret, name, params);
+            testUnreflectMaybeSpecial(null, (Boolean)ac[0], (Lookup)ac[1], defc, (isStatic ? null : defc), ret, name, params);
         }
     }
-    void testUnreflect(boolean positive, Lookup lookup, Class<?> defc, boolean isStatic, Class<?> ret, String name, Class<?>... params) throws Throwable {
+    void testUnreflect(Class<?> defc, Class<?> rcvc, Class<?> ret, String name, Class<?>... params) throws Throwable {
+        for (Object[] ac : accessCases(defc, name)) {
+            testUnreflectMaybeSpecial(null, (Boolean)ac[0], (Lookup)ac[1], defc, rcvc, ret, name, params);
+        }
+    }
+    void testUnreflectMaybeSpecial(Class<?> specialCaller,
+                                   boolean positive, Lookup lookup,
+                                   Class<?> defc, Class<?> rcvc, Class<?> ret, String name, Class<?>... params) throws Throwable {
         countTest(positive);
         MethodType type = MethodType.methodType(ret, params);
         Method rmethod = null;
@@ -598,43 +694,67 @@
         } catch (NoSuchMethodException ex) {
             throw new NoAccessException(ex);
         }
-        assertEquals(isStatic, Modifier.isStatic(rmethod.getModifiers()));
+        boolean isStatic = (rcvc == null);
+        boolean isSpecial = (specialCaller != null);
         try {
-            target = lookup.unreflect(rmethod);
+            if (verbosity >= 4)  System.out.println("lookup via "+lookup+" of "+defc+" "+name+type);
+            if (isSpecial)
+                target = lookup.unreflectSpecial(rmethod, specialCaller);
+            else
+                target = lookup.unreflect(rmethod);
         } catch (NoAccessException ex) {
             noAccess = ex;
         }
-        if (verbosity >= 2)
-            System.out.println("unreflect "+defc+"."+name+"/"+type+" => "+target
-                    +(noAccess == null ? "" : " !! "+noAccess));
+        if (verbosity >= 3)
+            System.out.println("unreflect"+(isSpecial?"Special":"")+" "+defc.getName()+"."+name+"/"+type
+                               +(!isSpecial ? "" : " specialCaller="+specialCaller)
+                               +( isStatic  ? "" : " receiver="+rcvc)
+                               +" => "+target
+                               +(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(isStatic, Modifier.isStatic(rmethod.getModifiers()));
         Class<?>[] paramsMaybeWithSelf = params;
         if (!isStatic) {
-            paramsMaybeWithSelf = cat(array(Class[].class, (Class)defc), params);
+            paramsMaybeWithSelf = cat(array(Class[].class, (Class)rcvc), params);
         }
         MethodType typeMaybeWithSelf = MethodType.methodType(ret, paramsMaybeWithSelf);
-        MethodType ttype = target.type();
-        if (!isStatic)
-            ttype = ttype.changeParameterType(0, defc); // FIXME: test this
-        assertEquals(typeMaybeWithSelf, ttype);
+        if (isStatic) {
+            assertEquals(typeMaybeWithSelf, target.type());
+        } else {
+            if (isSpecial)
+                assertEquals(specialCaller, target.type().parameterType(0));
+            else
+                assertEquals(defc, target.type().parameterType(0));
+            assertEquals(typeMaybeWithSelf, target.type().changeParameterType(0, rcvc));
+        }
         Object[] argsMaybeWithSelf = randomArgs(paramsMaybeWithSelf);
         printCalled(target, name, argsMaybeWithSelf);
         target.invokeVarargs(argsMaybeWithSelf);
         assertCalled(name, argsMaybeWithSelf);
-        System.out.print(':');
+        if (verbosity >= 1)
+            System.out.print(':');
+    }
+
+    void testUnreflectSpecial(Class<?> defc, Class<?> rcvc, Class<?> ret, String name, Class<?>... params) throws Throwable {
+        for (Object[] ac : accessCases(defc, name, true)) {
+            Class<?> specialCaller = rcvc;
+            testUnreflectMaybeSpecial(specialCaller, (Boolean)ac[0], (Lookup)ac[1], defc, rcvc, ret, name, params);
+        }
     }
 
-    @Test @Ignore("unimplemented")
+    @Test
     public void testUnreflectSpecial() throws Throwable {
-        Lookup lookup = PRIVATE;  // FIXME: test more lookups than this one
+        if (CAN_SKIP_WORKING)  return;
         startTest("unreflectSpecial");
-        Method m = null;
-        MethodHandle expResult = null;
-        MethodHandle result = lookup.unreflectSpecial(m, Example.class);
-        assertEquals(expResult, result);
-        fail("The test case is a prototype.");
+        testUnreflectSpecial(Example.class,    Example.class, void.class, "v0");
+        testUnreflectSpecial(Example.class, SubExample.class, void.class, "v0");
+        testUnreflectSpecial(Example.class,    Example.class, void.class, "pkg_v0");
+        testUnreflectSpecial(Example.class, SubExample.class, void.class, "pkg_v0");
+        testUnreflectSpecial(Example.class,    Example.class, Object.class, "v2", int.class, int.class);
+        testUnreflectSpecial(Example.class, SubExample.class, Object.class, "v2", int.class, int.class);
+        testUnreflectMaybeSpecial(Example.class, false, PRIVATE, Example.class, Example.class, void.class, "s0");
     }
 
     public static class HasFields {
@@ -704,28 +824,52 @@
         }
     }
 
+    static final int TEST_UNREFLECT = 1, TEST_FIND_FIELD = 2, TEST_FIND_STATIC_FIELD = 3;
+    static boolean testModeMatches(int testMode, boolean isStatic) {
+        switch (testMode) {
+        case TEST_FIND_STATIC_FIELD:    return isStatic;
+        case TEST_FIND_FIELD:           return !isStatic;
+        default:                        return true;  // unreflect matches both
+        }
+    }
+
     @Test
     public void testUnreflectGetter() throws Throwable {
+        startTest("unreflectGetter");
+        testGetter(TEST_UNREFLECT);
+    }
+    @Test
+    public void testFindGetter() throws Throwable {
+        startTest("findGetter");
+        testGetter(TEST_FIND_FIELD);
+    }
+    @Test
+    public void testFindStaticGetter() throws Throwable {
+        startTest("findStaticGetter");
+        testGetter(TEST_FIND_STATIC_FIELD);
+    }
+    public void testGetter(int testMode) throws Throwable {
         Lookup lookup = PRIVATE;  // FIXME: test more lookups than this one
-        startTest("unreflectGetter");
         for (Object[] c : HasFields.CASES) {
             Field f = (Field)c[0];
             Object value = c[1];
             Class<?> type = f.getType();
-            if (type.isPrimitive() && type != int.class)
-                continue;  //FIXME
-            testUnreflectGetter(lookup, f, type, value);
+            testGetter(lookup, f, type, value, testMode);
         }
     }
-    public void testUnreflectGetter(MethodHandles.Lookup lookup,
-            Field f, Class<?> type, Object value) throws Throwable {
+    public void testGetter(MethodHandles.Lookup lookup,
+            Field f, Class<?> type, Object value, int testMode) throws Throwable {
+        boolean isStatic = Modifier.isStatic(f.getModifiers());
+        Class<?> fclass = f.getDeclaringClass();
+        String   fname  = f.getName();
+        Class<?> ftype  = f.getType();
+        if (!testModeMatches(testMode, isStatic))  return;
         countTest(true);
-        boolean isStatic = Modifier.isStatic(f.getModifiers());
         MethodType expType = MethodType.methodType(type, HasFields.class);
         if (isStatic)  expType = expType.dropParameterTypes(0, 1);
         MethodHandle mh = lookup.unreflectGetter(f);
         assertSame(mh.type(), expType);
-        assertEquals(mh.toString(), f.getName());
+        assertEquals(mh.toString(), fname);
         HasFields fields = new HasFields();
         Object sawValue;
         Class<?> rtype = type;
@@ -735,14 +879,14 @@
         for (int i = 0; i <= 1; i++) {
             if (isStatic) {
                 if (type == int.class)
-                    sawValue = mh.<int>invoke();  // do these exactly
+                    sawValue = mh.<int>invokeExact();  // do these exactly
                 else
-                    sawValue = mh.invoke();
+                    sawValue = mh.invokeExact();
             } else {
                 if (type == int.class)
-                    sawValue = mh.<int>invoke((Object) fields);
+                    sawValue = mh.<int>invokeExact((Object) fields);
                 else
-                    sawValue = mh.invoke((Object) fields);
+                    sawValue = mh.invokeExact((Object) fields);
             }
             assertEquals(sawValue, expValue);
             Object random = randomArg(type);
@@ -755,26 +899,49 @@
 
     @Test
     public void testUnreflectSetter() throws Throwable {
+        startTest("unreflectSetter");
+        testSetter(TEST_UNREFLECT);
+    }
+    @Test
+    public void testFindSetter() throws Throwable {
+        startTest("findSetter");
+        testSetter(TEST_FIND_FIELD);
+    }
+    @Test
+    public void testFindStaticSetter() throws Throwable {
+        startTest("findStaticSetter");
+        testSetter(TEST_FIND_STATIC_FIELD);
+    }
+    public void testSetter(int testMode) throws Throwable {
         Lookup lookup = PRIVATE;  // FIXME: test more lookups than this one
         startTest("unreflectSetter");
         for (Object[] c : HasFields.CASES) {
             Field f = (Field)c[0];
             Object value = c[1];
             Class<?> type = f.getType();
-            if (type.isPrimitive() && type != int.class)
-                continue;  //FIXME
-            testUnreflectSetter(lookup, f, type, value);
+            testSetter(lookup, f, type, value, testMode);
         }
     }
-    public void testUnreflectSetter(MethodHandles.Lookup lookup,
-            Field f, Class<?> type, Object value) throws Throwable {
+    public void testSetter(MethodHandles.Lookup lookup,
+            Field f, Class<?> type, Object value, int testMode) throws Throwable {
+        boolean isStatic = Modifier.isStatic(f.getModifiers());
+        Class<?> fclass = f.getDeclaringClass();
+        String   fname  = f.getName();
+        Class<?> ftype  = f.getType();
+        if (!testModeMatches(testMode, isStatic))  return;
         countTest(true);
-        boolean isStatic = Modifier.isStatic(f.getModifiers());
         MethodType expType = MethodType.methodType(void.class, HasFields.class, type);
         if (isStatic)  expType = expType.dropParameterTypes(0, 1);
-        MethodHandle mh = lookup.unreflectSetter(f);
+        MethodHandle mh;
+        if (testMode == TEST_UNREFLECT)
+            mh = lookup.unreflectSetter(f);
+        else if (testMode == TEST_FIND_FIELD)
+            mh = lookup.findSetter(fclass, fname, ftype);
+        else if (testMode == TEST_FIND_STATIC_FIELD)
+            mh = lookup.findStaticSetter(fclass, fname, ftype);
+        else  throw new InternalError();
         assertSame(mh.type(), expType);
-        assertEquals(mh.toString(), f.getName());
+        assertEquals(mh.toString(), fname);
         HasFields fields = new HasFields();
         Object sawValue;
         Class<?> vtype = type;
@@ -786,14 +953,14 @@
             Object putValue = randomArg(type);
             if (isStatic) {
                 if (type == int.class)
-                    mh.<void>invoke((int)(Integer)putValue);  // do these exactly
+                    mh.<void>invokeExact((int)(Integer)putValue);  // do these exactly
                 else
-                    mh.<void>invoke(putValue);
+                    mh.<void>invokeExact(putValue);
             } else {
                 if (type == int.class)
-                    mh.<void>invoke((Object) fields, (int)(Integer)putValue);
+                    mh.<void>invokeExact((Object) fields, (int)(Integer)putValue);
                 else
-                    mh.<void>invoke((Object) fields, putValue);
+                    mh.<void>invokeExact((Object) fields, putValue);
             }
             assertEquals(f.get(fields), putValue);
         }
@@ -803,25 +970,31 @@
     @Test
     public void testArrayElementGetter() throws Throwable {
         startTest("arrayElementGetter");
-        testArrayElementGetterSetter(new Object[10], false);
-        testArrayElementGetterSetter(new String[10], false);
-        testArrayElementGetterSetter(new int[10], false);
-        // FIXME: Do the other primitive types.
-        //testArrayElementGetterSetter(new float[10], false);
+        testArrayElementGetterSetter(false);
     }
 
     @Test
     public void testArrayElementSetter() throws Throwable {
         startTest("arrayElementSetter");
-        testArrayElementGetterSetter(new Object[10], true);
-        testArrayElementGetterSetter(new String[10], true);
-        testArrayElementGetterSetter(new int[10], true);
-        // FIXME: Do the other primitive types.
-        //testArrayElementGetterSetter(new float[10], true);
+        testArrayElementGetterSetter(true);
+    }
+
+    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);
     }
 
     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)+"]");
         Class<?> arrayType = array.getClass();
         Class<?> elemType = arrayType.getComponentType();
         MethodType expType = !testSetter
@@ -831,7 +1004,19 @@
                 ? MethodHandles.arrayElementGetter(arrayType)
                 : MethodHandles.arrayElementSetter(arrayType);
         assertSame(mh.type(), expType);
-        //assertEquals(mh.toString(), f.getName());
+        if (elemType != int.class && elemType != boolean.class) {
+            MethodType gtype;
+            if (true) { // FIXME: remove this path (and remove <void> below in the mh.invokes)
+                gtype = mh.type().changeParameterType(0, Object.class);
+                if (testSetter)
+                    gtype = gtype.changeParameterType(2, Object.class);
+                else
+                    gtype = gtype.changeReturnType(Object.class);
+            } else
+                // FIXME: This simpler path hits a bug in convertArguments => ToGeneric
+                gtype = mh.type().generic().changeParameterType(1, int.class);
+            mh = MethodHandles.convertArguments(mh, gtype);
+        }
         Object sawValue, expValue;
         List<Object> model = array2list(array);
         int length = Array.getLength(array);
@@ -841,22 +1026,31 @@
             model.set(i, random);
             if (testSetter) {
                 if (elemType == int.class)
-                    mh.<void>invoke((int[]) array, i, (int)(Integer)random);
+                    mh.<void>invokeExact((int[]) array, i, (int)(Integer)random);
+                else if (elemType == boolean.class)
+                    mh.<void>invokeExact((boolean[]) array, i, (boolean)(Boolean)random);
                 else
-                    mh.invokeGeneric(array, i, random);
+                    mh.<void>invokeExact(array, i, random);
                 assertEquals(model, array2list(array));
             } else {
                 Array.set(array, i, random);
-
+            }
+            if (verbosity >= 5) {
+                List<Object> array2list = array2list(array);
+                System.out.println("a["+i+"]="+random+" => "+array2list);
+                if (!array2list.equals(model))
+                    System.out.println("***   != "+model);
             }
             // observe array element
             sawValue = Array.get(array, i);
             if (!testSetter) {
                 expValue = sawValue;
                 if (elemType == int.class)
-                    sawValue = mh.<int>invoke((int[]) array, i);
+                    sawValue = mh.<int>invokeExact((int[]) array, i);
+                else if (elemType == boolean.class)
+                    sawValue = mh.<boolean>invokeExact((boolean[]) array, i);
                 else
-                    sawValue = mh.invokeGeneric(array, i);
+                    sawValue = mh.invokeExact(array, i);
                 assertEquals(sawValue, expValue);
                 assertEquals(model, array2list(array));
             }
@@ -906,6 +1100,8 @@
         testConvert(Callee.ofType(1), null, "id", String.class);
         testConvert(Callee.ofType(1), null, "id", Integer.class);
         testConvert(Callee.ofType(1), null, "id", short.class);
+        testConvert(Callee.ofType(1), null, "id", char.class);
+        testConvert(Callee.ofType(1), null, "id", byte.class);
     }
 
     void testConvert(MethodHandle id, Class<?> rtype, String name, Class<?>... params) throws Throwable {
@@ -943,7 +1139,7 @@
         } catch (RuntimeException ex) {
             error = ex;
         }
-        if (verbosity >= 2)
+        if (verbosity >= 3)
             System.out.println("convert "+id+ " to "+newType+" => "+target
                     +(error == null ? "" : " !! "+error));
         if (positive && error != null)  throw error;
@@ -954,7 +1150,8 @@
         Object result = target.invokeVarargs(args);
         assertCalled(name, convArgs);
         assertEquals(convResult, result);
-        System.out.print(':');
+        if (verbosity >= 1)
+            System.out.print(':');
     }
 
     @Test
@@ -966,7 +1163,7 @@
         //testPermuteArguments(4, Integer.class,  1, int.class,     6);
     }
     public void testPermuteArguments(int max, Class<?> type1, int t2c, Class<?> type2, int dilution) throws Throwable {
-        if (verbosity >= 1)
+        if (verbosity >= 2)
             System.out.println("permuteArguments "+max+"*"+type1.getName()
                     +(t2c==0?"":"/"+t2c+"*"+type2.getName())
                     +(dilution > 0 ? " with dilution "+dilution : ""));
@@ -1054,7 +1251,7 @@
         }
         int inargs = args.length, outargs = reorder.length;
         assert(inargs == types.length);
-        if (verbosity >= 2)
+        if (verbosity >= 3)
             System.out.println("permuteArguments "+Arrays.toString(reorder));
         Object[] permArgs = new Object[outargs];
         Class<?>[] permTypes = new Class<?>[outargs];
@@ -1062,7 +1259,7 @@
             permArgs[i] = args[reorder[i]];
             permTypes[i] = types[reorder[i]];
         }
-        if (verbosity >= 3) {
+        if (verbosity >= 4) {
             System.out.println("in args:   "+Arrays.asList(args));
             System.out.println("out args:  "+Arrays.asList(permArgs));
             System.out.println("in types:  "+Arrays.asList(types));
@@ -1083,13 +1280,14 @@
         if (CAN_SKIP_WORKING)  return;
         startTest("spreadArguments");
         for (Class<?> argType : new Class[]{Object.class, Integer.class, int.class}) {
-            if (verbosity >= 2)
+            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);
+                     testSpreadArguments(argType, pos, nargs);
                 }
             }
         }
@@ -1098,7 +1296,7 @@
         countTest();
         MethodHandle target = ValueConversions.varargsArray(nargs);
         MethodHandle target2 = changeArgTypes(target, argType);
-        if (verbosity >= 2)
+        if (verbosity >= 3)
             System.out.println("spread into "+target2+" ["+pos+".."+nargs+"]");
         Object[] args = randomArgs(target2.type().parameterArray());
         // make sure the target does what we think it does:
@@ -1107,15 +1305,15 @@
             assertArrayEquals(args, check);
             switch (nargs) {
                 case 0:
-                    check = target.<Object[]>invoke();
+                    check = target.<Object[]>invokeExact();
                     assertArrayEquals(args, check);
                     break;
                 case 1:
-                    check = target.<Object[]>invoke(args[0]);
+                    check = target.<Object[]>invokeExact(args[0]);
                     assertArrayEquals(args, check);
                     break;
                 case 2:
-                    check = target.<Object[]>invoke(args[0], args[1]);
+                    check = target.<Object[]>invokeExact(args[0], args[1]);
                     assertArrayEquals(args, check);
                     break;
             }
@@ -1129,7 +1327,7 @@
         MethodHandle result = MethodHandles.spreadArguments(target2, newType);
         Object[] returnValue;
         if (pos == 0) {
-            returnValue = (Object[]) result.invoke(args);
+            returnValue = (Object[]) result.invokeExact(args);
         } else {
             Object[] args1 = Arrays.copyOfRange(args, 0, pos+1);
             args1[pos] = Arrays.copyOfRange(args, pos, args.length);
@@ -1143,7 +1341,7 @@
         if (CAN_SKIP_WORKING)  return;
         startTest("collectArguments");
         for (Class<?> argType : new Class[]{Object.class, Integer.class, int.class}) {
-            if (verbosity >= 2)
+            if (verbosity >= 3)
                 System.out.println("collectArguments "+argType);
             for (int nargs = 0; nargs < 10; nargs++) {
                 for (int pos = 0; pos < nargs; pos++) {
@@ -1167,7 +1365,7 @@
         MethodHandle target = ValueConversions.varargsArray(pos+1);
         target = changeArgTypes(target, 0, pos, argType);
         target = changeArgTypes(target, pos, pos+1, Object[].class);
-        if (verbosity >= 2)
+        if (verbosity >= 3)
             System.out.println("collect from "+Arrays.asList(args)+" ["+pos+".."+nargs+"]");
         MethodHandle result = MethodHandles.collectArguments(target, newType);
         Object[] returnValue = (Object[]) result.invokeVarargs(args);
@@ -1198,14 +1396,14 @@
         List<Object> resList = Arrays.asList(args);
         List<Object> argsToPass = new ArrayList<Object>(resList);
         List<Object> argsToInsert = argsToPass.subList(pos, pos + ins);
-        if (verbosity >= 2)
+        if (verbosity >= 3)
             System.out.println("insert: "+argsToInsert+" into "+target);
         MethodHandle target2 = MethodHandles.insertArguments(target, pos,
                 (Object[]) argsToInsert.toArray());
         argsToInsert.clear();  // remove from argsToInsert
         Object res2 = target2.invokeVarargs(argsToPass);
         Object res2List = Arrays.asList((Object[])res2);
-        if (verbosity >= 2)
+        if (verbosity >= 3)
             System.out.println("result: "+res2List);
         //if (!resList.equals(res2List))
         //    System.out.println("*** fail at n/p/i = "+nargs+"/"+pos+"/"+ins+": "+resList+" => "+res2List);
@@ -1229,17 +1427,17 @@
         MethodHandle filter = ValueConversions.varargsList(1);
         filter = MethodHandles.convertArguments(filter, filter.type().generic());
         Object[] argsToPass = randomArgs(nargs, Object.class);
-        if (verbosity >= 2)
+        if (verbosity >= 3)
             System.out.println("filter "+target+" at "+pos+" with "+filter);
         MethodHandle[] filters = new MethodHandle[pos*2+1];
         filters[pos] = filter;
         MethodHandle target2 = MethodHandles.filterArguments(target, filters);
         // Simulate expected effect of filter on arglist:
         Object[] filteredArgs = argsToPass.clone();
-        filteredArgs[pos] = filter.invoke(filteredArgs[pos]);
+        filteredArgs[pos] = filter.invokeExact(filteredArgs[pos]);
         List<Object> expected = Arrays.asList(filteredArgs);
         Object result = target2.invokeVarargs(argsToPass);
-        if (verbosity >= 2)
+        if (verbosity >= 3)
             System.out.println("result: "+result);
         if (!expected.equals(result))
             System.out.println("*** fail at n/p = "+nargs+"/"+pos+": "+argsToPass+" => "+result);
@@ -1265,18 +1463,18 @@
         MethodHandle target = ValueConversions.varargsList(1 + nargs);
         MethodHandle combine = ValueConversions.varargsList(fold);
         List<Object> argsToPass = Arrays.asList(randomArgs(nargs, Object.class));
-        if (verbosity >= 2)
+        if (verbosity >= 3)
             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> argsToFold = expected.subList(pos, pos + fold);
-        if (verbosity >= 2)
+        if (verbosity >= 3)
             System.out.println("fold: "+argsToFold+" into "+target2);
         Object foldedArgs = combine.invokeVarargs(argsToFold);
         argsToFold.add(0, foldedArgs);
         Object result = target2.invokeVarargs(argsToPass);
-        if (verbosity >= 2)
+        if (verbosity >= 3)
             System.out.println("result: "+result);
         if (!expected.equals(result))
             System.out.println("*** fail at n/p/f = "+nargs+"/"+pos+"/"+fold+": "+argsToPass+" => "+result);
@@ -1343,7 +1541,7 @@
     }
 
     public void testInvokers(MethodType type) throws Throwable {
-        if (verbosity >= 2)
+        if (verbosity >= 3)
             System.out.println("test invokers for "+type);
         int nargs = type.parameterCount();
         boolean testRetCode = type.returnType() != void.class;
@@ -1373,16 +1571,16 @@
             calledLog.clear();
             switch (nargs) {
             case 0:
-                result = inv.invoke(target);
+                result = inv.invokeExact(target);
                 break;
             case 1:
-                result = inv.invoke(target, args[0]);
+                result = inv.invokeExact(target, args[0]);
                 break;
             case 2:
-                result = inv.invoke(target, args[0], args[1]);
+                result = inv.invokeExact(target, args[0], args[1]);
                 break;
             case 3:
-                result = inv.invoke(target, args[0], args[1], args[2]);
+                result = inv.invokeExact(target, args[0], args[1], args[2]);
                 break;
             }
             if (testRetCode)  assertEquals(code, result);
@@ -1395,14 +1593,14 @@
         // varargs invoker #0
         calledLog.clear();
         inv = MethodHandles.varargsInvoker(type, 0);
-        result = inv.invoke(target, args);
+        result = inv.invokeExact(target, args);
         if (testRetCode)  assertEquals(code, result);
         assertCalled("invokee", args);
         if (nargs >= 1) {
             // varargs invoker #1
             calledLog.clear();
             inv = MethodHandles.varargsInvoker(type, 1);
-            result = inv.invoke(target, args[0], Arrays.copyOfRange(args, 1, nargs));
+            result = inv.invokeExact(target, args[0], Arrays.copyOfRange(args, 1, nargs));
             if (testRetCode)  assertEquals(code, result);
             assertCalled("invokee", args);
         }
@@ -1410,7 +1608,7 @@
             // varargs invoker #2
             calledLog.clear();
             inv = MethodHandles.varargsInvoker(type, 2);
-            result = inv.invoke(target, args[0], args[1], Arrays.copyOfRange(args, 2, nargs));
+            result = inv.invokeExact(target, args[0], args[1], Arrays.copyOfRange(args, 2, nargs));
             if (testRetCode)  assertEquals(code, result);
             assertCalled("invokee", args);
         }
@@ -1418,7 +1616,7 @@
             // varargs invoker #3
             calledLog.clear();
             inv = MethodHandles.varargsInvoker(type, 3);
-            result = inv.invoke(target, args[0], args[1], args[2], Arrays.copyOfRange(args, 3, nargs));
+            result = inv.invokeExact(target, args[0], args[1], args[2], Arrays.copyOfRange(args, 3, nargs));
             if (testRetCode)  assertEquals(code, result);
             assertCalled("invokee", args);
         }
@@ -1523,7 +1721,7 @@
             default:  equals = argList[0].equals(argList[1]); break;
             }
             String willCall = (equals ? "targetIfEquals" : "fallbackIfNotEquals");
-            if (verbosity >= 2)
+            if (verbosity >= 3)
                 System.out.println(logEntry(willCall, argList));
             Object result = mh.invokeVarargs(argList);
             assertCalled(willCall, argList);
@@ -1552,7 +1750,7 @@
 
     void testCatchException(Class<?> returnType, Throwable thrown, boolean throwIt, int nargs) throws Throwable {
         countTest();
-        if (verbosity >= 2)
+        if (verbosity >= 3)
             System.out.println("catchException rt="+returnType+" throw="+throwIt+" nargs="+nargs);
         Class<? extends Throwable> exType = thrown.getClass();
         MethodHandle throwOrReturn
@@ -1594,9 +1792,10 @@
         //System.out.println("throwing with "+target+" : "+thrown);
         MethodType expectedType = MethodType.methodType(returnType, exType);
         assertEquals(expectedType, target.type());
+        target = MethodHandles.convertArguments(target, target.type().generic());
         Throwable caught = null;
         try {
-            Object res = target.invokeGeneric(thrown);
+            Object res = target.invokeExact((Object) thrown);
             fail("got "+res+" instead of throwing "+thrown);
         } catch (Throwable ex) {
             if (ex != thrown) {
@@ -1647,7 +1846,7 @@
 
     void testCastFailure(String mode, int okCount) throws Throwable {
         countTest(false);
-        if (verbosity > 1)  System.out.println("mode="+mode);
+        if (verbosity > 2)  System.out.println("mode="+mode);
         Surprise boo = new Surprise();
         MethodHandle identity = Surprise.REF_IDENTITY, surprise = boo;
         if (mode.endsWith("/return")) {
@@ -1680,22 +1879,22 @@
         surprise = MethodHandles.convertArguments(surprise, MethodType.genericMethodType(1));
         Object x = 42;
         for (int i = 0; i < okCount; i++) {
-            Object y = identity.invoke(x);
+            Object y = identity.invokeExact(x);
             assertEquals(x, y);
-            Object z = surprise.invoke(x);
+            Object z = surprise.invokeExact(x);
             assertEquals(x, z);
         }
         boo.boo("Boo!");
-        Object y = identity.invoke(x);
+        Object y = identity.invokeExact(x);
         assertEquals(x, y);
         try {
-            Object z = surprise.invoke(x);
+            Object z = surprise.invokeExact(x);
             System.out.println("Failed to throw; got z="+z);
             assertTrue(false);
         } catch (Exception ex) {
-            if (verbosity > 1)
+            if (verbosity > 2)
                 System.out.println("caught "+ex);
-            if (verbosity > 2)
+            if (verbosity > 3)
                 ex.printStackTrace();
             assertTrue(ex instanceof ClassCastException
                     // FIXME: accept only one of the two for any given unit test
@@ -1704,6 +1903,39 @@
         }
     }
 
+    static Example userMethod(Object o, String s, int i) {
+        called("userMethod", o, s, i);
+        return null;
+    }
+
+    @Test
+    public void testUserClassInSignature() throws Throwable {
+        if (CAN_SKIP_WORKING)  return;
+        startTest("testUserClassInSignature");
+        Lookup lookup = MethodHandles.lookup();
+        String name; MethodType mt; MethodHandle mh;
+        Object[] args;
+
+        // Try a static method.
+        name = "userMethod";
+        mt = MethodType.methodType(Example.class, Object.class, String.class, int.class);
+        mh = lookup.findStatic(lookup.lookupClass(), name, mt);
+        assertEquals(mt, mh.type());
+        assertEquals(Example.class, mh.type().returnType());
+        args = randomArgs(mh.type().parameterArray());
+        mh.invokeVarargs(args);
+        assertCalled(name, args);
+
+        // Try a virtual method.
+        name = "v2";
+        mt = MethodType.methodType(Object.class, Object.class, int.class);
+        mh = lookup.findVirtual(Example.class, name, mt);
+        assertEquals(mt, mh.type().dropParameterTypes(0,1));
+        assertTrue(mh.type().parameterList().contains(Example.class));
+        args = randomArgs(mh.type().parameterArray());
+        mh.invokeVarargs(args);
+        assertCalled(name, args);
+    }
 }
 // Local abbreviated copy of sun.dyn.util.ValueConversions
 class ValueConversions {
@@ -1766,7 +1998,7 @@
         if (nargs < ARRAYS.length)
             return ARRAYS[nargs];
         // else need to spin bytecode or do something else fancy
-        throw new UnsupportedOperationException("NYI");
+        throw new UnsupportedOperationException("NYI: cannot form a varargs array of length "+nargs);
     }
 
     private static final List<Object> NO_ARGS_LIST = Arrays.asList(NO_ARGS_ARRAY);
--- a/jdk/test/java/io/BufferedReader/BigMark.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/test/java/io/BufferedReader/BigMark.java	Wed Jul 21 09:57:21 2010 -0700
@@ -25,6 +25,8 @@
    @summary BufferedReader should throw an OutOfMemoryError when the
             read-ahead limit is very large
    @bug 6350733
+   @build BigMark
+   @run main/othervm BigMark
 */
 
 import java.io.*;
--- a/jdk/test/java/io/BufferedReader/ReadLineSync.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/test/java/io/BufferedReader/ReadLineSync.java	Wed Jul 21 09:57:21 2010 -0700
@@ -46,16 +46,20 @@
 
         BufferedReader reader = new BufferedReader(
                                 new FileReader(f));
-        int threadCount = 2;
+        try {
+            int threadCount = 2;
 
-        ExecutorService es = Executors.newFixedThreadPool(threadCount);
+            ExecutorService es = Executors.newFixedThreadPool(threadCount);
 
-        for (int i=0; i < threadCount; i++)
-            es.execute(new BufferedReaderConsumer(reader));
+            for (int i=0; i < threadCount; i++)
+                es.execute(new BufferedReaderConsumer(reader));
 
-        // Wait for the tasks to complete
-        es.shutdown();
-        while (!es.awaitTermination(60, TimeUnit.SECONDS));
+            // Wait for the tasks to complete
+            es.shutdown();
+            while (!es.awaitTermination(60, TimeUnit.SECONDS));
+        } finally {
+            reader.close();
+        }
     }
 
     static class BufferedReaderConsumer extends Thread {
--- a/jdk/test/java/io/DataInputStream/OpsAfterClose.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/test/java/io/DataInputStream/OpsAfterClose.java	Wed Jul 21 09:57:21 2010 -0700
@@ -244,13 +244,19 @@
         f.deleteOnExit();
 
         FileInputStream fis = new FileInputStream(f);
-
-        DataInputStream dis = new DataInputStream(
-                                new FileInputStream(f));
-        if (testDataInputStream(dis)) {
-            failed = true;
+        try {
+            DataInputStream dis = new DataInputStream(
+                                    new FileInputStream(f));
+            try {
+                if (testDataInputStream(dis)) {
+                    failed = true;
+                }
+            } finally {
+                dis.close();
+            }
+        } finally {
+            fis.close();
         }
-
     }
 
     private static boolean testDataInputStream(DataInputStream is)
--- a/jdk/test/java/io/DataInputStream/ReadFully.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/test/java/io/DataInputStream/ReadFully.java	Wed Jul 21 09:57:21 2010 -0700
@@ -43,6 +43,7 @@
         } catch (IndexOutOfBoundsException ie) {
             caughtException = true;
         } finally {
+            dis.close();
             if (!caughtException)
                 throw new RuntimeException("Test failed");
         }
--- a/jdk/test/java/io/File/DeleteOnExit.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/test/java/io/File/DeleteOnExit.java	Wed Jul 21 09:57:21 2010 -0700
@@ -48,7 +48,9 @@
 
     public static void main (String args[]) throws Exception{
         if (args.length == 0) {
-            Runtime.getRuntime().exec(java +  " DeleteOnExit -test").waitFor();
+            String cmd = java + " -classpath " + System.getProperty("test.classes")
+                + " DeleteOnExit -test";
+            Runtime.getRuntime().exec(cmd).waitFor();
             if (file1.exists() || file2.exists() || file3.exists() ||
                 dir.exists()   || file4.exists() || file5.exists() ||
                 file6.exists() || file7.exists())  {
--- a/jdk/test/java/io/File/DeleteOnExitNPE.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/test/java/io/File/DeleteOnExitNPE.java	Wed Jul 21 09:57:21 2010 -0700
@@ -45,7 +45,8 @@
 
     public static void runTest() throws Exception {
         String cmd = System.getProperty("java.home") + File.separator +
-                     "bin" + File.separator + "java";
+                     "bin" + File.separator + "java" +
+                     " -classpath " + System.getProperty("test.classes");
         Process process = Runtime.getRuntime().exec(cmd +  " DeleteOnExitNPE -test");
         BufferedReader isReader = new BufferedReader(new InputStreamReader(process.getInputStream()));
         BufferedReader esReader = new BufferedReader(new InputStreamReader(process.getErrorStream()));
--- a/jdk/test/java/io/File/IsHidden.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/test/java/io/File/IsHidden.java	Wed Jul 21 09:57:21 2010 -0700
@@ -27,7 +27,7 @@
  */
 
 import java.io.*;
-
+import java.nio.file.attribute.DosFileAttributeView;
 
 public class IsHidden {
 
@@ -41,15 +41,20 @@
         System.err.println(path + " ==> " + x);
     }
 
+    private static void setHidden(File f, boolean value) throws IOException {
+        f.toPath().getFileAttributeView(DosFileAttributeView.class).setHidden(value);
+    }
+
     private static void testWin32() throws Exception {
         File f = new File(dir, "test");
         f.deleteOnExit();
         f.createNewFile();
-        String name = f.getCanonicalPath();
-        Process p = Runtime.getRuntime().exec("cmd.exe /c attrib +H " + name);
-        p.waitFor();
-        ck(name, true);
-
+        setHidden(f, true);
+        try {
+            ck(f.getPath(), true);
+        } finally {
+            setHidden(f, false);
+        }
         ck(".foo", false);
         ck("foo", false);
     }
--- a/jdk/test/java/io/FileInputStream/LeadingSlash.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/test/java/io/FileInputStream/LeadingSlash.java	Wed Jul 21 09:57:21 2010 -0700
@@ -36,8 +36,8 @@
             File file = null;
             try {
                 file = File.createTempFile("bug", "4487368");
-                new FileInputStream("\\" + file.getPath());
-                new FileOutputStream("\\" + file.getPath());
+                new FileInputStream("\\" + file.getPath()).close();
+                new FileOutputStream("\\" + file.getPath()).close();
             } finally {
                 if (file != null)
                     file.delete();
--- a/jdk/test/java/io/InputStream/OpsAfterClose.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/test/java/io/InputStream/OpsAfterClose.java	Wed Jul 21 09:57:21 2010 -0700
@@ -125,23 +125,35 @@
         f.deleteOnExit();
 
         FileInputStream fis = new FileInputStream(f);
-        if (testInputStream(fis)) {
-            failed = true;
-        }
-        if (testFileInputStream(fis)) {
-            failed = true;
+        try {
+            if (testInputStream(fis)) {
+                failed = true;
+            }
+            if (testFileInputStream(fis)) {
+                failed = true;
+            }
+        } finally {
+            fis.close();
         }
 
         BufferedInputStream bs =  new BufferedInputStream(
                                         new FileInputStream(f));
-        if (testInputStream(bs)) {
-            failed = true;
+        try {
+            if (testInputStream(bs)) {
+                failed = true;
+            }
+        } finally {
+            bs.close();
         }
 
         DataInputStream dis = new DataInputStream(
                                 new FileInputStream(f));
-        if (testInputStream(dis)) {
-            failed = true;
+        try {
+            if (testInputStream(dis)) {
+                failed = true;
+            }
+        } finally {
+            dis.close();
         }
 
         PushbackInputStream pbis = new PushbackInputStream(
--- a/jdk/test/java/io/InputStream/ReadParams.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/test/java/io/InputStream/ReadParams.java	Wed Jul 21 09:57:21 2010 -0700
@@ -137,6 +137,7 @@
         oos.writeInt(12345);
         oos.writeObject("Today");
         oos.writeObject(new Integer(32));
+        oos.close();
         ObjectInputStream ois = new ObjectInputStream(new FileInputStream(fn));
         doTest(ois);
         doTest1(ois);
--- a/jdk/test/java/io/InputStreamReader/GrowAfterEOF.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/test/java/io/InputStreamReader/GrowAfterEOF.java	Wed Jul 21 09:57:21 2010 -0700
@@ -33,29 +33,36 @@
     public static void main(String[] args) throws Exception {
         File input = new File(".", "TestEOFInput.txt");
         RandomAccessFile rf = new RandomAccessFile(input, "rw");
-        BufferedReader r = new BufferedReader
-            (new InputStreamReader(new FileInputStream(input)));
+        try {
+            BufferedReader r = new BufferedReader
+                (new InputStreamReader(new FileInputStream(input)));
+            try {
+                // write something
+                rf.writeBytes("a line");
 
-        // write something
-        rf.writeBytes("a line");
+                // read till the end of file
+                while (r.readLine() != null);
 
-        // read till the end of file
-        while (r.readLine() != null);
+                // append to the end of the file
+                rf.seek(rf.length());
+                rf.writeBytes("new line");
 
-        // append to the end of the file
-        rf.seek(rf.length());
-        rf.writeBytes("new line");
-
-        // now try to read again
-        boolean readMore = false;
-        while (r.readLine() != null) {
-            readMore = true;
-        }
-        if (!readMore) {
-            input.delete();
-            throw new Exception("Failed test: unable to read!");
-        } else {
-            input.delete();
+                // now try to read again
+                boolean readMore = false;
+                while (r.readLine() != null) {
+                    readMore = true;
+                }
+                if (!readMore) {
+                    input.delete();
+                    throw new Exception("Failed test: unable to read!");
+                } else {
+                    input.delete();
+                }
+            } finally {
+                r.close();
+            }
+        } finally {
+            rf.close();
         }
     }
 }
--- a/jdk/test/java/io/ObjectInputStream/ResolveProxyClass.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/test/java/io/ObjectInputStream/ResolveProxyClass.java	Wed Jul 21 09:57:21 2010 -0700
@@ -79,7 +79,7 @@
              * code, and it should be the first loader on the stack when
              * ObjectInputStream.resolveProxyClass gets executed.
              */
-            ClassLoader expectedLoader = ClassLoader.getSystemClassLoader();
+            ClassLoader expectedLoader = ResolveProxyClass.class.getClassLoader();
 
             TestObjectInputStream in = new TestObjectInputStream();
             Class proxyClass = in.resolveProxyClass(
--- a/jdk/test/java/io/RandomAccessFile/EOF.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/test/java/io/RandomAccessFile/EOF.java	Wed Jul 21 09:57:21 2010 -0700
@@ -35,12 +35,16 @@
         int n;
         String dir = System.getProperty("test.src", ".");
         RandomAccessFile raf = new RandomAccessFile(new File(dir, "EOF.java"), "r");
-        for (;;) {
-            n = raf.read(buf, 0, buf.length);
-            if (n <= 0) break;
+        try {
+            for (;;) {
+                n = raf.read(buf, 0, buf.length);
+                if (n <= 0) break;
+            }
+            if (n != -1)
+                throw new RuntimeException("Expected -1 for EOF, got " + n);
+        } finally {
+            raf.close();
         }
-        if (n != -1)
-            throw new RuntimeException("Expected -1 for EOF, got " + n);
     }
 
 }
--- a/jdk/test/java/io/RandomAccessFile/ParameterCheck.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/test/java/io/RandomAccessFile/ParameterCheck.java	Wed Jul 21 09:57:21 2010 -0700
@@ -44,6 +44,7 @@
 
     private static void doTest(String method) throws Exception {
         File fn = new File("x.ParameterCheck");
+        RandomAccessFile raf = null;
 
         try {
             byte b[] = new byte[32];
@@ -55,7 +56,7 @@
                 fout.write(i);
             }
             fout.close();
-            RandomAccessFile raf =  new RandomAccessFile(fn , "rw");
+            raf =  new RandomAccessFile(fn , "rw");
 
             System.err.println("-----------------------------" +
                                "-----------------------------");
@@ -125,6 +126,8 @@
             System.err.println("-----------------------------" +
                                "-----------------------------");
         } finally {
+            if (raf != null)
+                raf.close();
             fn.delete();
         }
 
--- a/jdk/test/java/io/RandomAccessFile/ReadLine.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/test/java/io/RandomAccessFile/ReadLine.java	Wed Jul 21 09:57:21 2010 -0700
@@ -33,26 +33,30 @@
     public static void main(String args[]) throws Exception {
         File fn = new File("x.ReadLine");
         RandomAccessFile raf = new RandomAccessFile(fn,"rw");
-        String line;
-        int ctr = 1;
-        String expected;
+        try {
+            String line;
+            int ctr = 1;
+            String expected;
 
-        raf.writeBytes
-            ("ln1\rln2\r\nln3\nln4\rln5\r\nln6\n\rln8\r\rln10\n\nln12\r\r\nln14");
-        raf.seek(0);
+            raf.writeBytes
+                ("ln1\rln2\r\nln3\nln4\rln5\r\nln6\n\rln8\r\rln10\n\nln12\r\r\nln14");
+            raf.seek(0);
 
-        while ((line=raf.readLine()) != null) {
-            if ((ctr == 7) || (ctr == 9) ||
-                (ctr == 11) || (ctr == 13)) {
-                expected = "";
-            } else {
-                expected = "ln" + ctr;
+            while ((line=raf.readLine()) != null) {
+                if ((ctr == 7) || (ctr == 9) ||
+                    (ctr == 11) || (ctr == 13)) {
+                     expected = "";
+                } else {
+                    expected = "ln" + ctr;
+                }
+                if (!line.equals(expected)) {
+                    throw new Exception("Expected \"" + expected + "\"" +
+                                        ", read \"" + line + "\"");
+                }
+                ctr++;
             }
-            if (!line.equals(expected)) {
-                throw new Exception("Expected \"" + expected + "\"" +
-                                    ", read \"" + line + "\"");
-            }
-            ctr++;
+        } finally {
+            raf.close();
         }
         System.err.println("Successfully completed test!");
     }
--- a/jdk/test/java/io/RandomAccessFile/Seek.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/test/java/io/RandomAccessFile/Seek.java	Wed Jul 21 09:57:21 2010 -0700
@@ -44,6 +44,8 @@
             throw new Exception
                 ("Should have thrown an IOException when seek offset is < 0");
         } catch (IOException e) {
+        } finally {
+            raf.close();
         }
     }
 }
--- a/jdk/test/java/io/RandomAccessFile/WriteBytesChars.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/test/java/io/RandomAccessFile/WriteBytesChars.java	Wed Jul 21 09:57:21 2010 -0700
@@ -37,8 +37,8 @@
         byte[] b = new byte[80];
         File fn = new File("x.WriteBytesChars");
 
-        try{
-            RandomAccessFile raf = new RandomAccessFile(fn , "rw");;
+        RandomAccessFile raf = new RandomAccessFile(fn , "rw");;
+        try {
             for (int i = 0; i < 80; i++) {
                 buf[i] = 'a';
             }
@@ -71,6 +71,7 @@
                     RuntimeException("RandomAccessFile.writeChars, wrong result");
             }
         } finally {
+            raf.close();
             fn.delete();
         }
     }
--- a/jdk/test/java/io/RandomAccessFile/WriteUTF.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/test/java/io/RandomAccessFile/WriteUTF.java	Wed Jul 21 09:57:21 2010 -0700
@@ -42,8 +42,8 @@
             s += s;
         System.err.println("String length " + s.length());
 
+        f = new RandomAccessFile(fn, "rw");
         try {
-            f = new RandomAccessFile(fn, "rw");
             try {
                 f.writeUTF(s);
             }
@@ -53,6 +53,7 @@
             throw new RuntimeException("UTFDataFormatException not thrown");
         }
         finally {
+            f.close();
             fn.delete();
         }
 
--- a/jdk/test/java/io/RandomAccessFile/skipBytes/SkipBytes.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/test/java/io/RandomAccessFile/skipBytes/SkipBytes.java	Wed Jul 21 09:57:21 2010 -0700
@@ -96,14 +96,18 @@
     public static void main(String[] args) throws Exception {
 
         RandomAccessFile raf = new RandomAccessFile("input.txt" , "rw");
-        int length = (int)raf.length();
+        try {
+            int length = (int)raf.length();
 
-        doTest(raf , 0 , 2*length);
-        doTest(raf , 0 , length);
-        doTest(raf , 0 , length/2);
-        doTest(raf , length/2 , -2);
-        doTest(raf , length , 0);
-        doTest(raf , 0 , -1);
+            doTest(raf , 0 , 2*length);
+            doTest(raf , 0 , length);
+            doTest(raf , 0 , length/2);
+            doTest(raf , length/2 , -2);
+            doTest(raf , length , 0);
+            doTest(raf , 0 , -1);
+        } finally{
+            raf.close();
+        }
 
     }
 
--- a/jdk/test/java/io/Reader/Skip.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/test/java/io/Reader/Skip.java	Wed Jul 21 09:57:21 2010 -0700
@@ -35,12 +35,16 @@
         File f = new File(System.getProperty("test.src", "."),
                           "SkipInput.txt");
         FileReader fr = new FileReader(f);
-        long nchars = 8200;
-        long actual = fr.skip(nchars);
+        try {
+            long nchars = 8200;
+            long actual = fr.skip(nchars);
 
-        if (actual > nchars) {
-            throw new Exception
-                ("Should skip " + nchars + ", but skipped " +actual+" chars");
+            if (actual > nchars) {
+                throw new Exception
+                    ("Should skip " + nchars + ", but skipped " +actual+" chars");
+            }
+        } finally {
+            fr.close();
         }
     }
 }
--- a/jdk/test/java/io/Reader/SkipNegative.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/test/java/io/Reader/SkipNegative.java	Wed Jul 21 09:57:21 2010 -0700
@@ -41,6 +41,8 @@
         } catch(IllegalArgumentException e){
             // Negative argument caught
             return;
+        } finally {
+            fr.close();
         }
         throw new Exception("Skip should not accept negative values");
     }
--- a/jdk/test/java/io/Serializable/ClassCastExceptionDetail/Read.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/test/java/io/Serializable/ClassCastExceptionDetail/Read.java	Wed Jul 21 09:57:21 2010 -0700
@@ -40,9 +40,9 @@
 
 public class Read {
     public static void main(String[] args) throws Exception {
-        ObjectInputStream oin =
-            new ObjectInputStream(new FileInputStream("tmp.ser"));
+        FileInputStream in = new FileInputStream("tmp.ser");
         try {
+            ObjectInputStream oin = new ObjectInputStream(in);
             oin.readObject();
             throw new Error("readObject should not succeed");
         } catch (ClassCastException e) {
@@ -57,6 +57,8 @@
             {
                 throw new Error("ClassNotFoundException message incomplete");
             }
+        } finally {
+            in.close();
         }
     }
 }
--- a/jdk/test/java/io/Serializable/auditStreamSubclass/AuditStreamSubclass.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/test/java/io/Serializable/auditStreamSubclass/AuditStreamSubclass.java	Wed Jul 21 09:57:21 2010 -0700
@@ -26,6 +26,8 @@
  * @summary Verify that unauthorized ObjectOutputStream and ObjectInputStream
  *          cannot be constructed if they override security-sensitive non-final
  *          methods.
+ * @build AuditStreamSubclass
+ * @run main/othervm AuditStreamSubclass
  */
 import java.io.*;
 
--- a/jdk/test/java/io/Serializable/backRefCNFException/Read.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/test/java/io/Serializable/backRefCNFException/Read.java	Wed Jul 21 09:57:21 2010 -0700
@@ -38,13 +38,17 @@
 
 public class Read {
     public static void main(String[] args) throws Exception {
-        ObjectInputStream oin =
-            new ObjectInputStream(new FileInputStream("tmp.ser"));
-        oin.readObject();
+        FileInputStream in = new FileInputStream("tmp.ser");
         try {
+            ObjectInputStream oin = new ObjectInputStream(in);
             oin.readObject();
-            throw new Error("back reference read succeeded");
-        } catch (ClassNotFoundException ex) {
+            try {
+                oin.readObject();
+                throw new Error("back reference read succeeded");
+            } catch (ClassNotFoundException ex) {
+            }
+        } finally {
+            in.close();
         }
     }
 }
--- a/jdk/test/java/io/Serializable/checkModifiers/CheckModifiers.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/test/java/io/Serializable/checkModifiers/CheckModifiers.java	Wed Jul 21 09:57:21 2010 -0700
@@ -213,33 +213,39 @@
 
 
         FileOutputStream fos = new FileOutputStream("fields.ser");
-        ObjectOutputStream oos = new ObjectOutputStream(fos);
-
-        System.out.println("Writing obj 1");
-        oos.writeObject(tc1);
-        System.out.println("Writing obj 2");
-        oos.writeObject(tc2);
-        System.out.println("Writing obj 3");
-        oos.writeObject(tc3);
-        System.out.println("Writing obj 4");
-        oos.writeObject(tc4);
+        try {
+            ObjectOutputStream oos = new ObjectOutputStream(fos);
+            System.out.println("Writing obj 1");
+            oos.writeObject(tc1);
+            System.out.println("Writing obj 2");
+            oos.writeObject(tc2);
+            System.out.println("Writing obj 3");
+            oos.writeObject(tc3);
+            System.out.println("Writing obj 4");
+            oos.writeObject(tc4);
+            oos.flush();
+        } finally {
+            fos.close();
+        }
 
         FileInputStream fis = new FileInputStream("fields.ser");
-        ObjectInputStream ois = new ObjectInputStream(fis);
-
-
-        System.out.println("Test modifiers for serialPeristentFields ");
-        System.out.println("---------------------------------------- ");
-        System.out.println("Declaration missing final modifier");
-        ois.readObject();
-        System.out.println();
-        System.out.println("Declaration with public instead of private access");
-        ois.readObject();
-        System.out.println();
-        System.out.println("Declaration with different type");
-        ois.readObject();
-        System.out.println();
-        System.out.println("Declaration as in specification");
-        ois.readObject();
+        try {
+            ObjectInputStream ois = new ObjectInputStream(fis);
+            System.out.println("Test modifiers for serialPeristentFields ");
+            System.out.println("---------------------------------------- ");
+            System.out.println("Declaration missing final modifier");
+            ois.readObject();
+            System.out.println();
+            System.out.println("Declaration with public instead of private access");
+            ois.readObject();
+            System.out.println();
+            System.out.println("Declaration with different type");
+            ois.readObject();
+            System.out.println();
+            System.out.println("Declaration as in specification");
+            ois.readObject();
+        } finally {
+            fis.close();
+        }
     }
 };
--- a/jdk/test/java/io/Serializable/classDescFlagConflict/Read.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/test/java/io/Serializable/classDescFlagConflict/Read.java	Wed Jul 21 09:57:21 2010 -0700
@@ -42,10 +42,15 @@
              * descriptor.
              */
             File f = new File(System.getProperty("test.src", "."), "Foo.ser");
-            new ObjectInputStream(new FileInputStream(f)).readObject();
-            throw new Error(
-                "read succeeded for object whose class descriptor has " +
-                "both SC_SERIALIZABLE and SC_EXTERNALIZABLE flags set");
+            FileInputStream in = new FileInputStream(f);
+            try {
+                new ObjectInputStream(in).readObject();
+                throw new Error(
+                    "read succeeded for object whose class descriptor has " +
+                    "both SC_SERIALIZABLE and SC_EXTERNALIZABLE flags set");
+            } finally {
+                in.close();
+            }
         } catch (InvalidClassException e) {
         }
     }
--- a/jdk/test/java/io/Serializable/classDescHooks/ClassDescHooks.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/test/java/io/Serializable/classDescHooks/ClassDescHooks.java	Wed Jul 21 09:57:21 2010 -0700
@@ -93,8 +93,12 @@
         bout = new ByteArrayOutputStream();
         foof = new File(System.getProperty("test.src", "."), "Foo.ser");
         fin = new FileInputStream(foof);
-        while (fin.available() > 0)
-            bout.write(fin.read());
+        try {
+            while (fin.available() > 0)
+                bout.write(fin.read());
+        } finally {
+            fin.close();
+        }
         byte[] buf1 = bout.toByteArray();
 
         bout = new ByteArrayOutputStream();
@@ -107,11 +111,16 @@
         if (! Arrays.equals(buf1, buf2))
             throw new Error("Incompatible stream format (write)");
 
+        Foo foocopy;
         fin = new FileInputStream(foof);
-        oin = new ObjectInputStream(fin);
-        Foo foocopy = (Foo) oin.readObject();
-        if (! foo.equals(foocopy))
-            throw new Error("Incompatible stream format (read)");
+        try {
+            oin = new ObjectInputStream(fin);
+            foocopy = (Foo) oin.readObject();
+            if (! foo.equals(foocopy))
+                throw new Error("Incompatible stream format (read)");
+        } finally {
+            fin.close();
+        }
 
         // make sure write hook not called when old protocol in use
         bout = new ByteArrayOutputStream();
--- a/jdk/test/java/io/Serializable/duplicateSerialFields/Test.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/test/java/io/Serializable/duplicateSerialFields/Test.java	Wed Jul 21 09:57:21 2010 -0700
@@ -82,18 +82,26 @@
         } catch (InvalidClassException e) {
         }
 
+        FileInputStream in = new FileInputStream("a.ser");
         try {
-            new ObjectInputStream(new FileInputStream("a.ser")).readObject();
+            ObjectInputStream oin = new ObjectInputStream(in);
+            oin.readObject();
             throw new Error(
                 "read of A should fail with InvalidClassException");
         } catch (InvalidClassException e) {
+        } finally {
+            in.close();
         }
 
+        in = new FileInputStream("b.ser");
         try {
-            new ObjectInputStream(new FileInputStream("b.ser")).readObject();
+            ObjectInputStream oin = new ObjectInputStream(in);
+            oin.readObject();
             throw new Error(
                 "read of B should fail with InvalidClassException");
         } catch (InvalidClassException e) {
+        } finally {
+            in.close();
         }
     }
 }
--- a/jdk/test/java/io/Serializable/enum/badResolve/Read.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/test/java/io/Serializable/enum/badResolve/Read.java	Wed Jul 21 09:57:21 2010 -0700
@@ -44,13 +44,15 @@
     }
 
     static void read(String filename) throws Exception {
-        ObjectInputStream oin =
-            new ObjectInputStream(new FileInputStream(filename));
+        FileInputStream in = new FileInputStream(filename);
         try {
+            ObjectInputStream oin = new ObjectInputStream(in);
             Object obj = oin.readObject();
             throw new Error("read of " + obj + " should not have succeeded");
         } catch (InvalidClassException e) {
             System.out.println("caught expected exception " + e);
+        } finally {
+            in.close();
         }
     }
 }
--- a/jdk/test/java/io/Serializable/enum/constantSubclasses/Read.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/test/java/io/Serializable/enum/constantSubclasses/Read.java	Wed Jul 21 09:57:21 2010 -0700
@@ -38,13 +38,17 @@
 
 public class Read {
     public static void main(String[] args) throws Exception {
-        ObjectInputStream oin =
-            new ObjectInputStream(new FileInputStream("foo.ser"));
-        for (Foo f : Foo.values()) {
-            Object obj = oin.readObject();
-            if (obj != f) {
-                throw new Error("expected " + f + ", got " + obj);
+        FileInputStream in = new FileInputStream("foo.ser");
+        try {
+            ObjectInputStream oin = new ObjectInputStream(in);
+            for (Foo f : Foo.values()) {
+                Object obj = oin.readObject();
+                if (obj != f) {
+                    throw new Error("expected " + f + ", got " + obj);
+                }
             }
+        } finally {
+            in.close();
         }
     }
 }
--- a/jdk/test/java/io/Serializable/enum/missingConstant/Read.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/test/java/io/Serializable/enum/missingConstant/Read.java	Wed Jul 21 09:57:21 2010 -0700
@@ -33,19 +33,23 @@
 
 public class Read {
     public static void main(String[] args) throws Exception {
-        ObjectInputStream oin =
-            new ObjectInputStream(new FileInputStream("foo.ser"));
-        for (Foo f : Foo.values()) {
-            Object obj = oin.readObject();
-            if (obj != f) {
-                throw new Error("expected " + f + ", got " + obj);
+        FileInputStream in = new FileInputStream("foo.ser");
+        try {
+            ObjectInputStream oin = new ObjectInputStream(in);
+            for (Foo f : Foo.values()) {
+                Object obj = oin.readObject();
+                if (obj != f) {
+                    throw new Error("expected " + f + ", got " + obj);
+                }
             }
-        }
-        try {
-            Object obj = oin.readObject();
-            throw new Error("read of " + obj + " should not succeed");
-        } catch (InvalidObjectException e) {
-            System.out.println("caught expected exception: " + e);
+            try {
+                Object obj = oin.readObject();
+                throw new Error("read of " + obj + " should not succeed");
+            } catch (InvalidObjectException e) {
+                System.out.println("caught expected exception: " + e);
+            }
+        } finally {
+            in.close();
         }
     }
 }
--- a/jdk/test/java/io/Serializable/fieldTypeString/Read.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/test/java/io/Serializable/fieldTypeString/Read.java	Wed Jul 21 09:57:21 2010 -0700
@@ -44,23 +44,30 @@
 
 public class Read {
     public static void main(String[] args) throws Exception {
-        ObjectInputStream oin =
-            new ObjectInputStream(new FileInputStream("foo.ser"));
-        Foo foo = (Foo) oin.readObject();
-        if (! foo.obj.equals("foo")) {
-            throw new Error();
-        }
+        FileInputStream in = new FileInputStream("foo.ser");
         try {
-            oin.readObject();
-            throw new Error();
-        } catch (ClassCastException ex) {
+            ObjectInputStream oin = new ObjectInputStream(in);
+            Foo foo = (Foo) oin.readObject();
+            if (! foo.obj.equals("foo")) {
+                throw new Error();
+            }
+            try {
+                oin.readObject();
+                throw new Error();
+            } catch (ClassCastException ex) {
+            }
+        } finally {
+            in.close();
         }
 
-        oin = new ObjectInputStream(new FileInputStream("bar.ser"));
+        in = new FileInputStream("bar.ser");
         try {
+            ObjectInputStream oin = new ObjectInputStream(in);
             oin.readObject();
             throw new Error();
         } catch (InvalidClassException ex) {
+        } finally {
+            in.close();
         }
     }
 }
--- a/jdk/test/java/io/Serializable/illegalHandle/Test.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/test/java/io/Serializable/illegalHandle/Test.java	Wed Jul 21 09:57:21 2010 -0700
@@ -38,21 +38,31 @@
          * serialized String object followed by an illegal handle
          */
         File f = new File(base, "negativeHandle.ser");
-        ObjectInputStream oin = new ObjectInputStream(new FileInputStream(f));
-        oin.readObject();
+        FileInputStream in = new FileInputStream(f);
         try {
+            ObjectInputStream oin = new ObjectInputStream(in);
             oin.readObject();
-            throw new Error("negative handle read should not succeed");
-        } catch (StreamCorruptedException ex) {
+            try {
+                oin.readObject();
+                throw new Error("negative handle read should not succeed");
+            } catch (StreamCorruptedException ex) {
+            }
+        } finally {
+            in.close();
         }
 
         f = new File(base, "tooHighHandle.ser");
-        oin = new ObjectInputStream(new FileInputStream(f));
-        oin.readObject();
+        in = new FileInputStream(f);
         try {
+            ObjectInputStream oin = new ObjectInputStream(in);
             oin.readObject();
-            throw new Error("too-high handle read should not succeed");
-        } catch (StreamCorruptedException ex) {
+            try {
+                oin.readObject();
+                throw new Error("too-high handle read should not succeed");
+            } catch (StreamCorruptedException ex) {
+            }
+        } finally {
+            in.close();
         }
     }
 }
--- a/jdk/test/java/io/Serializable/longString/LongString.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/test/java/io/Serializable/longString/LongString.java	Wed Jul 21 09:57:21 2010 -0700
@@ -68,17 +68,25 @@
         mesgf = new File(System.getProperty("test.src", "."), "mesg.ser");
         fin = new FileInputStream(mesgf);
         bout = new ByteArrayOutputStream();
-        while (fin.available() > 0)
-            bout.write(fin.read());
+        try {
+            while (fin.available() > 0)
+                bout.write(fin.read());
+        } finally {
+            fin.close();
+        }
         byte[] buf2 = bout.toByteArray();
 
         if (! Arrays.equals(buf1, buf2))
             throw new Error("incompatible string format (write)");
 
         fin = new FileInputStream(mesgf);
-        oin = new ObjectInputStream(fin);
-        String mesgcopy = (String) oin.readObject();
-        if (! mesg.equals(mesgcopy))
-            throw new Error("incompatible string format (read)");
+        try {
+            oin = new ObjectInputStream(fin);
+            String mesgcopy = (String) oin.readObject();
+            if (! mesg.equals(mesgcopy))
+                throw new Error("incompatible string format (read)");
+        } finally {
+            fin.close();
+        }
     }
 }
--- a/jdk/test/java/io/Serializable/oldTests/AnnotateClass.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/test/java/io/Serializable/oldTests/AnnotateClass.java	Wed Jul 21 09:57:21 2010 -0700
@@ -37,36 +37,43 @@
                            "methods \n");
         try {
             FileOutputStream ostream = new FileOutputStream("subtest1.tmp");
-            TestOutputStream p = new TestOutputStream(ostream);
-
-            p.writeObject(System.out);
-            p.writeObject(System.err);
-            p.writeObject(new PrintStream(ostream));
-            p.flush();
-            ostream.close();
+            try {
+                TestOutputStream p = new TestOutputStream(ostream);
+                p.writeObject(System.out);
+                p.writeObject(System.err);
+                p.writeObject(new PrintStream(ostream));
+                p.flush();
+            } finally {
+                ostream.close();
+            }
 
             FileInputStream istream = new FileInputStream("subtest1.tmp");
-            TestInputStream q = new TestInputStream(istream);
+            try {
+                TestInputStream q = new TestInputStream(istream);
 
-            PrintStream out = (PrintStream)q.readObject();
-            PrintStream err = (PrintStream)q.readObject();
-            Object other = q.readObject();
-            if (out != System.out) {
-                System.err.println(
-                    "\nTEST FAILED: System.out not read correctly");
-                throw new Error();
+                PrintStream out = (PrintStream)q.readObject();
+                PrintStream err = (PrintStream)q.readObject();
+                Object other = q.readObject();
+                if (out != System.out) {
+                    System.err.println(
+                        "\nTEST FAILED: System.out not read correctly");
+                    throw new Error();
+                }
+                if (err != System.err) {
+                    System.err.println(
+                        "\nTEST FAILED: System.err not read correctly");
+                    throw new Error();
+                }
+                if (other != null) {
+                    System.err.println(
+                        "\nTEST FAILED: Non-system PrintStream should have " +
+                        "been written/read as null");
+                    throw new Error();
+                }
+            } finally {
+                istream.close();
             }
-            if (err != System.err) {
-                System.err.println(
-                    "\nTEST FAILED: System.err not read correctly");
-                throw new Error();
-            }
-            if (other != null) {
-                System.err.println(
-                    "\nTEST FAILED: Non-system PrintStream should have " +
-                    "been written/read as null");
-                throw new Error();
-            }
+
             System.err.println("\nTEST PASSED");
         } catch (Exception e) {
             System.err.print("TEST FAILED: ");
--- a/jdk/test/java/io/Serializable/oldTests/ArrayFields.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/test/java/io/Serializable/oldTests/ArrayFields.java	Wed Jul 21 09:57:21 2010 -0700
@@ -35,20 +35,22 @@
 
 public class ArrayFields {
 
-   public static void main (String argv[]) {
+   public static void main (String argv[]) throws IOException {
        System.err.println("\nRegression test for testing of " +
            "serialization/deserialization of objects with " +
            "fields of array type\n");
 
+       FileOutputStream ostream = null;
+       FileInputStream istream = null;
        try {
-           FileOutputStream ostream = new FileOutputStream("piotest4.tmp");
+           ostream = new FileOutputStream("piotest4.tmp");
            ObjectOutputStream p = new ObjectOutputStream(ostream);
 
            ArrayTest array = new ArrayTest();
            p.writeObject(array);
            p.flush();
 
-           FileInputStream istream = new FileInputStream("piotest4.tmp");
+           istream = new FileInputStream("piotest4.tmp");
            ObjectInputStream q = new ObjectInputStream(istream);
 
            Object obj = null;
@@ -73,6 +75,9 @@
            System.err.print("TEST FAILED: ");
            e.printStackTrace();
            throw new Error();
+       } finally {
+           if (istream != null) istream.close();
+           if (ostream != null) ostream.close();
        }
    }
 }
--- a/jdk/test/java/io/Serializable/oldTests/ArraysOfArrays.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/test/java/io/Serializable/oldTests/ArraysOfArrays.java	Wed Jul 21 09:57:21 2010 -0700
@@ -31,14 +31,15 @@
 import java.io.*;
 
 public class ArraysOfArrays {
-    public static void main (String argv[]) {
+    public static void main (String argv[]) throws IOException {
         System.err.println("\nRegression test for testing of " +
             "serialization/deserialization of objects as " +
             "arrays of arrays \n");
 
         FileInputStream istream = null;
+        FileOutputStream ostream = null;
         try {
-            FileOutputStream ostream = new FileOutputStream("piotest5.tmp");
+            ostream = new FileOutputStream("piotest5.tmp");
             ObjectOutputStream p = new ObjectOutputStream(ostream);
 
             byte b[][] = {{ 0, 1}, {2,3}};
@@ -207,6 +208,9 @@
                 throw new Error();
             }
             throw new Error();
+        } finally {
+            if (istream != null) istream.close();
+            if (ostream != null) ostream.close();
         }
     }
 }
--- a/jdk/test/java/io/Serializable/oldTests/BinaryTree.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/test/java/io/Serializable/oldTests/BinaryTree.java	Wed Jul 21 09:57:21 2010 -0700
@@ -37,28 +37,34 @@
             "with BinaryTree types \n");
 
         try {
+            BinaryTreeTest base = new BinaryTreeTest(2);
             FileOutputStream ostream = new FileOutputStream("piotest3.tmp");
-            ObjectOutputStream p = new ObjectOutputStream(ostream);
-
-            BinaryTreeTest base = new BinaryTreeTest(2);
-            p.writeObject(null);
-            p.writeObject(base);
-            p.flush();
-            ostream.close();
+            try {
+                ObjectOutputStream p = new ObjectOutputStream(ostream);
+                p.writeObject(null);
+                p.writeObject(base);
+                p.flush();
+            } finally {
+                ostream.close();
+            }
 
             FileInputStream istream = new FileInputStream("piotest3.tmp");
-            ObjectInputStream q = new ObjectInputStream(istream);
-
-            Object n = q.readObject();
-            if (n != null) {
-                System.err.println("\nnull read as " + n);
+            try {
+                ObjectInputStream q = new ObjectInputStream(istream);
+                Object n = q.readObject();
+                if (n != null) {
+                    System.err.println("\nnull read as " + n);
+                }
+                BinaryTreeTest nbase = (BinaryTreeTest)q.readObject();
+                if (!base.equals(nbase)) {
+                    System.err.println("\nTEST FAILED: BinaryTree read " +
+                        "incorrectly.");
+                    throw new Error();
+                }
+            } finally {
+                istream.close();
             }
-            BinaryTreeTest nbase = (BinaryTreeTest)q.readObject();
-            if (!base.equals(nbase)) {
-                System.err.println("\nTEST FAILED: BinaryTree read " +
-                    "incorrectly.");
-                throw new Error();
-            }
+
             System.err.println("\nTEST PASSED");
         } catch (Exception e) {
             System.err.print("TEST FAILED: ");
--- a/jdk/test/java/io/Serializable/oldTests/CircularList.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/test/java/io/Serializable/oldTests/CircularList.java	Wed Jul 21 09:57:21 2010 -0700
@@ -31,20 +31,22 @@
 import java.io.*;
 
 public class CircularList {
-   public static void main (String argv[]) {
+   public static void main (String argv[]) throws IOException {
        System.err.println("\nRegression test for testing of " +
             "serialization/deserialization of " +
             "objects with CirculalListType types \n");
 
+       FileInputStream istream = null;
+       FileOutputStream ostream = null;
        try {
-           FileOutputStream ostream = new FileOutputStream("piotest7.tmp");
+           ostream = new FileOutputStream("piotest7.tmp");
            ObjectOutputStream p = new ObjectOutputStream(ostream);
 
            CircularListTest.setup();
            p.writeObject(CircularListTest.list);
            p.flush();
 
-           FileInputStream istream = new FileInputStream("piotest7.tmp");
+           istream = new FileInputStream("piotest7.tmp");
            ObjectInputStream q = new ObjectInputStream(istream);
 
            CircularListTest cv = (CircularListTest)q.readObject();
@@ -58,6 +60,9 @@
            System.err.print("TEST FAILED: ");
            e.printStackTrace();
            throw new Error();
+        } finally {
+           if (istream != null) istream.close();
+           if (ostream != null) ostream.close();
         }
     }
 }
--- a/jdk/test/java/io/Serializable/oldTests/SimpleArrays.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/test/java/io/Serializable/oldTests/SimpleArrays.java	Wed Jul 21 09:57:21 2010 -0700
@@ -35,13 +35,14 @@
 
 
 public class SimpleArrays {
-    public static void main (String argv[]) {
+    public static void main (String argv[]) throws IOException {
        System.err.println("\nRegression test for testing of " +
            "serialization/deserialization of objects with Arrays types\n");
 
        FileInputStream istream = null;
+       FileOutputStream ostream = null;
        try {
-           FileOutputStream ostream = new FileOutputStream("piotest2.tmp");
+           ostream = new FileOutputStream("piotest2.tmp");
            ObjectOutputStream p = new ObjectOutputStream(ostream);
 
             byte b[] = { 0, 1};
@@ -177,6 +178,9 @@
                throw new Error();
            }
            throw new Error();
+       } finally {
+           if (istream != null) istream.close();
+           if (ostream != null) ostream.close();
        }
     }
 }
--- a/jdk/test/java/io/Serializable/oldTests/WritePrimitive.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/test/java/io/Serializable/oldTests/WritePrimitive.java	Wed Jul 21 09:57:21 2010 -0700
@@ -34,11 +34,12 @@
 import java.io.*;
 
 public class WritePrimitive {
-    public static void main (String argv[]) {
+    public static void main (String argv[]) throws IOException {
         System.err.println("\nRegression test for testing of " +
             "serialization/deserialization of primitives \n");
 
         FileInputStream istream = null;
+        FileOutputStream ostream = null;
         try {
             int i = 123456;
             byte b = 12;
@@ -51,7 +52,7 @@
             String string = "The String";
             PrimitivesTest prim = new PrimitivesTest();
 
-            FileOutputStream ostream = new FileOutputStream("piotest1.tmp");
+            ostream = new FileOutputStream("piotest1.tmp");
             ObjectOutputStream p = new ObjectOutputStream(ostream);
 
             p.writeInt(i);
@@ -154,6 +155,9 @@
                 throw new Error();
             }
             throw new Error();
+        } finally {
+            if (istream != null) istream.close();
+            if (ostream != null) ostream.close();
         }
     }
 }
--- a/jdk/test/java/io/Serializable/packageAccess/Test.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/test/java/io/Serializable/packageAccess/Test.java	Wed Jul 21 09:57:21 2010 -0700
@@ -38,7 +38,8 @@
 
     public static void main(String[] args) throws Exception {
         ClassLoader ldr =
-            new URLClassLoader(new URL[]{ new URL("file:foo.jar") });
+            new URLClassLoader(new URL[]{ new URL("file:foo.jar") },
+                               Test.class.getClassLoader());
         bcl = Class.forName("B", true, ldr);
         dcl = Class.forName("D", true, ldr);
 
--- a/jdk/test/java/io/Serializable/parents/EvolvedClass.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/test/java/io/Serializable/parents/EvolvedClass.java	Wed Jul 21 09:57:21 2010 -0700
@@ -34,8 +34,12 @@
 
         // Deserialize in to new class object
         FileInputStream fi = new FileInputStream("parents.ser");
-        ObjectInputStream si = new ObjectInputStream(fi);
-        cnew = (ASubClass) si.readObject();
+        try {
+            ObjectInputStream si = new ObjectInputStream(fi);
+            cnew = (ASubClass) si.readObject();
+        } finally {
+            fi.close();
+        }
 
         System.out.println("Printing the deserialized class: ");
         System.out.println();
--- a/jdk/test/java/io/Serializable/parents/OriginalClass.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/test/java/io/Serializable/parents/OriginalClass.java	Wed Jul 21 09:57:21 2010 -0700
@@ -43,9 +43,13 @@
 
         // Serialize the subclass
         FileOutputStream fo = new FileOutputStream("parents.ser");
-        ObjectOutputStream so = new ObjectOutputStream(fo);
-        so.writeObject(corg);
-        so.flush();
+        try {
+            ObjectOutputStream so = new ObjectOutputStream(fo);
+            so.writeObject(corg);
+            so.flush();
+        } finally {
+            fo.close();
+        }
 
         System.out.println("Printing the serialized class: ");
         System.out.println();
--- a/jdk/test/java/io/Serializable/proxy/Basic.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/test/java/io/Serializable/proxy/Basic.java	Wed Jul 21 09:57:21 2010 -0700
@@ -81,7 +81,7 @@
 
 public class Basic {
     public static void main(String[] args) throws Exception {
-        ClassLoader loader = ClassLoader.getSystemClassLoader();
+        ClassLoader loader = Basic.class.getClassLoader();
         Class[] interfaces = new Class[] { Foo.class, Bar.class };
         Random rand = new Random();
         int foo = rand.nextInt();
--- a/jdk/test/java/io/Serializable/proxy/skipMissing/Read.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/test/java/io/Serializable/proxy/skipMissing/Read.java	Wed Jul 21 09:57:21 2010 -0700
@@ -49,20 +49,24 @@
 
 public class Read {
     public static void main(String[] args) throws Exception {
-        ObjectInputStream oin = new ObjectInputStream(
-            new FileInputStream("tmp.ser"));
-        A a = (A) oin.readObject();
-        if (! (a.a.equals("a") && a.z.equals("z"))) {
-            throw new Error("A fields corrupted");
-        }
-        B b = (B) oin.readObject();
-        if (! b.s.equals("s")) {
-            throw new Error("B fields corrupted");
-        }
+        FileInputStream in = new FileInputStream("tmp.ser");
         try {
-            oin.readObject();
-            throw new Error("proxy read should not succeed");
-        } catch (ClassNotFoundException ex) {
+            ObjectInputStream oin = new ObjectInputStream(in);
+            A a = (A) oin.readObject();
+            if (! (a.a.equals("a") && a.z.equals("z"))) {
+                throw new Error("A fields corrupted");
+            }
+            B b = (B) oin.readObject();
+            if (! b.s.equals("s")) {
+                throw new Error("B fields corrupted");
+            }
+            try {
+                oin.readObject();
+                throw new Error("proxy read should not succeed");
+            } catch (ClassNotFoundException ex) {
+            }
+        } finally {
+            in.close();
         }
     }
 }
--- a/jdk/test/java/io/Serializable/proxy/skipMissing/Write.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/test/java/io/Serializable/proxy/skipMissing/Write.java	Wed Jul 21 09:57:21 2010 -0700
@@ -64,7 +64,7 @@
 public class Write {
     public static void main(String[] args) throws Exception {
         Object proxy = Proxy.newProxyInstance(
-            ClassLoader.getSystemClassLoader(),
+            Write.class.getClassLoader(),
             new Class[] { I.class }, new Handler());
         ObjectOutputStream oout = new ObjectOutputStream(
             new FileOutputStream("tmp.ser"));
--- a/jdk/test/java/io/Serializable/readObjectNoData/Read.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/test/java/io/Serializable/readObjectNoData/Read.java	Wed Jul 21 09:57:21 2010 -0700
@@ -95,14 +95,18 @@
 
 public class Read {
     public static void main(String[] args) throws Exception {
-        ObjectInputStream oin =
-            new ObjectInputStream(new FileInputStream("tmp.ser"));
-        F f = (F) oin.readObject();
-        if (f.aCalled || f.bCalled || f.dCalled || f.eCalled) {
-            throw new Error("readObjectNoData invoked erroneously");
-        }
-        if (! f.cCalled) {
-            throw new Error("readObjectNoData not invoked");
+        FileInputStream in = new FileInputStream("tmp.ser");
+        try {
+            ObjectInputStream oin = new ObjectInputStream(in);
+            F f = (F) oin.readObject();
+            if (f.aCalled || f.bCalled || f.dCalled || f.eCalled) {
+                throw new Error("readObjectNoData invoked erroneously");
+            }
+            if (! f.cCalled) {
+                throw new Error("readObjectNoData not invoked");
+            }
+        } finally {
+            in.close();
         }
     }
 }
--- a/jdk/test/java/io/Serializable/skipWriteObject/Read.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/test/java/io/Serializable/skipWriteObject/Read.java	Wed Jul 21 09:57:21 2010 -0700
@@ -38,9 +38,13 @@
     public static void main(String[] args) throws Exception {
         ObjectInputStream oin =
             new ObjectInputStream(new FileInputStream("tmp.ser"));
-        Object[] array = (Object[]) oin.readObject();
-        if (! (array[0].equals("before") && array[2].equals("after"))) {
-            throw new Error();
+        try {
+            Object[] array = (Object[]) oin.readObject();
+            if (! (array[0].equals("before") && array[2].equals("after"))) {
+                throw new Error();
+            }
+        } finally {
+            oin.close();
         }
     }
 }
--- a/jdk/test/java/io/Serializable/skippedObjCNFException/Read.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/test/java/io/Serializable/skippedObjCNFException/Read.java	Wed Jul 21 09:57:21 2010 -0700
@@ -44,8 +44,12 @@
 
 public class Read {
     public static void main(String[] args) throws Exception {
-        ObjectInputStream oin =
-            new ObjectInputStream(new FileInputStream("tmp.ser"));
-        oin.readObject();
+        FileInputStream in = new FileInputStream("tmp.ser");
+        try {
+            ObjectInputStream oin = new ObjectInputStream(in);
+            oin.readObject();
+        } finally {
+            in.close();
+        }
     }
 }
--- a/jdk/test/java/io/Serializable/stopCustomDeserialization/Read.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/test/java/io/Serializable/stopCustomDeserialization/Read.java	Wed Jul 21 09:57:21 2010 -0700
@@ -53,16 +53,20 @@
 
 public class Read {
     public static void main(String[] args) throws Exception {
-        ObjectInputStream oin =
-            new ObjectInputStream(new FileInputStream("tmp.ser"));
+        FileInputStream in = new FileInputStream("tmp.ser");
         try {
-            oin.readObject();
-            throw new Error("readObject should not succeed");
-        } catch (ClassNotFoundException e) {
-            // expected
-        }
-        if (!oin.readObject().equals("after")) {
-            throw new Error("subsequent object corrupted");
+            ObjectInputStream oin = new ObjectInputStream(in);
+            try {
+                oin.readObject();
+                throw new Error("readObject should not succeed");
+            } catch (ClassNotFoundException e) {
+                // expected
+            }
+            if (!oin.readObject().equals("after")) {
+                throw new Error("subsequent object corrupted");
+            }
+        } finally {
+            in.close();
         }
     }
 }
--- a/jdk/test/java/io/Serializable/unresolvedClassDesc/Read.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/test/java/io/Serializable/unresolvedClassDesc/Read.java	Wed Jul 21 09:57:21 2010 -0700
@@ -32,19 +32,23 @@
 
 public class Read {
     public static void main(String[] args) throws Exception {
-        ObjectInputStream oin =
-            new ObjectInputStream(new FileInputStream("tmp.ser"));
-        oin.readObject();
-        oin.readObject();
+        FileInputStream in = new FileInputStream("tmp.ser");
         try {
+            ObjectInputStream oin = new ObjectInputStream(in);
+            oin.readObject();
             oin.readObject();
-            throw new Error("read of Foo instance succeeded");
-        } catch (ClassNotFoundException ex) {
-        }
-        try {
-            oin.readObject();
-            throw new Error("indirect read of Foo instance succeeded");
-        } catch (ClassNotFoundException ex) {
+            try {
+                oin.readObject();
+                throw new Error("read of Foo instance succeeded");
+            } catch (ClassNotFoundException ex) {
+            }
+            try {
+                oin.readObject();
+                throw new Error("indirect read of Foo instance succeeded");
+            } catch (ClassNotFoundException ex) {
+            }
+        } finally {
+            in.close();
         }
     }
 }
--- a/jdk/test/java/io/Serializable/unshared/Read.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/test/java/io/Serializable/unshared/Read.java	Wed Jul 21 09:57:21 2010 -0700
@@ -80,20 +80,30 @@
         }
 
         // read in objects written by Write.main()
-        oin = new ObjectInputStream(new FileInputStream("tmp.ser"));
-        oin.readObject();
+        FileInputStream in = new FileInputStream("tmp.ser");
         try {
+            oin = new ObjectInputStream(in);
             oin.readObject();
-            throw new Error();
-        } catch (ObjectStreamException ex) {
+            try {
+                oin.readObject();
+                throw new Error();
+            } catch (ObjectStreamException ex) {
+            }
+        } finally {
+            in.close();
         }
 
-        oin = new ObjectInputStream(new FileInputStream("tmp.ser"));
-        oin.readObject();
+        in = new FileInputStream("tmp.ser");
         try {
-            oin.readUnshared();
-            throw new Error();
-        } catch (ObjectStreamException ex) {
+            oin = new ObjectInputStream(in);
+            oin.readObject();
+            try {
+                oin.readUnshared();
+                throw new Error();
+            } catch (ObjectStreamException ex) {
+            }
+        } finally {
+            in.close();
         }
     }
 }
--- a/jdk/test/java/io/Serializable/wrongReturnTypes/Read.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/test/java/io/Serializable/wrongReturnTypes/Read.java	Wed Jul 21 09:57:21 2010 -0700
@@ -62,15 +62,19 @@
 
 public class Read {
     public static void main(String[] args) throws Exception {
-        ObjectInputStream oin =
-            new ObjectInputStream(new FileInputStream("tmp.ser"));
-        B b = (B) oin.readObject();
-        if (A.readObjectNoDataCalled) {
-            throw new Error("readObjectNoData with wrong return type called");
-        } else if (B.readObjectCalled) {
-            throw new Error("readObject with wrong return type called");
-        } else if (B.readResolveCalled) {
-            throw new Error("readResolve with wrong return type called");
+        FileInputStream in = new FileInputStream("tmp.ser");
+        try {
+            ObjectInputStream oin = new ObjectInputStream(in);
+            B b = (B) oin.readObject();
+            if (A.readObjectNoDataCalled) {
+                throw new Error("readObjectNoData with wrong return type called");
+            } else if (B.readObjectCalled) {
+                throw new Error("readObject with wrong return type called");
+            } else if (B.readResolveCalled) {
+                throw new Error("readResolve with wrong return type called");
+            }
+        } finally {
+            in.close();
         }
     }
 }
--- a/jdk/test/java/io/StreamTokenizer/Comment.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/test/java/io/StreamTokenizer/Comment.java	Wed Jul 21 09:57:21 2010 -0700
@@ -41,40 +41,45 @@
         int slashStarComment = 4;
 
         for (int i = 0; i < 8 ; i++) {
-            StreamTokenizer st = new StreamTokenizer(new FileReader(f));
-
-            /* decide the state of this run */
-            boolean slashCommentFlag = ((i & slashIsCommentStart) != 0);
-            boolean slashSlashCommentFlag = ((i & slashSlashComment) != 0);
-            boolean slashStarCommentFlag = ((i & slashStarComment) != 0);
+            FileReader reader = new FileReader(f);
+            try {
+                StreamTokenizer st = new StreamTokenizer(reader);
 
-            /* set the initial state of the tokenizer */
-            if (!slashCommentFlag) {
-                st.ordinaryChar('/');
-            }
-            st.slashSlashComments(slashSlashCommentFlag);
-            st.slashStarComments(slashStarCommentFlag);
+                /* decide the state of this run */
+                boolean slashCommentFlag = ((i & slashIsCommentStart) != 0);
+                boolean slashSlashCommentFlag = ((i & slashSlashComment) != 0);
+                boolean slashStarCommentFlag = ((i & slashStarComment) != 0);
+
+                /* set the initial state of the tokenizer */
+                if (!slashCommentFlag) {
+                    st.ordinaryChar('/');
+                }
+                st.slashSlashComments(slashSlashCommentFlag);
+                st.slashStarComments(slashStarCommentFlag);
 
-            /* now go throgh the input file */
-            while(st.nextToken() != StreamTokenizer.TT_EOF)
-            {
-                String token = st.sval;
-                if (token == null) {
-                    continue;
-                } else {
-                    if ((token.compareTo("Error1") == 0) && slashStarCommentFlag) {
-                        throw new Exception("Failed to pass one line C comments!");
-                    }
-                    if ((token.compareTo("Error2") == 0) && slashStarCommentFlag) {
-                        throw new Exception("Failed to pass multi line C comments!");
-                    }
-                    if ((token.compareTo("Error3") == 0) && slashSlashCommentFlag) {
-                        throw new Exception("Failed to pass C++ comments!");
-                    }
-                    if ((token.compareTo("Error4") == 0) && slashCommentFlag) {
-                        throw new Exception("Failed to pass / comments!");
+                /* now go throgh the input file */
+                while(st.nextToken() != StreamTokenizer.TT_EOF)
+                {
+                    String token = st.sval;
+                    if (token == null) {
+                        continue;
+                    } else {
+                        if ((token.compareTo("Error1") == 0) && slashStarCommentFlag) {
+                            throw new Exception("Failed to pass one line C comments!");
+                        }
+                        if ((token.compareTo("Error2") == 0) && slashStarCommentFlag) {
+                            throw new Exception("Failed to pass multi line C comments!");
+                        }
+                        if ((token.compareTo("Error3") == 0) && slashSlashCommentFlag) {
+                            throw new Exception("Failed to pass C++ comments!");
+                        }
+                        if ((token.compareTo("Error4") == 0) && slashCommentFlag) {
+                            throw new Exception("Failed to pass / comments!");
+                        }
                     }
                 }
+            } finally {
+                reader.close();
             }
         }
     }
--- a/jdk/test/java/io/readBytes/ReadBytesBounds.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/test/java/io/readBytes/ReadBytesBounds.java	Wed Jul 21 09:57:21 2010 -0700
@@ -57,24 +57,28 @@
     }
 
     public static void main(String argv[]) throws Throwable {
-        byte b[] = new byte[32];
-        testRead(-1, -1, false);
-        testRead(-1,  0, false);
-        testRead( 0, -1, false);
-        testRead( 0, 33, false);
-        testRead(33,  0, false);
-        testRead(33,  4, false);
-        testRead( 0, 32, true);
-        testRead(32,  0, true);
-        testRead(32,  4, false);
-        testRead( 4, 16, true);
-        testRead( 1, 31, true);
-        testRead( 0,  0, true);
-        testRead(31,  Integer.MAX_VALUE, false);
-        testRead( 0,  Integer.MAX_VALUE, false);
-        testRead(-1,  Integer.MAX_VALUE, false);
-        testRead(-4,  Integer.MIN_VALUE, false);
-        testRead( 0,  Integer.MIN_VALUE, false);
+        try {
+            testRead(-1, -1, false);
+            testRead(-1,  0, false);
+            testRead( 0, -1, false);
+            testRead( 0, 33, false);
+            testRead(33,  0, false);
+            testRead(33,  4, false);
+            testRead( 0, 32, true);
+            testRead(32,  0, true);
+            testRead(32,  4, false);
+            testRead( 4, 16, true);
+            testRead( 1, 31, true);
+            testRead( 0,  0, true);
+            testRead(31,  Integer.MAX_VALUE, false);
+            testRead( 0,  Integer.MAX_VALUE, false);
+            testRead(-1,  Integer.MAX_VALUE, false);
+            testRead(-4,  Integer.MIN_VALUE, false);
+            testRead( 0,  Integer.MIN_VALUE, false);
+        } finally {
+            fis.close();
+            raf.close();
+        }
     }
 
     static void testRead(int off, int len, boolean expected) throws Throwable {
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/lang/Character/CheckScript.java	Wed Jul 21 09:57:21 2010 -0700
@@ -0,0 +1,105 @@
+/**
+ * @test
+ * @bug 6945564
+ * @summary  Check that the j.l.Character.UnicodeScript
+ * @ignore don't run until #6903266 is integrated
+ */
+
+import java.io.*;
+import java.lang.reflect.*;
+import java.util.*;
+import java.util.regex.*;
+import java.lang.Character.UnicodeScript;
+
+public class CheckScript {
+
+    public static void main(String[] args) throws Exception {
+
+        if (args.length != 1) {
+            System.out.println("java CharacterScript script.txt");
+            System.exit(1);
+        }
+        BufferedReader sbfr = new BufferedReader(new FileReader(args[0]));
+        Matcher m = Pattern.compile("(\\p{XDigit}+)(?:\\.{2}(\\p{XDigit}+))?\\s+;\\s+(\\w+)\\s+#.*").matcher("");
+        String line = null;
+        HashMap<String,ArrayList<Integer>> scripts = new HashMap<>();
+        while ((line = sbfr.readLine()) != null) {
+            if (line.length() <= 1 || line.charAt(0) == '#') {
+                continue;
+            }
+            m.reset(line);
+            if (m.matches()) {
+                int start = Integer.parseInt(m.group(1), 16);
+                int end = (m.group(2)==null)?start
+                                            :Integer.parseInt(m.group(2), 16);
+                String name = m.group(3).toLowerCase(Locale.ENGLISH);
+                ArrayList<Integer> ranges = scripts.get(name);
+                if (ranges == null) {
+                    ranges = new ArrayList<Integer>();
+                    scripts.put(name, ranges);
+                }
+                ranges.add(start);
+                ranges.add(end);
+            }
+        }
+        sbfr.close();
+        // check all defined ranges
+        Integer[] ZEROSIZEARRAY = new Integer[0];
+        for (String name : scripts.keySet()) {
+            System.out.println("Checking " + name + "...");
+            Integer[] ranges = scripts.get(name).toArray(ZEROSIZEARRAY);
+            Character.UnicodeScript expected =
+                Character.UnicodeScript.forName(name);
+
+            int off = 0;
+            while (off < ranges.length) {
+                int start = ranges[off++];
+                int end = ranges[off++];
+                for (int cp = start; cp <= end; cp++) {
+                    Character.UnicodeScript script =
+                        Character.UnicodeScript.of(cp);
+                    if (script != expected) {
+                        throw new RuntimeException(
+                            "UnicodeScript failed: cp=" +
+                            Integer.toHexString(cp) +
+                            ", of(cp)=<" + script + "> but <" +
+                            expected + "> is expected");
+                   }
+                }
+            }
+        }
+        // check all codepoints
+        for (int cp = 0; cp < Character.MAX_CODE_POINT; cp++) {
+            Character.UnicodeScript script = Character.UnicodeScript.of(cp);
+            if (script == Character.UnicodeScript.UNKNOWN) {
+                if (Character.getType(cp) != Character.UNASSIGNED &&
+                    Character.getType(cp) != Character.SURROGATE &&
+                    Character.getType(cp) != Character.PRIVATE_USE)
+                    throw new RuntimeException(
+                        "UnicodeScript failed: cp=" +
+                        Integer.toHexString(cp) +
+                        ", of(cp)=<" + script + "> but UNKNOWN is expected");
+            } else {
+                Integer[] ranges =
+                    scripts.get(script.name().toLowerCase(Locale.ENGLISH))
+                           .toArray(ZEROSIZEARRAY);
+                int off = 0;
+                boolean found = false;
+                while (off < ranges.length) {
+                    int start = ranges[off++];
+                    int end = ranges[off++];
+                    if (cp >= start && cp <= end)
+                        found = true;
+                }
+                if (!found) {
+                    throw new RuntimeException(
+                        "UnicodeScript failed: cp=" +
+                        Integer.toHexString(cp) +
+                        ", of(cp)=<" + script +
+                        "> but NOT in ranges of this script");
+
+                }
+            }
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/lang/Character/Scripts.txt	Wed Jul 21 09:57:21 2010 -0700
@@ -0,0 +1,1972 @@
+# Scripts-5.2.0.txt
+# Date: 2009-08-22, 04:58:43 GMT [MD]
+#
+# Unicode Character Database
+# Copyright (c) 1991-2009 Unicode, Inc.
+# For terms of use, see http://www.unicode.org/terms_of_use.html
+# For documentation, see http://www.unicode.org/reports/tr44/
+
+# ================================================
+
+# Property:	Script
+
+#  All code points not explicitly listed for Script
+#  have the value Unknown (Zzzz).
+
+# @missing: 0000..10FFFF; Unknown
+
+# ================================================
+
+0000..001F    ; Common # Cc  [32] <control-0000>..<control-001F>
+0020          ; Common # Zs       SPACE
+0021..0023    ; Common # Po   [3] EXCLAMATION MARK..NUMBER SIGN
+0024          ; Common # Sc       DOLLAR SIGN
+0025..0027    ; Common # Po   [3] PERCENT SIGN..APOSTROPHE
+0028          ; Common # Ps       LEFT PARENTHESIS
+0029          ; Common # Pe       RIGHT PARENTHESIS
+002A          ; Common # Po       ASTERISK
+002B          ; Common # Sm       PLUS SIGN
+002C          ; Common # Po       COMMA
+002D          ; Common # Pd       HYPHEN-MINUS
+002E..002F    ; Common # Po   [2] FULL STOP..SOLIDUS
+0030..0039    ; Common # Nd  [10] DIGIT ZERO..DIGIT NINE
+003A..003B    ; Common # Po   [2] COLON..SEMICOLON
+003C..003E    ; Common # Sm   [3] LESS-THAN SIGN..GREATER-THAN SIGN
+003F..0040    ; Common # Po   [2] QUESTION MARK..COMMERCIAL AT
+005B          ; Common # Ps       LEFT SQUARE BRACKET
+005C          ; Common # Po       REVERSE SOLIDUS
+005D          ; Common # Pe       RIGHT SQUARE BRACKET
+005E          ; Common # Sk       CIRCUMFLEX ACCENT
+005F          ; Common # Pc       LOW LINE
+0060          ; Common # Sk       GRAVE ACCENT
+007B          ; Common # Ps       LEFT CURLY BRACKET
+007C          ; Common # Sm       VERTICAL LINE
+007D          ; Common # Pe       RIGHT CURLY BRACKET
+007E          ; Common # Sm       TILDE
+007F..009F    ; Common # Cc  [33] <control-007F>..<control-009F>
+00A0          ; Common # Zs       NO-BREAK SPACE
+00A1          ; Common # Po       INVERTED EXCLAMATION MARK
+00A2..00A5    ; Common # Sc   [4] CENT SIGN..YEN SIGN
+00A6..00A7    ; Common # So   [2] BROKEN BAR..SECTION SIGN
+00A8          ; Common # Sk       DIAERESIS
+00A9          ; Common # So       COPYRIGHT SIGN
+00AB          ; Common # Pi       LEFT-POINTING DOUBLE ANGLE QUOTATION MARK
+00AC          ; Common # Sm       NOT SIGN
+00AD          ; Common # Cf       SOFT HYPHEN
+00AE          ; Common # So       REGISTERED SIGN
+00AF          ; Common # Sk       MACRON
+00B0          ; Common # So       DEGREE SIGN
+00B1          ; Common # Sm       PLUS-MINUS SIGN
+00B2..00B3    ; Common # No   [2] SUPERSCRIPT TWO..SUPERSCRIPT THREE
+00B4          ; Common # Sk       ACUTE ACCENT
+00B5          ; Common # L&       MICRO SIGN
+00B6          ; Common # So       PILCROW SIGN
+00B7          ; Common # Po       MIDDLE DOT
+00B8          ; Common # Sk       CEDILLA
+00B9          ; Common # No       SUPERSCRIPT ONE
+00BB          ; Common # Pf       RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK
+00BC..00BE    ; Common # No   [3] VULGAR FRACTION ONE QUARTER..VULGAR FRACTION THREE QUARTERS
+00BF          ; Common # Po       INVERTED QUESTION MARK
+00D7          ; Common # Sm       MULTIPLICATION SIGN
+00F7          ; Common # Sm       DIVISION SIGN
+02B9..02C1    ; Common # Lm   [9] MODIFIER LETTER PRIME..MODIFIER LETTER REVERSED GLOTTAL STOP
+02C2..02C5    ; Common # Sk   [4] MODIFIER LETTER LEFT ARROWHEAD..MODIFIER LETTER DOWN ARROWHEAD
+02C6..02D1    ; Common # Lm  [12] MODIFIER LETTER CIRCUMFLEX ACCENT..MODIFIER LETTER HALF TRIANGULAR COLON
+02D2..02DF    ; Common # Sk  [14] MODIFIER LETTER CENTRED RIGHT HALF RING..MODIFIER LETTER CROSS ACCENT
+02E5..02EB    ; Common # Sk   [7] MODIFIER LETTER EXTRA-HIGH TONE BAR..MODIFIER LETTER YANG DEPARTING TONE MARK
+02EC          ; Common # Lm       MODIFIER LETTER VOICING
+02ED          ; Common # Sk       MODIFIER LETTER UNASPIRATED
+02EE          ; Common # Lm       MODIFIER LETTER DOUBLE APOSTROPHE
+02EF..02FF    ; Common # Sk  [17] MODIFIER LETTER LOW DOWN ARROWHEAD..MODIFIER LETTER LOW LEFT ARROW
+0374          ; Common # Lm       GREEK NUMERAL SIGN
+037E          ; Common # Po       GREEK QUESTION MARK
+0385          ; Common # Sk       GREEK DIALYTIKA TONOS
+0387          ; Common # Po       GREEK ANO TELEIA
+0589          ; Common # Po       ARMENIAN FULL STOP
+0600..0603    ; Common # Cf   [4] ARABIC NUMBER SIGN..ARABIC SIGN SAFHA
+060C          ; Common # Po       ARABIC COMMA
+061B          ; Common # Po       ARABIC SEMICOLON
+061F          ; Common # Po       ARABIC QUESTION MARK
+0640          ; Common # Lm       ARABIC TATWEEL
+0660..0669    ; Common # Nd  [10] ARABIC-INDIC DIGIT ZERO..ARABIC-INDIC DIGIT NINE
+06DD          ; Common # Cf       ARABIC END OF AYAH
+0964..0965    ; Common # Po   [2] DEVANAGARI DANDA..DEVANAGARI DOUBLE DANDA
+0970          ; Common # Po       DEVANAGARI ABBREVIATION SIGN
+0CF1..0CF2    ; Common # So   [2] KANNADA SIGN JIHVAMULIYA..KANNADA SIGN UPADHMANIYA
+0E3F          ; Common # Sc       THAI CURRENCY SYMBOL BAHT
+0FD5..0FD8    ; Common # So   [4] RIGHT-FACING SVASTI SIGN..LEFT-FACING SVASTI SIGN WITH DOTS
+10FB          ; Common # Po       GEORGIAN PARAGRAPH SEPARATOR
+16EB..16ED    ; Common # Po   [3] RUNIC SINGLE PUNCTUATION..RUNIC CROSS PUNCTUATION
+1735..1736    ; Common # Po   [2] PHILIPPINE SINGLE PUNCTUATION..PHILIPPINE DOUBLE PUNCTUATION
+1802..1803    ; Common # Po   [2] MONGOLIAN COMMA..MONGOLIAN FULL STOP
+1805          ; Common # Po       MONGOLIAN FOUR DOTS
+1CD3          ; Common # Po       VEDIC SIGN NIHSHVASA
+1CE1          ; Common # Mc       VEDIC TONE ATHARVAVEDIC INDEPENDENT SVARITA
+1CE9..1CEC    ; Common # Lo   [4] VEDIC SIGN ANUSVARA ANTARGOMUKHA..VEDIC SIGN ANUSVARA VAMAGOMUKHA WITH TAIL
+1CEE..1CF1    ; Common # Lo   [4] VEDIC SIGN HEXIFORM LONG ANUSVARA..VEDIC SIGN ANUSVARA UBHAYATO MUKHA
+1CF2          ; Common # Mc       VEDIC SIGN ARDHAVISARGA
+2000..200A    ; Common # Zs  [11] EN QUAD..HAIR SPACE
+200B          ; Common # Cf       ZERO WIDTH SPACE
+200E..200F    ; Common # Cf   [2] LEFT-TO-RIGHT MARK..RIGHT-TO-LEFT MARK
+2010..2015    ; Common # Pd   [6] HYPHEN..HORIZONTAL BAR
+2016..2017    ; Common # Po   [2] DOUBLE VERTICAL LINE..DOUBLE LOW LINE
+2018          ; Common # Pi       LEFT SINGLE QUOTATION MARK
+2019          ; Common # Pf       RIGHT SINGLE QUOTATION MARK
+201A          ; Common # Ps       SINGLE LOW-9 QUOTATION MARK
+201B..201C    ; Common # Pi   [2] SINGLE HIGH-REVERSED-9 QUOTATION MARK..LEFT DOUBLE QUOTATION MARK
+201D          ; Common # Pf       RIGHT DOUBLE QUOTATION MARK
+201E          ; Common # Ps       DOUBLE LOW-9 QUOTATION MARK
+201F          ; Common # Pi       DOUBLE HIGH-REVERSED-9 QUOTATION MARK
+2020..2027    ; Common # Po   [8] DAGGER..HYPHENATION POINT
+2028          ; Common # Zl       LINE SEPARATOR
+2029          ; Common # Zp       PARAGRAPH SEPARATOR
+202A..202E    ; Common # Cf   [5] LEFT-TO-RIGHT EMBEDDING..RIGHT-TO-LEFT OVERRIDE
+202F          ; Common # Zs       NARROW NO-BREAK SPACE
+2030..2038    ; Common # Po   [9] PER MILLE SIGN..CARET
+2039          ; Common # Pi       SINGLE LEFT-POINTING ANGLE QUOTATION MARK
+203A          ; Common # Pf       SINGLE RIGHT-POINTING ANGLE QUOTATION MARK
+203B..203E    ; Common # Po   [4] REFERENCE MARK..OVERLINE
+203F..2040    ; Common # Pc   [2] UNDERTIE..CHARACTER TIE
+2041..2043    ; Common # Po   [3] CARET INSERTION POINT..HYPHEN BULLET
+2044          ; Common # Sm       FRACTION SLASH
+2045          ; Common # Ps       LEFT SQUARE BRACKET WITH QUILL
+2046          ; Common # Pe       RIGHT SQUARE BRACKET WITH QUILL
+2047..2051    ; Common # Po  [11] DOUBLE QUESTION MARK..TWO ASTERISKS ALIGNED VERTICALLY
+2052          ; Common # Sm       COMMERCIAL MINUS SIGN
+2053          ; Common # Po       SWUNG DASH
+2054          ; Common # Pc       INVERTED UNDERTIE
+2055..205E    ; Common # Po  [10] FLOWER PUNCTUATION MARK..VERTICAL FOUR DOTS
+205F          ; Common # Zs       MEDIUM MATHEMATICAL SPACE
+2060..2064    ; Common # Cf   [5] WORD JOINER..INVISIBLE PLUS
+206A..206F    ; Common # Cf   [6] INHIBIT SYMMETRIC SWAPPING..NOMINAL DIGIT SHAPES
+2070          ; Common # No       SUPERSCRIPT ZERO
+2074..2079    ; Common # No   [6] SUPERSCRIPT FOUR..SUPERSCRIPT NINE
+207A..207C    ; Common # Sm   [3] SUPERSCRIPT PLUS SIGN..SUPERSCRIPT EQUALS SIGN
+207D          ; Common # Ps       SUPERSCRIPT LEFT PARENTHESIS
+207E          ; Common # Pe       SUPERSCRIPT RIGHT PARENTHESIS
+2080..2089    ; Common # No  [10] SUBSCRIPT ZERO..SUBSCRIPT NINE
+208A..208C    ; Common # Sm   [3] SUBSCRIPT PLUS SIGN..SUBSCRIPT EQUALS SIGN
+208D          ; Common # Ps       SUBSCRIPT LEFT PARENTHESIS
+208E          ; Common # Pe       SUBSCRIPT RIGHT PARENTHESIS
+20A0..20B8    ; Common # Sc  [25] EURO-CURRENCY SIGN..TENGE SIGN
+2100..2101    ; Common # So   [2] ACCOUNT OF..ADDRESSED TO THE SUBJECT
+2102          ; Common # L&       DOUBLE-STRUCK CAPITAL C
+2103..2106    ; Common # So   [4] DEGREE CELSIUS..CADA UNA
+2107          ; Common # L&       EULER CONSTANT
+2108..2109    ; Common # So   [2] SCRUPLE..DEGREE FAHRENHEIT
+210A..2113    ; Common # L&  [10] SCRIPT SMALL G..SCRIPT SMALL L
+2114          ; Common # So       L B BAR SYMBOL
+2115          ; Common # L&       DOUBLE-STRUCK CAPITAL N
+2116..2118    ; Common # So   [3] NUMERO SIGN..SCRIPT CAPITAL P
+2119..211D    ; Common # L&   [5] DOUBLE-STRUCK CAPITAL P..DOUBLE-STRUCK CAPITAL R
+211E..2123    ; Common # So   [6] PRESCRIPTION TAKE..VERSICLE
+2124          ; Common # L&       DOUBLE-STRUCK CAPITAL Z
+2125          ; Common # So       OUNCE SIGN
+2127          ; Common # So       INVERTED OHM SIGN
+2128          ; Common # L&       BLACK-LETTER CAPITAL Z
+2129          ; Common # So       TURNED GREEK SMALL LETTER IOTA
+212C..212D    ; Common # L&   [2] SCRIPT CAPITAL B..BLACK-LETTER CAPITAL C
+212E          ; Common # So       ESTIMATED SYMBOL
+212F..2131    ; Common # L&   [3] SCRIPT SMALL E..SCRIPT CAPITAL F
+2133..2134    ; Common # L&   [2] SCRIPT CAPITAL M..SCRIPT SMALL O
+2135..2138    ; Common # Lo   [4] ALEF SYMBOL..DALET SYMBOL
+2139          ; Common # L&       INFORMATION SOURCE
+213A..213B    ; Common # So   [2] ROTATED CAPITAL Q..FACSIMILE SIGN
+213C..213F    ; Common # L&   [4] DOUBLE-STRUCK SMALL PI..DOUBLE-STRUCK CAPITAL PI
+2140..2144    ; Common # Sm   [5] DOUBLE-STRUCK N-ARY SUMMATION..TURNED SANS-SERIF CAPITAL Y
+2145..2149    ; Common # L&   [5] DOUBLE-STRUCK ITALIC CAPITAL D..DOUBLE-STRUCK ITALIC SMALL J
+214A          ; Common # So       PROPERTY LINE
+214B          ; Common # Sm       TURNED AMPERSAND
+214C..214D    ; Common # So   [2] PER SIGN..AKTIESELSKAB
+214F          ; Common # So       SYMBOL FOR SAMARITAN SOURCE
+2150..215F    ; Common # No  [16] VULGAR FRACTION ONE SEVENTH..FRACTION NUMERATOR ONE
+2189          ; Common # No       VULGAR FRACTION ZERO THIRDS
+2190..2194    ; Common # Sm   [5] LEFTWARDS ARROW..LEFT RIGHT ARROW
+2195..2199    ; Common # So   [5] UP DOWN ARROW..SOUTH WEST ARROW
+219A..219B    ; Common # Sm   [2] LEFTWARDS ARROW WITH STROKE..RIGHTWARDS ARROW WITH STROKE
+219C..219F    ; Common # So   [4] LEFTWARDS WAVE ARROW..UPWARDS TWO HEADED ARROW
+21A0          ; Common # Sm       RIGHTWARDS TWO HEADED ARROW
+21A1..21A2    ; Common # So   [2] DOWNWARDS TWO HEADED ARROW..LEFTWARDS ARROW WITH TAIL
+21A3          ; Common # Sm       RIGHTWARDS ARROW WITH TAIL
+21A4..21A5    ; Common # So   [2] LEFTWARDS ARROW FROM BAR..UPWARDS ARROW FROM BAR
+21A6          ; Common # Sm       RIGHTWARDS ARROW FROM BAR
+21A7..21AD    ; Common # So   [7] DOWNWARDS ARROW FROM BAR..LEFT RIGHT WAVE ARROW
+21AE          ; Common # Sm       LEFT RIGHT ARROW WITH STROKE
+21AF..21CD    ; Common # So  [31] DOWNWARDS ZIGZAG ARROW..LEFTWARDS DOUBLE ARROW WITH STROKE
+21CE..21CF    ; Common # Sm   [2] LEFT RIGHT DOUBLE ARROW WITH STROKE..RIGHTWARDS DOUBLE ARROW WITH STROKE
+21D0..21D1    ; Common # So   [2] LEFTWARDS DOUBLE ARROW..UPWARDS DOUBLE ARROW
+21D2          ; Common # Sm       RIGHTWARDS DOUBLE ARROW
+21D3          ; Common # So       DOWNWARDS DOUBLE ARROW
+21D4          ; Common # Sm       LEFT RIGHT DOUBLE ARROW
+21D5..21F3    ; Common # So  [31] UP DOWN DOUBLE ARROW..UP DOWN WHITE ARROW
+21F4..22FF    ; Common # Sm [268] RIGHT ARROW WITH SMALL CIRCLE..Z NOTATION BAG MEMBERSHIP
+2300..2307    ; Common # So   [8] DIAMETER SIGN..WAVY LINE
+2308..230B    ; Common # Sm   [4] LEFT CEILING..RIGHT FLOOR
+230C..231F    ; Common # So  [20] BOTTOM RIGHT CROP..BOTTOM RIGHT CORNER
+2320..2321    ; Common # Sm   [2] TOP HALF INTEGRAL..BOTTOM HALF INTEGRAL
+2322..2328    ; Common # So   [7] FROWN..KEYBOARD
+2329          ; Common # Ps       LEFT-POINTING ANGLE BRACKET
+232A          ; Common # Pe       RIGHT-POINTING ANGLE BRACKET
+232B..237B    ; Common # So  [81] ERASE TO THE LEFT..NOT CHECK MARK
+237C          ; Common # Sm       RIGHT ANGLE WITH DOWNWARDS ZIGZAG ARROW
+237D..239A    ; Common # So  [30] SHOULDERED OPEN BOX..CLEAR SCREEN SYMBOL
+239B..23B3    ; Common # Sm  [25] LEFT PARENTHESIS UPPER HOOK..SUMMATION BOTTOM
+23B4..23DB    ; Common # So  [40] TOP SQUARE BRACKET..FUSE
+23DC..23E1    ; Common # Sm   [6] TOP PARENTHESIS..BOTTOM TORTOISE SHELL BRACKET
+23E2..23E8    ; Common # So   [7] WHITE TRAPEZIUM..DECIMAL EXPONENT SYMBOL
+2400..2426    ; Common # So  [39] SYMBOL FOR NULL..SYMBOL FOR SUBSTITUTE FORM TWO
+2440..244A    ; Common # So  [11] OCR HOOK..OCR DOUBLE BACKSLASH
+2460..249B    ; Common # No  [60] CIRCLED DIGIT ONE..NUMBER TWENTY FULL STOP
+249C..24E9    ; Common # So  [78] PARENTHESIZED LATIN SMALL LETTER A..CIRCLED LATIN SMALL LETTER Z
+24EA..24FF    ; Common # No  [22] CIRCLED DIGIT ZERO..NEGATIVE CIRCLED DIGIT ZERO
+2500..25B6    ; Common # So [183] BOX DRAWINGS LIGHT HORIZONTAL..BLACK RIGHT-POINTING TRIANGLE
+25B7          ; Common # Sm       WHITE RIGHT-POINTING TRIANGLE
+25B8..25C0    ; Common # So   [9] BLACK RIGHT-POINTING SMALL TRIANGLE..BLACK LEFT-POINTING TRIANGLE
+25C1          ; Common # Sm       WHITE LEFT-POINTING TRIANGLE
+25C2..25F7    ; Common # So  [54] BLACK LEFT-POINTING SMALL TRIANGLE..WHITE CIRCLE WITH UPPER RIGHT QUADRANT
+25F8..25FF    ; Common # Sm   [8] UPPER LEFT TRIANGLE..LOWER RIGHT TRIANGLE
+2600..266E    ; Common # So [111] BLACK SUN WITH RAYS..MUSIC NATURAL SIGN
+266F          ; Common # Sm       MUSIC SHARP SIGN
+2670..26CD    ; Common # So  [94] WEST SYRIAC CROSS..DISABLED CAR
+26CF..26E1    ; Common # So  [19] PICK..RESTRICTED LEFT ENTRY-2
+26E3          ; Common # So       HEAVY CIRCLE WITH STROKE AND TWO DOTS ABOVE
+26E8..26FF    ; Common # So  [24] BLACK CROSS ON SHIELD..WHITE FLAG WITH HORIZONTAL MIDDLE BLACK STRIPE
+2701..2704    ; Common # So   [4] UPPER BLADE SCISSORS..WHITE SCISSORS
+2706..2709    ; Common # So   [4] TELEPHONE LOCATION SIGN..ENVELOPE
+270C..2727    ; Common # So  [28] VICTORY HAND..WHITE FOUR POINTED STAR
+2729..274B    ; Common # So  [35] STRESS OUTLINED WHITE STAR..HEAVY EIGHT TEARDROP-SPOKED PROPELLER ASTERISK
+274D          ; Common # So       SHADOWED WHITE CIRCLE
+274F..2752    ; Common # So   [4] LOWER RIGHT DROP-SHADOWED WHITE SQUARE..UPPER RIGHT SHADOWED WHITE SQUARE
+2756..275E    ; Common # So   [9] BLACK DIAMOND MINUS WHITE X..HEAVY DOUBLE COMMA QUOTATION MARK ORNAMENT
+2761..2767    ; Common # So   [7] CURVED STEM PARAGRAPH SIGN ORNAMENT..ROTATED FLORAL HEART BULLET
+2768          ; Common # Ps       MEDIUM LEFT PARENTHESIS ORNAMENT
+2769          ; Common # Pe       MEDIUM RIGHT PARENTHESIS ORNAMENT
+276A          ; Common # Ps       MEDIUM FLATTENED LEFT PARENTHESIS ORNAMENT
+276B          ; Common # Pe       MEDIUM FLATTENED RIGHT PARENTHESIS ORNAMENT
+276C          ; Common # Ps       MEDIUM LEFT-POINTING ANGLE BRACKET ORNAMENT
+276D          ; Common # Pe       MEDIUM RIGHT-POINTING ANGLE BRACKET ORNAMENT
+276E          ; Common # Ps       HEAVY LEFT-POINTING ANGLE QUOTATION MARK ORNAMENT
+276F          ; Common # Pe       HEAVY RIGHT-POINTING ANGLE QUOTATION MARK ORNAMENT
+2770          ; Common # Ps       HEAVY LEFT-POINTING ANGLE BRACKET ORNAMENT
+2771          ; Common # Pe       HEAVY RIGHT-POINTING ANGLE BRACKET ORNAMENT
+2772          ; Common # Ps       LIGHT LEFT TORTOISE SHELL BRACKET ORNAMENT
+2773          ; Common # Pe       LIGHT RIGHT TORTOISE SHELL BRACKET ORNAMENT
+2774          ; Common # Ps       MEDIUM LEFT CURLY BRACKET ORNAMENT
+2775          ; Common # Pe       MEDIUM RIGHT CURLY BRACKET ORNAMENT
+2776..2793    ; Common # No  [30] DINGBAT NEGATIVE CIRCLED DIGIT ONE..DINGBAT NEGATIVE CIRCLED SANS-SERIF NUMBER TEN
+2794          ; Common # So       HEAVY WIDE-HEADED RIGHTWARDS ARROW
+2798..27AF    ; Common # So  [24] HEAVY SOUTH EAST ARROW..NOTCHED LOWER RIGHT-SHADOWED WHITE RIGHTWARDS ARROW
+27B1..27BE    ; Common # So  [14] NOTCHED UPPER RIGHT-SHADOWED WHITE RIGHTWARDS ARROW..OPEN-OUTLINED RIGHTWARDS ARROW
+27C0..27C4    ; Common # Sm   [5] THREE DIMENSIONAL ANGLE..OPEN SUPERSET
+27C5          ; Common # Ps       LEFT S-SHAPED BAG DELIMITER
+27C6          ; Common # Pe       RIGHT S-SHAPED BAG DELIMITER
+27C7..27CA    ; Common # Sm   [4] OR WITH DOT INSIDE..VERTICAL BAR WITH HORIZONTAL STROKE
+27CC          ; Common # Sm       LONG DIVISION
+27D0..27E5    ; Common # Sm  [22] WHITE DIAMOND WITH CENTRED DOT..WHITE SQUARE WITH RIGHTWARDS TICK
+27E6          ; Common # Ps       MATHEMATICAL LEFT WHITE SQUARE BRACKET
+27E7          ; Common # Pe       MATHEMATICAL RIGHT WHITE SQUARE BRACKET
+27E8          ; Common # Ps       MATHEMATICAL LEFT ANGLE BRACKET
+27E9          ; Common # Pe       MATHEMATICAL RIGHT ANGLE BRACKET
+27EA          ; Common # Ps       MATHEMATICAL LEFT DOUBLE ANGLE BRACKET
+27EB          ; Common # Pe       MATHEMATICAL RIGHT DOUBLE ANGLE BRACKET
+27EC          ; Common # Ps       MATHEMATICAL LEFT WHITE TORTOISE SHELL BRACKET
+27ED          ; Common # Pe       MATHEMATICAL RIGHT WHITE TORTOISE SHELL BRACKET
+27EE          ; Common # Ps       MATHEMATICAL LEFT FLATTENED PARENTHESIS
+27EF          ; Common # Pe       MATHEMATICAL RIGHT FLATTENED PARENTHESIS
+27F0..27FF    ; Common # Sm  [16] UPWARDS QUADRUPLE ARROW..LONG RIGHTWARDS SQUIGGLE ARROW
+2900..2982    ; Common # Sm [131] RIGHTWARDS TWO-HEADED ARROW WITH VERTICAL STROKE..Z NOTATION TYPE COLON
+2983          ; Common # Ps       LEFT WHITE CURLY BRACKET
+2984          ; Common # Pe       RIGHT WHITE CURLY BRACKET
+2985          ; Common # Ps       LEFT WHITE PARENTHESIS
+2986          ; Common # Pe       RIGHT WHITE PARENTHESIS
+2987          ; Common # Ps       Z NOTATION LEFT IMAGE BRACKET
+2988          ; Common # Pe       Z NOTATION RIGHT IMAGE BRACKET
+2989          ; Common # Ps       Z NOTATION LEFT BINDING BRACKET
+298A          ; Common # Pe       Z NOTATION RIGHT BINDING BRACKET
+298B          ; Common # Ps       LEFT SQUARE BRACKET WITH UNDERBAR
+298C          ; Common # Pe       RIGHT SQUARE BRACKET WITH UNDERBAR
+298D          ; Common # Ps       LEFT SQUARE BRACKET WITH TICK IN TOP CORNER
+298E          ; Common # Pe       RIGHT SQUARE BRACKET WITH TICK IN BOTTOM CORNER
+298F          ; Common # Ps       LEFT SQUARE BRACKET WITH TICK IN BOTTOM CORNER
+2990          ; Common # Pe       RIGHT SQUARE BRACKET WITH TICK IN TOP CORNER
+2991          ; Common # Ps       LEFT ANGLE BRACKET WITH DOT
+2992          ; Common # Pe       RIGHT ANGLE BRACKET WITH DOT
+2993          ; Common # Ps       LEFT ARC LESS-THAN BRACKET
+2994          ; Common # Pe       RIGHT ARC GREATER-THAN BRACKET
+2995          ; Common # Ps       DOUBLE LEFT ARC GREATER-THAN BRACKET
+2996          ; Common # Pe       DOUBLE RIGHT ARC LESS-THAN BRACKET
+2997          ; Common # Ps       LEFT BLACK TORTOISE SHELL BRACKET
+2998          ; Common # Pe       RIGHT BLACK TORTOISE SHELL BRACKET
+2999..29D7    ; Common # Sm  [63] DOTTED FENCE..BLACK HOURGLASS
+29D8          ; Common # Ps       LEFT WIGGLY FENCE
+29D9          ; Common # Pe       RIGHT WIGGLY FENCE
+29DA          ; Common # Ps       LEFT DOUBLE WIGGLY FENCE
+29DB          ; Common # Pe       RIGHT DOUBLE WIGGLY FENCE
+29DC..29FB    ; Common # Sm  [32] INCOMPLETE INFINITY..TRIPLE PLUS
+29FC          ; Common # Ps       LEFT-POINTING CURVED ANGLE BRACKET
+29FD          ; Common # Pe       RIGHT-POINTING CURVED ANGLE BRACKET
+29FE..2AFF    ; Common # Sm [258] TINY..N-ARY WHITE VERTICAL BAR
+2B00..2B2F    ; Common # So  [48] NORTH EAST WHITE ARROW..WHITE VERTICAL ELLIPSE
+2B30..2B44    ; Common # Sm  [21] LEFT ARROW WITH SMALL CIRCLE..RIGHTWARDS ARROW THROUGH SUPERSET
+2B45..2B46    ; Common # So   [2] LEFTWARDS QUADRUPLE ARROW..RIGHTWARDS QUADRUPLE ARROW
+2B47..2B4C    ; Common # Sm   [6] REVERSE TILDE OPERATOR ABOVE RIGHTWARDS ARROW..RIGHTWARDS ARROW ABOVE REVERSE TILDE OPERATOR
+2B50..2B59    ; Common # So  [10] WHITE MEDIUM STAR..HEAVY CIRCLED SALTIRE
+2E00..2E01    ; Common # Po   [2] RIGHT ANGLE SUBSTITUTION MARKER..RIGHT ANGLE DOTTED SUBSTITUTION MARKER
+2E02          ; Common # Pi       LEFT SUBSTITUTION BRACKET
+2E03          ; Common # Pf       RIGHT SUBSTITUTION BRACKET
+2E04          ; Common # Pi       LEFT DOTTED SUBSTITUTION BRACKET
+2E05          ; Common # Pf       RIGHT DOTTED SUBSTITUTION BRACKET
+2E06..2E08    ; Common # Po   [3] RAISED INTERPOLATION MARKER..DOTTED TRANSPOSITION MARKER
+2E09          ; Common # Pi       LEFT TRANSPOSITION BRACKET
+2E0A          ; Common # Pf       RIGHT TRANSPOSITION BRACKET
+2E0B          ; Common # Po       RAISED SQUARE
+2E0C          ; Common # Pi       LEFT RAISED OMISSION BRACKET
+2E0D          ; Common # Pf       RIGHT RAISED OMISSION BRACKET
+2E0E..2E16    ; Common # Po   [9] EDITORIAL CORONIS..DOTTED RIGHT-POINTING ANGLE
+2E17          ; Common # Pd       DOUBLE OBLIQUE HYPHEN
+2E18..2E19    ; Common # Po   [2] INVERTED INTERROBANG..PALM BRANCH
+2E1A          ; Common # Pd       HYPHEN WITH DIAERESIS
+2E1B          ; Common # Po       TILDE WITH RING ABOVE
+2E1C          ; Common # Pi       LEFT LOW PARAPHRASE BRACKET
+2E1D          ; Common # Pf       RIGHT LOW PARAPHRASE BRACKET
+2E1E..2E1F    ; Common # Po   [2] TILDE WITH DOT ABOVE..TILDE WITH DOT BELOW
+2E20          ; Common # Pi       LEFT VERTICAL BAR WITH QUILL
+2E21          ; Common # Pf       RIGHT VERTICAL BAR WITH QUILL
+2E22          ; Common # Ps       TOP LEFT HALF BRACKET
+2E23          ; Common # Pe       TOP RIGHT HALF BRACKET
+2E24          ; Common # Ps       BOTTOM LEFT HALF BRACKET
+2E25          ; Common # Pe       BOTTOM RIGHT HALF BRACKET
+2E26          ; Common # Ps       LEFT SIDEWAYS U BRACKET
+2E27          ; Common # Pe       RIGHT SIDEWAYS U BRACKET
+2E28          ; Common # Ps       LEFT DOUBLE PARENTHESIS
+2E29          ; Common # Pe       RIGHT DOUBLE PARENTHESIS
+2E2A..2E2E    ; Common # Po   [5] TWO DOTS OVER ONE DOT PUNCTUATION..REVERSED QUESTION MARK
+2E2F          ; Common # Lm       VERTICAL TILDE
+2E30..2E31    ; Common # Po   [2] RING POINT..WORD SEPARATOR MIDDLE DOT
+2FF0..2FFB    ; Common # So  [12] IDEOGRAPHIC DESCRIPTION CHARACTER LEFT TO RIGHT..IDEOGRAPHIC DESCRIPTION CHARACTER OVERLAID
+3000          ; Common # Zs       IDEOGRAPHIC SPACE
+3001..3003    ; Common # Po   [3] IDEOGRAPHIC COMMA..DITTO MARK
+3004          ; Common # So       JAPANESE INDUSTRIAL STANDARD SYMBOL
+3006          ; Common # Lo       IDEOGRAPHIC CLOSING MARK
+3008          ; Common # Ps       LEFT ANGLE BRACKET
+3009          ; Common # Pe       RIGHT ANGLE BRACKET
+300A          ; Common # Ps       LEFT DOUBLE ANGLE BRACKET
+300B          ; Common # Pe       RIGHT DOUBLE ANGLE BRACKET
+300C          ; Common # Ps       LEFT CORNER BRACKET
+300D          ; Common # Pe       RIGHT CORNER BRACKET
+300E          ; Common # Ps       LEFT WHITE CORNER BRACKET
+300F          ; Common # Pe       RIGHT WHITE CORNER BRACKET
+3010          ; Common # Ps       LEFT BLACK LENTICULAR BRACKET
+3011          ; Common # Pe       RIGHT BLACK LENTICULAR BRACKET
+3012..3013    ; Common # So   [2] POSTAL MARK..GETA MARK
+3014          ; Common # Ps       LEFT TORTOISE SHELL BRACKET
+3015          ; Common # Pe       RIGHT TORTOISE SHELL BRACKET
+3016          ; Common # Ps       LEFT WHITE LENTICULAR BRACKET
+3017          ; Common # Pe       RIGHT WHITE LENTICULAR BRACKET
+3018          ; Common # Ps       LEFT WHITE TORTOISE SHELL BRACKET
+3019          ; Common # Pe       RIGHT WHITE TORTOISE SHELL BRACKET
+301A          ; Common # Ps       LEFT WHITE SQUARE BRACKET
+301B          ; Common # Pe       RIGHT WHITE SQUARE BRACKET
+301C          ; Common # Pd       WAVE DASH
+301D          ; Common # Ps       REVERSED DOUBLE PRIME QUOTATION MARK
+301E..301F    ; Common # Pe   [2] DOUBLE PRIME QUOTATION MARK..LOW DOUBLE PRIME QUOTATION MARK
+3020          ; Common # So       POSTAL MARK FACE
+3030          ; Common # Pd       WAVY DASH
+3031..3035    ; Common # Lm   [5] VERTICAL KANA REPEAT MARK..VERTICAL KANA REPEAT MARK LOWER HALF
+3036..3037    ; Common # So   [2] CIRCLED POSTAL MARK..IDEOGRAPHIC TELEGRAPH LINE FEED SEPARATOR SYMBOL
+303C          ; Common # Lo       MASU MARK
+303D          ; Common # Po       PART ALTERNATION MARK
+303E..303F    ; Common # So   [2] IDEOGRAPHIC VARIATION INDICATOR..IDEOGRAPHIC HALF FILL SPACE
+309B..309C    ; Common # Sk   [2] KATAKANA-HIRAGANA VOICED SOUND MARK..KATAKANA-HIRAGANA SEMI-VOICED SOUND MARK
+30A0          ; Common # Pd       KATAKANA-HIRAGANA DOUBLE HYPHEN
+30FB          ; Common # Po       KATAKANA MIDDLE DOT
+30FC          ; Common # Lm       KATAKANA-HIRAGANA PROLONGED SOUND MARK
+3190..3191    ; Common # So   [2] IDEOGRAPHIC ANNOTATION LINKING MARK..IDEOGRAPHIC ANNOTATION REVERSE MARK
+3192..3195    ; Common # No   [4] IDEOGRAPHIC ANNOTATION ONE MARK..IDEOGRAPHIC ANNOTATION FOUR MARK
+3196..319F    ; Common # So  [10] IDEOGRAPHIC ANNOTATION TOP MARK..IDEOGRAPHIC ANNOTATION MAN MARK
+31C0..31E3    ; Common # So  [36] CJK STROKE T..CJK STROKE Q
+3220..3229    ; Common # No  [10] PARENTHESIZED IDEOGRAPH ONE..PARENTHESIZED IDEOGRAPH TEN
+322A..3250    ; Common # So  [39] PARENTHESIZED IDEOGRAPH MOON..PARTNERSHIP SIGN
+3251..325F    ; Common # No  [15] CIRCLED NUMBER TWENTY ONE..CIRCLED NUMBER THIRTY FIVE
+327F          ; Common # So       KOREAN STANDARD SYMBOL
+3280..3289    ; Common # No  [10] CIRCLED IDEOGRAPH ONE..CIRCLED IDEOGRAPH TEN
+328A..32B0    ; Common # So  [39] CIRCLED IDEOGRAPH MOON..CIRCLED IDEOGRAPH NIGHT
+32B1..32BF    ; Common # No  [15] CIRCLED NUMBER THIRTY SIX..CIRCLED NUMBER FIFTY
+32C0..32CF    ; Common # So  [16] IDEOGRAPHIC TELEGRAPH SYMBOL FOR JANUARY..LIMITED LIABILITY SIGN
+3358..33FF    ; Common # So [168] IDEOGRAPHIC TELEGRAPH SYMBOL FOR HOUR ZERO..SQUARE GAL
+4DC0..4DFF    ; Common # So  [64] HEXAGRAM FOR THE CREATIVE HEAVEN..HEXAGRAM FOR BEFORE COMPLETION
+A700..A716    ; Common # Sk  [23] MODIFIER LETTER CHINESE TONE YIN PING..MODIFIER LETTER EXTRA-LOW LEFT-STEM TONE BAR
+A717..A71F    ; Common # Lm   [9] MODIFIER LETTER DOT VERTICAL BAR..MODIFIER LETTER LOW INVERTED EXCLAMATION MARK
+A720..A721    ; Common # Sk   [2] MODIFIER LETTER STRESS AND HIGH TONE..MODIFIER LETTER STRESS AND LOW TONE
+A788          ; Common # Lm       MODIFIER LETTER LOW CIRCUMFLEX ACCENT
+A789..A78A    ; Common # Sk   [2] MODIFIER LETTER COLON..MODIFIER LETTER SHORT EQUALS SIGN
+A830..A835    ; Common # No   [6] NORTH INDIC FRACTION ONE QUARTER..NORTH INDIC FRACTION THREE SIXTEENTHS
+A836..A837    ; Common # So   [2] NORTH INDIC QUARTER MARK..NORTH INDIC PLACEHOLDER MARK
+A838          ; Common # Sc       NORTH INDIC RUPEE MARK
+A839          ; Common # So       NORTH INDIC QUANTITY MARK
+FD3E          ; Common # Ps       ORNATE LEFT PARENTHESIS
+FD3F          ; Common # Pe       ORNATE RIGHT PARENTHESIS
+FDFD          ; Common # So       ARABIC LIGATURE BISMILLAH AR-RAHMAN AR-RAHEEM
+FE10..FE16    ; Common # Po   [7] PRESENTATION FORM FOR VERTICAL COMMA..PRESENTATION FORM FOR VERTICAL QUESTION MARK
+FE17          ; Common # Ps       PRESENTATION FORM FOR VERTICAL LEFT WHITE LENTICULAR BRACKET
+FE18          ; Common # Pe       PRESENTATION FORM FOR VERTICAL RIGHT WHITE LENTICULAR BRAKCET
+FE19          ; Common # Po       PRESENTATION FORM FOR VERTICAL HORIZONTAL ELLIPSIS
+FE30          ; Common # Po       PRESENTATION FORM FOR VERTICAL TWO DOT LEADER
+FE31..FE32    ; Common # Pd   [2] PRESENTATION FORM FOR VERTICAL EM DASH..PRESENTATION FORM FOR VERTICAL EN DASH
+FE33..FE34    ; Common # Pc   [2] PRESENTATION FORM FOR VERTICAL LOW LINE..PRESENTATION FORM FOR VERTICAL WAVY LOW LINE
+FE35          ; Common # Ps       PRESENTATION FORM FOR VERTICAL LEFT PARENTHESIS
+FE36          ; Common # Pe       PRESENTATION FORM FOR VERTICAL RIGHT PARENTHESIS
+FE37          ; Common # Ps       PRESENTATION FORM FOR VERTICAL LEFT CURLY BRACKET
+FE38          ; Common # Pe       PRESENTATION FORM FOR VERTICAL RIGHT CURLY BRACKET
+FE39          ; Common # Ps       PRESENTATION FORM FOR VERTICAL LEFT TORTOISE SHELL BRACKET
+FE3A          ; Common # Pe       PRESENTATION FORM FOR VERTICAL RIGHT TORTOISE SHELL BRACKET
+FE3B          ; Common # Ps       PRESENTATION FORM FOR VERTICAL LEFT BLACK LENTICULAR BRACKET
+FE3C          ; Common # Pe       PRESENTATION FORM FOR VERTICAL RIGHT BLACK LENTICULAR BRACKET
+FE3D          ; Common # Ps       PRESENTATION FORM FOR VERTICAL LEFT DOUBLE ANGLE BRACKET
+FE3E          ; Common # Pe       PRESENTATION FORM FOR VERTICAL RIGHT DOUBLE ANGLE BRACKET
+FE3F          ; Common # Ps       PRESENTATION FORM FOR VERTICAL LEFT ANGLE BRACKET
+FE40          ; Common # Pe       PRESENTATION FORM FOR VERTICAL RIGHT ANGLE BRACKET
+FE41          ; Common # Ps       PRESENTATION FORM FOR VERTICAL LEFT CORNER BRACKET
+FE42          ; Common # Pe       PRESENTATION FORM FOR VERTICAL RIGHT CORNER BRACKET
+FE43          ; Common # Ps       PRESENTATION FORM FOR VERTICAL LEFT WHITE CORNER BRACKET
+FE44          ; Common # Pe       PRESENTATION FORM FOR VERTICAL RIGHT WHITE CORNER BRACKET
+FE45..FE46    ; Common # Po   [2] SESAME DOT..WHITE SESAME DOT
+FE47          ; Common # Ps       PRESENTATION FORM FOR VERTICAL LEFT SQUARE BRACKET
+FE48          ; Common # Pe       PRESENTATION FORM FOR VERTICAL RIGHT SQUARE BRACKET
+FE49..FE4C    ; Common # Po   [4] DASHED OVERLINE..DOUBLE WAVY OVERLINE
+FE4D..FE4F    ; Common # Pc   [3] DASHED LOW LINE..WAVY LOW LINE
+FE50..FE52    ; Common # Po   [3] SMALL COMMA..SMALL FULL STOP
+FE54..FE57    ; Common # Po   [4] SMALL SEMICOLON..SMALL EXCLAMATION MARK
+FE58          ; Common # Pd       SMALL EM DASH
+FE59          ; Common # Ps       SMALL LEFT PARENTHESIS
+FE5A          ; Common # Pe       SMALL RIGHT PARENTHESIS
+FE5B          ; Common # Ps       SMALL LEFT CURLY BRACKET
+FE5C          ; Common # Pe       SMALL RIGHT CURLY BRACKET
+FE5D          ; Common # Ps       SMALL LEFT TORTOISE SHELL BRACKET
+FE5E          ; Common # Pe       SMALL RIGHT TORTOISE SHELL BRACKET
+FE5F..FE61    ; Common # Po   [3] SMALL NUMBER SIGN..SMALL ASTERISK
+FE62          ; Common # Sm       SMALL PLUS SIGN
+FE63          ; Common # Pd       SMALL HYPHEN-MINUS
+FE64..FE66    ; Common # Sm   [3] SMALL LESS-THAN SIGN..SMALL EQUALS SIGN
+FE68          ; Common # Po       SMALL REVERSE SOLIDUS
+FE69          ; Common # Sc       SMALL DOLLAR SIGN
+FE6A..FE6B    ; Common # Po   [2] SMALL PERCENT SIGN..SMALL COMMERCIAL AT
+FEFF          ; Common # Cf       ZERO WIDTH NO-BREAK SPACE
+FF01..FF03    ; Common # Po   [3] FULLWIDTH EXCLAMATION MARK..FULLWIDTH NUMBER SIGN
+FF04          ; Common # Sc       FULLWIDTH DOLLAR SIGN
+FF05..FF07    ; Common # Po   [3] FULLWIDTH PERCENT SIGN..FULLWIDTH APOSTROPHE
+FF08          ; Common # Ps       FULLWIDTH LEFT PARENTHESIS
+FF09          ; Common # Pe       FULLWIDTH RIGHT PARENTHESIS
+FF0A          ; Common # Po       FULLWIDTH ASTERISK
+FF0B          ; Common # Sm       FULLWIDTH PLUS SIGN
+FF0C          ; Common # Po       FULLWIDTH COMMA
+FF0D          ; Common # Pd       FULLWIDTH HYPHEN-MINUS
+FF0E..FF0F    ; Common # Po   [2] FULLWIDTH FULL STOP..FULLWIDTH SOLIDUS
+FF10..FF19    ; Common # Nd  [10] FULLWIDTH DIGIT ZERO..FULLWIDTH DIGIT NINE
+FF1A..FF1B    ; Common # Po   [2] FULLWIDTH COLON..FULLWIDTH SEMICOLON
+FF1C..FF1E    ; Common # Sm   [3] FULLWIDTH LESS-THAN SIGN..FULLWIDTH GREATER-THAN SIGN
+FF1F..FF20    ; Common # Po   [2] FULLWIDTH QUESTION MARK..FULLWIDTH COMMERCIAL AT
+FF3B          ; Common # Ps       FULLWIDTH LEFT SQUARE BRACKET
+FF3C          ; Common # Po       FULLWIDTH REVERSE SOLIDUS
+FF3D          ; Common # Pe       FULLWIDTH RIGHT SQUARE BRACKET
+FF3E          ; Common # Sk       FULLWIDTH CIRCUMFLEX ACCENT
+FF3F          ; Common # Pc       FULLWIDTH LOW LINE
+FF40          ; Common # Sk       FULLWIDTH GRAVE ACCENT
+FF5B          ; Common # Ps       FULLWIDTH LEFT CURLY BRACKET
+FF5C          ; Common # Sm       FULLWIDTH VERTICAL LINE
+FF5D          ; Common # Pe       FULLWIDTH RIGHT CURLY BRACKET
+FF5E          ; Common # Sm       FULLWIDTH TILDE
+FF5F          ; Common # Ps       FULLWIDTH LEFT WHITE PARENTHESIS
+FF60          ; Common # Pe       FULLWIDTH RIGHT WHITE PARENTHESIS
+FF61          ; Common # Po       HALFWIDTH IDEOGRAPHIC FULL STOP
+FF62          ; Common # Ps       HALFWIDTH LEFT CORNER BRACKET
+FF63          ; Common # Pe       HALFWIDTH RIGHT CORNER BRACKET
+FF64..FF65    ; Common # Po   [2] HALFWIDTH IDEOGRAPHIC COMMA..HALFWIDTH KATAKANA MIDDLE DOT
+FF70          ; Common # Lm       HALFWIDTH KATAKANA-HIRAGANA PROLONGED SOUND MARK
+FF9E..FF9F    ; Common # Lm   [2] HALFWIDTH KATAKANA VOICED SOUND MARK..HALFWIDTH KATAKANA SEMI-VOICED SOUND MARK
+FFE0..FFE1    ; Common # Sc   [2] FULLWIDTH CENT SIGN..FULLWIDTH POUND SIGN
+FFE2          ; Common # Sm       FULLWIDTH NOT SIGN
+FFE3          ; Common # Sk       FULLWIDTH MACRON
+FFE4          ; Common # So       FULLWIDTH BROKEN BAR
+FFE5..FFE6    ; Common # Sc   [2] FULLWIDTH YEN SIGN..FULLWIDTH WON SIGN
+FFE8          ; Common # So       HALFWIDTH FORMS LIGHT VERTICAL
+FFE9..FFEC    ; Common # Sm   [4] HALFWIDTH LEFTWARDS ARROW..HALFWIDTH DOWNWARDS ARROW
+FFED..FFEE    ; Common # So   [2] HALFWIDTH BLACK SQUARE..HALFWIDTH WHITE CIRCLE
+FFF9..FFFB    ; Common # Cf   [3] INTERLINEAR ANNOTATION ANCHOR..INTERLINEAR ANNOTATION TERMINATOR
+FFFC..FFFD    ; Common # So   [2] OBJECT REPLACEMENT CHARACTER..REPLACEMENT CHARACTER
+10100..10101  ; Common # Po   [2] AEGEAN WORD SEPARATOR LINE..AEGEAN WORD SEPARATOR DOT
+10102         ; Common # So       AEGEAN CHECK MARK
+10107..10133  ; Common # No  [45] AEGEAN NUMBER ONE..AEGEAN NUMBER NINETY THOUSAND
+10137..1013F  ; Common # So   [9] AEGEAN WEIGHT BASE UNIT..AEGEAN MEASURE THIRD SUBUNIT
+10190..1019B  ; Common # So  [12] ROMAN SEXTANS SIGN..ROMAN CENTURIAL SIGN
+101D0..101FC  ; Common # So  [45] PHAISTOS DISC SIGN PEDESTRIAN..PHAISTOS DISC SIGN WAVY BAND
+1D000..1D0F5  ; Common # So [246] BYZANTINE MUSICAL SYMBOL PSILI..BYZANTINE MUSICAL SYMBOL GORGON NEO KATO
+1D100..1D126  ; Common # So  [39] MUSICAL SYMBOL SINGLE BARLINE..MUSICAL SYMBOL DRUM CLEF-2
+1D129..1D164  ; Common # So  [60] MUSICAL SYMBOL MULTIPLE MEASURE REST..MUSICAL SYMBOL ONE HUNDRED TWENTY-EIGHTH NOTE
+1D165..1D166  ; Common # Mc   [2] MUSICAL SYMBOL COMBINING STEM..MUSICAL SYMBOL COMBINING SPRECHGESANG STEM
+1D16A..1D16C  ; Common # So   [3] MUSICAL SYMBOL FINGERED TREMOLO-1..MUSICAL SYMBOL FINGERED TREMOLO-3
+1D16D..1D172  ; Common # Mc   [6] MUSICAL SYMBOL COMBINING AUGMENTATION DOT..MUSICAL SYMBOL COMBINING FLAG-5
+1D173..1D17A  ; Common # Cf   [8] MUSICAL SYMBOL BEGIN BEAM..MUSICAL SYMBOL END PHRASE
+1D183..1D184  ; Common # So   [2] MUSICAL SYMBOL ARPEGGIATO UP..MUSICAL SYMBOL ARPEGGIATO DOWN
+1D18C..1D1A9  ; Common # So  [30] MUSICAL SYMBOL RINFORZANDO..MUSICAL SYMBOL DEGREE SLASH
+1D1AE..1D1DD  ; Common # So  [48] MUSICAL SYMBOL PEDAL MARK..MUSICAL SYMBOL PES SUBPUNCTIS
+1D300..1D356  ; Common # So  [87] MONOGRAM FOR EARTH..TETRAGRAM FOR FOSTERING
+1D360..1D371  ; Common # No  [18] COUNTING ROD UNIT DIGIT ONE..COUNTING ROD TENS DIGIT NINE
+1D400..1D454  ; Common # L&  [85] MATHEMATICAL BOLD CAPITAL A..MATHEMATICAL ITALIC SMALL G
+1D456..1D49C  ; Common # L&  [71] MATHEMATICAL ITALIC SMALL I..MATHEMATICAL SCRIPT CAPITAL A
+1D49E..1D49F  ; Common # L&   [2] MATHEMATICAL SCRIPT CAPITAL C..MATHEMATICAL SCRIPT CAPITAL D
+1D4A2         ; Common # L&       MATHEMATICAL SCRIPT CAPITAL G
+1D4A5..1D4A6  ; Common # L&   [2] MATHEMATICAL SCRIPT CAPITAL J..MATHEMATICAL SCRIPT CAPITAL K
+1D4A9..1D4AC  ; Common # L&   [4] MATHEMATICAL SCRIPT CAPITAL N..MATHEMATICAL SCRIPT CAPITAL Q
+1D4AE..1D4B9  ; Common # L&  [12] MATHEMATICAL SCRIPT CAPITAL S..MATHEMATICAL SCRIPT SMALL D
+1D4BB         ; Common # L&       MATHEMATICAL SCRIPT SMALL F
+1D4BD..1D4C3  ; Common # L&   [7] MATHEMATICAL SCRIPT SMALL H..MATHEMATICAL SCRIPT SMALL N
+1D4C5..1D505  ; Common # L&  [65] MATHEMATICAL SCRIPT SMALL P..MATHEMATICAL FRAKTUR CAPITAL B
+1D507..1D50A  ; Common # L&   [4] MATHEMATICAL FRAKTUR CAPITAL D..MATHEMATICAL FRAKTUR CAPITAL G
+1D50D..1D514  ; Common # L&   [8] MATHEMATICAL FRAKTUR CAPITAL J..MATHEMATICAL FRAKTUR CAPITAL Q
+1D516..1D51C  ; Common # L&   [7] MATHEMATICAL FRAKTUR CAPITAL S..MATHEMATICAL FRAKTUR CAPITAL Y
+1D51E..1D539  ; Common # L&  [28] MATHEMATICAL FRAKTUR SMALL A..MATHEMATICAL DOUBLE-STRUCK CAPITAL B
+1D53B..1D53E  ; Common # L&   [4] MATHEMATICAL DOUBLE-STRUCK CAPITAL D..MATHEMATICAL DOUBLE-STRUCK CAPITAL G
+1D540..1D544  ; Common # L&   [5] MATHEMATICAL DOUBLE-STRUCK CAPITAL I..MATHEMATICAL DOUBLE-STRUCK CAPITAL M
+1D546         ; Common # L&       MATHEMATICAL DOUBLE-STRUCK CAPITAL O
+1D54A..1D550  ; Common # L&   [7] MATHEMATICAL DOUBLE-STRUCK CAPITAL S..MATHEMATICAL DOUBLE-STRUCK CAPITAL Y
+1D552..1D6A5  ; Common # L& [340] MATHEMATICAL DOUBLE-STRUCK SMALL A..MATHEMATICAL ITALIC SMALL DOTLESS J
+1D6A8..1D6C0  ; Common # L&  [25] MATHEMATICAL BOLD CAPITAL ALPHA..MATHEMATICAL BOLD CAPITAL OMEGA
+1D6C1         ; Common # Sm       MATHEMATICAL BOLD NABLA
+1D6C2..1D6DA  ; Common # L&  [25] MATHEMATICAL BOLD SMALL ALPHA..MATHEMATICAL BOLD SMALL OMEGA
+1D6DB         ; Common # Sm       MATHEMATICAL BOLD PARTIAL DIFFERENTIAL
+1D6DC..1D6FA  ; Common # L&  [31] MATHEMATICAL BOLD EPSILON SYMBOL..MATHEMATICAL ITALIC CAPITAL OMEGA
+1D6FB         ; Common # Sm       MATHEMATICAL ITALIC NABLA
+1D6FC..1D714  ; Common # L&  [25] MATHEMATICAL ITALIC SMALL ALPHA..MATHEMATICAL ITALIC SMALL OMEGA
+1D715         ; Common # Sm       MATHEMATICAL ITALIC PARTIAL DIFFERENTIAL
+1D716..1D734  ; Common # L&  [31] MATHEMATICAL ITALIC EPSILON SYMBOL..MATHEMATICAL BOLD ITALIC CAPITAL OMEGA
+1D735         ; Common # Sm       MATHEMATICAL BOLD ITALIC NABLA
+1D736..1D74E  ; Common # L&  [25] MATHEMATICAL BOLD ITALIC SMALL ALPHA..MATHEMATICAL BOLD ITALIC SMALL OMEGA
+1D74F         ; Common # Sm       MATHEMATICAL BOLD ITALIC PARTIAL DIFFERENTIAL
+1D750..1D76E  ; Common # L&  [31] MATHEMATICAL BOLD ITALIC EPSILON SYMBOL..MATHEMATICAL SANS-SERIF BOLD CAPITAL OMEGA
+1D76F         ; Common # Sm       MATHEMATICAL SANS-SERIF BOLD NABLA
+1D770..1D788  ; Common # L&  [25] MATHEMATICAL SANS-SERIF BOLD SMALL ALPHA..MATHEMATICAL SANS-SERIF BOLD SMALL OMEGA
+1D789         ; Common # Sm       MATHEMATICAL SANS-SERIF BOLD PARTIAL DIFFERENTIAL
+1D78A..1D7A8  ; Common # L&  [31] MATHEMATICAL SANS-SERIF BOLD EPSILON SYMBOL..MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL OMEGA
+1D7A9         ; Common # Sm       MATHEMATICAL SANS-SERIF BOLD ITALIC NABLA
+1D7AA..1D7C2  ; Common # L&  [25] MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL ALPHA..MATHEMATICAL SANS-SERIF BOLD ITALIC SMALL OMEGA
+1D7C3         ; Common # Sm       MATHEMATICAL SANS-SERIF BOLD ITALIC PARTIAL DIFFERENTIAL
+1D7C4..1D7CB  ; Common # L&   [8] MATHEMATICAL SANS-SERIF BOLD ITALIC EPSILON SYMBOL..MATHEMATICAL BOLD SMALL DIGAMMA
+1D7CE..1D7FF  ; Common # Nd  [50] MATHEMATICAL BOLD DIGIT ZERO..MATHEMATICAL MONOSPACE DIGIT NINE
+1F000..1F02B  ; Common # So  [44] MAHJONG TILE EAST WIND..MAHJONG TILE BACK
+1F030..1F093  ; Common # So [100] DOMINO TILE HORIZONTAL BACK..DOMINO TILE VERTICAL-06-06
+1F100..1F10A  ; Common # No  [11] DIGIT ZERO FULL STOP..DIGIT NINE COMMA
+1F110..1F12E  ; Common # So  [31] PARENTHESIZED LATIN CAPITAL LETTER A..CIRCLED WZ
+1F131         ; Common # So       SQUARED LATIN CAPITAL LETTER B
+1F13D         ; Common # So       SQUARED LATIN CAPITAL LETTER N
+1F13F         ; Common # So       SQUARED LATIN CAPITAL LETTER P
+1F142         ; Common # So       SQUARED LATIN CAPITAL LETTER S
+1F146         ; Common # So       SQUARED LATIN CAPITAL LETTER W
+1F14A..1F14E  ; Common # So   [5] SQUARED HV..SQUARED PPV
+1F157         ; Common # So       NEGATIVE CIRCLED LATIN CAPITAL LETTER H
+1F15F         ; Common # So       NEGATIVE CIRCLED LATIN CAPITAL LETTER P
+1F179         ; Common # So       NEGATIVE SQUARED LATIN CAPITAL LETTER J
+1F17B..1F17C  ; Common # So   [2] NEGATIVE SQUARED LATIN CAPITAL LETTER L..NEGATIVE SQUARED LATIN CAPITAL LETTER M
+1F17F         ; Common # So       NEGATIVE SQUARED LATIN CAPITAL LETTER P
+1F18A..1F18D  ; Common # So   [4] CROSSED NEGATIVE SQUARED LATIN CAPITAL LETTER P..NEGATIVE SQUARED SA
+1F190         ; Common # So       SQUARE DJ
+1F210..1F231  ; Common # So  [34] SQUARED CJK UNIFIED IDEOGRAPH-624B..SQUARED CJK UNIFIED IDEOGRAPH-6253
+1F240..1F248  ; Common # So   [9] TORTOISE SHELL BRACKETED CJK UNIFIED IDEOGRAPH-672C..TORTOISE SHELL BRACKETED CJK UNIFIED IDEOGRAPH-6557
+E0001         ; Common # Cf       LANGUAGE TAG
+E0020..E007F  ; Common # Cf  [96] TAG SPACE..CANCEL TAG
+
+# Total code points: 5395
+
+# ================================================
+
+0041..005A    ; Latin # L&  [26] LATIN CAPITAL LETTER A..LATIN CAPITAL LETTER Z
+0061..007A    ; Latin # L&  [26] LATIN SMALL LETTER A..LATIN SMALL LETTER Z
+00AA          ; Latin # L&       FEMININE ORDINAL INDICATOR
+00BA          ; Latin # L&       MASCULINE ORDINAL INDICATOR
+00C0..00D6    ; Latin # L&  [23] LATIN CAPITAL LETTER A WITH GRAVE..LATIN CAPITAL LETTER O WITH DIAERESIS
+00D8..00F6    ; Latin # L&  [31] LATIN CAPITAL LETTER O WITH STROKE..LATIN SMALL LETTER O WITH DIAERESIS
+00F8..01BA    ; Latin # L& [195] LATIN SMALL LETTER O WITH STROKE..LATIN SMALL LETTER EZH WITH TAIL
+01BB          ; Latin # Lo       LATIN LETTER TWO WITH STROKE
+01BC..01BF    ; Latin # L&   [4] LATIN CAPITAL LETTER TONE FIVE..LATIN LETTER WYNN
+01C0..01C3    ; Latin # Lo   [4] LATIN LETTER DENTAL CLICK..LATIN LETTER RETROFLEX CLICK
+01C4..0293    ; Latin # L& [208] LATIN CAPITAL LETTER DZ WITH CARON..LATIN SMALL LETTER EZH WITH CURL
+0294          ; Latin # Lo       LATIN LETTER GLOTTAL STOP
+0295..02AF    ; Latin # L&  [27] LATIN LETTER PHARYNGEAL VOICED FRICATIVE..LATIN SMALL LETTER TURNED H WITH FISHHOOK AND TAIL
+02B0..02B8    ; Latin # Lm   [9] MODIFIER LETTER SMALL H..MODIFIER LETTER SMALL Y
+02E0..02E4    ; Latin # Lm   [5] MODIFIER LETTER SMALL GAMMA..MODIFIER LETTER SMALL REVERSED GLOTTAL STOP
+1D00..1D25    ; Latin # L&  [38] LATIN LETTER SMALL CAPITAL A..LATIN LETTER AIN
+1D2C..1D5C    ; Latin # Lm  [49] MODIFIER LETTER CAPITAL A..MODIFIER LETTER SMALL AIN
+1D62..1D65    ; Latin # L&   [4] LATIN SUBSCRIPT SMALL LETTER I..LATIN SUBSCRIPT SMALL LETTER V
+1D6B..1D77    ; Latin # L&  [13] LATIN SMALL LETTER UE..LATIN SMALL LETTER TURNED G
+1D79..1D9A    ; Latin # L&  [34] LATIN SMALL LETTER INSULAR G..LATIN SMALL LETTER EZH WITH RETROFLEX HOOK
+1D9B..1DBE    ; Latin # Lm  [36] MODIFIER LETTER SMALL TURNED ALPHA..MODIFIER LETTER SMALL EZH
+1E00..1EFF    ; Latin # L& [256] LATIN CAPITAL LETTER A WITH RING BELOW..LATIN SMALL LETTER Y WITH LOOP
+2071          ; Latin # Lm       SUPERSCRIPT LATIN SMALL LETTER I
+207F          ; Latin # Lm       SUPERSCRIPT LATIN SMALL LETTER N
+2090..2094    ; Latin # Lm   [5] LATIN SUBSCRIPT SMALL LETTER A..LATIN SUBSCRIPT SMALL LETTER SCHWA
+212A..212B    ; Latin # L&   [2] KELVIN SIGN..ANGSTROM SIGN
+2132          ; Latin # L&       TURNED CAPITAL F
+214E          ; Latin # L&       TURNED SMALL F
+2160..2182    ; Latin # Nl  [35] ROMAN NUMERAL ONE..ROMAN NUMERAL TEN THOUSAND
+2183..2184    ; Latin # L&   [2] ROMAN NUMERAL REVERSED ONE HUNDRED..LATIN SMALL LETTER REVERSED C
+2185..2188    ; Latin # Nl   [4] ROMAN NUMERAL SIX LATE FORM..ROMAN NUMERAL ONE HUNDRED THOUSAND
+2C60..2C7C    ; Latin # L&  [29] LATIN CAPITAL LETTER L WITH DOUBLE BAR..LATIN SUBSCRIPT SMALL LETTER J
+2C7D          ; Latin # Lm       MODIFIER LETTER CAPITAL V
+2C7E..2C7F    ; Latin # L&   [2] LATIN CAPITAL LETTER S WITH SWASH TAIL..LATIN CAPITAL LETTER Z WITH SWASH TAIL
+A722..A76F    ; Latin # L&  [78] LATIN CAPITAL LETTER EGYPTOLOGICAL ALEF..LATIN SMALL LETTER CON
+A770          ; Latin # Lm       MODIFIER LETTER US
+A771..A787    ; Latin # L&  [23] LATIN SMALL LETTER DUM..LATIN SMALL LETTER INSULAR T
+A78B..A78C    ; Latin # L&   [2] LATIN CAPITAL LETTER SALTILLO..LATIN SMALL LETTER SALTILLO
+A7FB..A7FF    ; Latin # Lo   [5] LATIN EPIGRAPHIC LETTER REVERSED F..LATIN EPIGRAPHIC LETTER ARCHAIC M
+FB00..FB06    ; Latin # L&   [7] LATIN SMALL LIGATURE FF..LATIN SMALL LIGATURE ST
+FF21..FF3A    ; Latin # L&  [26] FULLWIDTH LATIN CAPITAL LETTER A..FULLWIDTH LATIN CAPITAL LETTER Z
+FF41..FF5A    ; Latin # L&  [26] FULLWIDTH LATIN SMALL LETTER A..FULLWIDTH LATIN SMALL LETTER Z
+
+# Total code points: 1244
+
+# ================================================
+
+0370..0373    ; Greek # L&   [4] GREEK CAPITAL LETTER HETA..GREEK SMALL LETTER ARCHAIC SAMPI
+0375          ; Greek # Sk       GREEK LOWER NUMERAL SIGN
+0376..0377    ; Greek # L&   [2] GREEK CAPITAL LETTER PAMPHYLIAN DIGAMMA..GREEK SMALL LETTER PAMPHYLIAN DIGAMMA
+037A          ; Greek # Lm       GREEK YPOGEGRAMMENI
+037B..037D    ; Greek # L&   [3] GREEK SMALL REVERSED LUNATE SIGMA SYMBOL..GREEK SMALL REVERSED DOTTED LUNATE SIGMA SYMBOL
+0384          ; Greek # Sk       GREEK TONOS
+0386          ; Greek # L&       GREEK CAPITAL LETTER ALPHA WITH TONOS
+0388..038A    ; Greek # L&   [3] GREEK CAPITAL LETTER EPSILON WITH TONOS..GREEK CAPITAL LETTER IOTA WITH TONOS
+038C          ; Greek # L&       GREEK CAPITAL LETTER OMICRON WITH TONOS
+038E..03A1    ; Greek # L&  [20] GREEK CAPITAL LETTER UPSILON WITH TONOS..GREEK CAPITAL LETTER RHO
+03A3..03E1    ; Greek # L&  [63] GREEK CAPITAL LETTER SIGMA..GREEK SMALL LETTER SAMPI
+03F0..03F5    ; Greek # L&   [6] GREEK KAPPA SYMBOL..GREEK LUNATE EPSILON SYMBOL
+03F6          ; Greek # Sm       GREEK REVERSED LUNATE EPSILON SYMBOL
+03F7..03FF    ; Greek # L&   [9] GREEK CAPITAL LETTER SHO..GREEK CAPITAL REVERSED DOTTED LUNATE SIGMA SYMBOL
+1D26..1D2A    ; Greek # L&   [5] GREEK LETTER SMALL CAPITAL GAMMA..GREEK LETTER SMALL CAPITAL PSI
+1D5D..1D61    ; Greek # Lm   [5] MODIFIER LETTER SMALL BETA..MODIFIER LETTER SMALL CHI
+1D66..1D6A    ; Greek # L&   [5] GREEK SUBSCRIPT SMALL LETTER BETA..GREEK SUBSCRIPT SMALL LETTER CHI
+1DBF          ; Greek # Lm       MODIFIER LETTER SMALL THETA
+1F00..1F15    ; Greek # L&  [22] GREEK SMALL LETTER ALPHA WITH PSILI..GREEK SMALL LETTER EPSILON WITH DASIA AND OXIA
+1F18..1F1D    ; Greek # L&   [6] GREEK CAPITAL LETTER EPSILON WITH PSILI..GREEK CAPITAL LETTER EPSILON WITH DASIA AND OXIA
+1F20..1F45    ; Greek # L&  [38] GREEK SMALL LETTER ETA WITH PSILI..GREEK SMALL LETTER OMICRON WITH DASIA AND OXIA
+1F48..1F4D    ; Greek # L&   [6] GREEK CAPITAL LETTER OMICRON WITH PSILI..GREEK CAPITAL LETTER OMICRON WITH DASIA AND OXIA
+1F50..1F57    ; Greek # L&   [8] GREEK SMALL LETTER UPSILON WITH PSILI..GREEK SMALL LETTER UPSILON WITH DASIA AND PERISPOMENI
+1F59          ; Greek # L&       GREEK CAPITAL LETTER UPSILON WITH DASIA
+1F5B          ; Greek # L&       GREEK CAPITAL LETTER UPSILON WITH DASIA AND VARIA
+1F5D          ; Greek # L&       GREEK CAPITAL LETTER UPSILON WITH DASIA AND OXIA
+1F5F..1F7D    ; Greek # L&  [31] GREEK CAPITAL LETTER UPSILON WITH DASIA AND PERISPOMENI..GREEK SMALL LETTER OMEGA WITH OXIA
+1F80..1FB4    ; Greek # L&  [53] GREEK SMALL LETTER ALPHA WITH PSILI AND YPOGEGRAMMENI..GREEK SMALL LETTER ALPHA WITH OXIA AND YPOGEGRAMMENI
+1FB6..1FBC    ; Greek # L&   [7] GREEK SMALL LETTER ALPHA WITH PERISPOMENI..GREEK CAPITAL LETTER ALPHA WITH PROSGEGRAMMENI
+1FBD          ; Greek # Sk       GREEK KORONIS
+1FBE          ; Greek # L&       GREEK PROSGEGRAMMENI
+1FBF..1FC1    ; Greek # Sk   [3] GREEK PSILI..GREEK DIALYTIKA AND PERISPOMENI
+1FC2..1FC4    ; Greek # L&   [3] GREEK SMALL LETTER ETA WITH VARIA AND YPOGEGRAMMENI..GREEK SMALL LETTER ETA WITH OXIA AND YPOGEGRAMMENI
+1FC6..1FCC    ; Greek # L&   [7] GREEK SMALL LETTER ETA WITH PERISPOMENI..GREEK CAPITAL LETTER ETA WITH PROSGEGRAMMENI
+1FCD..1FCF    ; Greek # Sk   [3] GREEK PSILI AND VARIA..GREEK PSILI AND PERISPOMENI
+1FD0..1FD3    ; Greek # L&   [4] GREEK SMALL LETTER IOTA WITH VRACHY..GREEK SMALL LETTER IOTA WITH DIALYTIKA AND OXIA
+1FD6..1FDB    ; Greek # L&   [6] GREEK SMALL LETTER IOTA WITH PERISPOMENI..GREEK CAPITAL LETTER IOTA WITH OXIA
+1FDD..1FDF    ; Greek # Sk   [3] GREEK DASIA AND VARIA..GREEK DASIA AND PERISPOMENI
+1FE0..1FEC    ; Greek # L&  [13] GREEK SMALL LETTER UPSILON WITH VRACHY..GREEK CAPITAL LETTER RHO WITH DASIA
+1FED..1FEF    ; Greek # Sk   [3] GREEK DIALYTIKA AND VARIA..GREEK VARIA
+1FF2..1FF4    ; Greek # L&   [3] GREEK SMALL LETTER OMEGA WITH VARIA AND YPOGEGRAMMENI..GREEK SMALL LETTER OMEGA WITH OXIA AND YPOGEGRAMMENI
+1FF6..1FFC    ; Greek # L&   [7] GREEK SMALL LETTER OMEGA WITH PERISPOMENI..GREEK CAPITAL LETTER OMEGA WITH PROSGEGRAMMENI
+1FFD..1FFE    ; Greek # Sk   [2] GREEK OXIA..GREEK DASIA
+2126          ; Greek # L&       OHM SIGN
+10140..10174  ; Greek # Nl  [53] GREEK ACROPHONIC ATTIC ONE QUARTER..GREEK ACROPHONIC STRATIAN FIFTY MNAS
+10175..10178  ; Greek # No   [4] GREEK ONE HALF SIGN..GREEK THREE QUARTERS SIGN
+10179..10189  ; Greek # So  [17] GREEK YEAR SIGN..GREEK TRYBLION BASE SIGN
+1018A         ; Greek # No       GREEK ZERO SIGN
+1D200..1D241  ; Greek # So  [66] GREEK VOCAL NOTATION SYMBOL-1..GREEK INSTRUMENTAL NOTATION SYMBOL-54
+1D242..1D244  ; Greek # Mn   [3] COMBINING GREEK MUSICAL TRISEME..COMBINING GREEK MUSICAL PENTASEME
+1D245         ; Greek # So       GREEK MUSICAL LEIMMA
+
+# Total code points: 511
+
+# ================================================
+
+0400..0481    ; Cyrillic # L& [130] CYRILLIC CAPITAL LETTER IE WITH GRAVE..CYRILLIC SMALL LETTER KOPPA
+0482          ; Cyrillic # So       CYRILLIC THOUSANDS SIGN
+0483..0484    ; Cyrillic # Mn   [2] COMBINING CYRILLIC TITLO..COMBINING CYRILLIC PALATALIZATION
+0487          ; Cyrillic # Mn       COMBINING CYRILLIC POKRYTIE
+0488..0489    ; Cyrillic # Me   [2] COMBINING CYRILLIC HUNDRED THOUSANDS SIGN..COMBINING CYRILLIC MILLIONS SIGN
+048A..0525    ; Cyrillic # L& [156] CYRILLIC CAPITAL LETTER SHORT I WITH TAIL..CYRILLIC SMALL LETTER PE WITH DESCENDER
+1D2B          ; Cyrillic # L&       CYRILLIC LETTER SMALL CAPITAL EL
+1D78          ; Cyrillic # Lm       MODIFIER LETTER CYRILLIC EN
+2DE0..2DFF    ; Cyrillic # Mn  [32] COMBINING CYRILLIC LETTER BE..COMBINING CYRILLIC LETTER IOTIFIED BIG YUS
+A640..A65F    ; Cyrillic # L&  [32] CYRILLIC CAPITAL LETTER ZEMLYA..CYRILLIC SMALL LETTER YN
+A662..A66D    ; Cyrillic # L&  [12] CYRILLIC CAPITAL LETTER SOFT DE..CYRILLIC SMALL LETTER DOUBLE MONOCULAR O
+A66E          ; Cyrillic # Lo       CYRILLIC LETTER MULTIOCULAR O
+A66F          ; Cyrillic # Mn       COMBINING CYRILLIC VZMET
+A670..A672    ; Cyrillic # Me   [3] COMBINING CYRILLIC TEN MILLIONS SIGN..COMBINING CYRILLIC THOUSAND MILLIONS SIGN
+A673          ; Cyrillic # Po       SLAVONIC ASTERISK
+A67C..A67D    ; Cyrillic # Mn   [2] COMBINING CYRILLIC KAVYKA..COMBINING CYRILLIC PAYEROK
+A67E          ; Cyrillic # Po       CYRILLIC KAVYKA
+A67F          ; Cyrillic # Lm       CYRILLIC PAYEROK
+A680..A697    ; Cyrillic # L&  [24] CYRILLIC CAPITAL LETTER DWE..CYRILLIC SMALL LETTER SHWE
+
+# Total code points: 404
+
+# ================================================
+
+0531..0556    ; Armenian # L&  [38] ARMENIAN CAPITAL LETTER AYB..ARMENIAN CAPITAL LETTER FEH
+0559          ; Armenian # Lm       ARMENIAN MODIFIER LETTER LEFT HALF RING
+055A..055F    ; Armenian # Po   [6] ARMENIAN APOSTROPHE..ARMENIAN ABBREVIATION MARK
+0561..0587    ; Armenian # L&  [39] ARMENIAN SMALL LETTER AYB..ARMENIAN SMALL LIGATURE ECH YIWN
+058A          ; Armenian # Pd       ARMENIAN HYPHEN
+FB13..FB17    ; Armenian # L&   [5] ARMENIAN SMALL LIGATURE MEN NOW..ARMENIAN SMALL LIGATURE MEN XEH
+
+# Total code points: 90
+
+# ================================================
+
+0591..05BD    ; Hebrew # Mn  [45] HEBREW ACCENT ETNAHTA..HEBREW POINT METEG
+05BE          ; Hebrew # Pd       HEBREW PUNCTUATION MAQAF
+05BF          ; Hebrew # Mn       HEBREW POINT RAFE
+05C0          ; Hebrew # Po       HEBREW PUNCTUATION PASEQ
+05C1..05C2    ; Hebrew # Mn   [2] HEBREW POINT SHIN DOT..HEBREW POINT SIN DOT
+05C3          ; Hebrew # Po       HEBREW PUNCTUATION SOF PASUQ
+05C4..05C5    ; Hebrew # Mn   [2] HEBREW MARK UPPER DOT..HEBREW MARK LOWER DOT
+05C6          ; Hebrew # Po       HEBREW PUNCTUATION NUN HAFUKHA
+05C7          ; Hebrew # Mn       HEBREW POINT QAMATS QATAN
+05D0..05EA    ; Hebrew # Lo  [27] HEBREW LETTER ALEF..HEBREW LETTER TAV
+05F0..05F2    ; Hebrew # Lo   [3] HEBREW LIGATURE YIDDISH DOUBLE VAV..HEBREW LIGATURE YIDDISH DOUBLE YOD
+05F3..05F4    ; Hebrew # Po   [2] HEBREW PUNCTUATION GERESH..HEBREW PUNCTUATION GERSHAYIM
+FB1D          ; Hebrew # Lo       HEBREW LETTER YOD WITH HIRIQ
+FB1E          ; Hebrew # Mn       HEBREW POINT JUDEO-SPANISH VARIKA
+FB1F..FB28    ; Hebrew # Lo  [10] HEBREW LIGATURE YIDDISH YOD YOD PATAH..HEBREW LETTER WIDE TAV
+FB29          ; Hebrew # Sm       HEBREW LETTER ALTERNATIVE PLUS SIGN
+FB2A..FB36    ; Hebrew # Lo  [13] HEBREW LETTER SHIN WITH SHIN DOT..HEBREW LETTER ZAYIN WITH DAGESH
+FB38..FB3C    ; Hebrew # Lo   [5] HEBREW LETTER TET WITH DAGESH..HEBREW LETTER LAMED WITH DAGESH
+FB3E          ; Hebrew # Lo       HEBREW LETTER MEM WITH DAGESH
+FB40..FB41    ; Hebrew # Lo   [2] HEBREW LETTER NUN WITH DAGESH..HEBREW LETTER SAMEKH WITH DAGESH
+FB43..FB44    ; Hebrew # Lo   [2] HEBREW LETTER FINAL PE WITH DAGESH..HEBREW LETTER PE WITH DAGESH
+FB46..FB4F    ; Hebrew # Lo  [10] HEBREW LETTER TSADI WITH DAGESH..HEBREW LIGATURE ALEF LAMED
+
+# Total code points: 133
+
+# ================================================
+
+0606..0608    ; Arabic # Sm   [3] ARABIC-INDIC CUBE ROOT..ARABIC RAY
+0609..060A    ; Arabic # Po   [2] ARABIC-INDIC PER MILLE SIGN..ARABIC-INDIC PER TEN THOUSAND SIGN
+060B          ; Arabic # Sc       AFGHANI SIGN
+060D          ; Arabic # Po       ARABIC DATE SEPARATOR
+060E..060F    ; Arabic # So   [2] ARABIC POETIC VERSE SIGN..ARABIC SIGN MISRA
+0610..061A    ; Arabic # Mn  [11] ARABIC SIGN SALLALLAHOU ALAYHE WASSALLAM..ARABIC SMALL KASRA
+061E          ; Arabic # Po       ARABIC TRIPLE DOT PUNCTUATION MARK
+0621..063F    ; Arabic # Lo  [31] ARABIC LETTER HAMZA..ARABIC LETTER FARSI YEH WITH THREE DOTS ABOVE
+0641..064A    ; Arabic # Lo  [10] ARABIC LETTER FEH..ARABIC LETTER YEH
+0656..065E    ; Arabic # Mn   [9] ARABIC SUBSCRIPT ALEF..ARABIC FATHA WITH TWO DOTS
+066A..066D    ; Arabic # Po   [4] ARABIC PERCENT SIGN..ARABIC FIVE POINTED STAR
+066E..066F    ; Arabic # Lo   [2] ARABIC LETTER DOTLESS BEH..ARABIC LETTER DOTLESS QAF
+0671..06D3    ; Arabic # Lo  [99] ARABIC LETTER ALEF WASLA..ARABIC LETTER YEH BARREE WITH HAMZA ABOVE
+06D4          ; Arabic # Po       ARABIC FULL STOP
+06D5          ; Arabic # Lo       ARABIC LETTER AE
+06D6..06DC    ; Arabic # Mn   [7] ARABIC SMALL HIGH LIGATURE SAD WITH LAM WITH ALEF MAKSURA..ARABIC SMALL HIGH SEEN
+06DE          ; Arabic # Me       ARABIC START OF RUB EL HIZB
+06DF..06E4    ; Arabic # Mn   [6] ARABIC SMALL HIGH ROUNDED ZERO..ARABIC SMALL HIGH MADDA
+06E5..06E6    ; Arabic # Lm   [2] ARABIC SMALL WAW..ARABIC SMALL YEH
+06E7..06E8    ; Arabic # Mn   [2] ARABIC SMALL HIGH YEH..ARABIC SMALL HIGH NOON
+06E9          ; Arabic # So       ARABIC PLACE OF SAJDAH
+06EA..06ED    ; Arabic # Mn   [4] ARABIC EMPTY CENTRE LOW STOP..ARABIC SMALL LOW MEEM
+06EE..06EF    ; Arabic # Lo   [2] ARABIC LETTER DAL WITH INVERTED V..ARABIC LETTER REH WITH INVERTED V
+06F0..06F9    ; Arabic # Nd  [10] EXTENDED ARABIC-INDIC DIGIT ZERO..EXTENDED ARABIC-INDIC DIGIT NINE
+06FA..06FC    ; Arabic # Lo   [3] ARABIC LETTER SHEEN WITH DOT BELOW..ARABIC LETTER GHAIN WITH DOT BELOW
+06FD..06FE    ; Arabic # So   [2] ARABIC SIGN SINDHI AMPERSAND..ARABIC SIGN SINDHI POSTPOSITION MEN
+06FF          ; Arabic # Lo       ARABIC LETTER HEH WITH INVERTED V
+0750..077F    ; Arabic # Lo  [48] ARABIC LETTER BEH WITH THREE DOTS HORIZONTALLY BELOW..ARABIC LETTER KAF WITH TWO DOTS ABOVE
+FB50..FBB1    ; Arabic # Lo  [98] ARABIC LETTER ALEF WASLA ISOLATED FORM..ARABIC LETTER YEH BARREE WITH HAMZA ABOVE FINAL FORM
+FBD3..FD3D    ; Arabic # Lo [363] ARABIC LETTER NG ISOLATED FORM..ARABIC LIGATURE ALEF WITH FATHATAN ISOLATED FORM
+FD50..FD8F    ; Arabic # Lo  [64] ARABIC LIGATURE TEH WITH JEEM WITH MEEM INITIAL FORM..ARABIC LIGATURE MEEM WITH KHAH WITH MEEM INITIAL FORM
+FD92..FDC7    ; Arabic # Lo  [54] ARABIC LIGATURE MEEM WITH JEEM WITH KHAH INITIAL FORM..ARABIC LIGATURE NOON WITH JEEM WITH YEH FINAL FORM
+FDF0..FDFB    ; Arabic # Lo  [12] ARABIC LIGATURE SALLA USED AS KORANIC STOP SIGN ISOLATED FORM..ARABIC LIGATURE JALLAJALALOUHOU
+FDFC          ; Arabic # Sc       RIAL SIGN
+FE70..FE74    ; Arabic # Lo   [5] ARABIC FATHATAN ISOLATED FORM..ARABIC KASRATAN ISOLATED FORM
+FE76..FEFC    ; Arabic # Lo [135] ARABIC FATHA ISOLATED FORM..ARABIC LIGATURE LAM WITH ALEF FINAL FORM
+10E60..10E7E  ; Arabic # No  [31] RUMI DIGIT ONE..RUMI FRACTION TWO THIRDS
+
+# Total code points: 1030
+
+# ================================================
+
+0700..070D    ; Syriac # Po  [14] SYRIAC END OF PARAGRAPH..SYRIAC HARKLEAN ASTERISCUS
+070F          ; Syriac # Cf       SYRIAC ABBREVIATION MARK
+0710          ; Syriac # Lo       SYRIAC LETTER ALAPH
+0711          ; Syriac # Mn       SYRIAC LETTER SUPERSCRIPT ALAPH
+0712..072F    ; Syriac # Lo  [30] SYRIAC LETTER BETH..SYRIAC LETTER PERSIAN DHALATH
+0730..074A    ; Syriac # Mn  [27] SYRIAC PTHAHA ABOVE..SYRIAC BARREKH
+074D..074F    ; Syriac # Lo   [3] SYRIAC LETTER SOGDIAN ZHAIN..SYRIAC LETTER SOGDIAN FE
+
+# Total code points: 77
+
+# ================================================
+
+0780..07A5    ; Thaana # Lo  [38] THAANA LETTER HAA..THAANA LETTER WAAVU
+07A6..07B0    ; Thaana # Mn  [11] THAANA ABAFILI..THAANA SUKUN
+07B1          ; Thaana # Lo       THAANA LETTER NAA
+
+# Total code points: 50
+
+# ================================================
+
+0900..0902    ; Devanagari # Mn   [3] DEVANAGARI SIGN INVERTED CANDRABINDU..DEVANAGARI SIGN ANUSVARA
+0903          ; Devanagari # Mc       DEVANAGARI SIGN VISARGA
+0904..0939    ; Devanagari # Lo  [54] DEVANAGARI LETTER SHORT A..DEVANAGARI LETTER HA
+093C          ; Devanagari # Mn       DEVANAGARI SIGN NUKTA
+093D          ; Devanagari # Lo       DEVANAGARI SIGN AVAGRAHA
+093E..0940    ; Devanagari # Mc   [3] DEVANAGARI VOWEL SIGN AA..DEVANAGARI VOWEL SIGN II
+0941..0948    ; Devanagari # Mn   [8] DEVANAGARI VOWEL SIGN U..DEVANAGARI VOWEL SIGN AI
+0949..094C    ; Devanagari # Mc   [4] DEVANAGARI VOWEL SIGN CANDRA O..DEVANAGARI VOWEL SIGN AU
+094D          ; Devanagari # Mn       DEVANAGARI SIGN VIRAMA
+094E          ; Devanagari # Mc       DEVANAGARI VOWEL SIGN PRISHTHAMATRA E
+0950          ; Devanagari # Lo       DEVANAGARI OM
+0953..0955    ; Devanagari # Mn   [3] DEVANAGARI GRAVE ACCENT..DEVANAGARI VOWEL SIGN CANDRA LONG E
+0958..0961    ; Devanagari # Lo  [10] DEVANAGARI LETTER QA..DEVANAGARI LETTER VOCALIC LL
+0962..0963    ; Devanagari # Mn   [2] DEVANAGARI VOWEL SIGN VOCALIC L..DEVANAGARI VOWEL SIGN VOCALIC LL
+0966..096F    ; Devanagari # Nd  [10] DEVANAGARI DIGIT ZERO..DEVANAGARI DIGIT NINE
+0971          ; Devanagari # Lm       DEVANAGARI SIGN HIGH SPACING DOT
+0972          ; Devanagari # Lo       DEVANAGARI LETTER CANDRA A
+0979..097F    ; Devanagari # Lo   [7] DEVANAGARI LETTER ZHA..DEVANAGARI LETTER BBA
+A8E0..A8F1    ; Devanagari # Mn  [18] COMBINING DEVANAGARI DIGIT ZERO..COMBINING DEVANAGARI SIGN AVAGRAHA
+A8F2..A8F7    ; Devanagari # Lo   [6] DEVANAGARI SIGN SPACING CANDRABINDU..DEVANAGARI SIGN CANDRABINDU AVAGRAHA
+A8F8..A8FA    ; Devanagari # Po   [3] DEVANAGARI SIGN PUSHPIKA..DEVANAGARI CARET
+A8FB          ; Devanagari # Lo       DEVANAGARI HEADSTROKE
+
+# Total code points: 140
+
+# ================================================
+
+0981          ; Bengali # Mn       BENGALI SIGN CANDRABINDU
+0982..0983    ; Bengali # Mc   [2] BENGALI SIGN ANUSVARA..BENGALI SIGN VISARGA
+0985..098C    ; Bengali # Lo   [8] BENGALI LETTER A..BENGALI LETTER VOCALIC L
+098F..0990    ; Bengali # Lo   [2] BENGALI LETTER E..BENGALI LETTER AI
+0993..09A8    ; Bengali # Lo  [22] BENGALI LETTER O..BENGALI LETTER NA
+09AA..09B0    ; Bengali # Lo   [7] BENGALI LETTER PA..BENGALI LETTER RA
+09B2          ; Bengali # Lo       BENGALI LETTER LA
+09B6..09B9    ; Bengali # Lo   [4] BENGALI LETTER SHA..BENGALI LETTER HA
+09BC          ; Bengali # Mn       BENGALI SIGN NUKTA
+09BD          ; Bengali # Lo       BENGALI SIGN AVAGRAHA
+09BE..09C0    ; Bengali # Mc   [3] BENGALI VOWEL SIGN AA..BENGALI VOWEL SIGN II
+09C1..09C4    ; Bengali # Mn   [4] BENGALI VOWEL SIGN U..BENGALI VOWEL SIGN VOCALIC RR
+09C7..09C8    ; Bengali # Mc   [2] BENGALI VOWEL SIGN E..BENGALI VOWEL SIGN AI
+09CB..09CC    ; Bengali # Mc   [2] BENGALI VOWEL SIGN O..BENGALI VOWEL SIGN AU
+09CD          ; Bengali # Mn       BENGALI SIGN VIRAMA
+09CE          ; Bengali # Lo       BENGALI LETTER KHANDA TA
+09D7          ; Bengali # Mc       BENGALI AU LENGTH MARK
+09DC..09DD    ; Bengali # Lo   [2] BENGALI LETTER RRA..BENGALI LETTER RHA
+09DF..09E1    ; Bengali # Lo   [3] BENGALI LETTER YYA..BENGALI LETTER VOCALIC LL
+09E2..09E3    ; Bengali # Mn   [2] BENGALI VOWEL SIGN VOCALIC L..BENGALI VOWEL SIGN VOCALIC LL
+09E6..09EF    ; Bengali # Nd  [10] BENGALI DIGIT ZERO..BENGALI DIGIT NINE
+09F0..09F1    ; Bengali # Lo   [2] BENGALI LETTER RA WITH MIDDLE DIAGONAL..BENGALI LETTER RA WITH LOWER DIAGONAL
+09F2..09F3    ; Bengali # Sc   [2] BENGALI RUPEE MARK..BENGALI RUPEE SIGN
+09F4..09F9    ; Bengali # No   [6] BENGALI CURRENCY NUMERATOR ONE..BENGALI CURRENCY DENOMINATOR SIXTEEN
+09FA          ; Bengali # So       BENGALI ISSHAR
+09FB          ; Bengali # Sc       BENGALI GANDA MARK
+
+# Total code points: 92
+
+# ================================================
+
+0A01..0A02    ; Gurmukhi # Mn   [2] GURMUKHI SIGN ADAK BINDI..GURMUKHI SIGN BINDI
+0A03          ; Gurmukhi # Mc       GURMUKHI SIGN VISARGA
+0A05..0A0A    ; Gurmukhi # Lo   [6] GURMUKHI LETTER A..GURMUKHI LETTER UU
+0A0F..0A10    ; Gurmukhi # Lo   [2] GURMUKHI LETTER EE..GURMUKHI LETTER AI
+0A13..0A28    ; Gurmukhi # Lo  [22] GURMUKHI LETTER OO..GURMUKHI LETTER NA
+0A2A..0A30    ; Gurmukhi # Lo   [7] GURMUKHI LETTER PA..GURMUKHI LETTER RA
+0A32..0A33    ; Gurmukhi # Lo   [2] GURMUKHI LETTER LA..GURMUKHI LETTER LLA
+0A35..0A36    ; Gurmukhi # Lo   [2] GURMUKHI LETTER VA..GURMUKHI LETTER SHA
+0A38..0A39    ; Gurmukhi # Lo   [2] GURMUKHI LETTER SA..GURMUKHI LETTER HA
+0A3C          ; Gurmukhi # Mn       GURMUKHI SIGN NUKTA
+0A3E..0A40    ; Gurmukhi # Mc   [3] GURMUKHI VOWEL SIGN AA..GURMUKHI VOWEL SIGN II
+0A41..0A42    ; Gurmukhi # Mn   [2] GURMUKHI VOWEL SIGN U..GURMUKHI VOWEL SIGN UU
+0A47..0A48    ; Gurmukhi # Mn   [2] GURMUKHI VOWEL SIGN EE..GURMUKHI VOWEL SIGN AI
+0A4B..0A4D    ; Gurmukhi # Mn   [3] GURMUKHI VOWEL SIGN OO..GURMUKHI SIGN VIRAMA
+0A51          ; Gurmukhi # Mn       GURMUKHI SIGN UDAAT
+0A59..0A5C    ; Gurmukhi # Lo   [4] GURMUKHI LETTER KHHA..GURMUKHI LETTER RRA
+0A5E          ; Gurmukhi # Lo       GURMUKHI LETTER FA
+0A66..0A6F    ; Gurmukhi # Nd  [10] GURMUKHI DIGIT ZERO..GURMUKHI DIGIT NINE
+0A70..0A71    ; Gurmukhi # Mn   [2] GURMUKHI TIPPI..GURMUKHI ADDAK
+0A72..0A74    ; Gurmukhi # Lo   [3] GURMUKHI IRI..GURMUKHI EK ONKAR
+0A75          ; Gurmukhi # Mn       GURMUKHI SIGN YAKASH
+
+# Total code points: 79
+
+# ================================================
+
+0A81..0A82    ; Gujarati # Mn   [2] GUJARATI SIGN CANDRABINDU..GUJARATI SIGN ANUSVARA
+0A83          ; Gujarati # Mc       GUJARATI SIGN VISARGA
+0A85..0A8D    ; Gujarati # Lo   [9] GUJARATI LETTER A..GUJARATI VOWEL CANDRA E
+0A8F..0A91    ; Gujarati # Lo   [3] GUJARATI LETTER E..GUJARATI VOWEL CANDRA O
+0A93..0AA8    ; Gujarati # Lo  [22] GUJARATI LETTER O..GUJARATI LETTER NA
+0AAA..0AB0    ; Gujarati # Lo   [7] GUJARATI LETTER PA..GUJARATI LETTER RA
+0AB2..0AB3    ; Gujarati # Lo   [2] GUJARATI LETTER LA..GUJARATI LETTER LLA
+0AB5..0AB9    ; Gujarati # Lo   [5] GUJARATI LETTER VA..GUJARATI LETTER HA
+0ABC          ; Gujarati # Mn       GUJARATI SIGN NUKTA
+0ABD          ; Gujarati # Lo       GUJARATI SIGN AVAGRAHA
+0ABE..0AC0    ; Gujarati # Mc   [3] GUJARATI VOWEL SIGN AA..GUJARATI VOWEL SIGN II
+0AC1..0AC5    ; Gujarati # Mn   [5] GUJARATI VOWEL SIGN U..GUJARATI VOWEL SIGN CANDRA E
+0AC7..0AC8    ; Gujarati # Mn   [2] GUJARATI VOWEL SIGN E..GUJARATI VOWEL SIGN AI
+0AC9          ; Gujarati # Mc       GUJARATI VOWEL SIGN CANDRA O
+0ACB..0ACC    ; Gujarati # Mc   [2] GUJARATI VOWEL SIGN O..GUJARATI VOWEL SIGN AU
+0ACD          ; Gujarati # Mn       GUJARATI SIGN VIRAMA
+0AD0          ; Gujarati # Lo       GUJARATI OM
+0AE0..0AE1    ; Gujarati # Lo   [2] GUJARATI LETTER VOCALIC RR..GUJARATI LETTER VOCALIC LL
+0AE2..0AE3    ; Gujarati # Mn   [2] GUJARATI VOWEL SIGN VOCALIC L..GUJARATI VOWEL SIGN VOCALIC LL
+0AE6..0AEF    ; Gujarati # Nd  [10] GUJARATI DIGIT ZERO..GUJARATI DIGIT NINE
+0AF1          ; Gujarati # Sc       GUJARATI RUPEE SIGN
+
+# Total code points: 83
+
+# ================================================
+
+0B01          ; Oriya # Mn       ORIYA SIGN CANDRABINDU
+0B02..0B03    ; Oriya # Mc   [2] ORIYA SIGN ANUSVARA..ORIYA SIGN VISARGA
+0B05..0B0C    ; Oriya # Lo   [8] ORIYA LETTER A..ORIYA LETTER VOCALIC L
+0B0F..0B10    ; Oriya # Lo   [2] ORIYA LETTER E..ORIYA LETTER AI
+0B13..0B28    ; Oriya # Lo  [22] ORIYA LETTER O..ORIYA LETTER NA
+0B2A..0B30    ; Oriya # Lo   [7] ORIYA LETTER PA..ORIYA LETTER RA
+0B32..0B33    ; Oriya # Lo   [2] ORIYA LETTER LA..ORIYA LETTER LLA
+0B35..0B39    ; Oriya # Lo   [5] ORIYA LETTER VA..ORIYA LETTER HA
+0B3C          ; Oriya # Mn       ORIYA SIGN NUKTA
+0B3D          ; Oriya # Lo       ORIYA SIGN AVAGRAHA
+0B3E          ; Oriya # Mc       ORIYA VOWEL SIGN AA
+0B3F          ; Oriya # Mn       ORIYA VOWEL SIGN I
+0B40          ; Oriya # Mc       ORIYA VOWEL SIGN II
+0B41..0B44    ; Oriya # Mn   [4] ORIYA VOWEL SIGN U..ORIYA VOWEL SIGN VOCALIC RR
+0B47..0B48    ; Oriya # Mc   [2] ORIYA VOWEL SIGN E..ORIYA VOWEL SIGN AI
+0B4B..0B4C    ; Oriya # Mc   [2] ORIYA VOWEL SIGN O..ORIYA VOWEL SIGN AU
+0B4D          ; Oriya # Mn       ORIYA SIGN VIRAMA
+0B56          ; Oriya # Mn       ORIYA AI LENGTH MARK
+0B57          ; Oriya # Mc       ORIYA AU LENGTH MARK
+0B5C..0B5D    ; Oriya # Lo   [2] ORIYA LETTER RRA..ORIYA LETTER RHA
+0B5F..0B61    ; Oriya # Lo   [3] ORIYA LETTER YYA..ORIYA LETTER VOCALIC LL
+0B62..0B63    ; Oriya # Mn   [2] ORIYA VOWEL SIGN VOCALIC L..ORIYA VOWEL SIGN VOCALIC LL
+0B66..0B6F    ; Oriya # Nd  [10] ORIYA DIGIT ZERO..ORIYA DIGIT NINE
+0B70          ; Oriya # So       ORIYA ISSHAR
+0B71          ; Oriya # Lo       ORIYA LETTER WA
+
+# Total code points: 84
+
+# ================================================
+
+0B82          ; Tamil # Mn       TAMIL SIGN ANUSVARA
+0B83          ; Tamil # Lo       TAMIL SIGN VISARGA
+0B85..0B8A    ; Tamil # Lo   [6] TAMIL LETTER A..TAMIL LETTER UU
+0B8E..0B90    ; Tamil # Lo   [3] TAMIL LETTER E..TAMIL LETTER AI
+0B92..0B95    ; Tamil # Lo   [4] TAMIL LETTER O..TAMIL LETTER KA
+0B99..0B9A    ; Tamil # Lo   [2] TAMIL LETTER NGA..TAMIL LETTER CA
+0B9C          ; Tamil # Lo       TAMIL LETTER JA
+0B9E..0B9F    ; Tamil # Lo   [2] TAMIL LETTER NYA..TAMIL LETTER TTA
+0BA3..0BA4    ; Tamil # Lo   [2] TAMIL LETTER NNA..TAMIL LETTER TA
+0BA8..0BAA    ; Tamil # Lo   [3] TAMIL LETTER NA..TAMIL LETTER PA
+0BAE..0BB9    ; Tamil # Lo  [12] TAMIL LETTER MA..TAMIL LETTER HA
+0BBE..0BBF    ; Tamil # Mc   [2] TAMIL VOWEL SIGN AA..TAMIL VOWEL SIGN I
+0BC0          ; Tamil # Mn       TAMIL VOWEL SIGN II
+0BC1..0BC2    ; Tamil # Mc   [2] TAMIL VOWEL SIGN U..TAMIL VOWEL SIGN UU
+0BC6..0BC8    ; Tamil # Mc   [3] TAMIL VOWEL SIGN E..TAMIL VOWEL SIGN AI
+0BCA..0BCC    ; Tamil # Mc   [3] TAMIL VOWEL SIGN O..TAMIL VOWEL SIGN AU
+0BCD          ; Tamil # Mn       TAMIL SIGN VIRAMA
+0BD0          ; Tamil # Lo       TAMIL OM
+0BD7          ; Tamil # Mc       TAMIL AU LENGTH MARK
+0BE6..0BEF    ; Tamil # Nd  [10] TAMIL DIGIT ZERO..TAMIL DIGIT NINE
+0BF0..0BF2    ; Tamil # No   [3] TAMIL NUMBER TEN..TAMIL NUMBER ONE THOUSAND
+0BF3..0BF8    ; Tamil # So   [6] TAMIL DAY SIGN..TAMIL AS ABOVE SIGN
+0BF9          ; Tamil # Sc       TAMIL RUPEE SIGN
+0BFA          ; Tamil # So       TAMIL NUMBER SIGN
+
+# Total code points: 72
+
+# ================================================
+
+0C01..0C03    ; Telugu # Mc   [3] TELUGU SIGN CANDRABINDU..TELUGU SIGN VISARGA
+0C05..0C0C    ; Telugu # Lo   [8] TELUGU LETTER A..TELUGU LETTER VOCALIC L
+0C0E..0C10    ; Telugu # Lo   [3] TELUGU LETTER E..TELUGU LETTER AI
+0C12..0C28    ; Telugu # Lo  [23] TELUGU LETTER O..TELUGU LETTER NA
+0C2A..0C33    ; Telugu # Lo  [10] TELUGU LETTER PA..TELUGU LETTER LLA
+0C35..0C39    ; Telugu # Lo   [5] TELUGU LETTER VA..TELUGU LETTER HA
+0C3D          ; Telugu # Lo       TELUGU SIGN AVAGRAHA
+0C3E..0C40    ; Telugu # Mn   [3] TELUGU VOWEL SIGN AA..TELUGU VOWEL SIGN II
+0C41..0C44    ; Telugu # Mc   [4] TELUGU VOWEL SIGN U..TELUGU VOWEL SIGN VOCALIC RR
+0C46..0C48    ; Telugu # Mn   [3] TELUGU VOWEL SIGN E..TELUGU VOWEL SIGN AI
+0C4A..0C4D    ; Telugu # Mn   [4] TELUGU VOWEL SIGN O..TELUGU SIGN VIRAMA
+0C55..0C56    ; Telugu # Mn   [2] TELUGU LENGTH MARK..TELUGU AI LENGTH MARK
+0C58..0C59    ; Telugu # Lo   [2] TELUGU LETTER TSA..TELUGU LETTER DZA
+0C60..0C61    ; Telugu # Lo   [2] TELUGU LETTER VOCALIC RR..TELUGU LETTER VOCALIC LL
+0C62..0C63    ; Telugu # Mn   [2] TELUGU VOWEL SIGN VOCALIC L..TELUGU VOWEL SIGN VOCALIC LL
+0C66..0C6F    ; Telugu # Nd  [10] TELUGU DIGIT ZERO..TELUGU DIGIT NINE
+0C78..0C7E    ; Telugu # No   [7] TELUGU FRACTION DIGIT ZERO FOR ODD POWERS OF FOUR..TELUGU FRACTION DIGIT THREE FOR EVEN POWERS OF FOUR
+0C7F          ; Telugu # So       TELUGU SIGN TUUMU
+
+# Total code points: 93
+
+# ================================================
+
+0C82..0C83    ; Kannada # Mc   [2] KANNADA SIGN ANUSVARA..KANNADA SIGN VISARGA
+0C85..0C8C    ; Kannada # Lo   [8] KANNADA LETTER A..KANNADA LETTER VOCALIC L
+0C8E..0C90    ; Kannada # Lo   [3] KANNADA LETTER E..KANNADA LETTER AI
+0C92..0CA8    ; Kannada # Lo  [23] KANNADA LETTER O..KANNADA LETTER NA
+0CAA..0CB3    ; Kannada # Lo  [10] KANNADA LETTER PA..KANNADA LETTER LLA
+0CB5..0CB9    ; Kannada # Lo   [5] KANNADA LETTER VA..KANNADA LETTER HA
+0CBC          ; Kannada # Mn       KANNADA SIGN NUKTA
+0CBD          ; Kannada # Lo       KANNADA SIGN AVAGRAHA
+0CBE          ; Kannada # Mc       KANNADA VOWEL SIGN AA
+0CBF          ; Kannada # Mn       KANNADA VOWEL SIGN I
+0CC0..0CC4    ; Kannada # Mc   [5] KANNADA VOWEL SIGN II..KANNADA VOWEL SIGN VOCALIC RR
+0CC6          ; Kannada # Mn       KANNADA VOWEL SIGN E
+0CC7..0CC8    ; Kannada # Mc   [2] KANNADA VOWEL SIGN EE..KANNADA VOWEL SIGN AI
+0CCA..0CCB    ; Kannada # Mc   [2] KANNADA VOWEL SIGN O..KANNADA VOWEL SIGN OO
+0CCC..0CCD    ; Kannada # Mn   [2] KANNADA VOWEL SIGN AU..KANNADA SIGN VIRAMA
+0CD5..0CD6    ; Kannada # Mc   [2] KANNADA LENGTH MARK..KANNADA AI LENGTH MARK
+0CDE          ; Kannada # Lo       KANNADA LETTER FA
+0CE0..0CE1    ; Kannada # Lo   [2] KANNADA LETTER VOCALIC RR..KANNADA LETTER VOCALIC LL
+0CE2..0CE3    ; Kannada # Mn   [2] KANNADA VOWEL SIGN VOCALIC L..KANNADA VOWEL SIGN VOCALIC LL
+0CE6..0CEF    ; Kannada # Nd  [10] KANNADA DIGIT ZERO..KANNADA DIGIT NINE
+
+# Total code points: 84
+
+# ================================================
+
+0D02..0D03    ; Malayalam # Mc   [2] MALAYALAM SIGN ANUSVARA..MALAYALAM SIGN VISARGA
+0D05..0D0C    ; Malayalam # Lo   [8] MALAYALAM LETTER A..MALAYALAM LETTER VOCALIC L
+0D0E..0D10    ; Malayalam # Lo   [3] MALAYALAM LETTER E..MALAYALAM LETTER AI
+0D12..0D28    ; Malayalam # Lo  [23] MALAYALAM LETTER O..MALAYALAM LETTER NA
+0D2A..0D39    ; Malayalam # Lo  [16] MALAYALAM LETTER PA..MALAYALAM LETTER HA
+0D3D          ; Malayalam # Lo       MALAYALAM SIGN AVAGRAHA
+0D3E..0D40    ; Malayalam # Mc   [3] MALAYALAM VOWEL SIGN AA..MALAYALAM VOWEL SIGN II
+0D41..0D44    ; Malayalam # Mn   [4] MALAYALAM VOWEL SIGN U..MALAYALAM VOWEL SIGN VOCALIC RR
+0D46..0D48    ; Malayalam # Mc   [3] MALAYALAM VOWEL SIGN E..MALAYALAM VOWEL SIGN AI
+0D4A..0D4C    ; Malayalam # Mc   [3] MALAYALAM VOWEL SIGN O..MALAYALAM VOWEL SIGN AU
+0D4D          ; Malayalam # Mn       MALAYALAM SIGN VIRAMA
+0D57          ; Malayalam # Mc       MALAYALAM AU LENGTH MARK
+0D60..0D61    ; Malayalam # Lo   [2] MALAYALAM LETTER VOCALIC RR..MALAYALAM LETTER VOCALIC LL
+0D62..0D63    ; Malayalam # Mn   [2] MALAYALAM VOWEL SIGN VOCALIC L..MALAYALAM VOWEL SIGN VOCALIC LL
+0D66..0D6F    ; Malayalam # Nd  [10] MALAYALAM DIGIT ZERO..MALAYALAM DIGIT NINE
+0D70..0D75    ; Malayalam # No   [6] MALAYALAM NUMBER TEN..MALAYALAM FRACTION THREE QUARTERS
+0D79          ; Malayalam # So       MALAYALAM DATE MARK
+0D7A..0D7F    ; Malayalam # Lo   [6] MALAYALAM LETTER CHILLU NN..MALAYALAM LETTER CHILLU K
+
+# Total code points: 95
+
+# ================================================
+
+0D82..0D83    ; Sinhala # Mc   [2] SINHALA SIGN ANUSVARAYA..SINHALA SIGN VISARGAYA
+0D85..0D96    ; Sinhala # Lo  [18] SINHALA LETTER AYANNA..SINHALA LETTER AUYANNA
+0D9A..0DB1    ; Sinhala # Lo  [24] SINHALA LETTER ALPAPRAANA KAYANNA..SINHALA LETTER DANTAJA NAYANNA
+0DB3..0DBB    ; Sinhala # Lo   [9] SINHALA LETTER SANYAKA DAYANNA..SINHALA LETTER RAYANNA
+0DBD          ; Sinhala # Lo       SINHALA LETTER DANTAJA LAYANNA
+0DC0..0DC6    ; Sinhala # Lo   [7] SINHALA LETTER VAYANNA..SINHALA LETTER FAYANNA
+0DCA          ; Sinhala # Mn       SINHALA SIGN AL-LAKUNA
+0DCF..0DD1    ; Sinhala # Mc   [3] SINHALA VOWEL SIGN AELA-PILLA..SINHALA VOWEL SIGN DIGA AEDA-PILLA
+0DD2..0DD4    ; Sinhala # Mn   [3] SINHALA VOWEL SIGN KETTI IS-PILLA..SINHALA VOWEL SIGN KETTI PAA-PILLA
+0DD6          ; Sinhala # Mn       SINHALA VOWEL SIGN DIGA PAA-PILLA
+0DD8..0DDF    ; Sinhala # Mc   [8] SINHALA VOWEL SIGN GAETTA-PILLA..SINHALA VOWEL SIGN GAYANUKITTA
+0DF2..0DF3    ; Sinhala # Mc   [2] SINHALA VOWEL SIGN DIGA GAETTA-PILLA..SINHALA VOWEL SIGN DIGA GAYANUKITTA
+0DF4          ; Sinhala # Po       SINHALA PUNCTUATION KUNDDALIYA
+
+# Total code points: 80
+
+# ================================================
+
+0E01..0E30    ; Thai # Lo  [48] THAI CHARACTER KO KAI..THAI CHARACTER SARA A
+0E31          ; Thai # Mn       THAI CHARACTER MAI HAN-AKAT
+0E32..0E33    ; Thai # Lo   [2] THAI CHARACTER SARA AA..THAI CHARACTER SARA AM
+0E34..0E3A    ; Thai # Mn   [7] THAI CHARACTER SARA I..THAI CHARACTER PHINTHU
+0E40..0E45    ; Thai # Lo   [6] THAI CHARACTER SARA E..THAI CHARACTER LAKKHANGYAO
+0E46          ; Thai # Lm       THAI CHARACTER MAIYAMOK
+0E47..0E4E    ; Thai # Mn   [8] THAI CHARACTER MAITAIKHU..THAI CHARACTER YAMAKKAN
+0E4F          ; Thai # Po       THAI CHARACTER FONGMAN
+0E50..0E59    ; Thai # Nd  [10] THAI DIGIT ZERO..THAI DIGIT NINE
+0E5A..0E5B    ; Thai # Po   [2] THAI CHARACTER ANGKHANKHU..THAI CHARACTER KHOMUT
+
+# Total code points: 86
+
+# ================================================
+
+0E81..0E82    ; Lao # Lo   [2] LAO LETTER KO..LAO LETTER KHO SUNG
+0E84          ; Lao # Lo       LAO LETTER KHO TAM
+0E87..0E88    ; Lao # Lo   [2] LAO LETTER NGO..LAO LETTER CO
+0E8A          ; Lao # Lo       LAO LETTER SO TAM
+0E8D          ; Lao # Lo       LAO LETTER NYO
+0E94..0E97    ; Lao # Lo   [4] LAO LETTER DO..LAO LETTER THO TAM
+0E99..0E9F    ; Lao # Lo   [7] LAO LETTER NO..LAO LETTER FO SUNG
+0EA1..0EA3    ; Lao # Lo   [3] LAO LETTER MO..LAO LETTER LO LING
+0EA5          ; Lao # Lo       LAO LETTER LO LOOT
+0EA7          ; Lao # Lo       LAO LETTER WO
+0EAA..0EAB    ; Lao # Lo   [2] LAO LETTER SO SUNG..LAO LETTER HO SUNG
+0EAD..0EB0    ; Lao # Lo   [4] LAO LETTER O..LAO VOWEL SIGN A
+0EB1          ; Lao # Mn       LAO VOWEL SIGN MAI KAN
+0EB2..0EB3    ; Lao # Lo   [2] LAO VOWEL SIGN AA..LAO VOWEL SIGN AM
+0EB4..0EB9    ; Lao # Mn   [6] LAO VOWEL SIGN I..LAO VOWEL SIGN UU
+0EBB..0EBC    ; Lao # Mn   [2] LAO VOWEL SIGN MAI KON..LAO SEMIVOWEL SIGN LO
+0EBD          ; Lao # Lo       LAO SEMIVOWEL SIGN NYO
+0EC0..0EC4    ; Lao # Lo   [5] LAO VOWEL SIGN E..LAO VOWEL SIGN AI
+0EC6          ; Lao # Lm       LAO KO LA
+0EC8..0ECD    ; Lao # Mn   [6] LAO TONE MAI EK..LAO NIGGAHITA
+0ED0..0ED9    ; Lao # Nd  [10] LAO DIGIT ZERO..LAO DIGIT NINE
+0EDC..0EDD    ; Lao # Lo   [2] LAO HO NO..LAO HO MO
+
+# Total code points: 65
+
+# ================================================
+
+0F00          ; Tibetan # Lo       TIBETAN SYLLABLE OM
+0F01..0F03    ; Tibetan # So   [3] TIBETAN MARK GTER YIG MGO TRUNCATED A..TIBETAN MARK GTER YIG MGO -UM GTER TSHEG MA
+0F04..0F12    ; Tibetan # Po  [15] TIBETAN MARK INITIAL YIG MGO MDUN MA..TIBETAN MARK RGYA GRAM SHAD
+0F13..0F17    ; Tibetan # So   [5] TIBETAN MARK CARET -DZUD RTAGS ME LONG CAN..TIBETAN ASTROLOGICAL SIGN SGRA GCAN -CHAR RTAGS
+0F18..0F19    ; Tibetan # Mn   [2] TIBETAN ASTROLOGICAL SIGN -KHYUD PA..TIBETAN ASTROLOGICAL SIGN SDONG TSHUGS
+0F1A..0F1F    ; Tibetan # So   [6] TIBETAN SIGN RDEL DKAR GCIG..TIBETAN SIGN RDEL DKAR RDEL NAG
+0F20..0F29    ; Tibetan # Nd  [10] TIBETAN DIGIT ZERO..TIBETAN DIGIT NINE
+0F2A..0F33    ; Tibetan # No  [10] TIBETAN DIGIT HALF ONE..TIBETAN DIGIT HALF ZERO
+0F34          ; Tibetan # So       TIBETAN MARK BSDUS RTAGS
+0F35          ; Tibetan # Mn       TIBETAN MARK NGAS BZUNG NYI ZLA
+0F36          ; Tibetan # So       TIBETAN MARK CARET -DZUD RTAGS BZHI MIG CAN
+0F37          ; Tibetan # Mn       TIBETAN MARK NGAS BZUNG SGOR RTAGS
+0F38          ; Tibetan # So       TIBETAN MARK CHE MGO
+0F39          ; Tibetan # Mn       TIBETAN MARK TSA -PHRU
+0F3A          ; Tibetan # Ps       TIBETAN MARK GUG RTAGS GYON
+0F3B          ; Tibetan # Pe       TIBETAN MARK GUG RTAGS GYAS
+0F3C          ; Tibetan # Ps       TIBETAN MARK ANG KHANG GYON
+0F3D          ; Tibetan # Pe       TIBETAN MARK ANG KHANG GYAS
+0F3E..0F3F    ; Tibetan # Mc   [2] TIBETAN SIGN YAR TSHES..TIBETAN SIGN MAR TSHES
+0F40..0F47    ; Tibetan # Lo   [8] TIBETAN LETTER KA..TIBETAN LETTER JA
+0F49..0F6C    ; Tibetan # Lo  [36] TIBETAN LETTER NYA..TIBETAN LETTER RRA
+0F71..0F7E    ; Tibetan # Mn  [14] TIBETAN VOWEL SIGN AA..TIBETAN SIGN RJES SU NGA RO
+0F7F          ; Tibetan # Mc       TIBETAN SIGN RNAM BCAD
+0F80..0F84    ; Tibetan # Mn   [5] TIBETAN VOWEL SIGN REVERSED I..TIBETAN MARK HALANTA
+0F85          ; Tibetan # Po       TIBETAN MARK PALUTA
+0F86..0F87    ; Tibetan # Mn   [2] TIBETAN SIGN LCI RTAGS..TIBETAN SIGN YANG RTAGS
+0F88..0F8B    ; Tibetan # Lo   [4] TIBETAN SIGN LCE TSA CAN..TIBETAN SIGN GRU MED RGYINGS
+0F90..0F97    ; Tibetan # Mn   [8] TIBETAN SUBJOINED LETTER KA..TIBETAN SUBJOINED LETTER JA
+0F99..0FBC    ; Tibetan # Mn  [36] TIBETAN SUBJOINED LETTER NYA..TIBETAN SUBJOINED LETTER FIXED-FORM RA
+0FBE..0FC5    ; Tibetan # So   [8] TIBETAN KU RU KHA..TIBETAN SYMBOL RDO RJE
+0FC6          ; Tibetan # Mn       TIBETAN SYMBOL PADMA GDAN
+0FC7..0FCC    ; Tibetan # So   [6] TIBETAN SYMBOL RDO RJE RGYA GRAM..TIBETAN SYMBOL NOR BU BZHI -KHYIL
+0FCE..0FCF    ; Tibetan # So   [2] TIBETAN SIGN RDEL NAG RDEL DKAR..TIBETAN SIGN RDEL NAG GSUM
+0FD0..0FD4    ; Tibetan # Po   [5] TIBETAN MARK BSKA- SHOG GI MGO RGYAN..TIBETAN MARK CLOSING BRDA RNYING YIG MGO SGAB MA
+
+# Total code points: 201
+
+# ================================================
+
+1000..102A    ; Myanmar # Lo  [43] MYANMAR LETTER KA..MYANMAR LETTER AU
+102B..102C    ; Myanmar # Mc   [2] MYANMAR VOWEL SIGN TALL AA..MYANMAR VOWEL SIGN AA
+102D..1030    ; Myanmar # Mn   [4] MYANMAR VOWEL SIGN I..MYANMAR VOWEL SIGN UU
+1031          ; Myanmar # Mc       MYANMAR VOWEL SIGN E
+1032..1037    ; Myanmar # Mn   [6] MYANMAR VOWEL SIGN AI..MYANMAR SIGN DOT BELOW
+1038          ; Myanmar # Mc       MYANMAR SIGN VISARGA
+1039..103A    ; Myanmar # Mn   [2] MYANMAR SIGN VIRAMA..MYANMAR SIGN ASAT
+103B..103C    ; Myanmar # Mc   [2] MYANMAR CONSONANT SIGN MEDIAL YA..MYANMAR CONSONANT SIGN MEDIAL RA
+103D..103E    ; Myanmar # Mn   [2] MYANMAR CONSONANT SIGN MEDIAL WA..MYANMAR CONSONANT SIGN MEDIAL HA
+103F          ; Myanmar # Lo       MYANMAR LETTER GREAT SA
+1040..1049    ; Myanmar # Nd  [10] MYANMAR DIGIT ZERO..MYANMAR DIGIT NINE
+104A..104F    ; Myanmar # Po   [6] MYANMAR SIGN LITTLE SECTION..MYANMAR SYMBOL GENITIVE
+1050..1055    ; Myanmar # Lo   [6] MYANMAR LETTER SHA..MYANMAR LETTER VOCALIC LL
+1056..1057    ; Myanmar # Mc   [2] MYANMAR VOWEL SIGN VOCALIC R..MYANMAR VOWEL SIGN VOCALIC RR
+1058..1059    ; Myanmar # Mn   [2] MYANMAR VOWEL SIGN VOCALIC L..MYANMAR VOWEL SIGN VOCALIC LL
+105A..105D    ; Myanmar # Lo   [4] MYANMAR LETTER MON NGA..MYANMAR LETTER MON BBE
+105E..1060    ; Myanmar # Mn   [3] MYANMAR CONSONANT SIGN MON MEDIAL NA..MYANMAR CONSONANT SIGN MON MEDIAL LA
+1061          ; Myanmar # Lo       MYANMAR LETTER SGAW KAREN SHA
+1062..1064    ; Myanmar # Mc   [3] MYANMAR VOWEL SIGN SGAW KAREN EU..MYANMAR TONE MARK SGAW KAREN KE PHO
+1065..1066    ; Myanmar # Lo   [2] MYANMAR LETTER WESTERN PWO KAREN THA..MYANMAR LETTER WESTERN PWO KAREN PWA
+1067..106D    ; Myanmar # Mc   [7] MYANMAR VOWEL SIGN WESTERN PWO KAREN EU..MYANMAR SIGN WESTERN PWO KAREN TONE-5
+106E..1070    ; Myanmar # Lo   [3] MYANMAR LETTER EASTERN PWO KAREN NNA..MYANMAR LETTER EASTERN PWO KAREN GHWA
+1071..1074    ; Myanmar # Mn   [4] MYANMAR VOWEL SIGN GEBA KAREN I..MYANMAR VOWEL SIGN KAYAH EE
+1075..1081    ; Myanmar # Lo  [13] MYANMAR LETTER SHAN KA..MYANMAR LETTER SHAN HA
+1082          ; Myanmar # Mn       MYANMAR CONSONANT SIGN SHAN MEDIAL WA
+1083..1084    ; Myanmar # Mc   [2] MYANMAR VOWEL SIGN SHAN AA..MYANMAR VOWEL SIGN SHAN E
+1085..1086    ; Myanmar # Mn   [2] MYANMAR VOWEL SIGN SHAN E ABOVE..MYANMAR VOWEL SIGN SHAN FINAL Y
+1087..108C    ; Myanmar # Mc   [6] MYANMAR SIGN SHAN TONE-2..MYANMAR SIGN SHAN COUNCIL TONE-3
+108D          ; Myanmar # Mn       MYANMAR SIGN SHAN COUNCIL EMPHATIC TONE
+108E          ; Myanmar # Lo       MYANMAR LETTER RUMAI PALAUNG FA
+108F          ; Myanmar # Mc       MYANMAR SIGN RUMAI PALAUNG TONE-5
+1090..1099    ; Myanmar # Nd  [10] MYANMAR SHAN DIGIT ZERO..MYANMAR SHAN DIGIT NINE
+109A..109C    ; Myanmar # Mc   [3] MYANMAR SIGN KHAMTI TONE-1..MYANMAR VOWEL SIGN AITON A
+109D          ; Myanmar # Mn       MYANMAR VOWEL SIGN AITON AI
+109E..109F    ; Myanmar # So   [2] MYANMAR SYMBOL SHAN ONE..MYANMAR SYMBOL SHAN EXCLAMATION
+AA60..AA6F    ; Myanmar # Lo  [16] MYANMAR LETTER KHAMTI GA..MYANMAR LETTER KHAMTI FA
+AA70          ; Myanmar # Lm       MYANMAR MODIFIER LETTER KHAMTI REDUPLICATION
+AA71..AA76    ; Myanmar # Lo   [6] MYANMAR LETTER KHAMTI XA..MYANMAR LOGOGRAM KHAMTI HM
+AA77..AA79    ; Myanmar # So   [3] MYANMAR SYMBOL AITON EXCLAMATION..MYANMAR SYMBOL AITON TWO
+AA7A          ; Myanmar # Lo       MYANMAR LETTER AITON RA
+AA7B          ; Myanmar # Mc       MYANMAR SIGN PAO KAREN TONE
+
+# Total code points: 188
+
+# ================================================
+
+10A0..10C5    ; Georgian # L&  [38] GEORGIAN CAPITAL LETTER AN..GEORGIAN CAPITAL LETTER HOE
+10D0..10FA    ; Georgian # Lo  [43] GEORGIAN LETTER AN..GEORGIAN LETTER AIN
+10FC          ; Georgian # Lm       MODIFIER LETTER GEORGIAN NAR
+2D00..2D25    ; Georgian # L&  [38] GEORGIAN SMALL LETTER AN..GEORGIAN SMALL LETTER HOE
+
+# Total code points: 120
+
+# ================================================
+
+1100..11FF    ; Hangul # Lo [256] HANGUL CHOSEONG KIYEOK..HANGUL JONGSEONG SSANGNIEUN
+3131..318E    ; Hangul # Lo  [94] HANGUL LETTER KIYEOK..HANGUL LETTER ARAEAE
+3200..321E    ; Hangul # So  [31] PARENTHESIZED HANGUL KIYEOK..PARENTHESIZED KOREAN CHARACTER O HU
+3260..327E    ; Hangul # So  [31] CIRCLED HANGUL KIYEOK..CIRCLED HANGUL IEUNG U
+A960..A97C    ; Hangul # Lo  [29] HANGUL CHOSEONG TIKEUT-MIEUM..HANGUL CHOSEONG SSANGYEORINHIEUH
+AC00..D7A3    ; Hangul # Lo [11172] HANGUL SYLLABLE GA..HANGUL SYLLABLE HIH
+D7B0..D7C6    ; Hangul # Lo  [23] HANGUL JUNGSEONG O-YEO..HANGUL JUNGSEONG ARAEA-E
+D7CB..D7FB    ; Hangul # Lo  [49] HANGUL JONGSEONG NIEUN-RIEUL..HANGUL JONGSEONG PHIEUPH-THIEUTH
+FFA0..FFBE    ; Hangul # Lo  [31] HALFWIDTH HANGUL FILLER..HALFWIDTH HANGUL LETTER HIEUH
+FFC2..FFC7    ; Hangul # Lo   [6] HALFWIDTH HANGUL LETTER A..HALFWIDTH HANGUL LETTER E
+FFCA..FFCF    ; Hangul # Lo   [6] HALFWIDTH HANGUL LETTER YEO..HALFWIDTH HANGUL LETTER OE
+FFD2..FFD7    ; Hangul # Lo   [6] HALFWIDTH HANGUL LETTER YO..HALFWIDTH HANGUL LETTER YU
+FFDA..FFDC    ; Hangul # Lo   [3] HALFWIDTH HANGUL LETTER EU..HALFWIDTH HANGUL LETTER I
+
+# Total code points: 11737
+
+# ================================================
+
+1200..1248    ; Ethiopic # Lo  [73] ETHIOPIC SYLLABLE HA..ETHIOPIC SYLLABLE QWA
+124A..124D    ; Ethiopic # Lo   [4] ETHIOPIC SYLLABLE QWI..ETHIOPIC SYLLABLE QWE
+1250..1256    ; Ethiopic # Lo   [7] ETHIOPIC SYLLABLE QHA..ETHIOPIC SYLLABLE QHO
+1258          ; Ethiopic # Lo       ETHIOPIC SYLLABLE QHWA
+125A..125D    ; Ethiopic # Lo   [4] ETHIOPIC SYLLABLE QHWI..ETHIOPIC SYLLABLE QHWE
+1260..1288    ; Ethiopic # Lo  [41] ETHIOPIC SYLLABLE BA..ETHIOPIC SYLLABLE XWA
+128A..128D    ; Ethiopic # Lo   [4] ETHIOPIC SYLLABLE XWI..ETHIOPIC SYLLABLE XWE
+1290..12B0    ; Ethiopic # Lo  [33] ETHIOPIC SYLLABLE NA..ETHIOPIC SYLLABLE KWA
+12B2..12B5    ; Ethiopic # Lo   [4] ETHIOPIC SYLLABLE KWI..ETHIOPIC SYLLABLE KWE
+12B8..12BE    ; Ethiopic # Lo   [7] ETHIOPIC SYLLABLE KXA..ETHIOPIC SYLLABLE KXO
+12C0          ; Ethiopic # Lo       ETHIOPIC SYLLABLE KXWA
+12C2..12C5    ; Ethiopic # Lo   [4] ETHIOPIC SYLLABLE KXWI..ETHIOPIC SYLLABLE KXWE
+12C8..12D6    ; Ethiopic # Lo  [15] ETHIOPIC SYLLABLE WA..ETHIOPIC SYLLABLE PHARYNGEAL O
+12D8..1310    ; Ethiopic # Lo  [57] ETHIOPIC SYLLABLE ZA..ETHIOPIC SYLLABLE GWA
+1312..1315    ; Ethiopic # Lo   [4] ETHIOPIC SYLLABLE GWI..ETHIOPIC SYLLABLE GWE
+1318..135A    ; Ethiopic # Lo  [67] ETHIOPIC SYLLABLE GGA..ETHIOPIC SYLLABLE FYA
+135F          ; Ethiopic # Mn       ETHIOPIC COMBINING GEMINATION MARK
+1360          ; Ethiopic # So       ETHIOPIC SECTION MARK
+1361..1368    ; Ethiopic # Po   [8] ETHIOPIC WORDSPACE..ETHIOPIC PARAGRAPH SEPARATOR
+1369..137C    ; Ethiopic # No  [20] ETHIOPIC DIGIT ONE..ETHIOPIC NUMBER TEN THOUSAND
+1380..138F    ; Ethiopic # Lo  [16] ETHIOPIC SYLLABLE SEBATBEIT MWA..ETHIOPIC SYLLABLE PWE
+1390..1399    ; Ethiopic # So  [10] ETHIOPIC TONAL MARK YIZET..ETHIOPIC TONAL MARK KURT
+2D80..2D96    ; Ethiopic # Lo  [23] ETHIOPIC SYLLABLE LOA..ETHIOPIC SYLLABLE GGWE
+2DA0..2DA6    ; Ethiopic # Lo   [7] ETHIOPIC SYLLABLE SSA..ETHIOPIC SYLLABLE SSO
+2DA8..2DAE    ; Ethiopic # Lo   [7] ETHIOPIC SYLLABLE CCA..ETHIOPIC SYLLABLE CCO
+2DB0..2DB6    ; Ethiopic # Lo   [7] ETHIOPIC SYLLABLE ZZA..ETHIOPIC SYLLABLE ZZO
+2DB8..2DBE    ; Ethiopic # Lo   [7] ETHIOPIC SYLLABLE CCHA..ETHIOPIC SYLLABLE CCHO
+2DC0..2DC6    ; Ethiopic # Lo   [7] ETHIOPIC SYLLABLE QYA..ETHIOPIC SYLLABLE QYO
+2DC8..2DCE    ; Ethiopic # Lo   [7] ETHIOPIC SYLLABLE KYA..ETHIOPIC SYLLABLE KYO
+2DD0..2DD6    ; Ethiopic # Lo   [7] ETHIOPIC SYLLABLE XYA..ETHIOPIC SYLLABLE XYO
+2DD8..2DDE    ; Ethiopic # Lo   [7] ETHIOPIC SYLLABLE GYA..ETHIOPIC SYLLABLE GYO
+
+# Total code points: 461
+
+# ================================================
+
+13A0..13F4    ; Cherokee # Lo  [85] CHEROKEE LETTER A..CHEROKEE LETTER YV
+
+# Total code points: 85
+
+# ================================================
+
+1400          ; Canadian_Aboriginal # Pd       CANADIAN SYLLABICS HYPHEN
+1401..166C    ; Canadian_Aboriginal # Lo [620] CANADIAN SYLLABICS E..CANADIAN SYLLABICS CARRIER TTSA
+166D..166E    ; Canadian_Aboriginal # Po   [2] CANADIAN SYLLABICS CHI SIGN..CANADIAN SYLLABICS FULL STOP
+166F..167F    ; Canadian_Aboriginal # Lo  [17] CANADIAN SYLLABICS QAI..CANADIAN SYLLABICS BLACKFOOT W
+18B0..18F5    ; Canadian_Aboriginal # Lo  [70] CANADIAN SYLLABICS OY..CANADIAN SYLLABICS CARRIER DENTAL S
+
+# Total code points: 710
+
+# ================================================
+
+1680          ; Ogham # Zs       OGHAM SPACE MARK
+1681..169A    ; Ogham # Lo  [26] OGHAM LETTER BEITH..OGHAM LETTER PEITH
+169B          ; Ogham # Ps       OGHAM FEATHER MARK
+169C          ; Ogham # Pe       OGHAM REVERSED FEATHER MARK
+
+# Total code points: 29
+
+# ================================================
+
+16A0..16EA    ; Runic # Lo  [75] RUNIC LETTER FEHU FEOH FE F..RUNIC LETTER X
+16EE..16F0    ; Runic # Nl   [3] RUNIC ARLAUG SYMBOL..RUNIC BELGTHOR SYMBOL
+
+# Total code points: 78
+
+# ================================================
+
+1780..17B3    ; Khmer # Lo  [52] KHMER LETTER KA..KHMER INDEPENDENT VOWEL QAU
+17B4..17B5    ; Khmer # Cf   [2] KHMER VOWEL INHERENT AQ..KHMER VOWEL INHERENT AA
+17B6          ; Khmer # Mc       KHMER VOWEL SIGN AA
+17B7..17BD    ; Khmer # Mn   [7] KHMER VOWEL SIGN I..KHMER VOWEL SIGN UA
+17BE..17C5    ; Khmer # Mc   [8] KHMER VOWEL SIGN OE..KHMER VOWEL SIGN AU
+17C6          ; Khmer # Mn       KHMER SIGN NIKAHIT
+17C7..17C8    ; Khmer # Mc   [2] KHMER SIGN REAHMUK..KHMER SIGN YUUKALEAPINTU
+17C9..17D3    ; Khmer # Mn  [11] KHMER SIGN MUUSIKATOAN..KHMER SIGN BATHAMASAT
+17D4..17D6    ; Khmer # Po   [3] KHMER SIGN KHAN..KHMER SIGN CAMNUC PII KUUH
+17D7          ; Khmer # Lm       KHMER SIGN LEK TOO
+17D8..17DA    ; Khmer # Po   [3] KHMER SIGN BEYYAL..KHMER SIGN KOOMUUT
+17DB          ; Khmer # Sc       KHMER CURRENCY SYMBOL RIEL
+17DC          ; Khmer # Lo       KHMER SIGN AVAKRAHASANYA
+17DD          ; Khmer # Mn       KHMER SIGN ATTHACAN
+17E0..17E9    ; Khmer # Nd  [10] KHMER DIGIT ZERO..KHMER DIGIT NINE
+17F0..17F9    ; Khmer # No  [10] KHMER SYMBOL LEK ATTAK SON..KHMER SYMBOL LEK ATTAK PRAM-BUON
+19E0..19FF    ; Khmer # So  [32] KHMER SYMBOL PATHAMASAT..KHMER SYMBOL DAP-PRAM ROC
+
+# Total code points: 146
+
+# ================================================
+
+1800..1801    ; Mongolian # Po   [2] MONGOLIAN BIRGA..MONGOLIAN ELLIPSIS
+1804          ; Mongolian # Po       MONGOLIAN COLON
+1806          ; Mongolian # Pd       MONGOLIAN TODO SOFT HYPHEN
+1807..180A    ; Mongolian # Po   [4] MONGOLIAN SIBE SYLLABLE BOUNDARY MARKER..MONGOLIAN NIRUGU
+180B..180D    ; Mongolian # Mn   [3] MONGOLIAN FREE VARIATION SELECTOR ONE..MONGOLIAN FREE VARIATION SELECTOR THREE
+180E          ; Mongolian # Zs       MONGOLIAN VOWEL SEPARATOR
+1810..1819    ; Mongolian # Nd  [10] MONGOLIAN DIGIT ZERO..MONGOLIAN DIGIT NINE
+1820..1842    ; Mongolian # Lo  [35] MONGOLIAN LETTER A..MONGOLIAN LETTER CHI
+1843          ; Mongolian # Lm       MONGOLIAN LETTER TODO LONG VOWEL SIGN
+1844..1877    ; Mongolian # Lo  [52] MONGOLIAN LETTER TODO E..MONGOLIAN LETTER MANCHU ZHA
+1880..18A8    ; Mongolian # Lo  [41] MONGOLIAN LETTER ALI GALI ANUSVARA ONE..MONGOLIAN LETTER MANCHU ALI GALI BHA
+18A9          ; Mongolian # Mn       MONGOLIAN LETTER ALI GALI DAGALGA
+18AA          ; Mongolian # Lo       MONGOLIAN LETTER MANCHU ALI GALI LHA
+
+# Total code points: 153
+
+# ================================================
+
+3041..3096    ; Hiragana # Lo  [86] HIRAGANA LETTER SMALL A..HIRAGANA LETTER SMALL KE
+309D..309E    ; Hiragana # Lm   [2] HIRAGANA ITERATION MARK..HIRAGANA VOICED ITERATION MARK
+309F          ; Hiragana # Lo       HIRAGANA DIGRAPH YORI
+1F200         ; Hiragana # So       SQUARE HIRAGANA HOKA
+
+# Total code points: 90
+
+# ================================================
+
+30A1..30FA    ; Katakana # Lo  [90] KATAKANA LETTER SMALL A..KATAKANA LETTER VO
+30FD..30FE    ; Katakana # Lm   [2] KATAKANA ITERATION MARK..KATAKANA VOICED ITERATION MARK
+30FF          ; Katakana # Lo       KATAKANA DIGRAPH KOTO
+31F0..31FF    ; Katakana # Lo  [16] KATAKANA LETTER SMALL KU..KATAKANA LETTER SMALL RO
+32D0..32FE    ; Katakana # So  [47] CIRCLED KATAKANA A..CIRCLED KATAKANA WO
+3300..3357    ; Katakana # So  [88] SQUARE APAATO..SQUARE WATTO
+FF66..FF6F    ; Katakana # Lo  [10] HALFWIDTH KATAKANA LETTER WO..HALFWIDTH KATAKANA LETTER SMALL TU
+FF71..FF9D    ; Katakana # Lo  [45] HALFWIDTH KATAKANA LETTER A..HALFWIDTH KATAKANA LETTER N
+
+# Total code points: 299
+
+# ================================================
+
+3105..312D    ; Bopomofo # Lo  [41] BOPOMOFO LETTER B..BOPOMOFO LETTER IH
+31A0..31B7    ; Bopomofo # Lo  [24] BOPOMOFO LETTER BU..BOPOMOFO FINAL LETTER H
+
+# Total code points: 65
+
+# ================================================
+
+2E80..2E99    ; Han # So  [26] CJK RADICAL REPEAT..CJK RADICAL RAP
+2E9B..2EF3    ; Han # So  [89] CJK RADICAL CHOKE..CJK RADICAL C-SIMPLIFIED TURTLE
+2F00..2FD5    ; Han # So [214] KANGXI RADICAL ONE..KANGXI RADICAL FLUTE
+3005          ; Han # Lm       IDEOGRAPHIC ITERATION MARK
+3007          ; Han # Nl       IDEOGRAPHIC NUMBER ZERO
+3021..3029    ; Han # Nl   [9] HANGZHOU NUMERAL ONE..HANGZHOU NUMERAL NINE
+3038..303A    ; Han # Nl   [3] HANGZHOU NUMERAL TEN..HANGZHOU NUMERAL THIRTY
+303B          ; Han # Lm       VERTICAL IDEOGRAPHIC ITERATION MARK
+3400..4DB5    ; Han # Lo [6582] CJK UNIFIED IDEOGRAPH-3400..CJK UNIFIED IDEOGRAPH-4DB5
+4E00..9FCB    ; Han # Lo [20940] CJK UNIFIED IDEOGRAPH-4E00..CJK UNIFIED IDEOGRAPH-9FCB
+F900..FA2D    ; Han # Lo [302] CJK COMPATIBILITY IDEOGRAPH-F900..CJK COMPATIBILITY IDEOGRAPH-FA2D
+FA30..FA6D    ; Han # Lo  [62] CJK COMPATIBILITY IDEOGRAPH-FA30..CJK COMPATIBILITY IDEOGRAPH-FA6D
+FA70..FAD9    ; Han # Lo [106] CJK COMPATIBILITY IDEOGRAPH-FA70..CJK COMPATIBILITY IDEOGRAPH-FAD9
+20000..2A6D6  ; Han # Lo [42711] CJK UNIFIED IDEOGRAPH-20000..CJK UNIFIED IDEOGRAPH-2A6D6
+2A700..2B734  ; Han # Lo [4149] CJK UNIFIED IDEOGRAPH-2A700..CJK UNIFIED IDEOGRAPH-2B734
+2F800..2FA1D  ; Han # Lo [542] CJK COMPATIBILITY IDEOGRAPH-2F800..CJK COMPATIBILITY IDEOGRAPH-2FA1D
+
+# Total code points: 75738
+
+# ================================================
+
+A000..A014    ; Yi # Lo  [21] YI SYLLABLE IT..YI SYLLABLE E
+A015          ; Yi # Lm       YI SYLLABLE WU
+A016..A48C    ; Yi # Lo [1143] YI SYLLABLE BIT..YI SYLLABLE YYR
+A490..A4C6    ; Yi # So  [55] YI RADICAL QOT..YI RADICAL KE
+
+# Total code points: 1220
+
+# ================================================
+
+10300..1031E  ; Old_Italic # Lo  [31] OLD ITALIC LETTER A..OLD ITALIC LETTER UU
+10320..10323  ; Old_Italic # No   [4] OLD ITALIC NUMERAL ONE..OLD ITALIC NUMERAL FIFTY
+
+# Total code points: 35
+
+# ================================================
+
+10330..10340  ; Gothic # Lo  [17] GOTHIC LETTER AHSA..GOTHIC LETTER PAIRTHRA
+10341         ; Gothic # Nl       GOTHIC LETTER NINETY
+10342..10349  ; Gothic # Lo   [8] GOTHIC LETTER RAIDA..GOTHIC LETTER OTHAL
+1034A         ; Gothic # Nl       GOTHIC LETTER NINE HUNDRED
+
+# Total code points: 27
+
+# ================================================
+
+10400..1044F  ; Deseret # L&  [80] DESERET CAPITAL LETTER LONG I..DESERET SMALL LETTER EW
+
+# Total code points: 80
+
+# ================================================
+
+0300..036F    ; Inherited # Mn [112] COMBINING GRAVE ACCENT..COMBINING LATIN SMALL LETTER X
+0485..0486    ; Inherited # Mn   [2] COMBINING CYRILLIC DASIA PNEUMATA..COMBINING CYRILLIC PSILI PNEUMATA
+064B..0655    ; Inherited # Mn  [11] ARABIC FATHATAN..ARABIC HAMZA BELOW
+0670          ; Inherited # Mn       ARABIC LETTER SUPERSCRIPT ALEF
+0951..0952    ; Inherited # Mn   [2] DEVANAGARI STRESS SIGN UDATTA..DEVANAGARI STRESS SIGN ANUDATTA
+1CD0..1CD2    ; Inherited # Mn   [3] VEDIC TONE KARSHANA..VEDIC TONE PRENKHA
+1CD4..1CE0    ; Inherited # Mn  [13] VEDIC SIGN YAJURVEDIC MIDLINE SVARITA..VEDIC TONE RIGVEDIC KASHMIRI INDEPENDENT SVARITA
+1CE2..1CE8    ; Inherited # Mn   [7] VEDIC SIGN VISARGA SVARITA..VEDIC SIGN VISARGA ANUDATTA WITH TAIL
+1CED          ; Inherited # Mn       VEDIC SIGN TIRYAK
+1DC0..1DE6    ; Inherited # Mn  [39] COMBINING DOTTED GRAVE ACCENT..COMBINING LATIN SMALL LETTER Z
+1DFD..1DFF    ; Inherited # Mn   [3] COMBINING ALMOST EQUAL TO BELOW..COMBINING RIGHT ARROWHEAD AND DOWN ARROWHEAD BELOW
+200C..200D    ; Inherited # Cf   [2] ZERO WIDTH NON-JOINER..ZERO WIDTH JOINER
+20D0..20DC    ; Inherited # Mn  [13] COMBINING LEFT HARPOON ABOVE..COMBINING FOUR DOTS ABOVE
+20DD..20E0    ; Inherited # Me   [4] COMBINING ENCLOSING CIRCLE..COMBINING ENCLOSING CIRCLE BACKSLASH
+20E1          ; Inherited # Mn       COMBINING LEFT RIGHT ARROW ABOVE
+20E2..20E4    ; Inherited # Me   [3] COMBINING ENCLOSING SCREEN..COMBINING ENCLOSING UPWARD POINTING TRIANGLE
+20E5..20F0    ; Inherited # Mn  [12] COMBINING REVERSE SOLIDUS OVERLAY..COMBINING ASTERISK ABOVE
+302A..302F    ; Inherited # Mn   [6] IDEOGRAPHIC LEVEL TONE MARK..HANGUL DOUBLE DOT TONE MARK
+3099..309A    ; Inherited # Mn   [2] COMBINING KATAKANA-HIRAGANA VOICED SOUND MARK..COMBINING KATAKANA-HIRAGANA SEMI-VOICED SOUND MARK
+FE00..FE0F    ; Inherited # Mn  [16] VARIATION SELECTOR-1..VARIATION SELECTOR-16
+FE20..FE26    ; Inherited # Mn   [7] COMBINING LIGATURE LEFT HALF..COMBINING CONJOINING MACRON
+101FD         ; Inherited # Mn       PHAISTOS DISC SIGN COMBINING OBLIQUE STROKE
+1D167..1D169  ; Inherited # Mn   [3] MUSICAL SYMBOL COMBINING TREMOLO-1..MUSICAL SYMBOL COMBINING TREMOLO-3
+1D17B..1D182  ; Inherited # Mn   [8] MUSICAL SYMBOL COMBINING ACCENT..MUSICAL SYMBOL COMBINING LOURE
+1D185..1D18B  ; Inherited # Mn   [7] MUSICAL SYMBOL COMBINING DOIT..MUSICAL SYMBOL COMBINING TRIPLE TONGUE
+1D1AA..1D1AD  ; Inherited # Mn   [4] MUSICAL SYMBOL COMBINING DOWN BOW..MUSICAL SYMBOL COMBINING SNAP PIZZICATO
+E0100..E01EF  ; Inherited # Mn [240] VARIATION SELECTOR-17..VARIATION SELECTOR-256
+
+# Total code points: 523
+
+# ================================================
+
+1700..170C    ; Tagalog # Lo  [13] TAGALOG LETTER A..TAGALOG LETTER YA
+170E..1711    ; Tagalog # Lo   [4] TAGALOG LETTER LA..TAGALOG LETTER HA
+1712..1714    ; Tagalog # Mn   [3] TAGALOG VOWEL SIGN I..TAGALOG SIGN VIRAMA
+
+# Total code points: 20
+
+# ================================================
+
+1720..1731    ; Hanunoo # Lo  [18] HANUNOO LETTER A..HANUNOO LETTER HA
+1732..1734    ; Hanunoo # Mn   [3] HANUNOO VOWEL SIGN I..HANUNOO SIGN PAMUDPOD
+
+# Total code points: 21
+
+# ================================================
+
+1740..1751    ; Buhid # Lo  [18] BUHID LETTER A..BUHID LETTER HA
+1752..1753    ; Buhid # Mn   [2] BUHID VOWEL SIGN I..BUHID VOWEL SIGN U
+
+# Total code points: 20
+
+# ================================================
+
+1760..176C    ; Tagbanwa # Lo  [13] TAGBANWA LETTER A..TAGBANWA LETTER YA
+176E..1770    ; Tagbanwa # Lo   [3] TAGBANWA LETTER LA..TAGBANWA LETTER SA
+1772..1773    ; Tagbanwa # Mn   [2] TAGBANWA VOWEL SIGN I..TAGBANWA VOWEL SIGN U
+
+# Total code points: 18
+
+# ================================================
+
+1900..191C    ; Limbu # Lo  [29] LIMBU VOWEL-CARRIER LETTER..LIMBU LETTER HA
+1920..1922    ; Limbu # Mn   [3] LIMBU VOWEL SIGN A..LIMBU VOWEL SIGN U
+1923..1926    ; Limbu # Mc   [4] LIMBU VOWEL SIGN EE..LIMBU VOWEL SIGN AU
+1927..1928    ; Limbu # Mn   [2] LIMBU VOWEL SIGN E..LIMBU VOWEL SIGN O
+1929..192B    ; Limbu # Mc   [3] LIMBU SUBJOINED LETTER YA..LIMBU SUBJOINED LETTER WA
+1930..1931    ; Limbu # Mc   [2] LIMBU SMALL LETTER KA..LIMBU SMALL LETTER NGA
+1932          ; Limbu # Mn       LIMBU SMALL LETTER ANUSVARA
+1933..1938    ; Limbu # Mc   [6] LIMBU SMALL LETTER TA..LIMBU SMALL LETTER LA
+1939..193B    ; Limbu # Mn   [3] LIMBU SIGN MUKPHRENG..LIMBU SIGN SA-I
+1940          ; Limbu # So       LIMBU SIGN LOO
+1944..1945    ; Limbu # Po   [2] LIMBU EXCLAMATION MARK..LIMBU QUESTION MARK
+1946..194F    ; Limbu # Nd  [10] LIMBU DIGIT ZERO..LIMBU DIGIT NINE
+
+# Total code points: 66
+
+# ================================================
+
+1950..196D    ; Tai_Le # Lo  [30] TAI LE LETTER KA..TAI LE LETTER AI
+1970..1974    ; Tai_Le # Lo   [5] TAI LE LETTER TONE-2..TAI LE LETTER TONE-6
+
+# Total code points: 35
+
+# ================================================
+
+10000..1000B  ; Linear_B # Lo  [12] LINEAR B SYLLABLE B008 A..LINEAR B SYLLABLE B046 JE
+1000D..10026  ; Linear_B # Lo  [26] LINEAR B SYLLABLE B036 JO..LINEAR B SYLLABLE B032 QO
+10028..1003A  ; Linear_B # Lo  [19] LINEAR B SYLLABLE B060 RA..LINEAR B SYLLABLE B042 WO
+1003C..1003D  ; Linear_B # Lo   [2] LINEAR B SYLLABLE B017 ZA..LINEAR B SYLLABLE B074 ZE
+1003F..1004D  ; Linear_B # Lo  [15] LINEAR B SYLLABLE B020 ZO..LINEAR B SYLLABLE B091 TWO
+10050..1005D  ; Linear_B # Lo  [14] LINEAR B SYMBOL B018..LINEAR B SYMBOL B089
+10080..100FA  ; Linear_B # Lo [123] LINEAR B IDEOGRAM B100 MAN..LINEAR B IDEOGRAM VESSEL B305
+
+# Total code points: 211
+
+# ================================================
+
+10380..1039D  ; Ugaritic # Lo  [30] UGARITIC LETTER ALPA..UGARITIC LETTER SSU
+1039F         ; Ugaritic # Po       UGARITIC WORD DIVIDER
+
+# Total code points: 31
+
+# ================================================
+
+10450..1047F  ; Shavian # Lo  [48] SHAVIAN LETTER PEEP..SHAVIAN LETTER YEW
+
+# Total code points: 48
+
+# ================================================
+
+10480..1049D  ; Osmanya # Lo  [30] OSMANYA LETTER ALEF..OSMANYA LETTER OO
+104A0..104A9  ; Osmanya # Nd  [10] OSMANYA DIGIT ZERO..OSMANYA DIGIT NINE
+
+# Total code points: 40
+
+# ================================================
+
+10800..10805  ; Cypriot # Lo   [6] CYPRIOT SYLLABLE A..CYPRIOT SYLLABLE JA
+10808         ; Cypriot # Lo       CYPRIOT SYLLABLE JO
+1080A..10835  ; Cypriot # Lo  [44] CYPRIOT SYLLABLE KA..CYPRIOT SYLLABLE WO
+10837..10838  ; Cypriot # Lo   [2] CYPRIOT SYLLABLE XA..CYPRIOT SYLLABLE XE
+1083C         ; Cypriot # Lo       CYPRIOT SYLLABLE ZA
+1083F         ; Cypriot # Lo       CYPRIOT SYLLABLE ZO
+
+# Total code points: 55
+
+# ================================================
+
+2800..28FF    ; Braille # So [256] BRAILLE PATTERN BLANK..BRAILLE PATTERN DOTS-12345678
+
+# Total code points: 256
+
+# ================================================
+
+1A00..1A16    ; Buginese # Lo  [23] BUGINESE LETTER KA..BUGINESE LETTER HA
+1A17..1A18    ; Buginese # Mn   [2] BUGINESE VOWEL SIGN I..BUGINESE VOWEL SIGN U
+1A19..1A1B    ; Buginese # Mc   [3] BUGINESE VOWEL SIGN E..BUGINESE VOWEL SIGN AE
+1A1E..1A1F    ; Buginese # Po   [2] BUGINESE PALLAWA..BUGINESE END OF SECTION
+
+# Total code points: 30
+
+# ================================================
+
+03E2..03EF    ; Coptic # L&  [14] COPTIC CAPITAL LETTER SHEI..COPTIC SMALL LETTER DEI
+2C80..2CE4    ; Coptic # L& [101] COPTIC CAPITAL LETTER ALFA..COPTIC SYMBOL KAI
+2CE5..2CEA    ; Coptic # So   [6] COPTIC SYMBOL MI RO..COPTIC SYMBOL SHIMA SIMA
+2CEB..2CEE    ; Coptic # L&   [4] COPTIC CAPITAL LETTER CRYPTOGRAMMIC SHEI..COPTIC SMALL LETTER CRYPTOGRAMMIC GANGIA
+2CEF..2CF1    ; Coptic # Mn   [3] COPTIC COMBINING NI ABOVE..COPTIC COMBINING SPIRITUS LENIS
+2CF9..2CFC    ; Coptic # Po   [4] COPTIC OLD NUBIAN FULL STOP..COPTIC OLD NUBIAN VERSE DIVIDER
+2CFD          ; Coptic # No       COPTIC FRACTION ONE HALF
+2CFE..2CFF    ; Coptic # Po   [2] COPTIC FULL STOP..COPTIC MORPHOLOGICAL DIVIDER
+
+# Total code points: 135
+
+# ================================================
+
+1980..19AB    ; New_Tai_Lue # Lo  [44] NEW TAI LUE LETTER HIGH QA..NEW TAI LUE LETTER LOW SUA
+19B0..19C0    ; New_Tai_Lue # Mc  [17] NEW TAI LUE VOWEL SIGN VOWEL SHORTENER..NEW TAI LUE VOWEL SIGN IY
+19C1..19C7    ; New_Tai_Lue # Lo   [7] NEW TAI LUE LETTER FINAL V..NEW TAI LUE LETTER FINAL B
+19C8..19C9    ; New_Tai_Lue # Mc   [2] NEW TAI LUE TONE MARK-1..NEW TAI LUE TONE MARK-2
+19D0..19DA    ; New_Tai_Lue # Nd  [11] NEW TAI LUE DIGIT ZERO..NEW TAI LUE THAM DIGIT ONE
+19DE..19DF    ; New_Tai_Lue # Po   [2] NEW TAI LUE SIGN LAE..NEW TAI LUE SIGN LAEV
+
+# Total code points: 83
+
+# ================================================
+
+2C00..2C2E    ; Glagolitic # L&  [47] GLAGOLITIC CAPITAL LETTER AZU..GLAGOLITIC CAPITAL LETTER LATINATE MYSLITE
+2C30..2C5E    ; Glagolitic # L&  [47] GLAGOLITIC SMALL LETTER AZU..GLAGOLITIC SMALL LETTER LATINATE MYSLITE
+
+# Total code points: 94
+
+# ================================================
+
+2D30..2D65    ; Tifinagh # Lo  [54] TIFINAGH LETTER YA..TIFINAGH LETTER YAZZ
+2D6F          ; Tifinagh # Lm       TIFINAGH MODIFIER LETTER LABIALIZATION MARK
+
+# Total code points: 55
+
+# ================================================
+
+A800..A801    ; Syloti_Nagri # Lo   [2] SYLOTI NAGRI LETTER A..SYLOTI NAGRI LETTER I
+A802          ; Syloti_Nagri # Mn       SYLOTI NAGRI SIGN DVISVARA
+A803..A805    ; Syloti_Nagri # Lo   [3] SYLOTI NAGRI LETTER U..SYLOTI NAGRI LETTER O
+A806          ; Syloti_Nagri # Mn       SYLOTI NAGRI SIGN HASANTA
+A807..A80A    ; Syloti_Nagri # Lo   [4] SYLOTI NAGRI LETTER KO..SYLOTI NAGRI LETTER GHO
+A80B          ; Syloti_Nagri # Mn       SYLOTI NAGRI SIGN ANUSVARA
+A80C..A822    ; Syloti_Nagri # Lo  [23] SYLOTI NAGRI LETTER CO..SYLOTI NAGRI LETTER HO
+A823..A824    ; Syloti_Nagri # Mc   [2] SYLOTI NAGRI VOWEL SIGN A..SYLOTI NAGRI VOWEL SIGN I
+A825..A826    ; Syloti_Nagri # Mn   [2] SYLOTI NAGRI VOWEL SIGN U..SYLOTI NAGRI VOWEL SIGN E
+A827          ; Syloti_Nagri # Mc       SYLOTI NAGRI VOWEL SIGN OO
+A828..A82B    ; Syloti_Nagri # So   [4] SYLOTI NAGRI POETRY MARK-1..SYLOTI NAGRI POETRY MARK-4
+
+# Total code points: 44
+
+# ================================================
+
+103A0..103C3  ; Old_Persian # Lo  [36] OLD PERSIAN SIGN A..OLD PERSIAN SIGN HA
+103C8..103CF  ; Old_Persian # Lo   [8] OLD PERSIAN SIGN AURAMAZDAA..OLD PERSIAN SIGN BUUMISH
+103D0         ; Old_Persian # Po       OLD PERSIAN WORD DIVIDER
+103D1..103D5  ; Old_Persian # Nl   [5] OLD PERSIAN NUMBER ONE..OLD PERSIAN NUMBER HUNDRED
+
+# Total code points: 50
+
+# ================================================
+
+10A00         ; Kharoshthi # Lo       KHAROSHTHI LETTER A
+10A01..10A03  ; Kharoshthi # Mn   [3] KHAROSHTHI VOWEL SIGN I..KHAROSHTHI VOWEL SIGN VOCALIC R
+10A05..10A06  ; Kharoshthi # Mn   [2] KHAROSHTHI VOWEL SIGN E..KHAROSHTHI VOWEL SIGN O
+10A0C..10A0F  ; Kharoshthi # Mn   [4] KHAROSHTHI VOWEL LENGTH MARK..KHAROSHTHI SIGN VISARGA
+10A10..10A13  ; Kharoshthi # Lo   [4] KHAROSHTHI LETTER KA..KHAROSHTHI LETTER GHA
+10A15..10A17  ; Kharoshthi # Lo   [3] KHAROSHTHI LETTER CA..KHAROSHTHI LETTER JA
+10A19..10A33  ; Kharoshthi # Lo  [27] KHAROSHTHI LETTER NYA..KHAROSHTHI LETTER TTTHA
+10A38..10A3A  ; Kharoshthi # Mn   [3] KHAROSHTHI SIGN BAR ABOVE..KHAROSHTHI SIGN DOT BELOW
+10A3F         ; Kharoshthi # Mn       KHAROSHTHI VIRAMA
+10A40..10A47  ; Kharoshthi # No   [8] KHAROSHTHI DIGIT ONE..KHAROSHTHI NUMBER ONE THOUSAND
+10A50..10A58  ; Kharoshthi # Po   [9] KHAROSHTHI PUNCTUATION DOT..KHAROSHTHI PUNCTUATION LINES
+
+# Total code points: 65
+
+# ================================================
+
+1B00..1B03    ; Balinese # Mn   [4] BALINESE SIGN ULU RICEM..BALINESE SIGN SURANG
+1B04          ; Balinese # Mc       BALINESE SIGN BISAH
+1B05..1B33    ; Balinese # Lo  [47] BALINESE LETTER AKARA..BALINESE LETTER HA
+1B34          ; Balinese # Mn       BALINESE SIGN REREKAN
+1B35          ; Balinese # Mc       BALINESE VOWEL SIGN TEDUNG
+1B36..1B3A    ; Balinese # Mn   [5] BALINESE VOWEL SIGN ULU..BALINESE VOWEL SIGN RA REPA
+1B3B          ; Balinese # Mc       BALINESE VOWEL SIGN RA REPA TEDUNG
+1B3C          ; Balinese # Mn       BALINESE VOWEL SIGN LA LENGA
+1B3D..1B41    ; Balinese # Mc   [5] BALINESE VOWEL SIGN LA LENGA TEDUNG..BALINESE VOWEL SIGN TALING REPA TEDUNG
+1B42          ; Balinese # Mn       BALINESE VOWEL SIGN PEPET
+1B43..1B44    ; Balinese # Mc   [2] BALINESE VOWEL SIGN PEPET TEDUNG..BALINESE ADEG ADEG
+1B45..1B4B    ; Balinese # Lo   [7] BALINESE LETTER KAF SASAK..BALINESE LETTER ASYURA SASAK
+1B50..1B59    ; Balinese # Nd  [10] BALINESE DIGIT ZERO..BALINESE DIGIT NINE
+1B5A..1B60    ; Balinese # Po   [7] BALINESE PANTI..BALINESE PAMENENG
+1B61..1B6A    ; Balinese # So  [10] BALINESE MUSICAL SYMBOL DONG..BALINESE MUSICAL SYMBOL DANG GEDE
+1B6B..1B73    ; Balinese # Mn   [9] BALINESE MUSICAL SYMBOL COMBINING TEGEH..BALINESE MUSICAL SYMBOL COMBINING GONG
+1B74..1B7C    ; Balinese # So   [9] BALINESE MUSICAL SYMBOL RIGHT-HAND OPEN DUG..BALINESE MUSICAL SYMBOL LEFT-HAND OPEN PING
+
+# Total code points: 121
+
+# ================================================
+
+12000..1236E  ; Cuneiform # Lo [879] CUNEIFORM SIGN A..CUNEIFORM SIGN ZUM
+12400..12462  ; Cuneiform # Nl  [99] CUNEIFORM NUMERIC SIGN TWO ASH..CUNEIFORM NUMERIC SIGN OLD ASSYRIAN ONE QUARTER
+12470..12473  ; Cuneiform # Po   [4] CUNEIFORM PUNCTUATION SIGN OLD ASSYRIAN WORD DIVIDER..CUNEIFORM PUNCTUATION SIGN DIAGONAL TRICOLON
+
+# Total code points: 982
+
+# ================================================
+
+10900..10915  ; Phoenician # Lo  [22] PHOENICIAN LETTER ALF..PHOENICIAN LETTER TAU
+10916..1091B  ; Phoenician # No   [6] PHOENICIAN NUMBER ONE..PHOENICIAN NUMBER THREE
+1091F         ; Phoenician # Po       PHOENICIAN WORD SEPARATOR
+
+# Total code points: 29
+
+# ================================================
+
+A840..A873    ; Phags_Pa # Lo  [52] PHAGS-PA LETTER KA..PHAGS-PA LETTER CANDRABINDU
+A874..A877    ; Phags_Pa # Po   [4] PHAGS-PA SINGLE HEAD MARK..PHAGS-PA MARK DOUBLE SHAD
+
+# Total code points: 56
+
+# ================================================
+
+07C0..07C9    ; Nko # Nd  [10] NKO DIGIT ZERO..NKO DIGIT NINE
+07CA..07EA    ; Nko # Lo  [33] NKO LETTER A..NKO LETTER JONA RA
+07EB..07F3    ; Nko # Mn   [9] NKO COMBINING SHORT HIGH TONE..NKO COMBINING DOUBLE DOT ABOVE
+07F4..07F5    ; Nko # Lm   [2] NKO HIGH TONE APOSTROPHE..NKO LOW TONE APOSTROPHE
+07F6          ; Nko # So       NKO SYMBOL OO DENNEN
+07F7..07F9    ; Nko # Po   [3] NKO SYMBOL GBAKURUNEN..NKO EXCLAMATION MARK
+07FA          ; Nko # Lm       NKO LAJANYALAN
+
+# Total code points: 59
+
+# ================================================
+
+1B80..1B81    ; Sundanese # Mn   [2] SUNDANESE SIGN PANYECEK..SUNDANESE SIGN PANGLAYAR
+1B82          ; Sundanese # Mc       SUNDANESE SIGN PANGWISAD
+1B83..1BA0    ; Sundanese # Lo  [30] SUNDANESE LETTER A..SUNDANESE LETTER HA
+1BA1          ; Sundanese # Mc       SUNDANESE CONSONANT SIGN PAMINGKAL
+1BA2..1BA5    ; Sundanese # Mn   [4] SUNDANESE CONSONANT SIGN PANYAKRA..SUNDANESE VOWEL SIGN PANYUKU
+1BA6..1BA7    ; Sundanese # Mc   [2] SUNDANESE VOWEL SIGN PANAELAENG..SUNDANESE VOWEL SIGN PANOLONG
+1BA8..1BA9    ; Sundanese # Mn   [2] SUNDANESE VOWEL SIGN PAMEPET..SUNDANESE VOWEL SIGN PANEULEUNG
+1BAA          ; Sundanese # Mc       SUNDANESE SIGN PAMAAEH
+1BAE..1BAF    ; Sundanese # Lo   [2] SUNDANESE LETTER KHA..SUNDANESE LETTER SYA
+1BB0..1BB9    ; Sundanese # Nd  [10] SUNDANESE DIGIT ZERO..SUNDANESE DIGIT NINE
+
+# Total code points: 55
+
+# ================================================
+
+1C00..1C23    ; Lepcha # Lo  [36] LEPCHA LETTER KA..LEPCHA LETTER A
+1C24..1C2B    ; Lepcha # Mc   [8] LEPCHA SUBJOINED LETTER YA..LEPCHA VOWEL SIGN UU
+1C2C..1C33    ; Lepcha # Mn   [8] LEPCHA VOWEL SIGN E..LEPCHA CONSONANT SIGN T
+1C34..1C35    ; Lepcha # Mc   [2] LEPCHA CONSONANT SIGN NYIN-DO..LEPCHA CONSONANT SIGN KANG
+1C36..1C37    ; Lepcha # Mn   [2] LEPCHA SIGN RAN..LEPCHA SIGN NUKTA
+1C3B..1C3F    ; Lepcha # Po   [5] LEPCHA PUNCTUATION TA-ROL..LEPCHA PUNCTUATION TSHOOK
+1C40..1C49    ; Lepcha # Nd  [10] LEPCHA DIGIT ZERO..LEPCHA DIGIT NINE
+1C4D..1C4F    ; Lepcha # Lo   [3] LEPCHA LETTER TTA..LEPCHA LETTER DDA
+
+# Total code points: 74
+
+# ================================================
+
+1C50..1C59    ; Ol_Chiki # Nd  [10] OL CHIKI DIGIT ZERO..OL CHIKI DIGIT NINE
+1C5A..1C77    ; Ol_Chiki # Lo  [30] OL CHIKI LETTER LA..OL CHIKI LETTER OH
+1C78..1C7D    ; Ol_Chiki # Lm   [6] OL CHIKI MU TTUDDAG..OL CHIKI AHAD
+1C7E..1C7F    ; Ol_Chiki # Po   [2] OL CHIKI PUNCTUATION MUCAAD..OL CHIKI PUNCTUATION DOUBLE MUCAAD
+
+# Total code points: 48
+
+# ================================================
+
+A500..A60B    ; Vai # Lo [268] VAI SYLLABLE EE..VAI SYLLABLE NG
+A60C          ; Vai # Lm       VAI SYLLABLE LENGTHENER
+A60D..A60F    ; Vai # Po   [3] VAI COMMA..VAI QUESTION MARK
+A610..A61F    ; Vai # Lo  [16] VAI SYLLABLE NDOLE FA..VAI SYMBOL JONG
+A620..A629    ; Vai # Nd  [10] VAI DIGIT ZERO..VAI DIGIT NINE
+A62A..A62B    ; Vai # Lo   [2] VAI SYLLABLE NDOLE MA..VAI SYLLABLE NDOLE DO
+
+# Total code points: 300
+
+# ================================================
+
+A880..A881    ; Saurashtra # Mc   [2] SAURASHTRA SIGN ANUSVARA..SAURASHTRA SIGN VISARGA
+A882..A8B3    ; Saurashtra # Lo  [50] SAURASHTRA LETTER A..SAURASHTRA LETTER LLA
+A8B4..A8C3    ; Saurashtra # Mc  [16] SAURASHTRA CONSONANT SIGN HAARU..SAURASHTRA VOWEL SIGN AU
+A8C4          ; Saurashtra # Mn       SAURASHTRA SIGN VIRAMA
+A8CE..A8CF    ; Saurashtra # Po   [2] SAURASHTRA DANDA..SAURASHTRA DOUBLE DANDA
+A8D0..A8D9    ; Saurashtra # Nd  [10] SAURASHTRA DIGIT ZERO..SAURASHTRA DIGIT NINE
+
+# Total code points: 81
+
+# ================================================
+
+A900..A909    ; Kayah_Li # Nd  [10] KAYAH LI DIGIT ZERO..KAYAH LI DIGIT NINE
+A90A..A925    ; Kayah_Li # Lo  [28] KAYAH LI LETTER KA..KAYAH LI LETTER OO
+A926..A92D    ; Kayah_Li # Mn   [8] KAYAH LI VOWEL UE..KAYAH LI TONE CALYA PLOPHU
+A92E..A92F    ; Kayah_Li # Po   [2] KAYAH LI SIGN CWI..KAYAH LI SIGN SHYA
+
+# Total code points: 48
+
+# ================================================
+
+A930..A946    ; Rejang # Lo  [23] REJANG LETTER KA..REJANG LETTER A
+A947..A951    ; Rejang # Mn  [11] REJANG VOWEL SIGN I..REJANG CONSONANT SIGN R
+A952..A953    ; Rejang # Mc   [2] REJANG CONSONANT SIGN H..REJANG VIRAMA
+A95F          ; Rejang # Po       REJANG SECTION MARK
+
+# Total code points: 37
+
+# ================================================
+
+10280..1029C  ; Lycian # Lo  [29] LYCIAN LETTER A..LYCIAN LETTER X
+
+# Total code points: 29
+
+# ================================================
+
+102A0..102D0  ; Carian # Lo  [49] CARIAN LETTER A..CARIAN LETTER UUU3
+
+# Total code points: 49
+
+# ================================================
+
+10920..10939  ; Lydian # Lo  [26] LYDIAN LETTER A..LYDIAN LETTER C
+1093F         ; Lydian # Po       LYDIAN TRIANGULAR MARK
+
+# Total code points: 27
+
+# ================================================
+
+AA00..AA28    ; Cham # Lo  [41] CHAM LETTER A..CHAM LETTER HA
+AA29..AA2E    ; Cham # Mn   [6] CHAM VOWEL SIGN AA..CHAM VOWEL SIGN OE
+AA2F..AA30    ; Cham # Mc   [2] CHAM VOWEL SIGN O..CHAM VOWEL SIGN AI
+AA31..AA32    ; Cham # Mn   [2] CHAM VOWEL SIGN AU..CHAM VOWEL SIGN UE
+AA33..AA34    ; Cham # Mc   [2] CHAM CONSONANT SIGN YA..CHAM CONSONANT SIGN RA
+AA35..AA36    ; Cham # Mn   [2] CHAM CONSONANT SIGN LA..CHAM CONSONANT SIGN WA
+AA40..AA42    ; Cham # Lo   [3] CHAM LETTER FINAL K..CHAM LETTER FINAL NG
+AA43          ; Cham # Mn       CHAM CONSONANT SIGN FINAL NG
+AA44..AA4B    ; Cham # Lo   [8] CHAM LETTER FINAL CH..CHAM LETTER FINAL SS
+AA4C          ; Cham # Mn       CHAM CONSONANT SIGN FINAL M
+AA4D          ; Cham # Mc       CHAM CONSONANT SIGN FINAL H
+AA50..AA59    ; Cham # Nd  [10] CHAM DIGIT ZERO..CHAM DIGIT NINE
+AA5C..AA5F    ; Cham # Po   [4] CHAM PUNCTUATION SPIRAL..CHAM PUNCTUATION TRIPLE DANDA
+
+# Total code points: 83
+
+# ================================================
+
+1A20..1A54    ; Tai_Tham # Lo  [53] TAI THAM LETTER HIGH KA..TAI THAM LETTER GREAT SA
+1A55          ; Tai_Tham # Mc       TAI THAM CONSONANT SIGN MEDIAL RA
+1A56          ; Tai_Tham # Mn       TAI THAM CONSONANT SIGN MEDIAL LA
+1A57          ; Tai_Tham # Mc       TAI THAM CONSONANT SIGN LA TANG LAI
+1A58..1A5E    ; Tai_Tham # Mn   [7] TAI THAM SIGN MAI KANG LAI..TAI THAM CONSONANT SIGN SA
+1A60          ; Tai_Tham # Mn       TAI THAM SIGN SAKOT
+1A61          ; Tai_Tham # Mc       TAI THAM VOWEL SIGN A
+1A62          ; Tai_Tham # Mn       TAI THAM VOWEL SIGN MAI SAT
+1A63..1A64    ; Tai_Tham # Mc   [2] TAI THAM VOWEL SIGN AA..TAI THAM VOWEL SIGN TALL AA
+1A65..1A6C    ; Tai_Tham # Mn   [8] TAI THAM VOWEL SIGN I..TAI THAM VOWEL SIGN OA BELOW
+1A6D..1A72    ; Tai_Tham # Mc   [6] TAI THAM VOWEL SIGN OY..TAI THAM VOWEL SIGN THAM AI
+1A73..1A7C    ; Tai_Tham # Mn  [10] TAI THAM VOWEL SIGN OA ABOVE..TAI THAM SIGN KHUEN-LUE KARAN
+1A7F          ; Tai_Tham # Mn       TAI THAM COMBINING CRYPTOGRAMMIC DOT
+1A80..1A89    ; Tai_Tham # Nd  [10] TAI THAM HORA DIGIT ZERO..TAI THAM HORA DIGIT NINE
+1A90..1A99    ; Tai_Tham # Nd  [10] TAI THAM THAM DIGIT ZERO..TAI THAM THAM DIGIT NINE
+1AA0..1AA6    ; Tai_Tham # Po   [7] TAI THAM SIGN WIANG..TAI THAM SIGN REVERSED ROTATED RANA
+1AA7          ; Tai_Tham # Lm       TAI THAM SIGN MAI YAMOK
+1AA8..1AAD    ; Tai_Tham # Po   [6] TAI THAM SIGN KAAN..TAI THAM SIGN CAANG
+
+# Total code points: 127
+
+# ================================================
+
+AA80..AAAF    ; Tai_Viet # Lo  [48] TAI VIET LETTER LOW KO..TAI VIET LETTER HIGH O
+AAB0          ; Tai_Viet # Mn       TAI VIET MAI KANG
+AAB1          ; Tai_Viet # Lo       TAI VIET VOWEL AA
+AAB2..AAB4    ; Tai_Viet # Mn   [3] TAI VIET VOWEL I..TAI VIET VOWEL U
+AAB5..AAB6    ; Tai_Viet # Lo   [2] TAI VIET VOWEL E..TAI VIET VOWEL O
+AAB7..AAB8    ; Tai_Viet # Mn   [2] TAI VIET MAI KHIT..TAI VIET VOWEL IA
+AAB9..AABD    ; Tai_Viet # Lo   [5] TAI VIET VOWEL UEA..TAI VIET VOWEL AN
+AABE..AABF    ; Tai_Viet # Mn   [2] TAI VIET VOWEL AM..TAI VIET TONE MAI EK
+AAC0          ; Tai_Viet # Lo       TAI VIET TONE MAI NUENG
+AAC1          ; Tai_Viet # Mn       TAI VIET TONE MAI THO
+AAC2          ; Tai_Viet # Lo       TAI VIET TONE MAI SONG
+AADB..AADC    ; Tai_Viet # Lo   [2] TAI VIET SYMBOL KON..TAI VIET SYMBOL NUENG
+AADD          ; Tai_Viet # Lm       TAI VIET SYMBOL SAM
+AADE..AADF    ; Tai_Viet # Po   [2] TAI VIET SYMBOL HO HOI..TAI VIET SYMBOL KOI KOI
+
+# Total code points: 72
+
+# ================================================
+
+10B00..10B35  ; Avestan # Lo  [54] AVESTAN LETTER A..AVESTAN LETTER HE
+10B39..10B3F  ; Avestan # Po   [7] AVESTAN ABBREVIATION MARK..LARGE ONE RING OVER TWO RINGS PUNCTUATION
+
+# Total code points: 61
+
+# ================================================
+
+13000..1342E  ; Egyptian_Hieroglyphs # Lo [1071] EGYPTIAN HIEROGLYPH A001..EGYPTIAN HIEROGLYPH AA032
+
+# Total code points: 1071
+
+# ================================================
+
+0800..0815    ; Samaritan # Lo  [22] SAMARITAN LETTER ALAF..SAMARITAN LETTER TAAF
+0816..0819    ; Samaritan # Mn   [4] SAMARITAN MARK IN..SAMARITAN MARK DAGESH
+081A          ; Samaritan # Lm       SAMARITAN MODIFIER LETTER EPENTHETIC YUT
+081B..0823    ; Samaritan # Mn   [9] SAMARITAN MARK EPENTHETIC YUT..SAMARITAN VOWEL SIGN A
+0824          ; Samaritan # Lm       SAMARITAN MODIFIER LETTER SHORT A
+0825..0827    ; Samaritan # Mn   [3] SAMARITAN VOWEL SIGN SHORT A..SAMARITAN VOWEL SIGN U
+0828          ; Samaritan # Lm       SAMARITAN MODIFIER LETTER I
+0829..082D    ; Samaritan # Mn   [5] SAMARITAN VOWEL SIGN LONG I..SAMARITAN MARK NEQUDAA
+0830..083E    ; Samaritan # Po  [15] SAMARITAN PUNCTUATION NEQUDAA..SAMARITAN PUNCTUATION ANNAAU
+
+# Total code points: 61
+
+# ================================================
+
+A4D0..A4F7    ; Lisu # Lo  [40] LISU LETTER BA..LISU LETTER OE
+A4F8..A4FD    ; Lisu # Lm   [6] LISU LETTER TONE MYA TI..LISU LETTER TONE MYA JEU
+A4FE..A4FF    ; Lisu # Po   [2] LISU PUNCTUATION COMMA..LISU PUNCTUATION FULL STOP
+
+# Total code points: 48
+
+# ================================================
+
+A6A0..A6E5    ; Bamum # Lo  [70] BAMUM LETTER A..BAMUM LETTER KI
+A6E6..A6EF    ; Bamum # Nl  [10] BAMUM LETTER MO..BAMUM LETTER KOGHOM
+A6F0..A6F1    ; Bamum # Mn   [2] BAMUM COMBINING MARK KOQNDON..BAMUM COMBINING MARK TUKWENTIS
+A6F2..A6F7    ; Bamum # Po   [6] BAMUM NJAEMLI..BAMUM QUESTION MARK
+
+# Total code points: 88
+
+# ================================================
+
+A980..A982    ; Javanese # Mn   [3] JAVANESE SIGN PANYANGGA..JAVANESE SIGN LAYAR
+A983          ; Javanese # Mc       JAVANESE SIGN WIGNYAN
+A984..A9B2    ; Javanese # Lo  [47] JAVANESE LETTER A..JAVANESE LETTER HA
+A9B3          ; Javanese # Mn       JAVANESE SIGN CECAK TELU
+A9B4..A9B5    ; Javanese # Mc   [2] JAVANESE VOWEL SIGN TARUNG..JAVANESE VOWEL SIGN TOLONG
+A9B6..A9B9    ; Javanese # Mn   [4] JAVANESE VOWEL SIGN WULU..JAVANESE VOWEL SIGN SUKU MENDUT
+A9BA..A9BB    ; Javanese # Mc   [2] JAVANESE VOWEL SIGN TALING..JAVANESE VOWEL SIGN DIRGA MURE
+A9BC          ; Javanese # Mn       JAVANESE VOWEL SIGN PEPET
+A9BD..A9C0    ; Javanese # Mc   [4] JAVANESE CONSONANT SIGN KERET..JAVANESE PANGKON
+A9C1..A9CD    ; Javanese # Po  [13] JAVANESE LEFT RERENGGAN..JAVANESE TURNED PADA PISELEH
+A9CF          ; Javanese # Lm       JAVANESE PANGRANGKEP
+A9D0..A9D9    ; Javanese # Nd  [10] JAVANESE DIGIT ZERO..JAVANESE DIGIT NINE
+A9DE..A9DF    ; Javanese # Po   [2] JAVANESE PADA TIRTA TUMETES..JAVANESE PADA ISEN-ISEN
+
+# Total code points: 91
+
+# ================================================
+
+ABC0..ABE2    ; Meetei_Mayek # Lo  [35] MEETEI MAYEK LETTER KOK..MEETEI MAYEK LETTER I LONSUM
+ABE3..ABE4    ; Meetei_Mayek # Mc   [2] MEETEI MAYEK VOWEL SIGN ONAP..MEETEI MAYEK VOWEL SIGN INAP
+ABE5          ; Meetei_Mayek # Mn       MEETEI MAYEK VOWEL SIGN ANAP
+ABE6..ABE7    ; Meetei_Mayek # Mc   [2] MEETEI MAYEK VOWEL SIGN YENAP..MEETEI MAYEK VOWEL SIGN SOUNAP
+ABE8          ; Meetei_Mayek # Mn       MEETEI MAYEK VOWEL SIGN UNAP
+ABE9..ABEA    ; Meetei_Mayek # Mc   [2] MEETEI MAYEK VOWEL SIGN CHEINAP..MEETEI MAYEK VOWEL SIGN NUNG
+ABEB          ; Meetei_Mayek # Po       MEETEI MAYEK CHEIKHEI
+ABEC          ; Meetei_Mayek # Mc       MEETEI MAYEK LUM IYEK
+ABED          ; Meetei_Mayek # Mn       MEETEI MAYEK APUN IYEK
+ABF0..ABF9    ; Meetei_Mayek # Nd  [10] MEETEI MAYEK DIGIT ZERO..MEETEI MAYEK DIGIT NINE
+
+# Total code points: 56
+
+# ================================================
+
+10840..10855  ; Imperial_Aramaic # Lo  [22] IMPERIAL ARAMAIC LETTER ALEPH..IMPERIAL ARAMAIC LETTER TAW
+10857         ; Imperial_Aramaic # Po       IMPERIAL ARAMAIC SECTION SIGN
+10858..1085F  ; Imperial_Aramaic # No   [8] IMPERIAL ARAMAIC NUMBER ONE..IMPERIAL ARAMAIC NUMBER TEN THOUSAND
+
+# Total code points: 31
+
+# ================================================
+
+10A60..10A7C  ; Old_South_Arabian # Lo  [29] OLD SOUTH ARABIAN LETTER HE..OLD SOUTH ARABIAN LETTER THETH
+10A7D..10A7E  ; Old_South_Arabian # No   [2] OLD SOUTH ARABIAN NUMBER ONE..OLD SOUTH ARABIAN NUMBER FIFTY
+10A7F         ; Old_South_Arabian # Po       OLD SOUTH ARABIAN NUMERIC INDICATOR
+
+# Total code points: 32
+
+# ================================================
+
+10B40..10B55  ; Inscriptional_Parthian # Lo  [22] INSCRIPTIONAL PARTHIAN LETTER ALEPH..INSCRIPTIONAL PARTHIAN LETTER TAW
+10B58..10B5F  ; Inscriptional_Parthian # No   [8] INSCRIPTIONAL PARTHIAN NUMBER ONE..INSCRIPTIONAL PARTHIAN NUMBER ONE THOUSAND
+
+# Total code points: 30
+
+# ================================================
+
+10B60..10B72  ; Inscriptional_Pahlavi # Lo  [19] INSCRIPTIONAL PAHLAVI LETTER ALEPH..INSCRIPTIONAL PAHLAVI LETTER TAW
+10B78..10B7F  ; Inscriptional_Pahlavi # No   [8] INSCRIPTIONAL PAHLAVI NUMBER ONE..INSCRIPTIONAL PAHLAVI NUMBER ONE THOUSAND
+
+# Total code points: 27
+
+# ================================================
+
+10C00..10C48  ; Old_Turkic # Lo  [73] OLD TURKIC LETTER ORKHON A..OLD TURKIC LETTER ORKHON BASH
+
+# Total code points: 73
+
+# ================================================
+
+11080..11081  ; Kaithi # Mn   [2] KAITHI SIGN CANDRABINDU..KAITHI SIGN ANUSVARA
+11082         ; Kaithi # Mc       KAITHI SIGN VISARGA
+11083..110AF  ; Kaithi # Lo  [45] KAITHI LETTER A..KAITHI LETTER HA
+110B0..110B2  ; Kaithi # Mc   [3] KAITHI VOWEL SIGN AA..KAITHI VOWEL SIGN II
+110B3..110B6  ; Kaithi # Mn   [4] KAITHI VOWEL SIGN U..KAITHI VOWEL SIGN AI
+110B7..110B8  ; Kaithi # Mc   [2] KAITHI VOWEL SIGN O..KAITHI VOWEL SIGN AU
+110B9..110BA  ; Kaithi # Mn   [2] KAITHI SIGN VIRAMA..KAITHI SIGN NUKTA
+110BB..110BC  ; Kaithi # Po   [2] KAITHI ABBREVIATION SIGN..KAITHI ENUMERATION SIGN
+110BD         ; Kaithi # Cf       KAITHI NUMBER SIGN
+110BE..110C1  ; Kaithi # Po   [4] KAITHI SECTION MARK..KAITHI DOUBLE DANDA
+
+# Total code points: 66
+
+# EOF
--- a/jdk/test/java/lang/ClassLoader/UninitializedParent.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/test/java/lang/ClassLoader/UninitializedParent.java	Wed Jul 21 09:57:21 2010 -0700
@@ -26,6 +26,7 @@
  * @bug 6636650
  * @summary Uninitialized class loaders should not be a parent of other
  *          class loaders.
+ * @run main/othervm UninitializedParent
  */
 
 
--- a/jdk/test/java/lang/ClassLoader/defineClass/DefineClassByteBuffer.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/test/java/lang/ClassLoader/defineClass/DefineClassByteBuffer.java	Wed Jul 21 09:57:21 2010 -0700
@@ -38,14 +38,17 @@
 public class DefineClassByteBuffer {
 
     static void test(ClassLoader cl) throws Exception {
-        Class c = Class.forName("TestClass", true, cl);
+        Class<?> c = Class.forName("TestClass", true, cl);
         if (!"TestClass".equals(c.getName())) {
             throw new RuntimeException("Got wrong class: " + c);
         }
+        if (c.getClassLoader() != cl) {
+            throw new RuntimeException("TestClass defined by wrong classloader: " + c.getClassLoader());
+        }
     }
 
     public static void main(String arg[]) throws Exception {
-        ClassLoader[] cls = new ClassLoader[DummyClassLoader.MAX_TYPE];
+        DummyClassLoader[] cls = new DummyClassLoader[DummyClassLoader.MAX_TYPE];
         for (int i = 0; i < cls.length; i++) {
             cls[i] = new DummyClassLoader(i);
         }
@@ -53,7 +56,7 @@
         /* Create several instances of the class using different classloaders,
            which are using different types of ByteBuffer. */
         for (int i = 0; i < cls.length; i++) {
-          test(cls[i]);
+            test(cls[i]);
         }
     }
 
@@ -100,12 +103,13 @@
                buffers. */
             buffers[MAPPED_BUFFER] = readClassFile(CLASS_NAME + ".class");
             byte[] array = new byte[buffers[MAPPED_BUFFER].limit()];
+            buffers[MAPPED_BUFFER].get(array).flip();
 
             buffers[DIRECT_BUFFER] = ByteBuffer.allocateDirect(array.length);
-            buffers[DIRECT_BUFFER].put(array);
+            buffers[DIRECT_BUFFER].put(array).flip();
 
             buffers[ARRAY_BUFFER] = ByteBuffer.allocate(array.length);
-            buffers[ARRAY_BUFFER].put(array);
+            buffers[ARRAY_BUFFER].put(array).flip();
 
             buffers[WRAPPED_BUFFER] = ByteBuffer.wrap(array);
 
@@ -118,9 +122,30 @@
             buffers[DUP_DIRECT_BUFFER] = buffers[DIRECT_BUFFER].duplicate();
         }
 
-         public Class findClass(String name) {
-             return defineClass(name, buffers[loaderType], null);
-         }
+        protected Class<?> loadClass(String name, boolean resolve)
+            throws ClassNotFoundException
+        {
+            Class<?> c;
+            if (!"TestClass".equals(name)) {
+                c = super.loadClass(name, resolve);
+            } else {
+                // should not delegate to the system class loader
+                c = findClass(name);
+                if (resolve) {
+                    resolveClass(c);
+                }
+            }
+            return c;
+        }
+
+        protected Class<?> findClass(String name)
+            throws ClassNotFoundException
+        {
+            if (!"TestClass".equals(name)) {
+                throw new ClassNotFoundException("Unexpected class: " + name);
+            }
+            return defineClass(name, buffers[loaderType], null);
+        }
     } /* DummyClassLoader */
 
 } /* DefineClassByteBuffer */
--- a/jdk/test/java/lang/ClassLoader/findSystemClass/Loader.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/test/java/lang/ClassLoader/findSystemClass/Loader.java	Wed Jul 21 09:57:21 2010 -0700
@@ -21,10 +21,16 @@
  * questions.
  */
 
+/*
+ * This test runs in othervm mode as it tests ClassLoader.findSystemClass
+ * and getSystemResource methods.
+ */
+
 /* @test
    @bug 4147599 4478150
    @summary In 1.2beta4-I ClassLoader loaded classes can not link
             against application classes.
+   @run main/othervm Loader
 */
 
 /*
--- a/jdk/test/java/lang/ProcessBuilder/Basic.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/test/java/lang/ProcessBuilder/Basic.java	Wed Jul 21 09:57:21 2010 -0700
@@ -28,7 +28,7 @@
  *      6464154 6523983 6206031 4960438 6631352 6631966 6850957 6850958
  *      4947220
  * @summary Basic tests for Process and Environment Variable code
- * @run main/othervm Basic
+ * @run main/othervm/timeout=300 Basic
  * @author Martin Buchholz
  */
 
@@ -37,6 +37,7 @@
 
 import java.io.*;
 import java.util.*;
+import java.util.concurrent.CountDownLatch;
 import java.security.*;
 import java.util.regex.Pattern;
 import static java.lang.System.getenv;
@@ -252,9 +253,9 @@
         return sb.toString();
     }
 
-    static void print4095(OutputStream s) throws Throwable {
+    static void print4095(OutputStream s, byte b) throws Throwable {
         byte[] bytes = new byte[4095];
-        Arrays.fill(bytes, (byte) '!');
+        Arrays.fill(bytes, b);
         s.write(bytes);         // Might hang!
     }
 
@@ -273,7 +274,9 @@
     public static class JavaChild {
         public static void main(String args[]) throws Throwable {
             String action = args[0];
-            if (action.equals("testIO")) {
+            if (action.equals("sleep")) {
+                Thread.sleep(10 * 60 * 1000L);
+            } else if (action.equals("testIO")) {
                 String expected = "standard input";
                 char[] buf = new char[expected.length()+1];
                 int n = new InputStreamReader(System.in).read(buf,0,buf.length);
@@ -315,7 +318,8 @@
                 printUTF8(new File(System.getProperty("user.dir"))
                           .getCanonicalPath());
             } else if (action.equals("print4095")) {
-                print4095(System.out);
+                print4095(System.out, (byte) '!');
+                print4095(System.err, (byte) 'E');
                 System.exit(5);
             } else if (action.equals("OutErr")) {
                 // You might think the system streams would be
@@ -1717,16 +1721,107 @@
         } catch (Throwable t) { unexpected(t); }
 
         //----------------------------------------------------------------
-        // This would deadlock, if not for the fact that
+        // Attempt to write 4095 bytes to the pipe buffer without a
+        // reader to drain it would deadlock, if not for the fact that
         // interprocess pipe buffers are at least 4096 bytes.
+        //
+        // Also, check that available reports all the bytes expected
+        // in the pipe buffer, and that I/O operations do the expected
+        // things.
         //----------------------------------------------------------------
         try {
             List<String> childArgs = new ArrayList<String>(javaChildArgs);
             childArgs.add("print4095");
-            Process p = new ProcessBuilder(childArgs).start();
-            print4095(p.getOutputStream()); // Might hang!
-            p.waitFor();                    // Might hang!
+            final int SIZE = 4095;
+            final Process p = new ProcessBuilder(childArgs).start();
+            print4095(p.getOutputStream(), (byte) '!'); // Might hang!
+            p.waitFor();                                // Might hang!
+            equal(SIZE, p.getInputStream().available());
+            equal(SIZE, p.getErrorStream().available());
+            THROWS(IOException.class,
+                   new Fun(){void f() throws IOException {
+                       p.getOutputStream().write((byte) '!');
+                       p.getOutputStream().flush();
+                       }});
+
+            final byte[] bytes = new byte[SIZE + 1];
+            equal(SIZE, p.getInputStream().read(bytes));
+            for (int i = 0; i < SIZE; i++)
+                equal((byte) '!', bytes[i]);
+            equal((byte) 0, bytes[SIZE]);
+
+            equal(SIZE, p.getErrorStream().read(bytes));
+            for (int i = 0; i < SIZE; i++)
+                equal((byte) 'E', bytes[i]);
+            equal((byte) 0, bytes[SIZE]);
+
+            equal(0, p.getInputStream().available());
+            equal(0, p.getErrorStream().available());
+            equal(-1, p.getErrorStream().read());
+            equal(-1, p.getInputStream().read());
+
             equal(p.exitValue(), 5);
+
+            p.getInputStream().close();
+            p.getErrorStream().close();
+            p.getOutputStream().close();
+
+            InputStream[] streams = { p.getInputStream(), p.getErrorStream() };
+            for (final InputStream in : streams) {
+                Fun[] ops = {
+                    new Fun(){void f() throws IOException {
+                        in.read(); }},
+                    new Fun(){void f() throws IOException {
+                        in.read(bytes); }},
+                    new Fun(){void f() throws IOException {
+                        in.available(); }}
+                };
+                for (Fun op : ops) {
+                    try {
+                        op.f();
+                        fail();
+                    } catch (IOException expected) {
+                        check(expected.getMessage()
+                              .matches("[Ss]tream [Cc]losed"));
+                    }
+                }
+            }
+        } catch (Throwable t) { unexpected(t); }
+
+        //----------------------------------------------------------------
+        // Check that reads which are pending when Process.destroy is
+        // called, get EOF, not IOException("Stream closed").
+        //----------------------------------------------------------------
+        try {
+            final int cases = 4;
+            for (int i = 0; i < cases; i++) {
+                final int action = i;
+                List<String> childArgs = new ArrayList<String>(javaChildArgs);
+                childArgs.add("sleep");
+                final byte[] bytes = new byte[10];
+                final Process p = new ProcessBuilder(childArgs).start();
+                final CountDownLatch latch = new CountDownLatch(1);
+                final Thread thread = new Thread() {
+                    public void run() {
+                        try {
+                            latch.countDown();
+                            int r;
+                            switch (action) {
+                            case 0: r = p.getInputStream().read(); break;
+                            case 1: r = p.getErrorStream().read(); break;
+                            case 2: r = p.getInputStream().read(bytes); break;
+                            case 3: r = p.getErrorStream().read(bytes); break;
+                            default: throw new Error();
+                            }
+                            equal(-1, r);
+                        } catch (Throwable t) { unexpected(t); }}};
+
+                thread.start();
+                latch.await();
+                Thread.sleep(10);
+                p.destroy();
+                thread.join();
+            }
         } catch (Throwable t) { unexpected(t); }
 
         //----------------------------------------------------------------
@@ -1741,7 +1836,6 @@
         } catch (IOException e) {
             new File("./emptyCommand").delete();
             String m = e.getMessage();
-            //e.printStackTrace();
             if (EnglishUnix.is() &&
                 ! matches(m, "Permission denied"))
                 unexpected(e);
--- a/jdk/test/java/lang/Runtime/exec/ExecWithDir.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/test/java/lang/Runtime/exec/ExecWithDir.java	Wed Jul 21 09:57:21 2010 -0700
@@ -23,6 +23,7 @@
 
 /* @test
  * @bug 4750978
+ * @run main/othervm/timeout=300 ExecWithDir
  * @summary Ensure that we can fork-and-exec repeatedly when a new working
  *          directory is specified
  */
--- a/jdk/test/java/lang/String/Supplementary.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/test/java/lang/String/Supplementary.java	Wed Jul 21 09:57:21 2010 -0700
@@ -62,7 +62,7 @@
          0     1     2345     678     9     012     345678     9 01     2     */
         "\uD800\uDC00!#$\uD800%&\uD800\uDC00;+\uDC00<>;=^\uDC00\\@\uD800\uDC00",
 
-        // includes an undefined supprementary characters in Unicode 4.0.0
+        // includes an undefined supplementary character in Unicode 4.0.0
       /*                                    1     11     1     1111     1
          0     1     2345     6     789     0     12     3     4567     8     */
         "\uDB40\uDE00abc\uDE01\uDB40de\uDB40\uDE02f\uDB40\uDE03ghi\uDB40\uDE02",
@@ -168,7 +168,7 @@
      * string in input[m].
      *
      * The meaning of each element in golden3[][n]
-     *   golden3[][0]: characater which is searched.
+     *   golden3[][0]: character which is searched.
      *   golden3[][2]: the golden data for indexOf(int ch)
      *   From golden3[][2] to golden3[][n-1]:
      *       the golden data for indexOf(int ch, int fromIndex)
@@ -201,17 +201,17 @@
             /*
              * Normal case
              */
-            testIndexOf(First, s, golden3[i][0], golden3[i][2]);
+            testIndexOf(s, golden3[i][0], golden3[i][2]);
 
             /*
              * Abnormal case - char which isn't included in the string.
              */
-            testIndexOf(First, s, 'Z', -1);
-            testIndexOf(First, s, 0xDB98, -1);
-            testIndexOf(First, s, 0xDE76, -1);
-            testIndexOf(First, s, 0x12345, -1);
-            testIndexOf(First, s, -1, -1);
-            testIndexOf(First, s, 0x110000, -1);
+            testIndexOf(s, 'Z', -1);
+            testIndexOf(s, 0xDB98, -1);
+            testIndexOf(s, 0xDE76, -1);
+            testIndexOf(s, 0x12345, -1);
+            testIndexOf(s, -1, -1);
+            testIndexOf(s, 0x110000, -1);
         }
     }
 
@@ -229,7 +229,7 @@
              */
             int fromIndex = 0;
             for (int j = 2; j < golden3[i].length; j++) {
-                fromIndex = testIndexOf(First, s, fromIndex, ch,
+                fromIndex = testIndexOf(s, fromIndex, ch,
                                         golden3[i][j]) + 1;
             }
 
@@ -237,19 +237,19 @@
              * Abnormal case1 - char is included in the string but fromIndex
              *                  is incorrect.
              */
-            testIndexOf(First, s, -1, ch, golden3[i][2]);
-            testIndexOf(First, s, s.length(), ch,
+            testIndexOf(s, -1, ch, golden3[i][2]);
+            testIndexOf(s, s.length(), ch,
                         golden3[i][golden3[i].length-1]);
 
             /*
              * Abnormal case2 - char which isn't included in the string.
              */
-            testIndexOf(First, s, 0, 'Z', -1);
-            testIndexOf(First, s, 0, 0xDB98, -1);
-            testIndexOf(First, s, 0, 0xDE76, -1);
-            testIndexOf(First, s, 0, 0x12345, -1);
-            testIndexOf(First, s, 0, -1, -1);
-            testIndexOf(First, s, 0, 0x110000, -1);
+            testIndexOf(s, 0, 'Z', -1);
+            testIndexOf(s, 0, 0xDB98, -1);
+            testIndexOf(s, 0, 0xDE76, -1);
+            testIndexOf(s, 0, 0x12345, -1);
+            testIndexOf(s, 0, -1, -1);
+            testIndexOf(s, 0, 0x110000, -1);
         }
     }
 
@@ -264,18 +264,18 @@
             /*
              * Normal case
              */
-            testIndexOf(Last, s, golden3[i][0],
+            testLastIndexOf(s, golden3[i][0],
                         golden3[i][golden3[i].length-2]);
 
             /*
              * Abnormal case - char which isn't included in the string.
              */
-            testIndexOf(Last, s, 'Z', -1);
-            testIndexOf(Last, s, 0xDB98, -1);
-            testIndexOf(Last, s, 0xDE76, -1);
-            testIndexOf(Last, s, 0x12345, -1);
-            testIndexOf(Last, s, -1, -1);
-            testIndexOf(Last, s, 0x110000, -1);
+            testLastIndexOf(s, 'Z', -1);
+            testLastIndexOf(s, 0xDB98, -1);
+            testLastIndexOf(s, 0xDE76, -1);
+            testLastIndexOf(s, 0x12345, -1);
+            testLastIndexOf(s, -1, -1);
+            testLastIndexOf(s, 0x110000, -1);
         }
     }
 
@@ -294,7 +294,7 @@
              */
             int fromIndex = len - 1;
             for (int j = golden3[i].length - 2; j > 0; j--) {
-                fromIndex = testIndexOf(Last, s, fromIndex, ch,
+                fromIndex = testLastIndexOf(s, fromIndex, ch,
                                         golden3[i][j]) - 1;
             }
 
@@ -302,18 +302,18 @@
              * Abnormal case1 - char is included in the string but fromIndex
              *                  is incorrect.
              */
-            testIndexOf(Last, s, -1, ch, golden3[i][1]);
-            testIndexOf(Last, s, len, ch, golden3[i][golden3[i].length-2]);
+            testLastIndexOf(s, -1, ch, golden3[i][1]);
+            testLastIndexOf(s, len, ch, golden3[i][golden3[i].length-2]);
 
             /*
              * Abnormal case2 - char which isn't included in the string.
              */
-            testIndexOf(Last, s, len, 'Z', -1);
-            testIndexOf(Last, s, len, 0xDB98, -1);
-            testIndexOf(Last, s, len, 0xDE76, -1);
-            testIndexOf(Last, s, len, 0x12345, -1);
-            testIndexOf(Last, s, len, -1, -1);
-            testIndexOf(Last, s, len, 0x110000, -1);
+            testLastIndexOf(s, len, 'Z', -1);
+            testLastIndexOf(s, len, 0xDB98, -1);
+            testLastIndexOf(s, len, 0xDE76, -1);
+            testLastIndexOf(s, len, 0x12345, -1);
+            testLastIndexOf(s, len, -1, -1);
+            testLastIndexOf(s, len, 0x110000, -1);
         }
     }
 
@@ -471,7 +471,7 @@
                       result, expected);
                 result = str.offsetByCodePoints(j, -nCodePoints);
                 check(result != 0,
-                      "offsetBycodePoints(input["+i+"], "+j+", "+(-nCodePoints)+")",
+                      "offsetByCodePoints(input["+i+"], "+j+", "+(-nCodePoints)+")",
                       result, 0);
             }
 
@@ -531,7 +531,7 @@
                       result, expected);
                 result = str.offsetByCodePoints(j, -nCodePoints);
                 check(result != 0,
-                      "offsetBycodePoints(input["+i+"], "+j+", "+(-nCodePoints)+")",
+                      "offsetByCodePoints(input["+i+"], "+j+", "+(-nCodePoints)+")",
                       result, 0);
             }
         }
@@ -539,7 +539,7 @@
 
 
     static final boolean At = true, Before = false;
-    static final boolean First = true, Last = false;
+    static final boolean FIRST = true, LAST = false;
 
     static void testCodePoint(boolean isAt, String s, int index, int expected) {
         int c = isAt ? s.codePointAt(index) : s.codePointBefore(index);
@@ -563,22 +563,72 @@
               + s + "> should throw StringIndexOutOfBoundsPointerException.");
     }
 
-    static void testIndexOf(boolean isFirst, String s, int c, int expected) {
-        int index = isFirst ? s.indexOf(c) : s.lastIndexOf(c);
+    static void testIndexOf(String s, int c, int expected) {
+        testIndexOf2(s, c, expected);
+        if (s.indexOf(c) != -1) {
+            testIndexOf2(s + (char) c, c, expected);
+            if (Character.isSupplementaryCodePoint(c)) {
+                char[] surrogates = Character.toChars(c);
+                testIndexOf2(s + new String(surrogates), c, expected);
+                testIndexOf2(s + surrogates[0], c, expected);
+                testIndexOf2(s + surrogates[1], c, expected);
+                testIndexOf2(new String(surrogates) + s, c, 0);
+                testIndexOf2(surrogates[0] + s, c, expected + 1);
+                testIndexOf2(surrogates[1] + s, c, expected + 1);
+            }
+        }
+    }
+
+    static void testIndexOf2(String s, int c, int expected) {
+        int index = s.indexOf(c);
 
         check(index != expected,
-              (isFirst ? "i" : "lastI") + "ndexOf(" + toHexString(c)
-              + ") for <" + s + ">", index, expected);
+              "indexOf(" + toHexString(c) + ") for <" + s + ">",
+              index, expected);
     }
 
-    static int testIndexOf(boolean isFirst, String s, int fromIndex, int c,
-                           int expected) {
-        int index = isFirst ? s.indexOf(c, fromIndex) :
-                              s.lastIndexOf(c, fromIndex);
+    static void testLastIndexOf(String s, int c, int expected) {
+        testLastIndexOf2(s, c, expected);
+        if (s.lastIndexOf(c) != -1) {
+            testLastIndexOf2((char) c + s, c, expected + 1);
+            if (Character.isSupplementaryCodePoint(c)) {
+                char[] surrogates = Character.toChars(c);
+                testLastIndexOf2(s + new String(surrogates), c, s.length());
+                testLastIndexOf2(s + surrogates[0], c, expected);
+                testLastIndexOf2(s + surrogates[1], c, expected);
+                testLastIndexOf2(new String(surrogates) + s, c, expected + 2);
+                testLastIndexOf2(surrogates[0] + s, c, expected + 1);
+                testLastIndexOf2(surrogates[1] + s, c, expected + 1);
+            }
+        }
+    }
+
+    static void testLastIndexOf2(String s, int c, int expected) {
+        int index = s.lastIndexOf(c);
 
         check(index != expected,
-              (isFirst ? "i" : "lastI") + "ndexOf(" + toHexString(c) + ", "
-              + fromIndex + ") for <" + s + ">", index, expected);
+              "lastIndexOf(" + toHexString(c) + ") for <" + s + ">",
+              index, expected);
+    }
+
+    static int testIndexOf(String s, int fromIndex, int c, int expected) {
+        int index = s.indexOf(c, fromIndex);
+
+        check(index != expected,
+              "indexOf(" + toHexString(c) + ", "
+              + fromIndex + ") for <" + s + ">",
+              index, expected);
+
+        return index;
+    }
+
+    static int testLastIndexOf(String s, int fromIndex, int c, int expected) {
+        int index = s.lastIndexOf(c, fromIndex);
+
+        check(index != expected,
+              "lastIndexOf(" + toHexString(c) + ", "
+              + fromIndex + ") for <" + s + ">",
+              index, expected);
 
         return index;
     }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/lang/StringBuffer/Capacity.java	Wed Jul 21 09:57:21 2010 -0700
@@ -0,0 +1,85 @@
+/*
+ * Copyright 2010 Google 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.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along 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.
+ */
+
+/*
+ * @test
+ * @bug 6952330
+ * @summary Test StringBuffer/StringBuilder capacity handling.
+ */
+
+import java.util.Random;
+
+public class Capacity {
+    void test(String[] args) throws Throwable {
+        Random rnd = new Random();
+        int[] sizes = { 0, 1, rnd.nextInt(10), rnd.nextInt(1000) };
+        for (int size : sizes) {
+            equal(16, new StringBuffer().capacity());
+            equal(16, new StringBuilder().capacity());
+            StringBuffer buff = new StringBuffer(size);
+            StringBuilder bild = new StringBuilder(size);
+            equal(size, buff.capacity());
+            equal(size, bild.capacity());
+            buff.ensureCapacity(size);
+            bild.ensureCapacity(size);
+            equal(size, buff.capacity());
+            equal(size, bild.capacity());
+            buff.ensureCapacity(size+1);
+            bild.ensureCapacity(size+1);
+            equal(size*2+2, buff.capacity());
+            equal(size*2+2, bild.capacity());
+            size = buff.capacity();
+            buff.ensureCapacity(size*2+1);
+            bild.ensureCapacity(size*2+1);
+            equal(size*2+2, buff.capacity());
+            equal(size*2+2, bild.capacity());
+            size = buff.capacity();
+            int newSize = size * 2 + 3;
+            buff.ensureCapacity(newSize);
+            bild.ensureCapacity(newSize);
+            equal(newSize, buff.capacity());
+            equal(newSize, bild.capacity());
+            buff.ensureCapacity(0);
+            bild.ensureCapacity(0);
+            equal(newSize, buff.capacity());
+            equal(newSize, bild.capacity());
+        }
+    }
+
+    //--------------------- 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 Capacity().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");}
+}
--- a/jdk/test/java/lang/StringBuffer/Supplementary.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/test/java/lang/StringBuffer/Supplementary.java	Wed Jul 21 09:57:21 2010 -0700
@@ -24,7 +24,7 @@
 /*
  *
  * @test
- * @bug 4533872 4915683 4985217 5017280
+ * @bug 4533872 4915683 4985217 5017280 6937112
  * @summary Unit tests for supplementary character support (JSR-204)
  */
 
@@ -57,7 +57,7 @@
          0     1     2345     678     9     012     345678     9 01     2     */
         "\uD800\uDC00!#$\uD800%&\uD800\uDC00;+\uDC00<>;=^\uDC00\\@\uD800\uDC00",
 
-        // includes an undefined supprementary characters in Unicode 4.0.0
+        // includes an undefined supplementary character in Unicode 4.0.0
       /*                                    1     11     1     1111     1
          0     1     2345     6     789     0     12     3     4567     8     */
         "\uDB40\uDE00abc\uDE01\uDB40de\uDB40\uDE02f\uDB40\uDE03ghi\uDB40\uDE02",
@@ -151,7 +151,7 @@
         "\uD800on\uDC00ml\uDC00\uDC00ki9\uD800\uDC00hgfe\uDBFF\uDFFFdcba\uDC00",
         "\uD800\uDC00@\\\uDC00^=;><\uDC00+;\uD800\uDC00&%\uD800$#!\uD800\uDC00",
 
-        // includes an undefined supprementary characters in Unicode 4.0.0
+        // includes an undefined supplementary character in Unicode 4.0.0
         "\uDB40\uDE02ihg\uDB40\uDE03f\uDB40\uDE02ed\uDB40\uDE01cba\uDB40\uDE00",
     };
 
--- a/jdk/test/java/lang/StringBuilder/Supplementary.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/test/java/lang/StringBuilder/Supplementary.java	Wed Jul 21 09:57:21 2010 -0700
@@ -57,7 +57,7 @@
          0     1     2345     678     9     012     345678     9 01     2     */
         "\uD800\uDC00!#$\uD800%&\uD800\uDC00;+\uDC00<>;=^\uDC00\\@\uD800\uDC00",
 
-        // includes an undefined supprementary characters in Unicode 4.0.0
+        // includes an undefined supplementary character in Unicode 4.0.0
       /*                                    1     11     1     1111     1
          0     1     2345     6     789     0     12     3     4567     8     */
         "\uDB40\uDE00abc\uDE01\uDB40de\uDB40\uDE02f\uDB40\uDE03ghi\uDB40\uDE02",
@@ -151,7 +151,7 @@
         "\uD800on\uDC00ml\uDC00\uDC00ki9\uD800\uDC00hgfe\uDBFF\uDFFFdcba\uDC00",
         "\uD800\uDC00@\\\uDC00^=;><\uDC00+;\uD800\uDC00&%\uD800$#!\uD800\uDC00",
 
-        // includes an undefined supprementary characters in Unicode 4.0.0
+        // includes an undefined supplementary character in Unicode 4.0.0
         "\uDB40\uDE02ihg\uDB40\uDE03f\uDB40\uDE02ed\uDB40\uDE01cba\uDB40\uDE00",
     };
 
--- a/jdk/test/java/lang/System/ExitFinalizersAndJIT.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/test/java/lang/System/ExitFinalizersAndJIT.java	Wed Jul 21 09:57:21 2010 -0700
@@ -26,6 +26,7 @@
    @summary runFinalizersOnExit(true) causes JIT to be unloaded and
             crashes the VM.  Interim fix for 1.2 beta4 -- don't unload
             native libraries loaded by system classes.
+   @run main/othervm ExitFinalizersAndJIT
 */
 
 public class ExitFinalizersAndJIT {
--- a/jdk/test/java/lang/System/IgnoreNullSecurityManager.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/test/java/lang/System/IgnoreNullSecurityManager.java	Wed Jul 21 09:57:21 2010 -0700
@@ -26,6 +26,7 @@
  * @bug 4213876
  * @summary Make sure "null" security manager is ignored, as specified in the
  * javadocs
+ * @run main/othervm IgnoreNullSecurityManager
  */
 
 public class IgnoreNullSecurityManager {
--- a/jdk/test/java/lang/Thread/GenerifyStackTraces.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/test/java/lang/Thread/GenerifyStackTraces.java	Wed Jul 21 09:57:21 2010 -0700
@@ -155,7 +155,7 @@
             printStack(t, stack);
         }
         int frame = stack.length - 1;
-        for (int i = 0; i < depth; i++) {
+        for (int i = 0; i < depth && frame >= 0; i++) {
             if (! stack[frame].getMethodName().equals(methodNames[i])) {
                 throw new RuntimeException("Expected " + methodNames[i] +
                                            " in frame " + frame + " but got " +
--- a/jdk/test/java/lang/Thread/StackTraces.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/test/java/lang/Thread/StackTraces.java	Wed Jul 21 09:57:21 2010 -0700
@@ -159,7 +159,7 @@
             printStack(t, stack);
         }
         int frame = stack.length - 1;
-        for (int i = 0; i < depth; i++) {
+        for (int i = 0; i < depth && frame >= 0; i++) {
             if (! stack[frame].getMethodName().equals(methodNames[i])) {
                 throw new RuntimeException("Expected " + methodNames[i] +
                                            " in frame " + frame + " but got " +
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/lang/Throwable/SuppressedExceptions.java	Wed Jul 21 09:57:21 2010 -0700
@@ -0,0 +1,165 @@
+/*
+ * 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.
+ */
+
+import java.io.*;
+import java.util.*;
+
+/*
+ * @test
+ * @bug     6911258 6962571
+ * @summary Basic tests of suppressed exceptions
+ * @author  Joseph D. Darcy
+ */
+
+public class SuppressedExceptions {
+    private static String message = "Bad suppressed exception information";
+
+    public static void main(String... args) throws Exception {
+        basicSupressionTest();
+        serializationTest();
+        selfReference();
+    }
+
+    private static void basicSupressionTest() {
+        Throwable throwable = new Throwable();
+        RuntimeException suppressed = new RuntimeException("A suppressed exception.");
+        AssertionError repressed  = new AssertionError("A repressed error.");
+
+        Throwable[] t0 = throwable.getSuppressedExceptions();
+        if (t0.length != 0) {
+            throw new RuntimeException(message);
+        }
+        throwable.printStackTrace();
+
+        throwable.addSuppressedException(suppressed);
+        Throwable[] t1 = throwable.getSuppressedExceptions();
+        if (t1.length != 1 ||
+            t1[0] != suppressed) {throw new RuntimeException(message);
+        }
+        throwable.printStackTrace();
+
+        throwable.addSuppressedException(repressed);
+        Throwable[] t2 = throwable.getSuppressedExceptions();
+        if (t2.length != 2 ||
+            t2[0] != suppressed ||
+            t2[1] != repressed) {
+            throw new RuntimeException(message);
+        }
+        throwable.printStackTrace();
+    }
+
+    private static void serializationTest() throws Exception {
+        /*
+         * Bytes of the serial form of
+         *
+         * (new Throwable())setStackTrace(new StackTraceElement[0])
+         *
+         * from JDK 6; suppressedException field will be missing and
+         * thus default to null upon deserialization.
+         */
+        byte[] bytes = {
+            (byte)0xac, (byte)0xed, (byte)0x00, (byte)0x05, (byte)0x73, (byte)0x72, (byte)0x00, (byte)0x13,
+            (byte)0x6a, (byte)0x61, (byte)0x76, (byte)0x61, (byte)0x2e, (byte)0x6c, (byte)0x61, (byte)0x6e,
+            (byte)0x67, (byte)0x2e, (byte)0x54, (byte)0x68, (byte)0x72, (byte)0x6f, (byte)0x77, (byte)0x61,
+            (byte)0x62, (byte)0x6c, (byte)0x65, (byte)0xd5, (byte)0xc6, (byte)0x35, (byte)0x27, (byte)0x39,
+            (byte)0x77, (byte)0xb8, (byte)0xcb, (byte)0x03, (byte)0x00, (byte)0x03, (byte)0x4c, (byte)0x00,
+            (byte)0x05, (byte)0x63, (byte)0x61, (byte)0x75, (byte)0x73, (byte)0x65, (byte)0x74, (byte)0x00,
+            (byte)0x15, (byte)0x4c, (byte)0x6a, (byte)0x61, (byte)0x76, (byte)0x61, (byte)0x2f, (byte)0x6c,
+            (byte)0x61, (byte)0x6e, (byte)0x67, (byte)0x2f, (byte)0x54, (byte)0x68, (byte)0x72, (byte)0x6f,
+            (byte)0x77, (byte)0x61, (byte)0x62, (byte)0x6c, (byte)0x65, (byte)0x3b, (byte)0x4c, (byte)0x00,
+            (byte)0x0d, (byte)0x64, (byte)0x65, (byte)0x74, (byte)0x61, (byte)0x69, (byte)0x6c, (byte)0x4d,
+            (byte)0x65, (byte)0x73, (byte)0x73, (byte)0x61, (byte)0x67, (byte)0x65, (byte)0x74, (byte)0x00,
+            (byte)0x12, (byte)0x4c, (byte)0x6a, (byte)0x61, (byte)0x76, (byte)0x61, (byte)0x2f, (byte)0x6c,
+            (byte)0x61, (byte)0x6e, (byte)0x67, (byte)0x2f, (byte)0x53, (byte)0x74, (byte)0x72, (byte)0x69,
+            (byte)0x6e, (byte)0x67, (byte)0x3b, (byte)0x5b, (byte)0x00, (byte)0x0a, (byte)0x73, (byte)0x74,
+            (byte)0x61, (byte)0x63, (byte)0x6b, (byte)0x54, (byte)0x72, (byte)0x61, (byte)0x63, (byte)0x65,
+            (byte)0x74, (byte)0x00, (byte)0x1e, (byte)0x5b, (byte)0x4c, (byte)0x6a, (byte)0x61, (byte)0x76,
+            (byte)0x61, (byte)0x2f, (byte)0x6c, (byte)0x61, (byte)0x6e, (byte)0x67, (byte)0x2f, (byte)0x53,
+            (byte)0x74, (byte)0x61, (byte)0x63, (byte)0x6b, (byte)0x54, (byte)0x72, (byte)0x61, (byte)0x63,
+            (byte)0x65, (byte)0x45, (byte)0x6c, (byte)0x65, (byte)0x6d, (byte)0x65, (byte)0x6e, (byte)0x74,
+            (byte)0x3b, (byte)0x78, (byte)0x70, (byte)0x71, (byte)0x00, (byte)0x7e, (byte)0x00, (byte)0x04,
+            (byte)0x70, (byte)0x75, (byte)0x72, (byte)0x00, (byte)0x1e, (byte)0x5b, (byte)0x4c, (byte)0x6a,
+            (byte)0x61, (byte)0x76, (byte)0x61, (byte)0x2e, (byte)0x6c, (byte)0x61, (byte)0x6e, (byte)0x67,
+            (byte)0x2e, (byte)0x53, (byte)0x74, (byte)0x61, (byte)0x63, (byte)0x6b, (byte)0x54, (byte)0x72,
+            (byte)0x61, (byte)0x63, (byte)0x65, (byte)0x45, (byte)0x6c, (byte)0x65, (byte)0x6d, (byte)0x65,
+            (byte)0x6e, (byte)0x74, (byte)0x3b, (byte)0x02, (byte)0x46, (byte)0x2a, (byte)0x3c, (byte)0x3c,
+            (byte)0xfd, (byte)0x22, (byte)0x39, (byte)0x02, (byte)0x00, (byte)0x00, (byte)0x78, (byte)0x70,
+            (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x78, (byte)0xac, (byte)0xed, (byte)0x00,
+            (byte)0x05, (byte)0x73, (byte)0x72, (byte)0x00, (byte)0x13, (byte)0x6a, (byte)0x61, (byte)0x76,
+            (byte)0x61, (byte)0x2e, (byte)0x6c, (byte)0x61, (byte)0x6e, (byte)0x67, (byte)0x2e, (byte)0x54,
+            (byte)0x68, (byte)0x72, (byte)0x6f, (byte)0x77, (byte)0x61, (byte)0x62, (byte)0x6c, (byte)0x65,
+            (byte)0xd5, (byte)0xc6, (byte)0x35, (byte)0x27, (byte)0x39, (byte)0x77, (byte)0xb8, (byte)0xcb,
+            (byte)0x03, (byte)0x00, (byte)0x03, (byte)0x4c, (byte)0x00, (byte)0x05, (byte)0x63, (byte)0x61,
+            (byte)0x75, (byte)0x73, (byte)0x65, (byte)0x74, (byte)0x00, (byte)0x15, (byte)0x4c, (byte)0x6a,
+            (byte)0x61, (byte)0x76, (byte)0x61, (byte)0x2f, (byte)0x6c, (byte)0x61, (byte)0x6e, (byte)0x67,
+            (byte)0x2f, (byte)0x54, (byte)0x68, (byte)0x72, (byte)0x6f, (byte)0x77, (byte)0x61, (byte)0x62,
+            (byte)0x6c, (byte)0x65, (byte)0x3b, (byte)0x4c, (byte)0x00, (byte)0x0d, (byte)0x64, (byte)0x65,
+            (byte)0x74, (byte)0x61, (byte)0x69, (byte)0x6c, (byte)0x4d, (byte)0x65, (byte)0x73, (byte)0x73,
+            (byte)0x61, (byte)0x67, (byte)0x65, (byte)0x74, (byte)0x00, (byte)0x12, (byte)0x4c, (byte)0x6a,
+            (byte)0x61, (byte)0x76, (byte)0x61, (byte)0x2f, (byte)0x6c, (byte)0x6e, (byte)0x67, (byte)0x3b,
+            (byte)0x61, (byte)0x6e, (byte)0x67, (byte)0x2f, (byte)0x53, (byte)0x74, (byte)0x72, (byte)0x69,
+            (byte)0x5b, (byte)0x00, (byte)0x0a, (byte)0x73, (byte)0x74, (byte)0x61, (byte)0x63, (byte)0x6b,
+            (byte)0x54, (byte)0x72, (byte)0x61, (byte)0x63, (byte)0x65, (byte)0x74, (byte)0x00, (byte)0x1e,
+            (byte)0x5b, (byte)0x4c, (byte)0x6a, (byte)0x61, (byte)0x76, (byte)0x61, (byte)0x2f, (byte)0x6c,
+            (byte)0x61, (byte)0x6e, (byte)0x67, (byte)0x2f, (byte)0x53, (byte)0x74, (byte)0x61, (byte)0x63,
+            (byte)0x6b, (byte)0x54, (byte)0x72, (byte)0x61, (byte)0x63, (byte)0x65, (byte)0x45, (byte)0x6c,
+            (byte)0x65, (byte)0x6d, (byte)0x65, (byte)0x6e, (byte)0x74, (byte)0x3b, (byte)0x78, (byte)0x70,
+            (byte)0x71, (byte)0x00, (byte)0x7e, (byte)0x00, (byte)0x04, (byte)0x70, (byte)0x75, (byte)0x72,
+            (byte)0x00, (byte)0x1e, (byte)0x5b, (byte)0x4c, (byte)0x6a, (byte)0x61, (byte)0x76, (byte)0x61,
+            (byte)0x2e, (byte)0x6c, (byte)0x61, (byte)0x6e, (byte)0x67, (byte)0x2e, (byte)0x53, (byte)0x74,
+            (byte)0x61, (byte)0x63, (byte)0x6b, (byte)0x54, (byte)0x72, (byte)0x61, (byte)0x63, (byte)0x65,
+            (byte)0x45, (byte)0x6c, (byte)0x65, (byte)0x6d, (byte)0x65, (byte)0x6e, (byte)0x74, (byte)0x3b,
+            (byte)0x02, (byte)0x46, (byte)0x2a, (byte)0x3c, (byte)0x3c, (byte)0xfd, (byte)0x22, (byte)0x39,
+            (byte)0x02, (byte)0x00, (byte)0x00, (byte)0x78, (byte)0x70,
+        };
+
+        ByteArrayInputStream bais = new ByteArrayInputStream(bytes);
+        ObjectInputStream ois = new ObjectInputStream(bais);
+
+        Object o = ois.readObject();
+        Throwable throwable = (Throwable) o;
+
+        System.err.println("TESTING SERIALIZED EXCEPTION");
+
+        Throwable[] t0 = throwable.getSuppressedExceptions();
+        if (t0.length != 0) { // Will fail if t0 is null.
+            throw new RuntimeException(message);
+        }
+        throwable.printStackTrace();
+    }
+
+    private static void selfReference() {
+        Throwable throwable1 = new RuntimeException();
+        Throwable throwable2 = new AssertionError();
+        throwable1.initCause(throwable2);
+        throwable2.initCause(throwable1);
+
+        throwable1.printStackTrace();
+
+
+        throwable1.addSuppressedException(throwable1);
+        throwable1.addSuppressedException(throwable2);
+
+        throwable1.printStackTrace();
+    }
+}
--- a/jdk/test/java/lang/annotation/ParameterAnnotations.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/test/java/lang/annotation/ParameterAnnotations.java	Wed Jul 21 09:57:21 2010 -0700
@@ -27,6 +27,7 @@
  * @summary Check properties of Annotations returned from
  * getParameterAnnotations, including freedom from security
  * exceptions.
+ * @run main/othervm ParameterAnnotations
  * @author Martin Buchholz
  */
 
--- a/jdk/test/java/lang/management/ClassLoadingMXBean/LoadCounts.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/test/java/lang/management/ClassLoadingMXBean/LoadCounts.java	Wed Jul 21 09:57:21 2010 -0700
@@ -118,9 +118,21 @@
 }
 class Slave {}
 
-class LeftHand extends ClassLoader {}
-class RightHand extends ClassLoader {}
+class LeftHand extends ClassLoader {
+    public LeftHand() {
+        super(LeftHand.class.getClassLoader());
+    }
+}
+class RightHand extends ClassLoader {
+    public RightHand() {
+        super(RightHand.class.getClassLoader());
+    }
+}
 class Body {}
 
-class LoaderForTwoInstances extends ClassLoader {}
+class LoaderForTwoInstances extends ClassLoader {
+    public LoaderForTwoInstances() {
+        super(LoaderForTwoInstances.class.getClassLoader());
+    }
+}
 class TheSameClass {}
--- a/jdk/test/java/lang/management/ManagementFactory/MXBeanProxyTest.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/test/java/lang/management/ManagementFactory/MXBeanProxyTest.java	Wed Jul 21 09:57:21 2010 -0700
@@ -25,6 +25,7 @@
  * @test
  * @bug     5024531
  * @summary Basic Test for ManagementFactory.newPlatformMXBean().
+ * @run main/othervm MXBeanProxyTest
  * @author  Mandy Chung
  */
 import javax.management.*;
--- a/jdk/test/java/lang/management/MemoryMXBean/CollectionUsageThreshold.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/test/java/lang/management/MemoryMXBean/CollectionUsageThreshold.java	Wed Jul 21 09:57:21 2010 -0700
@@ -41,9 +41,9 @@
 
 public class CollectionUsageThreshold {
     private static MemoryMXBean mm = ManagementFactory.getMemoryMXBean();
-    private static List pools = ManagementFactory.getMemoryPoolMXBeans();
-    private static List managers = ManagementFactory.getMemoryManagerMXBeans();
-    private static Map result = new HashMap();
+    private static List<MemoryPoolMXBean> pools = ManagementFactory.getMemoryPoolMXBeans();
+    private static List<MemoryManagerMXBean> managers = ManagementFactory.getMemoryManagerMXBeans();
+    private static Map<String, PoolRecord> result = new HashMap<>();
     private static boolean trace = false;
     private static boolean testFailed = false;
     private static final int EXPECTED_NUM_POOLS = 2;
@@ -119,8 +119,7 @@
         }
 
         // Find the Old generation which supports low memory detection
-        for (ListIterator iter = pools.listIterator(); iter.hasNext(); ) {
-            MemoryPoolMXBean p = (MemoryPoolMXBean) iter.next();
+        for (MemoryPoolMXBean p : pools) {
             MemoryUsage u = p.getUsage();
             if (p.isUsageThresholdSupported() && p.isCollectionUsageThresholdSupported()) {
                 PoolRecord pr = new PoolRecord(p);
@@ -134,25 +133,30 @@
             throw new RuntimeException("Unexpected number of selected pools");
         }
 
-        checker = new Checker("Checker thread");
-        checker.setDaemon(true);
-        checker.start();
+        try {
+            checker = new Checker("Checker thread");
+            checker.setDaemon(true);
+            checker.start();
+
+            for (PoolRecord pr : result.values()) {
+                pr.getPool().setCollectionUsageThreshold(THRESHOLD);
+                System.out.println("Collection usage threshold of " +
+                    pr.getPool().getName() + " set to " + THRESHOLD);
+            }
 
-        for (Iterator iter = result.values().iterator(); iter.hasNext();) {
-            PoolRecord pr = (PoolRecord) iter.next();
-            pr.getPool().setCollectionUsageThreshold(THRESHOLD);
-            System.out.println("Collection usage threshold of " +
-                pr.getPool().getName() + " set to " + THRESHOLD);
-        }
+            SensorListener listener = new SensorListener();
+            NotificationEmitter emitter = (NotificationEmitter) mm;
+            emitter.addNotificationListener(listener, null, null);
 
-        SensorListener listener = new SensorListener();
-        NotificationEmitter emitter = (NotificationEmitter) mm;
-        emitter.addNotificationListener(listener, null, null);
-
-        mm.setVerbose(true);
-        for (int i = 0; i < NUM_GCS; i++) {
-            invokeGC();
-            checker.waitForCheckResult();
+            for (int i = 0; i < NUM_GCS; i++) {
+                invokeGC();
+                checker.waitForCheckResult();
+            }
+        } finally {
+            // restore the default
+            for (PoolRecord pr : result.values()) {
+                pr.getPool().setCollectionUsageThreshold(0);
+            }
         }
 
         if (testFailed)
@@ -168,8 +172,7 @@
         mm.gc();
 
         if (trace) {
-            for (Iterator iter = result.values().iterator(); iter.hasNext();) {
-                PoolRecord pr = (PoolRecord) iter.next();
+            for (PoolRecord pr : result.values()) {
                 System.out.println("Usage after GC for: " + pr.getPool().getName());
                 MemoryUtil.printMemoryUsage(pr.getPool().getUsage());
             }
@@ -200,8 +203,7 @@
             }
         }
         private void checkResult() {
-            for (Iterator iter = result.values().iterator(); iter.hasNext();) {
-                PoolRecord pr = (PoolRecord) iter.next();
+            for (PoolRecord pr : result.values()) {
                 if (pr.getListenerInvokedCount() != numGCs) {
                     throw new RuntimeException("Listeners invoked count = " +
                          pr.getListenerInvokedCount() + " expected to be " +
--- a/jdk/test/java/lang/management/MemoryMXBean/LowMemoryTest.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/test/java/lang/management/MemoryMXBean/LowMemoryTest.java	Wed Jul 21 09:57:21 2010 -0700
@@ -31,7 +31,7 @@
  * @author  Mandy Chung
  *
  * @build LowMemoryTest MemoryUtil
- * @run main/timeout=600 LowMemoryTest
+ * @run main/othervm/timeout=600 LowMemoryTest
  */
 
 import java.lang.management.*;
--- a/jdk/test/java/lang/management/MemoryMXBean/MemoryManagement.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/test/java/lang/management/MemoryMXBean/MemoryManagement.java	Wed Jul 21 09:57:21 2010 -0700
@@ -31,7 +31,7 @@
  * @author  Mandy Chung
  *
  * @build MemoryManagement MemoryUtil
- * @run main/timeout=600 MemoryManagement
+ * @run main/othervm/timeout=600 MemoryManagement
  */
 
 import java.lang.management.*;
--- a/jdk/test/java/lang/management/MemoryMXBean/Pending.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/test/java/lang/management/MemoryMXBean/Pending.java	Wed Jul 21 09:57:21 2010 -0700
@@ -62,9 +62,21 @@
             trace = true;
         }
 
-        // Turn on verbose:gc to track GC
-        mbean.setVerbose(true);
+        try {
+            if (trace) {
+                // Turn on verbose:gc to track GC
+                mbean.setVerbose(true);
+            }
+            test();
+        } finally {
+            if (trace) {
+                mbean.setVerbose(false);
+            }
+        }
+        System.out.println("Test passed.");
+    }
 
+    private static void test() throws Exception {
         // Clean the memory and remove all objects that are pending
         // finalization
         System.gc();
@@ -130,7 +142,6 @@
                                      + " end = " + snapshot);
         }
 
-        System.out.println("Test passed.");
     }
 
     private static void checkFinalizerCount(int expectedTotal, int curFinalized)
--- a/jdk/test/java/lang/management/MemoryMXBean/ResetPeakMemoryUsage.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/test/java/lang/management/MemoryMXBean/ResetPeakMemoryUsage.java	Wed Jul 21 09:57:21 2010 -0700
@@ -28,7 +28,7 @@
  * @author  Mandy Chung
  *
  * @build ResetPeakMemoryUsage MemoryUtil
- * @run main ResetPeakMemoryUsage
+ * @run main/othervm ResetPeakMemoryUsage
  */
 
 import java.lang.management.*;
--- a/jdk/test/java/lang/management/MemoryPoolMXBean/ThresholdTest.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/test/java/lang/management/MemoryPoolMXBean/ThresholdTest.java	Wed Jul 21 09:57:21 2010 -0700
@@ -37,11 +37,23 @@
 public class ThresholdTest {
     public static void main(String args[]) throws Exception {
         List<MemoryPoolMXBean> pools = ManagementFactory.getMemoryPoolMXBeans();
-        for (MemoryPoolMXBean p : pools) {
-            // verify if isUsageThresholdExceeded() returns correct value
-            checkUsageThreshold(p);
-            // verify if isCollectionUsageThresholdExceeded() returns correct value
-            checkCollectionUsageThreshold(p);
+        try {
+            for (MemoryPoolMXBean p : pools) {
+                // verify if isUsageThresholdExceeded() returns correct value
+                checkUsageThreshold(p);
+                // verify if isCollectionUsageThresholdExceeded() returns correct value
+                checkCollectionUsageThreshold(p);
+            }
+        } finally {
+            // restore the default
+            for (MemoryPoolMXBean p : pools) {
+                if (p.isUsageThresholdSupported()) {
+                    p.setUsageThreshold(0);
+                }
+                if (p.isCollectionUsageThresholdSupported()) {
+                    p.setCollectionUsageThreshold(0);
+                }
+            }
         }
 
         System.out.println("Test passed.");
--- a/jdk/test/java/lang/management/RuntimeMXBean/UpTime.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/test/java/lang/management/RuntimeMXBean/UpTime.java	Wed Jul 21 09:57:21 2010 -0700
@@ -37,13 +37,18 @@
         = ManagementFactory.getRuntimeMXBean();
 
     public static void main(String argv[]) throws Exception {
+        long jvmStartTime = metrics.getStartTime();
         long systemStartOuter = System.currentTimeMillis();
         long metricsStart = metrics.getUptime();
         long systemStartInner = System.currentTimeMillis();
 
+        // This JVM might have been running for some time if this test runs
+        // in samevm mode.  The sanity check should apply to the test uptime.
+        long testUptime = metricsStart - (systemStartOuter - jvmStartTime);
+
         // If uptime is more than 30 minutes then it looks like a bug in
         // the method
-        if (metricsStart > TIMEOUT * 60 * 1000)
+        if (testUptime > TIMEOUT * 60 * 1000)
             throw new RuntimeException("Uptime of the JVM is more than 30 "
                                      + "minutes ("
                                      + (metricsStart / 60 / 1000)
--- a/jdk/test/java/lang/management/ThreadMXBean/AllThreadIds.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/test/java/lang/management/ThreadMXBean/AllThreadIds.java	Wed Jul 21 09:57:21 2010 -0700
@@ -28,7 +28,7 @@
  * @author  Alexei Guibadoulline and Mandy Chung
  *
  * @run build Barrier
- * @run main AllThreadIds
+ * @run main/othervm AllThreadIds
  */
 
 import java.lang.management.*;
@@ -70,6 +70,12 @@
         }
     }
 
+    private static void fail(String msg) {
+        trace = true;
+        printThreadList();
+        throw new RuntimeException(msg);
+    }
+
     private static void checkThreadCount(int numNewThreads,
                                          int numTerminatedThreads)
         throws Exception {
@@ -82,27 +88,27 @@
 
         if ((curLiveThreadCount - prevLiveThreadCount) !=
             (numNewThreads - numTerminatedThreads)) {
-            throw new RuntimeException("Unexpected number of live threads: " +
-                " Prev Total = " + prevTotalThreadCount +
-                " Current Total = " + curTotalThreadCount +
+            fail("Unexpected number of live threads: " +
+                " Prev live = " + prevLiveThreadCount +
+                " Current live = " + curLiveThreadCount +
                 " Threads added = " + numNewThreads +
                 " Threads terminated = " + numTerminatedThreads);
         }
         if (curPeakThreadCount - prevPeakThreadCount != numNewThreads) {
-            throw new RuntimeException("Unexpected number of peak threads: " +
-                " Prev Total = " + prevTotalThreadCount +
-                " Current Total = " + curTotalThreadCount +
+            fail("Unexpected number of peak threads: " +
+                " Prev peak = " + prevPeakThreadCount +
+                " Current peak = " + curPeakThreadCount +
                 " Threads added = " + numNewThreads);
         }
         if (curTotalThreadCount - prevTotalThreadCount != numNewThreads) {
-            throw new RuntimeException("Unexpected number of total threads: " +
+            fail("Unexpected number of total threads: " +
                 " Prev Total = " + prevTotalThreadCount +
                 " Current Total = " + curTotalThreadCount +
                 " Threads added = " + numNewThreads);
         }
         long[] list = mbean.getAllThreadIds();
         if (list.length != curLiveThreadCount) {
-            throw new RuntimeException("Array length returned by " +
+            fail("Array length returned by " +
                 "getAllThreadIds() = " + list.length +
                 " not matched count = " + curLiveThreadCount);
         }
--- a/jdk/test/java/lang/management/ThreadMXBean/DisableTest.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/test/java/lang/management/ThreadMXBean/DisableTest.java	Wed Jul 21 09:57:21 2010 -0700
@@ -36,8 +36,18 @@
     private static ThreadMXBean tm = ManagementFactory.getThreadMXBean();
 
     public static void main(String args[]) throws Exception {
-        testThreadContentionMonitoring();
-        testThreadCpuMonitoring();
+        try {
+            testThreadContentionMonitoring();
+            testThreadCpuMonitoring();
+        } finally {
+            // restore the default
+            if (tm.isThreadContentionMonitoringSupported()) {
+                tm.setThreadContentionMonitoringEnabled(false);
+            }
+            if (tm.isThreadCpuTimeSupported()) {
+                tm.setThreadCpuTimeEnabled(false);
+            }
+        }
 
         System.out.println("Test passed.");
     }
--- a/jdk/test/java/lang/management/ThreadMXBean/EnableTest.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/test/java/lang/management/ThreadMXBean/EnableTest.java	Wed Jul 21 09:57:21 2010 -0700
@@ -119,8 +119,19 @@
     }
 
     public static void main(String args[]) throws Exception {
-        testThreadContentionMonitoring();
-        testThreadCpuTime();
+        try {
+            testThreadContentionMonitoring();
+            testThreadCpuTime();
+        } finally {
+            // restore the default
+            if (tm.isThreadContentionMonitoringSupported()) {
+                tm.setThreadContentionMonitoringEnabled(false);
+            }
+            if (tm.isThreadCpuTimeSupported()) {
+                tm.setThreadCpuTimeEnabled(false);
+            }
+        }
+
 
         System.out.println("Test passed.");
     }
--- a/jdk/test/java/lang/management/ThreadMXBean/FindDeadlocks.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/test/java/lang/management/ThreadMXBean/FindDeadlocks.java	Wed Jul 21 09:57:21 2010 -0700
@@ -33,7 +33,7 @@
  * @build MonitorDeadlock
  * @build SynchronizerDeadlock
  * @build ThreadDump
- * @run main FindDeadlocks
+ * @run main/othervm FindDeadlocks
  */
 
 import java.lang.management.*;
--- a/jdk/test/java/lang/management/ThreadMXBean/FindMonitorDeadlock.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/test/java/lang/management/ThreadMXBean/FindMonitorDeadlock.java	Wed Jul 21 09:57:21 2010 -0700
@@ -30,7 +30,7 @@
  *
  * @build MonitorDeadlock
  * @build ThreadDump
- * @run main FindMonitorDeadlock
+ * @run main/othervm FindMonitorDeadlock
  */
 
 import java.lang.management.*;
--- a/jdk/test/java/lang/management/ThreadMXBean/Locks.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/test/java/lang/management/ThreadMXBean/Locks.java	Wed Jul 21 09:57:21 2010 -0700
@@ -29,7 +29,7 @@
  * @author  Mandy Chung
  *
  * @build ThreadExecutionSynchronizer
- * @run main Locks
+ * @run main/othervm Locks
  */
 
 import java.lang.management.*;
--- a/jdk/test/java/lang/reflect/Proxy/Boxing.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/test/java/lang/reflect/Proxy/Boxing.java	Wed Jul 21 09:57:21 2010 -0700
@@ -71,8 +71,8 @@
         Random random = new Random(42); // ensure consistent test domain
 
         Test proxy = (Test) Proxy.newProxyInstance(
-            ClassLoader.getSystemClassLoader(),
-            new Class[] { Test.class },
+            Test.class.getClassLoader(),
+            new Class<?>[] { Test.class },
             new TestHandler());
 
         for (int rep = 0; rep < REPS; rep++) {
--- a/jdk/test/java/lang/reflect/Proxy/ClassRestrictions.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/test/java/lang/reflect/Proxy/ClassRestrictions.java	Wed Jul 21 09:57:21 2010 -0700
@@ -54,16 +54,16 @@
             "\nTest of restrictions on parameters to Proxy.getProxyClass\n");
 
         try {
-            ClassLoader loader = ClassLoader.getSystemClassLoader();
-            Class[] interfaces;
-            Class proxyClass;
+            ClassLoader loader = ClassRestrictions.class.getClassLoader();
+            Class<?>[] interfaces;
+            Class<?> proxyClass;
 
             /*
              * All of the Class objects in the interfaces array must represent
              * interfaces, not classes or primitive types.
              */
             try {
-                interfaces = new Class[] { Object.class };
+                interfaces = new Class<?>[] { Object.class };
                 proxyClass = Proxy.getProxyClass(loader, interfaces);
                 throw new RuntimeException(
                     "proxy class created with java.lang.Object as interface");
@@ -73,7 +73,7 @@
                 // assume exception is for intended failure
             }
             try {
-                interfaces = new Class[] { Integer.TYPE };
+                interfaces = new Class<?>[] { Integer.TYPE };
                 proxyClass = Proxy.getProxyClass(loader, interfaces);
                 throw new RuntimeException(
                     "proxy class created with int.class as interface");
@@ -88,7 +88,7 @@
              * Class objects.
              */
             try {
-                interfaces = new Class[] { Bar.class, Bar.class };
+                interfaces = new Class<?>[] { Bar.class, Bar.class };
                 proxyClass = Proxy.getProxyClass(loader, interfaces);
                 throw new RuntimeException(
                     "proxy class created with repeated interfaces");
@@ -107,7 +107,7 @@
             Class altBarClass;
             altBarClass = Class.forName(Bar.class.getName(), false, altLoader);
             try {
-                interfaces = new Class[] { altBarClass };
+                interfaces = new Class<?>[] { altBarClass };
                 proxyClass = Proxy.getProxyClass(loader, interfaces);
                 throw new RuntimeException(
                     "proxy class created with interface " +
@@ -121,8 +121,8 @@
             /*
              * All non-public interfaces must be in the same package.
              */
-            Class nonPublic1 = Bashful.class;
-            Class nonPublic2 = null;
+            Class<?> nonPublic1 = Bashful.class;
+            Class<?> nonPublic2 = null;
             String[] nonPublicInterfaces = new String[] {
                 "java.awt.Conditional",
                 "java.util.zip.ZipConstants",
@@ -147,7 +147,7 @@
                     "no second non-public interface found for test");
             }
             try {
-                interfaces = new Class[] { nonPublic1, nonPublic2 };
+                interfaces = new Class<?>[] { nonPublic1, nonPublic2 };
                 proxyClass = Proxy.getProxyClass(loader, interfaces);
                 throw new RuntimeException(
                     "proxy class created with two non-public interfaces " +
@@ -163,7 +163,7 @@
              * parameter signature but different return type.
              */
             try {
-                interfaces = new Class[] { Bar.class, Baz.class };
+                interfaces = new Class<?>[] { Bar.class, Baz.class };
                 proxyClass = Proxy.getProxyClass(loader, interfaces);
                 throw new RuntimeException(
                     "proxy class created with conflicting methods");
--- a/jdk/test/java/lang/reflect/Proxy/returnTypes/Test.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/test/java/lang/reflect/Proxy/returnTypes/Test.java	Wed Jul 21 09:57:21 2010 -0700
@@ -42,7 +42,7 @@
 
     // additional test cases may be added to both of these lists:
 
-    private static final Class[][] GOOD = {
+    private static final Class<?>[][] GOOD = {
         { Collection.class },
         { Iterable.class, Collection.class },
         { Iterable.class, Collection.class, List.class },
@@ -51,7 +51,7 @@
           GetArray.class }
     };
 
-    private static final Class[][] BAD = {
+    private static final Class<?>[][] BAD = {
         { Runnable.class, PrivilegedAction.class },
         { GetSerializable.class, GetCloneable.class },
         { GetObject.class, GetSerializable.class, GetCloneable.class }
@@ -60,12 +60,12 @@
     public static void main(String[] args) throws Exception {
         System.err.println("\nRegression test for bug 4838310\n");
 
-        ClassLoader loader = ClassLoader.getSystemClassLoader();
+        ClassLoader loader = Test.class.getClassLoader();
 
         System.err.println("Testing GOOD combinations:");
 
         for (int i = 0; i < GOOD.length; i++) {
-            Class[] interfaces = GOOD[i];
+            Class<?>[] interfaces = GOOD[i];
             System.err.println(Arrays.asList(interfaces));
             Proxy.getProxyClass(loader, interfaces);
             System.err.println("--- OK.");
@@ -74,7 +74,7 @@
         System.err.println("Testing BAD combinations:");
 
         for (int i = 0; i < BAD.length; i++) {
-            Class[] interfaces = BAD[i];
+            Class<?>[] interfaces = BAD[i];
             System.err.println(Arrays.asList(interfaces));
             try {
                 Proxy.getProxyClass(loader, interfaces);
--- a/jdk/test/java/net/Authenticator/B4769350.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/test/java/net/Authenticator/B4769350.java	Wed Jul 21 09:57:21 2010 -0700
@@ -54,6 +54,7 @@
         boolean allowerror;
 
         Client (String authority, String path, boolean allowerror) {
+            super("Thread-" + path);
             this.authority = authority;
             this.path = path;
             this.allowerror = allowerror;
@@ -72,7 +73,8 @@
                 error = true;
             } catch (IOException e) {
                 if (!allowerror) {
-                    System.out.println (e);
+                    System.out.println (Thread.currentThread().getName() + " " + e);
+                    e.printStackTrace();
                     error = true;
                 }
             }
@@ -94,6 +96,7 @@
         }
 
         void okReply (HttpTransaction req) throws IOException {
+            req.addResponseHeader ("Connection", "close");
             req.setResponseEntityBody ("Hello .");
             req.sendResponse (200, "Ok");
             req.orderlyClose();
--- a/jdk/test/java/net/BindException/Test.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/test/java/net/BindException/Test.java	Wed Jul 21 09:57:21 2010 -0700
@@ -180,7 +180,7 @@
             while (addrs.hasMoreElements()) {
                 InetAddress ia = (InetAddress)addrs.nextElement();
 
-                if (ia.isLoopbackAddress()) {
+                if (ia.isLoopbackAddress() || ia.isAnyLocalAddress()) {
                     continue;
                 }
 
--- a/jdk/test/java/net/Inet6Address/B6214234.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/test/java/net/Inet6Address/B6214234.java	Wed Jul 21 09:57:21 2010 -0700
@@ -23,7 +23,7 @@
 
 /**
  * @test
- * @bug 6214234
+ * @bug 6214234 6967937
  * @summary IPv6 scope_id for local addresses not set in Solaris 10
  */
 
@@ -51,6 +51,7 @@
             return;
         }
         if (addr.getScopeId() == 0) {
+            System.out.println("addr: "+ addr);
             throw new RuntimeException ("Non zero scope_id expected");
         }
     }
Binary file jdk/test/java/net/ResponseCache/file1.cache has changed
--- a/jdk/test/java/net/URI/Test.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/test/java/net/URI/Test.java	Wed Jul 21 09:57:21 2010 -0700
@@ -1091,6 +1091,7 @@
         test("").p("").sp("").z();
 
 
+
         header("Emptiness");
 
         // Components that may be empty
@@ -1321,6 +1322,11 @@
             .sp("//host/foo%20bar/a/b/c/resolve").s("http")
             .pd("/foo bar/a/b/c/resolve").h("host")
             .p("/foo%20bar/a/b/c/resolve").z();
+
+        // 6773270: java.net.URI fails to escape u0000
+        test("s", "a", "/\u0000", null)
+            .s("s").p("/%00").h("a")
+            .ta("s://a/%00").z();
     }
 
 
--- a/jdk/test/java/net/ipv6tests/Tests.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/test/java/net/ipv6tests/Tests.java	Wed Jul 21 09:57:21 2010 -0700
@@ -248,7 +248,8 @@
                 }
                 while (addrs.hasMoreElements()) {
                     InetAddress addr = (InetAddress) addrs.nextElement();
-                    if (filter.isInstance (addr) && !addr.isLoopbackAddress()) {
+                    if (filter.isInstance (addr) && !addr.isLoopbackAddress()
+                            && !addr.isAnyLocalAddress()) {
                         if (Arrays.equals (addr.getAddress(), fe80_loopback)) {
                             continue;
                         }
--- a/jdk/test/java/nio/BufferPoolMXBean/Basic.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/test/java/nio/BufferPoolMXBean/Basic.java	Wed Jul 21 09:57:21 2010 -0700
@@ -24,6 +24,7 @@
 /* @test
  * @bug 6606598
  * @summary Unit test for java.nio.BufferPoolMXBean
+ * @run main/othervm Basic
  */
 
 import java.nio.ByteBuffer;
--- a/jdk/test/java/nio/MappedByteBuffer/Basic.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/test/java/nio/MappedByteBuffer/Basic.java	Wed Jul 21 09:57:21 2010 -0700
@@ -24,6 +24,7 @@
 /* @test
  * @bug 4462336
  * @summary Simple MappedByteBuffer tests
+ * @run main/othervm Basic
  */
 
 import java.io.*;
--- a/jdk/test/java/nio/MappedByteBuffer/Force.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/test/java/nio/MappedByteBuffer/Force.java	Wed Jul 21 09:57:21 2010 -0700
@@ -24,6 +24,7 @@
 /* @test
  * @bug 4625907
  * @summary Testing force()
+ * @run main/othervm Force
  */
 
 import java.io.*;
--- a/jdk/test/java/nio/MappedByteBuffer/ZeroMap.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/test/java/nio/MappedByteBuffer/ZeroMap.java	Wed Jul 21 09:57:21 2010 -0700
@@ -24,6 +24,7 @@
 /* @test
  * @bug 4802340
  * @summary Testing force(), load() isLoaded() of zero len MBB
+ * @run main/othervm ZeroMap
  */
 
 import java.io.*;
--- a/jdk/test/java/nio/channels/AsyncCloseAndInterrupt.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/test/java/nio/channels/AsyncCloseAndInterrupt.java	Wed Jul 21 09:57:21 2010 -0700
@@ -22,7 +22,7 @@
  */
 
 /* @test
- * @bug 4460583 4470470 4840199 6419424 6710579 6596323 6824135
+ * @bug 4460583 4470470 4840199 6419424 6710579 6596323 6824135 6395224
  * @summary Comprehensive test of asynchronous closing and interruption
  * @author Mark Reinhold
  */
@@ -88,6 +88,9 @@
     }
 
     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();
 
@@ -203,9 +206,9 @@
         = new ChannelFactory("DatagramChannel") {
                 InterruptibleChannel create() throws IOException {
                     DatagramChannel dc = DatagramChannel.open();
-                    dc.socket().bind(wildcardAddress);
-                    InetAddress ia = InetAddress.getByName("127.0.0.1");
-                    dc.connect(new InetSocketAddress(ia, 80));
+                    InetAddress lb = InetAddress.getByName("127.0.0.1");
+                    dc.bind(new InetSocketAddress(lb, 0));
+                    dc.connect(new InetSocketAddress(lb, 80));
                     return dc;
                 }
             };
@@ -636,7 +639,8 @@
 
         wildcardAddress = new InetSocketAddress(InetAddress.getLocalHost(), 0);
         initAcceptor();
-        initRefuser();
+        if (!TestUtil.onWindows())
+            initRefuser();
         initPipes();
         initFile();
 
@@ -658,8 +662,15 @@
         // unclear under what conditions mmap(2) will actually block.
 
         test(connectedSocketChannelFactory);
-        test(socketChannelFactory, CONNECT);
-        test(socketChannelFactory, FINISH_CONNECT);
+
+        if (TestUtil.onWindows()) {
+            log.println("WARNING Cannot reliably test connect/finishConnect"
+                + " operations on Windows");
+        } else {
+            test(socketChannelFactory, CONNECT);
+            test(socketChannelFactory, FINISH_CONNECT);
+        }
+
         test(serverSocketChannelFactory, ACCEPT);
         test(datagramChannelFactory);
         test(pipeSourceChannelFactory);
--- a/jdk/test/java/nio/channels/AsynchronousChannelGroup/GroupOfOne.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/test/java/nio/channels/AsynchronousChannelGroup/GroupOfOne.java	Wed Jul 21 09:57:21 2010 -0700
@@ -29,6 +29,7 @@
 import java.nio.ByteBuffer;
 import java.nio.channels.*;
 import java.net.*;
+import java.util.*;
 import java.util.concurrent.*;
 import java.io.IOException;
 
@@ -44,8 +45,12 @@
         final AsynchronousServerSocketChannel listener =
             AsynchronousServerSocketChannel.open()
                 .bind(new InetSocketAddress(0));
+        final List<AsynchronousSocketChannel> accepted = new ArrayList<AsynchronousSocketChannel>();
         listener.accept((Void)null, new CompletionHandler<AsynchronousSocketChannel,Void>() {
             public void completed(AsynchronousSocketChannel ch, Void att) {
+                synchronized (accepted) {
+                    accepted.add(ch);
+                }
                 listener.accept((Void)null, this);
             }
             public void failed(Throwable exc, Void att) {
@@ -58,6 +63,14 @@
         test(sa, true, false);
         test(sa, false, true);
         test(sa, true, true);
+
+        // clean-up
+        listener.close();
+        synchronized (accepted) {
+            for (AsynchronousSocketChannel ch: accepted) {
+                ch.close();
+            }
+        }
     }
 
     static void test(SocketAddress sa,
--- a/jdk/test/java/nio/channels/AsynchronousChannelGroup/Identity.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/test/java/nio/channels/AsynchronousChannelGroup/Identity.java	Wed Jul 21 09:57:21 2010 -0700
@@ -32,6 +32,7 @@
 import java.util.*;
 import java.util.concurrent.*;
 import java.util.concurrent.atomic.*;
+import java.io.IOException;
 
 /**
  * Tests that the completion handler is invoked by a thread with
@@ -81,14 +82,18 @@
         listener.accept((Void)null, new CompletionHandler<AsynchronousSocketChannel,Void>() {
             public void completed(final AsynchronousSocketChannel ch, Void att) {
                 listener.accept((Void)null, this);
-
                 final ByteBuffer buf = ByteBuffer.allocate(100);
-                ch.read(buf, (Void)null, new CompletionHandler<Integer,Void>() {
-                    public void completed(Integer bytesRead, Void att) {
-                        buf.clear();
-                        ch.read(buf, (Void)null, this);
+                ch.read(buf, ch, new CompletionHandler<Integer,AsynchronousSocketChannel>() {
+                    public void completed(Integer bytesRead, AsynchronousSocketChannel ch) {
+                        if (bytesRead < 0) {
+                            try { ch.close(); } catch (IOException ignore) { }
+                        } else {
+                            buf.clear();
+                            ch.read(buf, ch, this);
+                        }
                     }
-                    public void failed(Throwable exc, Void att) {
+                    public void failed(Throwable exc, AsynchronousSocketChannel ch) {
+                        try { ch.close(); } catch (IOException ignore) { }
                     }
                 });
             }
@@ -100,7 +105,8 @@
 
         // create 3-10 channels, each in its own group
         final int groupCount = 3 + rand.nextInt(8);
-        final AsynchronousSocketChannel[] channel = new AsynchronousSocketChannel[groupCount];
+        AsynchronousChannelGroup[] groups = new AsynchronousChannelGroup[groupCount];
+        final AsynchronousSocketChannel[] channels = new AsynchronousSocketChannel[groupCount];
         for (int i=0; i<groupCount; i++) {
             ThreadFactory factory = createThreadFactory(i);
             AsynchronousChannelGroup group;
@@ -111,17 +117,18 @@
                 ExecutorService pool = Executors.newCachedThreadPool(factory);
                 group = AsynchronousChannelGroup.withCachedThreadPool(pool, rand.nextInt(5));
             }
+            groups[i] = group;
 
             // create channel in group and connect it to the server
             AsynchronousSocketChannel ch = AsynchronousSocketChannel.open(group);
             ch.connect(sa).get();
-            channel[i] = ch;
+            channels[i] = ch;
         }
 
         // randomly write to each channel, ensuring that the completion handler
         // is always invoked by a thread with the right identity.
         final AtomicInteger writeCount = new AtomicInteger(100);
-        channel[0].write(getBuffer(), 0, new CompletionHandler<Integer,Integer>() {
+        channels[0].write(getBuffer(), 0, new CompletionHandler<Integer,Integer>() {
             public void completed(Integer bytesWritten, Integer groupId) {
                 if (bytesWritten != 1)
                     fail("Expected 1 byte to be written");
@@ -129,7 +136,7 @@
                     fail("Handler invoked by thread with the wrong identity");
                 if (writeCount.decrementAndGet() > 0) {
                     int id = rand.nextInt(groupCount);
-                    channel[id].write(getBuffer(), id, this);
+                    channels[id].write(getBuffer(), id, this);
                 } else {
                     done.countDown();
                 }
@@ -139,8 +146,16 @@
             }
         });
 
-        // wait until
+        // wait until done
         done.await();
+
+        // clean-up
+        for (AsynchronousSocketChannel ch: channels)
+            ch.close();
+        for (AsynchronousChannelGroup group: groups)
+            group.shutdownNow();
+        listener.close();
+
         if (failed.get())
             throw new RuntimeException("Test failed - see log for details");
     }
--- a/jdk/test/java/nio/channels/AsynchronousDatagramChannel/Basic.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/test/java/nio/channels/AsynchronousDatagramChannel/Basic.java	Wed Jul 21 09:57:21 2010 -0700
@@ -371,17 +371,22 @@
     static void doMulticastTests() throws Exception {
         final byte[] msg = "hello".getBytes();
 
+        InetAddress lh = InetAddress.getLocalHost();
+        NetworkInterface interf = NetworkInterface.getByInetAddress(lh);
+        if (interf.isLoopback() || !interf.supportsMulticast()) {
+            System.out.println("Multicasting not tested");
+            return;
+        }
+
         AsynchronousDatagramChannel ch = AsynchronousDatagramChannel
             .open(StandardProtocolFamily.INET, null)
             .setOption(StandardSocketOption.SO_REUSEADDR, true)
             .bind(new InetSocketAddress(0));
 
-        InetAddress lh = InetAddress.getLocalHost();
         int port = ((InetSocketAddress)(ch.getLocalAddress())).getPort();
 
         // join group
         InetAddress group = InetAddress.getByName("225.4.5.6");
-        NetworkInterface interf = NetworkInterface.getByInetAddress(lh);
         MembershipKey key = ch.join(group, interf);
 
         // check key
--- a/jdk/test/java/nio/channels/AsynchronousFileChannel/Basic.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/test/java/nio/channels/AsynchronousFileChannel/Basic.java	Wed Jul 21 09:57:21 2010 -0700
@@ -45,16 +45,18 @@
         File blah = File.createTempFile("blah", null);
         blah.deleteOnExit();
 
-        final AsynchronousFileChannel ch = AsynchronousFileChannel
+        AsynchronousFileChannel ch = AsynchronousFileChannel
             .open(blah.toPath(), READ, WRITE);
+        try {
+            // run tests
+            testUsingCompletionHandlers(ch);
+            testUsingWaitOnResult(ch);
+            testInterruptHandlerThread(ch);
+        } finally {
+            ch.close();
+        }
 
-        // run tests
-        testUsingCompletionHandlers(ch);
-        testUsingWaitOnResult(ch);
-        testInterruptHandlerThread(ch);
-
-        // close channel and invoke test that expects channel to be closed
-        ch.close();
+        // run test that expects channel to be closed
         testClosedChannel(ch);
 
         // these tests open the file themselves
@@ -63,6 +65,9 @@
         testAsynchronousClose(blah.toPath());
         testCancel(blah.toPath());
         testTruncate(blah.toPath());
+
+        // eagerly clean-up
+        blah.delete();
     }
 
     /*
--- a/jdk/test/java/nio/channels/AsynchronousFileChannel/Lock.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/test/java/nio/channels/AsynchronousFileChannel/Lock.java	Wed Jul 21 09:57:21 2010 -0700
@@ -53,13 +53,17 @@
         LockSlaveMirror slave = startLockSlave();
         try {
 
-             // create temporary file
+            // create temporary file
             File blah = File.createTempFile("blah", null);
             blah.deleteOnExit();
 
+            // run tests
             testLockProtocol(blah, slave);
             testAsyncClose(blah, slave);
 
+            // eagerly clean-up
+            blah.delete();
+
         } finally {
             slave.shutdown();
         }
@@ -150,7 +154,12 @@
         String sep = FileSystems.getDefault().getSeparator();
 
         String command = System.getProperty("java.home") +
-            sep + "bin" + sep + "java Lock -lockslave " + port;
+            sep + "bin" + sep + "java";
+        String testClasses = System.getProperty("test.classes");
+        if (testClasses != null)
+            command += " -cp " + testClasses;
+        command += " Lock -lockslave " + port;
+
         Process p = Runtime.getRuntime().exec(command);
         IOHandler.handle(p.getInputStream());
         IOHandler.handle(p.getErrorStream());
--- a/jdk/test/java/nio/channels/AsynchronousFileChannel/LotsOfWrites.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/test/java/nio/channels/AsynchronousFileChannel/LotsOfWrites.java	Wed Jul 21 09:57:21 2010 -0700
@@ -135,6 +135,7 @@
         latch.await();
 
         // verify content of each file
+        boolean failed = false;
         byte[] buf = new byte[8192];
         for (int i=0; i<count ;i++) {
             Writer writer = writers[i];
@@ -145,18 +146,35 @@
                 int nread = in.read(buf);
                 while (nread > 0) {
                     for (int j=0; j<nread; j++) {
-                        if (buf[j] != expected)
-                            throw new RuntimeException("Unexpected byte");
+                        if (buf[j] != expected) {
+                            System.err.println("Unexpected contents");
+                            failed = true;
+                            break;
+                        }
                         expected++;
                     }
+                    if (failed)
+                        break;
                     size += nread;
                     nread = in.read(buf);
                 }
-                if (size != writer.size())
-                    throw new RuntimeException("Unexpected size");
+                if (!failed && size != writer.size()) {
+                    System.err.println("Unexpected size");
+                    failed = true;
+                }
+                if (failed)
+                    break;
             } finally {
                 in.close();
             }
         }
+
+        // clean-up
+        for (int i=0; i<count; i++) {
+            writers[i].file().delete();
+        }
+
+        if (failed)
+            throw new RuntimeException("Test failed");
     }
 }
--- a/jdk/test/java/nio/channels/AsynchronousSocketChannel/Basic.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/test/java/nio/channels/AsynchronousSocketChannel/Basic.java	Wed Jul 21 09:57:21 2010 -0700
@@ -196,18 +196,16 @@
 
         System.out.println("-- connect to non-existent host --");
 
-        // test failure
-        InetAddress badHost = InetAddress.getByName("1.2.3.4");
-        if (!badHost.isReachable(10*1000)) {
-
-            ch = AsynchronousSocketChannel.open();
-            try {
-                ch.connect(new InetSocketAddress(badHost, 9876)).get();
-                throw new RuntimeException("Connection should not be established");
-            } catch (ExecutionException x) {
-            }
+        // test that failure to connect closes the channel
+        ch = AsynchronousSocketChannel.open();
+        try {
+            ch.connect(genSocketAddress()).get();
+        } catch (ExecutionException x) {
+            // failed to establish connection
             if (ch.isOpen())
                 throw new RuntimeException("Channel should be closed");
+        } finally {
+            ch.close();
         }
 
         server.close();
@@ -219,27 +217,22 @@
         AsynchronousSocketChannel ch;
 
         // asynchronous close while connecting
-        InetAddress rh = InetAddress.getByName("1.2.3.4");
-        if (!rh.isReachable(3000)) {
-            InetSocketAddress isa = new InetSocketAddress(rh, 1234);
+        ch = AsynchronousSocketChannel.open();
+        Future<Void> connectResult = ch.connect(genSocketAddress());
 
-            ch = AsynchronousSocketChannel.open();
-            Future<Void> result = ch.connect(isa);
-
-            // give time to initiate the connect (SYN)
-            Thread.sleep(50);
+        // give time to initiate the connect (SYN)
+        Thread.sleep(50);
 
-            // close
-            ch.close();
+        // close
+        ch.close();
 
-            // check that AsynchronousCloseException is thrown
-            try {
-                result.get();
-                throw new RuntimeException("Should not connect");
-            } catch (ExecutionException x) {
-                if (!(x.getCause() instanceof AsynchronousCloseException))
-                    throw new RuntimeException(x);
-            }
+        // check that exception is thrown in timely manner
+        try {
+            connectResult.get(5, TimeUnit.SECONDS);
+        } catch (TimeoutException x) {
+            throw new RuntimeException("AsynchronousCloseException not thrown");
+        } catch (ExecutionException x) {
+            // expected
         }
 
         System.out.println("-- asynchronous close when reading --");
@@ -783,32 +776,50 @@
             throw new RuntimeException("RuntimeException expected after timeout.");
 
         ch.close();
+        server.close();
+    }
+
+    // returns ByteBuffer with random bytes
+    static ByteBuffer genBuffer() {
+        int size = 1024 + rand.nextInt(16000);
+        byte[] buf = new byte[size];
+        rand.nextBytes(buf);
+        boolean useDirect = rand.nextBoolean();
+        if (useDirect) {
+            ByteBuffer bb = ByteBuffer.allocateDirect(buf.length);
+            bb.put(buf);
+            bb.flip();
+            return bb;
+        } else {
+            return ByteBuffer.wrap(buf);
+        }
     }
 
-   // returns ByteBuffer with random bytes
-   static ByteBuffer genBuffer() {
-       int size = 1024 + rand.nextInt(16000);
-       byte[] buf = new byte[size];
-       rand.nextBytes(buf);
-       boolean useDirect = rand.nextBoolean();
-       if (useDirect) {
-           ByteBuffer bb = ByteBuffer.allocateDirect(buf.length);
-           bb.put(buf);
-           bb.flip();
-           return bb;
-       } else {
-           return ByteBuffer.wrap(buf);
-       }
-   }
+    // return ByteBuffer[] with random bytes
+    static ByteBuffer[] genBuffers(int max) {
+        int len = 1;
+        if (max > 1)
+            len += rand.nextInt(max);
+        ByteBuffer[] bufs = new ByteBuffer[len];
+        for (int i=0; i<len; i++)
+            bufs[i] = genBuffer();
+        return bufs;
+    }
 
-   // return ByteBuffer[] with random bytes
-   static ByteBuffer[] genBuffers(int max) {
-       int len = 1;
-       if (max > 1)
-           len += rand.nextInt(max);
-       ByteBuffer[] bufs = new ByteBuffer[len];
-       for (int i=0; i<len; i++)
-           bufs[i] = genBuffer();
-       return bufs;
-   }
+    // return random SocketAddress
+    static SocketAddress genSocketAddress() {
+        StringBuilder sb = new StringBuilder("10.");
+        sb.append(rand.nextInt(256));
+        sb.append('.');
+        sb.append(rand.nextInt(256));
+        sb.append('.');
+        sb.append(rand.nextInt(256));
+        InetAddress rh;
+        try {
+            rh = InetAddress.getByName(sb.toString());
+        } catch (UnknownHostException x) {
+            throw new InternalError("Should not happen");
+        }
+        return new InetSocketAddress(rh, rand.nextInt(65535)+1);
+    }
 }
--- a/jdk/test/java/nio/channels/Channels/Basic2.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/test/java/nio/channels/Channels/Basic2.java	Wed Jul 21 09:57:21 2010 -0700
@@ -61,6 +61,9 @@
         writerThread.join();
         readerThread.join();
 
+        // shutdown listener
+        listener.close();
+
         // check that reader received what we expected
         if (reader.total() != writer.total())
             throw new RuntimeException("Unexpected number of bytes read");
--- a/jdk/test/java/nio/channels/Channels/Write.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/test/java/nio/channels/Channels/Write.java	Wed Jul 21 09:57:21 2010 -0700
@@ -47,5 +47,6 @@
         out.close();
         fc.close();
         fos.close();
+        testFile.delete();
     }
 }
--- a/jdk/test/java/nio/channels/DatagramChannel/AdaptDatagramSocket.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/test/java/nio/channels/DatagramChannel/AdaptDatagramSocket.java	Wed Jul 21 09:57:21 2010 -0700
@@ -22,6 +22,7 @@
  */
 
 /* @test
+ * @bug 4313882 4981129
  * @summary Unit test for datagram-socket-channel adaptors
  * @library ..
  */
@@ -81,8 +82,6 @@
                 }
                 throw x;
             }
-            if (shouldTimeout)
-                throw new Exception("Receive did not time out");
             break;
         }
 
@@ -93,6 +92,11 @@
             if (ip.getData()[ip.getOffset() + i]
                 != op.getData()[op.getOffset() + i])
                 throw new Exception("Incorrect data received");
+
+        if (!(ip.getSocketAddress().equals(dst))) {
+            throw new Exception("Incorrect sender address, expected: " + dst
+                + " actual: " + ip.getSocketAddress());
+        }
     }
 
     static void test(InetSocketAddress dst,
--- a/jdk/test/java/nio/channels/DatagramChannel/Connect.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/test/java/nio/channels/DatagramChannel/Connect.java	Wed Jul 21 09:57:21 2010 -0700
@@ -42,15 +42,15 @@
     }
 
     static void test() throws Exception {
-        invoke(new Actor(), new Reactor());
+        Reactor r = new Reactor();
+        Actor a = new Actor(r.port());
+        invoke(a, r);
     }
 
     static void invoke(Sprintable reader, Sprintable writer) throws Exception {
 
         Thread writerThread = new Thread(writer);
         writerThread.start();
-        while (!writer.ready())
-            Thread.sleep(50);
 
         Thread readerThread = new Thread(reader);
         readerThread.start();
@@ -64,34 +64,31 @@
 
     public interface Sprintable extends Runnable {
         public void throwException() throws Exception;
-        public boolean ready();
     }
 
     public static class Actor implements Sprintable {
+        final int port;
         Exception e = null;
 
+        Actor(int port) {
+            this.port = port;
+        }
+
         public void throwException() throws Exception {
             if (e != null)
                 throw e;
         }
 
-        private volatile boolean ready = false;
-
-        public boolean ready() {
-            return ready;
-        }
-
         public void run() {
             try {
                 DatagramChannel dc = DatagramChannel.open();
-                ready = true;
 
                 // Send a message
                 ByteBuffer bb = ByteBuffer.allocateDirect(256);
                 bb.put("hello".getBytes());
                 bb.flip();
                 InetAddress address = InetAddress.getLocalHost();
-                InetSocketAddress isa = new InetSocketAddress(address, 8888);
+                InetSocketAddress isa = new InetSocketAddress(address, port);
                 dc.connect(isa);
                 dc.write(bb);
 
@@ -123,26 +120,26 @@
     }
 
     public static class Reactor implements Sprintable {
+        final DatagramChannel dc;
         Exception e = null;
 
+        Reactor() throws IOException {
+            dc = DatagramChannel.open().bind(new InetSocketAddress(0));
+        }
+
+        int port() {
+            return dc.socket().getLocalPort();
+        }
+
         public void throwException() throws Exception {
             if (e != null)
                 throw e;
         }
 
-        private volatile boolean ready = false;
-
-        public boolean ready() {
-            return ready;
-        }
-
         public void run() {
             try {
                 // Listen for a message
-                DatagramChannel dc = DatagramChannel.open();
-                dc.socket().bind(new InetSocketAddress(8888));
                 ByteBuffer bb = ByteBuffer.allocateDirect(100);
-                ready = true;
                 SocketAddress sa = dc.receive(bb);
                 bb.flip();
                 CharBuffer cb = Charset.forName("US-ASCII").
--- a/jdk/test/java/nio/channels/DatagramChannel/EmptyBuffer.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/test/java/nio/channels/DatagramChannel/EmptyBuffer.java	Wed Jul 21 09:57:21 2010 -0700
@@ -42,47 +42,48 @@
     }
 
     static void test() throws Exception {
-        Sprintable server = new Server();
+        Server server = new Server();
         Thread serverThread = new Thread(server);
         serverThread.start();
-        while (!server.ready())
-            Thread.sleep(50);
         DatagramChannel dc = DatagramChannel.open();
-        ByteBuffer bb = ByteBuffer.allocateDirect(12);
-        bb.order(ByteOrder.BIG_ENDIAN);
-        bb.putInt(1).putLong(1);
-        bb.flip();
-        InetAddress address = InetAddress.getLocalHost();
-        InetSocketAddress isa = new InetSocketAddress(address, 8888);
-        dc.connect(isa);
-        dc.write(bb);
-        bb.rewind();
-        dc.write(bb);
-        bb.rewind();
-        dc.write(bb);
-        Thread.sleep(2000);
-        serverThread.interrupt();
-        server.throwException();
+        try {
+            ByteBuffer bb = ByteBuffer.allocateDirect(12);
+            bb.order(ByteOrder.BIG_ENDIAN);
+            bb.putInt(1).putLong(1);
+            bb.flip();
+            InetAddress address = InetAddress.getLocalHost();
+            InetSocketAddress isa = new InetSocketAddress(address, server.port());
+            dc.connect(isa);
+            dc.write(bb);
+            bb.rewind();
+            dc.write(bb);
+            bb.rewind();
+            dc.write(bb);
+            Thread.sleep(2000);
+            serverThread.interrupt();
+            server.throwException();
+        } finally {
+            dc.close();
+        }
     }
 
-    public interface Sprintable extends Runnable {
-        public void throwException() throws Exception;
-        public boolean ready();
-    }
+    public static class Server implements Runnable {
+        final DatagramChannel dc;
+        Exception e = null;
 
-    public static class Server implements Sprintable {
-        Exception e = null;
-        private volatile boolean ready = false;
+        Server() throws IOException {
+            this.dc = DatagramChannel.open().bind(new InetSocketAddress(0));
+        }
 
-        public void throwException() throws Exception {
+        int port() {
+            return dc.socket().getLocalPort();
+        }
+
+        void throwException() throws Exception {
             if (e != null)
                 throw e;
         }
 
-        public boolean ready() {
-            return ready;
-        }
-
         void showBuffer(String s, ByteBuffer bb) {
             log.println(s);
             bb.rewind();
@@ -97,9 +98,6 @@
             SocketAddress sa = null;
             int numberReceived = 0;
             try {
-                DatagramChannel dc = DatagramChannel.open();
-                dc.socket().bind(new InetSocketAddress(8888));
-                ready = true;
                 ByteBuffer bb = ByteBuffer.allocateDirect(12);
                 bb.clear();
                 // Only one clear. The buffer will be full after
@@ -124,6 +122,8 @@
                 }
             } catch (Exception ex) {
                 e = ex;
+            } finally {
+                try { dc.close(); } catch (IOException ignore) { }
             }
         }
     }
--- a/jdk/test/java/nio/channels/DatagramChannel/NoSender.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/test/java/nio/channels/DatagramChannel/NoSender.java	Wed Jul 21 09:57:21 2010 -0700
@@ -33,7 +33,7 @@
 public class NoSender {
     public static void main(String argv[]) throws Exception {
         DatagramChannel dc = DatagramChannel.open();
-        dc.socket().bind(new InetSocketAddress(5441));
+        dc.socket().bind(new InetSocketAddress(0));
         dc.configureBlocking(false);
         ByteBuffer buf1 = ByteBuffer.allocateDirect(256);
         SocketAddress sa1 = dc.receive(buf1);
--- a/jdk/test/java/nio/channels/DatagramChannel/ReceiveISA.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/test/java/nio/channels/DatagramChannel/ReceiveISA.java	Wed Jul 21 09:57:21 2010 -0700
@@ -66,6 +66,10 @@
             rb.clear();
         }
 
+        dc1.close();
+        dc2.close();
+        dc3.close();
+
         /*
          * Check that sa[0] equals sa[1] (both from dc1)
          * Check that sa[1] not equal to sa[2] (one from dc1, one from dc2)
--- a/jdk/test/java/nio/channels/DatagramChannel/SRTest.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/test/java/nio/channels/DatagramChannel/SRTest.java	Wed Jul 21 09:57:21 2010 -0700
@@ -42,16 +42,23 @@
     }
 
     static void test() throws Exception {
-        invoke(new ClassicReader(), new ClassicWriter());
+        ClassicReader classicReader;
+        NioReader nioReader;
+
+        classicReader = new ClassicReader();
+        invoke(classicReader, new ClassicWriter(classicReader.port()));
         log.println("Classic RW: OK");
 
-        invoke(new ClassicReader(), new NioWriter());
+        classicReader = new ClassicReader();
+        invoke(classicReader, new NioWriter(classicReader.port()));
         log.println("Classic R, Nio W: OK");
 
-        invoke(new NioReader(), new ClassicWriter());
+        nioReader = new NioReader();
+        invoke(nioReader, new ClassicWriter(nioReader.port()));
         log.println("Classic W, Nio R: OK");
 
-        invoke(new NioReader(), new NioWriter());
+        nioReader = new NioReader();
+        invoke(nioReader, new NioWriter(nioReader.port()));
         log.println("Nio RW: OK");
     }
 
@@ -75,8 +82,13 @@
     }
 
     public static class ClassicWriter implements Sprintable {
+        final int port;
         Exception e = null;
 
+        ClassicWriter(int port) {
+            this.port = port;
+        }
+
         public void throwException() throws Exception {
             if (e != null)
                 throw e;
@@ -89,7 +101,7 @@
                 byte[] data = dataString.getBytes();
                 InetAddress address = InetAddress.getLocalHost();
                 DatagramPacket dp = new DatagramPacket(data, data.length,
-                                                       address, 8888);
+                                                       address, port);
                 ds.send(dp);
                 Thread.sleep(50);
                 ds.send(dp);
@@ -100,8 +112,13 @@
     }
 
     public static class NioWriter implements Sprintable {
+        final int port;
         Exception e = null;
 
+        NioWriter(int port) {
+            this.port = port;
+        }
+
         public void throwException() throws Exception {
             if (e != null)
                 throw e;
@@ -114,7 +131,7 @@
                 bb.put("hello".getBytes());
                 bb.flip();
                 InetAddress address = InetAddress.getLocalHost();
-                InetSocketAddress isa = new InetSocketAddress(address, 8888);
+                InetSocketAddress isa = new InetSocketAddress(address, port);
                 dc.send(bb, isa);
                 Thread.sleep(50);
                 dc.send(bb, isa);
@@ -125,8 +142,17 @@
     }
 
     public static class ClassicReader implements Sprintable {
+        final DatagramSocket ds;
         Exception e = null;
 
+        ClassicReader() throws IOException {
+            this.ds = new DatagramSocket();
+        }
+
+        int port() {
+            return ds.getLocalPort();
+        }
+
         public void throwException() throws Exception {
             if (e != null)
                 throw e;
@@ -136,7 +162,6 @@
             try {
                 byte[] buf = new byte[256];
                 DatagramPacket dp = new DatagramPacket(buf, buf.length);
-                DatagramSocket ds = new DatagramSocket(8888);
                 ds.receive(dp);
                 String received = new String(dp.getData());
                 log.println(received);
@@ -148,8 +173,17 @@
     }
 
     public static class NioReader implements Sprintable {
+        final DatagramChannel dc;
         Exception e = null;
 
+        NioReader() throws IOException {
+            this.dc = DatagramChannel.open().bind(new InetSocketAddress(0));
+        }
+
+        int port() {
+            return dc.socket().getLocalPort();
+        }
+
         public void throwException() throws Exception {
             if (e != null)
                 throw e;
@@ -157,8 +191,6 @@
 
         public void run() {
             try {
-                DatagramChannel dc = DatagramChannel.open();
-                dc.socket().bind(new InetSocketAddress(8888));
                 ByteBuffer bb = ByteBuffer.allocateDirect(100);
                 SocketAddress sa = dc.receive(bb);
                 bb.flip();
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/nio/channels/DatagramChannel/SelectWhenRefused.java	Wed Jul 21 09:57:21 2010 -0700
@@ -0,0 +1,95 @@
+/*
+ * 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 6935563
+ * @summary Test that Selector does not select an unconnected DatagramChannel when
+ *    ICMP port unreachable received
+ */
+
+import java.nio.ByteBuffer;
+import java.nio.channels.*;
+import java.net.*;
+import java.io.IOException;
+
+public class SelectWhenRefused {
+
+    public static void main(String[] args) throws IOException {
+        DatagramChannel dc = DatagramChannel.open().bind(new InetSocketAddress(0));
+        int port = dc.socket().getLocalPort();
+        dc.close();
+
+        // datagram sent to this address should be refused
+        SocketAddress refuser = new InetSocketAddress(InetAddress.getLocalHost(), port);
+
+        dc = DatagramChannel.open().bind(new InetSocketAddress(0));
+        Selector sel = Selector.open();
+        try {
+            dc.configureBlocking(false);
+            dc.register(sel, SelectionKey.OP_READ);
+
+            /* Test 1: not connected so ICMP port unreachable should not be received */
+            sendDatagram(dc, refuser);
+            int n = sel.select(2000);
+            if (n > 0) {
+                throw new RuntimeException("Unexpected wakeup");
+            }
+
+            /* Test 2: connected so ICMP port unreachable may be received */
+            dc.connect(refuser);
+            try {
+                sendDatagram(dc, refuser);
+                n = sel.select(2000);
+                if (n > 0) {
+                    sel.selectedKeys().clear();
+                    try {
+                        n = dc.read(ByteBuffer.allocate(100));
+                        throw new RuntimeException("Unexpected datagram received");
+                    } catch (PortUnreachableException pue) {
+                        // expected
+                    }
+                }
+            } finally {
+                dc.disconnect();
+            }
+
+            /* Test 3: not connected so ICMP port unreachable should not be received */
+            sendDatagram(dc, refuser);
+            n = sel.select(2000);
+            if (n > 0) {
+                throw new RuntimeException("Unexpected wakeup after disconnect");
+            }
+
+        } finally {
+            sel.close();
+            dc.close();
+        }
+    }
+
+    static void sendDatagram(DatagramChannel dc, SocketAddress remote)
+        throws IOException
+    {
+        ByteBuffer bb = ByteBuffer.wrap("Greetings!".getBytes());
+        dc.send(bb, remote);
+    }
+}
--- a/jdk/test/java/nio/channels/DatagramChannel/Sender.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/test/java/nio/channels/DatagramChannel/Sender.java	Wed Jul 21 09:57:21 2010 -0700
@@ -42,13 +42,11 @@
     }
 
     static void test() throws Exception {
-        Sprintable server = new Server();
-        Sprintable client = new Client();
+        Server server = new Server();
+        Client client = new Client(server.port());
 
         Thread serverThread = new Thread(server);
         serverThread.start();
-        while (!server.ready())
-            Thread.sleep(50);
 
         Thread clientThread = new Thread(client);
         clientThread.start();
@@ -60,23 +58,17 @@
         client.throwException();
     }
 
-    public interface Sprintable extends Runnable {
-        public void throwException() throws Exception;
-        public boolean ready();
-    }
-
-    public static class Client implements Sprintable {
+    public static class Client implements Runnable {
+        final int port;
         Exception e = null;
 
-        public void throwException() throws Exception {
-            if (e != null)
-                throw e;
+        Client(int port) {
+            this.port = port;
         }
 
-        private volatile boolean ready = false;
-
-        public boolean ready() {
-            return ready;
+        void throwException() throws Exception {
+            if (e != null)
+                throw e;
         }
 
         public void run() {
@@ -87,7 +79,7 @@
                 bb.putInt(1).putLong(1);
                 bb.flip();
                 InetAddress address = InetAddress.getLocalHost();
-                InetSocketAddress isa = new InetSocketAddress(address, 8888);
+                InetSocketAddress isa = new InetSocketAddress(address, port);
                 dc.connect(isa);
                 dc.write(bb);
             } catch (Exception ex) {
@@ -96,19 +88,23 @@
         }
     }
 
-    public static class Server implements Sprintable {
+    public static class Server implements Runnable {
+        final DatagramChannel dc;
         Exception e = null;
-        private volatile boolean ready = false;
+
+        Server() throws IOException {
+            dc = DatagramChannel.open().bind(new InetSocketAddress(0));
+        }
 
-        public void throwException() throws Exception {
+        int port() {
+            return dc.socket().getLocalPort();
+        }
+
+        void throwException() throws Exception {
             if (e != null)
                 throw e;
         }
 
-        public boolean ready() {
-            return ready;
-        }
-
         void showBuffer(String s, ByteBuffer bb) {
             log.println(s);
             bb.rewind();
@@ -123,13 +119,10 @@
             SocketAddress sa = null;
 
             try {
-                DatagramChannel dc = DatagramChannel.open();
-                dc.socket().bind(new InetSocketAddress(8888));
-                dc.configureBlocking(false);
-                ready = true;
                 ByteBuffer bb = ByteBuffer.allocateDirect(12);
                 bb.clear();
                 // Get the one valid datagram
+                dc.configureBlocking(false);
                 while (sa == null)
                     sa = dc.receive(bb);
                 sa = null;
--- a/jdk/test/java/nio/channels/FileChannel/Args.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/test/java/nio/channels/FileChannel/Args.java	Wed Jul 21 09:57:21 2010 -0700
@@ -97,6 +97,8 @@
                            (long)Integer.MAX_VALUE << 3);
                 }});
 
+        fc.close();
+        f.delete();
     }
 
 }
--- a/jdk/test/java/nio/channels/FileChannel/ClosedChannelTransfer.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/test/java/nio/channels/FileChannel/ClosedChannelTransfer.java	Wed Jul 21 09:57:21 2010 -0700
@@ -38,6 +38,7 @@
         test1(channel);
         test2(channel);
         channel.close();
+        file.delete();
     }
 
     static void test1(FileChannel channel) throws Exception {
--- a/jdk/test/java/nio/channels/FileChannel/ExpandingMap.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/test/java/nio/channels/FileChannel/ExpandingMap.java	Wed Jul 21 09:57:21 2010 -0700
@@ -25,6 +25,7 @@
  * @bug 4938372 6541641
  * @summary Flushing dirty pages prior to unmap can cause Cleaner thread to
  *          abort VM if memory system has pages locked
+ * @run main/othervm ExpandingMap
  */
 import java.io.File;
 import java.io.RandomAccessFile;
--- a/jdk/test/java/nio/channels/FileChannel/Lock.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/test/java/nio/channels/FileChannel/Lock.java	Wed Jul 21 09:57:21 2010 -0700
@@ -55,6 +55,7 @@
         test2(blah, true);
         test2(blah, false);
         test3(blah);
+        blah.delete();
     }
 
     private static void test2(File blah, boolean b) throws Exception {
@@ -90,7 +91,11 @@
 
         // Exec the tamperer
         String command = System.getProperty("java.home") +
-            File.separator + "bin" + File.separator + "java Lock " + str + " " + blah;
+            File.separator + "bin" + File.separator + "java";
+        String testClasses = System.getProperty("test.classes");
+        if (testClasses != null)
+            command += " -cp " + testClasses;
+        command += " Lock " + str + " " + blah;
         Process p = Runtime.getRuntime().exec(command);
 
         BufferedReader in = new BufferedReader
--- a/jdk/test/java/nio/channels/FileChannel/MapOverEnd.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/test/java/nio/channels/FileChannel/MapOverEnd.java	Wed Jul 21 09:57:21 2010 -0700
@@ -24,6 +24,7 @@
 /* @test
  * @bug 4463036
  * @summary Check if file mapping extends beyond end of file
+ * @run main/othervm MapOverEnd
  */
 
 import java.nio.*;
--- a/jdk/test/java/nio/channels/FileChannel/MapReadOnly.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/test/java/nio/channels/FileChannel/MapReadOnly.java	Wed Jul 21 09:57:21 2010 -0700
@@ -24,6 +24,7 @@
 /* @test
  * @bug 4510489
  * @summary Verify IOUtil.java reads to buffer limits
+ * @run main/othervm MapReadOnly
  */
 import java.io.*;
 import java.nio.*;
--- a/jdk/test/java/nio/channels/FileChannel/MapTest.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/test/java/nio/channels/FileChannel/MapTest.java	Wed Jul 21 09:57:21 2010 -0700
@@ -23,6 +23,7 @@
 
 /* @test
  * @summary Test file mapping with FileChannel
+ * @run main/othervm MapTest
  */
 
 import java.io.*;
--- a/jdk/test/java/nio/channels/FileChannel/Mode.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/test/java/nio/channels/FileChannel/Mode.java	Wed Jul 21 09:57:21 2010 -0700
@@ -24,6 +24,7 @@
 /* @test
    @bug 4462298
  * @summary Test FileChannel maps with different accesses
+ * @run main/othervm Mode
  */
 
 import java.nio.channels.*;
--- a/jdk/test/java/nio/channels/FileChannel/Position.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/test/java/nio/channels/FileChannel/Position.java	Wed Jul 21 09:57:21 2010 -0700
@@ -63,6 +63,7 @@
 
         c.close();
         fis.close();
+        blah.delete();
     }
 
     /**
--- a/jdk/test/java/nio/channels/FileChannel/Pread.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/test/java/nio/channels/FileChannel/Pread.java	Wed Jul 21 09:57:21 2010 -0700
@@ -65,6 +65,9 @@
             throw new RuntimeException("Expected exception not thrown");
         } catch(IllegalArgumentException e) {
             // Correct result
+        } finally {
+            fc.close();
+            blah.delete();
         }
     }
 
@@ -73,13 +76,18 @@
         File blah = File.createTempFile("blah2", null);
         blah.deleteOnExit();
         FileOutputStream fos = new FileOutputStream(blah);
-        fos.write(new byte[128]);
-        FileChannel fc = fos.getChannel();
         try {
-            fc.read(ByteBuffer.allocate(256),1);
-            throw new RuntimeException("Expected exception not thrown");
-        } catch(NonReadableChannelException e) {
-            // Correct result
+            fos.write(new byte[128]);
+            FileChannel fc = fos.getChannel();
+            try {
+                fc.read(ByteBuffer.allocate(256),1);
+                throw new RuntimeException("Expected exception not thrown");
+            } catch(NonReadableChannelException e) {
+                // Correct result
+            }
+        } finally {
+            fos.close();
+            blah.delete();
         }
     }
 
@@ -130,6 +138,7 @@
 
         c.close();
         fis.close();
+        blah.delete();
     }
 
     /**
--- a/jdk/test/java/nio/channels/FileChannel/Pwrite.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/test/java/nio/channels/FileChannel/Pwrite.java	Wed Jul 21 09:57:21 2010 -0700
@@ -62,6 +62,9 @@
             throw new RuntimeException("Expected exception not thrown");
         } catch(NonWritableChannelException e) {
             // Correct result
+        } finally {
+            fc.close();
+            blah.delete();
         }
     }
 
@@ -123,6 +126,7 @@
         }
         c.close();
         raf.close();
+        blah.delete();
     }
 
     /**
--- a/jdk/test/java/nio/channels/FileChannel/Read.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/test/java/nio/channels/FileChannel/Read.java	Wed Jul 21 09:57:21 2010 -0700
@@ -80,6 +80,7 @@
 
         c.close();
         fis.close();
+        blah.delete();
     }
 
     /**
--- a/jdk/test/java/nio/channels/FileChannel/ReadFull.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/test/java/nio/channels/FileChannel/ReadFull.java	Wed Jul 21 09:57:21 2010 -0700
@@ -54,5 +54,6 @@
 
         fc.close();
         fis.close();
+        blah.delete();
     }
 }
--- a/jdk/test/java/nio/channels/FileChannel/ReadToLimit.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/test/java/nio/channels/FileChannel/ReadToLimit.java	Wed Jul 21 09:57:21 2010 -0700
@@ -48,6 +48,7 @@
                 throw new Exception("Test failed");
         fc.close();
         fis.close();
+        blah.delete();
     }
 
     /**
--- a/jdk/test/java/nio/channels/FileChannel/ReleaseOnCloseDeadlock.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/test/java/nio/channels/FileChannel/ReleaseOnCloseDeadlock.java	Wed Jul 21 09:57:21 2010 -0700
@@ -39,8 +39,12 @@
     public static void main(String[] args) throws IOException {
         File blah = File.createTempFile("blah", null);
         blah.deleteOnExit();
-        for (int i=0; i<100; i++) {
-            test(blah.toPath());
+        try {
+            for (int i=0; i<100; i++) {
+                test(blah.toPath());
+            }
+        } finally {
+            blah.delete();
         }
     }
 
--- a/jdk/test/java/nio/channels/FileChannel/ScatteringRead.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/test/java/nio/channels/FileChannel/ScatteringRead.java	Wed Jul 21 09:57:21 2010 -0700
@@ -24,6 +24,7 @@
 /* @test
    @bug 4452020 4629048 4638365 4869859
  * @summary Test FileChannel scattering reads
+ * @run main/othervm ScatteringRead
  */
 
 import java.nio.channels.*;
--- a/jdk/test/java/nio/channels/FileChannel/Size.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/test/java/nio/channels/FileChannel/Size.java	Wed Jul 21 09:57:21 2010 -0700
@@ -24,6 +24,7 @@
 /* @test
  * @bug 4563125
  * @summary Test size method of FileChannel
+ * @run main/othervm Size
  */
 
 import java.io.*;
--- a/jdk/test/java/nio/channels/FileChannel/Transfer.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/test/java/nio/channels/FileChannel/Transfer.java	Wed Jul 21 09:57:21 2010 -0700
@@ -25,7 +25,6 @@
  * @bug 4434723 4482726 4559072 4638365 4795550 5081340 5103988 6253145
  * @summary Test FileChannel.transferFrom and transferTo
  * @library ..
- * @run main/timeout=180 Transfer
  */
 
 import java.io.*;
@@ -33,6 +32,8 @@
 import java.nio.*;
 import java.nio.channels.*;
 import java.nio.channels.spi.SelectorProvider;
+import java.nio.file.StandardOpenOption;
+import java.nio.file.FileAlreadyExistsException;
 import java.util.Random;
 
 
@@ -96,6 +97,9 @@
 
         sourceChannel.close();
         sinkChannel.close();
+
+        source.delete();
+        sink.delete();
     }
 
     private static void testReadableByteChannel(int size) throws Exception {
@@ -139,6 +143,8 @@
         fc.close();
         sink.close();
         source.close();
+
+        f.delete();
     }
 
     public static void xferTest02() throws Exception {
@@ -173,6 +179,9 @@
         fc2.close();
         raf1.close();
         raf2.close();
+
+        source.delete();
+        dest.delete();
     }
 
     public static void xferTest03() throws Exception {
@@ -207,6 +216,9 @@
         fc2.close();
         raf1.close();
         raf2.close();
+
+        source.delete();
+        dest.delete();
     }
 
     // Test transferTo with large file
@@ -245,27 +257,36 @@
         sourceChannel.close();
         sinkChannel.close();
 
+        source.delete();
+        sink.delete();
     }
 
     // Test transferFrom with large file
     public static void xferTest05() throws Exception {
-        // Linux can't handle the really large file sizes for a
-        // truncate or a positional write
-        String osName = System.getProperty("os.name");
-        if (osName.startsWith("Linux"))
-            return;
-
         // Create a source file & large sink file for the test
         File source = File.createTempFile("blech", null);
         source.deleteOnExit();
         initTestFile(source, 100);
 
-        File sink = File.createTempFile("sink", null);
+        // Create the sink file as a sparse file if possible
+        File sink = null;
+        FileChannel fc = null;
+        while (fc == null) {
+            sink = File.createTempFile("sink", null);
+            // re-create as a sparse file
+            sink.toPath().delete();
+            try {
+                fc = FileChannel.open(sink.toPath(),
+                                      StandardOpenOption.CREATE_NEW,
+                                      StandardOpenOption.WRITE,
+                                      StandardOpenOption.SPARSE);
+            } catch (FileAlreadyExistsException ignore) {
+                // someone else got it
+            }
+        }
         sink.deleteOnExit();
 
         long testSize = ((long)Integer.MAX_VALUE) * 2;
-        RandomAccessFile raf = new RandomAccessFile(sink, "rw");
-        FileChannel fc = raf.getChannel();
         try {
             fc.write(ByteBuffer.wrap("Use the source!".getBytes()),
                      testSize - 40);
@@ -275,24 +296,28 @@
             return;
         } finally {
             fc.close();
-            raf.close();
         }
 
         // Get new channels for the source and sink and attempt transfer
-        FileInputStream fis = new FileInputStream(source);
-        FileChannel sourceChannel = fis.getChannel();
-
-        raf = new RandomAccessFile(sink, "rw");
-        FileChannel sinkChannel = raf.getChannel();
+        FileChannel sourceChannel = new FileInputStream(source).getChannel();
+        try {
+            FileChannel sinkChannel = new RandomAccessFile(sink, "rw").getChannel();
+            try {
+                long bytesWritten = sinkChannel.transferFrom(sourceChannel,
+                                                             testSize - 40, 10);
+                if (bytesWritten != 10) {
+                    throw new RuntimeException("Transfer test 5 failed " +
+                                               bytesWritten);
+                }
+            } finally {
+                sinkChannel.close();
+            }
+        } finally {
+            sourceChannel.close();
+        }
 
-        long bytesWritten = sinkChannel.transferFrom(sourceChannel,
-                                                     testSize - 40, 10);
-        if (bytesWritten != 10) {
-            throw new RuntimeException("Transfer test 5 failed " +
-                                       bytesWritten);
-        }
-        sourceChannel.close();
-        sinkChannel.close();
+        source.delete();
+        sink.delete();
     }
 
     static void checkFileData(File file, String expected) throws Exception {
@@ -338,6 +363,8 @@
 
         checkFileData(source, data);
         checkFileData(sink, data.substring(7,data.length()));
+
+        source.delete();
     }
 
     // Test transferTo to non-blocking socket channel
@@ -371,6 +398,7 @@
         sink.close();
         other.close();
         ssc.close();
+        source.delete();
     }
 
 
@@ -473,6 +501,7 @@
             source.close();
             ssc.close();
             fc.close();
+            file.delete();
         }
     }
 
--- a/jdk/test/java/nio/channels/FileChannel/TransferToChannel.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/test/java/nio/channels/FileChannel/TransferToChannel.java	Wed Jul 21 09:57:21 2010 -0700
@@ -51,6 +51,8 @@
         test1();
         test2();
         in.close();
+        file.delete();
+        outFile.delete();
     }
 
     static void test1() throws Exception {
--- a/jdk/test/java/nio/channels/FileChannel/TransferToNonWritable.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/test/java/nio/channels/FileChannel/TransferToNonWritable.java	Wed Jul 21 09:57:21 2010 -0700
@@ -43,6 +43,9 @@
             throw new RuntimeException("Test failed");
         } catch (NonWritableChannelException nwce) {
             // Correct result
+        } finally {
+            channel.close();
+            blah.delete();
         }
     }
 }
--- a/jdk/test/java/nio/channels/FileChannel/Transfers.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/test/java/nio/channels/FileChannel/Transfers.java	Wed Jul 21 09:57:21 2010 -0700
@@ -554,6 +554,10 @@
                 break;
         }
 
+        sourceFile.delete();
+        targetFile.delete();
+        fn.delete();
+
         if (failures > 0) {
             out.println();
             throw new RuntimeException("Some tests failed");
--- a/jdk/test/java/nio/channels/FileChannel/TryLock.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/test/java/nio/channels/FileChannel/TryLock.java	Wed Jul 21 09:57:21 2010 -0700
@@ -56,7 +56,6 @@
 
     public static void test1(boolean shared, boolean trylock) throws Exception {
         File testFile = File.createTempFile("test1", null);
-        testFile.deleteOnExit();
         FileInputStream fis = new FileInputStream(testFile);
         FileChannel fc = fis.getChannel();
         FileLock fl = null;
@@ -73,12 +72,13 @@
         } finally {
             if (fl != null)
                 fl.release();
+            fc.close();
+            testFile.delete();
         }
     }
 
     public static void test2(boolean shared, boolean trylock) throws Exception {
         File testFile = File.createTempFile("test2", null);
-        testFile.deleteOnExit();
         FileOutputStream fis = new FileOutputStream(testFile);
         FileChannel fc = fis.getChannel();
         FileLock fl = null;
@@ -95,19 +95,25 @@
         } finally {
             if (fl != null)
                 fl.release();
+            fc.close();
+            testFile.delete();
         }
     }
 
     public static void test3(boolean shared, boolean trylock) throws Exception {
         File testFile = File.createTempFile("test3", null);
-        testFile.deleteOnExit();
         RandomAccessFile fis = new RandomAccessFile(testFile, "rw");
         FileChannel fc = fis.getChannel();
-        FileLock fl = null;
-        if (trylock)
-            fl = fc.tryLock(0, fc.size(), shared);
-        else
-            fl = fc.lock(0, fc.size(), shared);
-        fl.release();
+        try {
+            FileLock fl = null;
+            if (trylock)
+                fl = fc.tryLock(0, fc.size(), shared);
+            else
+                fl = fc.lock(0, fc.size(), shared);
+            fl.release();
+        } finally {
+            fc.close();
+            testFile.delete();
+        }
     }
 }
--- a/jdk/test/java/nio/channels/FileChannel/Write.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/test/java/nio/channels/FileChannel/Write.java	Wed Jul 21 09:57:21 2010 -0700
@@ -25,6 +25,7 @@
  * @test
  * @bug 4475533 4698138 4638365 4796221
  * @summary Test FileChannel write
+ * @run main/othervm Write
  */
 
 import java.nio.channels.*;
@@ -46,23 +47,25 @@
 
     // Test to see that offset > length does not throw exception
     static void test1() throws Exception {
-        File testFile = File.createTempFile("test1", null);
-        testFile.deleteOnExit();
-
         ByteBuffer[] dsts = new ByteBuffer[4];
         for (int i=0; i<4; i++)
             dsts[i] = ByteBuffer.allocateDirect(10);
 
-        FileOutputStream fos = new FileOutputStream(testFile);
-        FileChannel fc = fos.getChannel();
-        fc.write(dsts, 2, 1);
-        fos.close();
+        File testFile = File.createTempFile("test1", null);
+        try {
+            FileOutputStream fos = new FileOutputStream(testFile);
+            FileChannel fc = fos.getChannel();
+            fc.write(dsts, 2, 1);
+            fos.close();
+        } finally {
+            testFile.delete();
+        }
     }
 
     // Test to see that the appropriate buffers are updated
     static void test2() throws Exception {
         File testFile = File.createTempFile("test2", null);
-        testFile.deleteOnExit();
+        testFile.delete();
         ByteBuffer[] srcs = new ByteBuffer[4];
         for (int i=0; i<4; i++)
             srcs[i] = ByteBuffer.allocateDirect(10);
@@ -74,25 +77,34 @@
 
         FileOutputStream fos = new FileOutputStream(testFile);
         FileChannel fc = fos.getChannel();
-        fc.write(srcs, 1, 2);
-        fos.close();
+        try {
+            fc.write(srcs, 1, 2);
+        } finally {
+            fc.close();
+        }
 
         FileInputStream fis = new FileInputStream(testFile);
         fc = fis.getChannel();
-        ByteBuffer bb = ByteBuffer.allocateDirect(10);
-        fc.read(bb);
-        bb.flip();
-        if (bb.get() != 2)
-            throw new RuntimeException("Write failure");
-        if (bb.get() != 3)
-            throw new RuntimeException("Write failure");
         try {
-            bb.get();
-            throw new RuntimeException("Write failure");
-        } catch (BufferUnderflowException bufe) {
-            // correct result
+            ByteBuffer bb = ByteBuffer.allocateDirect(10);
+            fc.read(bb);
+            bb.flip();
+            if (bb.get() != 2)
+                throw new RuntimeException("Write failure");
+            if (bb.get() != 3)
+                throw new RuntimeException("Write failure");
+            try {
+                bb.get();
+                throw new RuntimeException("Write failure");
+            } catch (BufferUnderflowException bufe) {
+                // correct result
+            }
+        } finally {
+            fc.close();
         }
-        fis.close();
+
+        // eagerly clean-up
+        testFile.delete();
     }
 
     // Test write to a negative position (bug 4698138).
--- a/jdk/test/java/nio/channels/Pipe/NonBlocking.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/test/java/nio/channels/Pipe/NonBlocking.java	Wed Jul 21 09:57:21 2010 -0700
@@ -41,12 +41,17 @@
 
     static void test1() throws Exception {
         Pipe p = Pipe.open();
-        p.sink().configureBlocking(false);
-        if (p.sink().isBlocking())
-            throw new Exception("Sink still blocking");
-        p.source().configureBlocking(false);
-        if (p.source().isBlocking())
-            throw new Exception("Source still blocking");
+        try {
+            p.sink().configureBlocking(false);
+            if (p.sink().isBlocking())
+                throw new Exception("Sink still blocking");
+            p.source().configureBlocking(false);
+            if (p.source().isBlocking())
+                throw new Exception("Source still blocking");
+        } finally {
+            p.sink().close();
+            p.source().close();
+        }
     }
 
 }
--- a/jdk/test/java/nio/channels/Pipe/SelectPipe.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/test/java/nio/channels/Pipe/SelectPipe.java	Wed Jul 21 09:57:21 2010 -0700
@@ -78,10 +78,12 @@
                 totalRead += bytesRead;
         } while(totalRead < 10);
 
+        sink.close();
+        source.close();
+        selector.close();
+
         for(int i=0; i<10; i++)
             if (outgoingdata.get(i) != incomingdata.get(i))
                 throw new Exception("Pipe failed");
-        sink.close();
-        source.close();
     }
 }
--- a/jdk/test/java/nio/channels/SelectionKey/AtomicAttachTest.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/test/java/nio/channels/SelectionKey/AtomicAttachTest.java	Wed Jul 21 09:57:21 2010 -0700
@@ -58,6 +58,11 @@
         };
 
         t.join();
+
+        pipe.sink().close();
+        pipe.source().close();
+        selector.close();
+
         int count = errorCount.get();
         if (count > 0) {
             throw new RuntimeException("Error count:" + count);
--- a/jdk/test/java/nio/channels/Selector/BasicAccept.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/test/java/nio/channels/Selector/BasicAccept.java	Wed Jul 21 09:57:21 2010 -0700
@@ -36,49 +36,60 @@
 
 public class BasicAccept {
 
-    public static int TEST_PORT = 40170;
-
-    static void server() throws Exception {
+    static void server(ServerSocketChannel ssc) throws Exception {
         Selector acceptSelector = Selector.open();
-        ServerSocketChannel ssc = ServerSocketChannel.open();
-        ssc.configureBlocking(false);
-        InetAddress lh = InetAddress.getLocalHost();
-        InetSocketAddress isa
-            = new InetSocketAddress(lh, SelectorTest.TEST_PORT);
-        ssc.socket().bind(isa);
-        SelectionKey acceptKey
-            = ssc.register(acceptSelector, SelectionKey.OP_ACCEPT);
-        for (;;) {
-            if (acceptSelector.select() == 0)
-                continue;
-            Set readyKeys = acceptSelector.selectedKeys();
-            Iterator i = readyKeys.iterator();
-            while (i.hasNext()) {
-                SelectionKey sk = (SelectionKey)i.next();
-                i.remove();
-                ServerSocketChannel nextReady
-                    = (ServerSocketChannel)sk.channel();
-                SocketChannel sc = nextReady.accept();
-                ByteBuffer bb = ByteBuffer.wrap(new byte[] { 42 });
-                sc.write(bb);
+        try {
+            ssc.configureBlocking(false);
+            SelectionKey acceptKey
+                = ssc.register(acceptSelector, SelectionKey.OP_ACCEPT);
+            for (;;) {
+                int n = acceptSelector.select();
+                if (Thread.interrupted())
+                    break;
+                if (n == 0)
+                    continue;
+                Set<SelectionKey> readyKeys = acceptSelector.selectedKeys();
+                Iterator<SelectionKey> i = readyKeys.iterator();
+                while (i.hasNext()) {
+                    SelectionKey sk = i.next();
+                    i.remove();
+                    ServerSocketChannel nextReady
+                        = (ServerSocketChannel)sk.channel();
+                    SocketChannel sc = nextReady.accept();
+                    ByteBuffer bb = ByteBuffer.wrap(new byte[] { 42 });
+                    sc.write(bb);
+                    sc.close();
+                }
+            }
+        } finally {
+            acceptSelector.close();
+        }
+    }
+
+    private static class Server extends TestThread {
+        final ServerSocketChannel ssc;
+        Server() throws IOException {
+            super("Server", System.err);
+            this.ssc = ServerSocketChannel.open()
+                .bind(new InetSocketAddress(0));
+        }
+        int port() {
+            return ssc.socket().getLocalPort();
+        }
+        void go() throws Exception {
+            try {
+                server(ssc);
+            } finally {
+                ssc.close();
             }
         }
     }
 
-    private static class Server extends TestThread {
-        Server() {
-            super("Server", System.err);
-        }
-        void go() throws Exception {
-            server();
-        }
-    }
-
-    static void client() throws Exception {
+    static void client(int port) throws Exception {
         // Get a connection from the server
         InetAddress lh = InetAddress.getLocalHost();
         InetSocketAddress isa
-            = new InetSocketAddress(lh, SelectorTest.TEST_PORT);
+            = new InetSocketAddress(lh, port);
         int connectFailures = 0;
         boolean result = false;
         SocketChannel sc = SocketChannel.open();
@@ -122,17 +133,17 @@
         if (bb.get(0) != 42)
             throw new RuntimeException("Read wrong byte from server");
         System.err.println("Read from server");
+        sc.close();
     }
 
     public static void main(String[] args) throws Exception {
-        if (args.length == 0) {
-            Server server = new Server();
-            server.start();
-            client();
-        } else if (args[0].equals("client")) {
-            client();
-        } else if (args[0].equals("server")) {
-            server();
+        Server server = new Server();
+        server.start();
+        try {
+            client(server.port());
+        } finally {
+            server.interrupt();
+            server.finish(2000);
         }
     }
 
--- a/jdk/test/java/nio/channels/Selector/BasicConnect.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/test/java/nio/channels/Selector/BasicConnect.java	Wed Jul 21 09:57:21 2010 -0700
@@ -83,10 +83,13 @@
         ByteBuffer bb2 = ByteBuffer.allocateDirect(100);
         int n = sc.read(bb2);
         bb2.flip();
+
+        sc.close();
+        connectSelector.close();
+
         if (!bb.equals(bb2))
             throw new Exception("Echoed bytes incorrect: Sent "
                                 + bb + ", got " + bb2);
-        sc.close();
     }
 
 }
--- a/jdk/test/java/nio/channels/Selector/ByteServer.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/test/java/nio/channels/Selector/ByteServer.java	Wed Jul 21 09:57:21 2010 -0700
@@ -33,7 +33,6 @@
 
 public class ByteServer {
 
-    public static final int PORT = 31415;
     public static final String LOCALHOST = "localhost";
     private int bytecount;
     private Socket  socket;
@@ -43,7 +42,11 @@
 
     public ByteServer(int bytecount) throws Exception{
         this.bytecount = bytecount;
-        serversocket = new ServerSocket(PORT);
+        serversocket = new ServerSocket(0);
+    }
+
+    public int port() {
+        return serversocket.getLocalPort();
     }
 
     public void start() {
--- a/jdk/test/java/nio/channels/Selector/CheckLocking.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/test/java/nio/channels/Selector/CheckLocking.java	Wed Jul 21 09:57:21 2010 -0700
@@ -61,5 +61,7 @@
         doSelect();
         sk.interestOps(SelectionKey.OP_READ);
         selector.wakeup();
+        sc.close();
+        selector.close();
     }
 }
--- a/jdk/test/java/nio/channels/Selector/CloseInvalidatesKeys.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/test/java/nio/channels/Selector/CloseInvalidatesKeys.java	Wed Jul 21 09:57:21 2010 -0700
@@ -33,12 +33,16 @@
 
     public static void main (String [] args) throws Exception {
         DatagramChannel ch = DatagramChannel.open();
-        ch.configureBlocking(false);
-        Selector sel = Selector.open();
-        SelectionKey key = ch.register(sel, SelectionKey.OP_WRITE);
-        sel.close();
-        if (key.isValid())
-            throw new Exception("Key valid after selector closed");
+        try {
+            ch.configureBlocking(false);
+            Selector sel = Selector.open();
+            SelectionKey key = ch.register(sel, SelectionKey.OP_WRITE);
+            sel.close();
+            if (key.isValid())
+                throw new Exception("Key valid after selector closed");
+        } finally {
+            ch.close();
+        }
     }
 
 }
--- a/jdk/test/java/nio/channels/Selector/CloseThenRegister.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/test/java/nio/channels/Selector/CloseThenRegister.java	Wed Jul 21 09:57:21 2010 -0700
@@ -32,17 +32,19 @@
 public class CloseThenRegister {
 
     public static void main (String [] args) throws Exception {
+        Selector sel = Selector.open();
+        sel.close();
+        ServerSocketChannel ssc = ServerSocketChannel.open();
         try {
-            Selector s = Selector.open();
-            s.close();
-            ServerSocketChannel c = ServerSocketChannel.open();
-            c.socket().bind(new InetSocketAddress(40000));
-            c.configureBlocking(false);
-            c.register(s, SelectionKey.OP_ACCEPT);
+            ssc.bind(new InetSocketAddress(0));
+            ssc.configureBlocking(false);
+            ssc.register(sel, SelectionKey.OP_ACCEPT);
+            throw new RuntimeException("register after close does not cause CSE!");
         } catch (ClosedSelectorException cse) {
-            return;
+            // expected
+        } finally {
+            ssc.close();
         }
-        throw new RuntimeException("register after close does not cause CSE!");
     }
 
 }
--- a/jdk/test/java/nio/channels/Selector/CloseWhenKeyIdle.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/test/java/nio/channels/Selector/CloseWhenKeyIdle.java	Wed Jul 21 09:57:21 2010 -0700
@@ -111,10 +111,14 @@
         // select should block
 
         int spinCount = 0;
+        boolean failed = false;
         for (;;) {
             int n = sel.select();
-            if (n > 0)
-                throw new RuntimeException("channel should not be selected");
+            if (n > 0) {
+                System.err.println("Channel should not be selected!!!");
+                failed = true;
+                break;
+            }
 
             // wakeup
             if (wakeupDone)
@@ -123,10 +127,19 @@
             // wakeup for no reason - if it happens a few times then we have a
             // problem
             spinCount++;
-            if (spinCount >= 3)
-                throw new RuntimeException("Selector appears to be spinning");
+            if (spinCount >= 3) {
+                System.err.println("Selector appears to be spinning");
+                failed = true;
+                break;
+            }
         }
 
+        sc1.close();
+        sel.close();
+
+        if (failed)
+            throw new RuntimeException("Test failed");
+
         System.out.println("PASS");
     }
 
--- a/jdk/test/java/nio/channels/Selector/Connect.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/test/java/nio/channels/Selector/Connect.java	Wed Jul 21 09:57:21 2010 -0700
@@ -25,7 +25,6 @@
  * @bug 4511624
  * @summary Test Making lots of Selectors
  * @library ..
- * @run main/timeout=240 Connect
  */
 
 import java.io.*;
@@ -38,7 +37,7 @@
 public class Connect {
 
     static int success = 0;
-    static int LIMIT = 500;
+    static int LIMIT = 100;
 
     public static void main(String[] args) throws Exception {
         scaleTest();
@@ -51,29 +50,30 @@
         for (int j=0; j<LIMIT; j++) {
             SocketChannel sc = SocketChannel.open();
             sc.configureBlocking(false);
-            boolean result = sc.connect(isa);
-            if (!result) {
+            boolean connected = sc.connect(isa);
+            if (!connected) {
                 Selector RSelector = SelectorProvider.provider().openSelector();
                 SelectionKey RKey = sc.register (RSelector, SelectionKey.OP_CONNECT);
-                while (!result) {
+                while (!connected) {
                     int keysAdded = RSelector.select(100);
                     if (keysAdded > 0) {
-                        Set readyKeys = RSelector.selectedKeys();
-                        Iterator i = readyKeys.iterator();
+                        Set<SelectionKey> readyKeys = RSelector.selectedKeys();
+                        Iterator<SelectionKey> i = readyKeys.iterator();
                         while (i.hasNext()) {
-                            SelectionKey sk = (SelectionKey)i.next();
+                            SelectionKey sk = i.next();
                             SocketChannel nextReady = (SocketChannel)sk.channel();
-                            result = nextReady.finishConnect();
+                            connected = nextReady.finishConnect();
                         }
+                        readyKeys.clear();
                     }
                 }
                 RSelector.close();
             }
-            read(sc);
+            readAndClose(sc);
         }
     }
 
-    static void read(SocketChannel sc) throws Exception {
+    static void readAndClose(SocketChannel sc) throws Exception {
         ByteBuffer bb = ByteBuffer.allocateDirect(100);
         int n = 0;
         while (n == 0) // Note this is not a rigorous check for done reading
--- a/jdk/test/java/nio/channels/Selector/ConnectWrite.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/test/java/nio/channels/Selector/ConnectWrite.java	Wed Jul 21 09:57:21 2010 -0700
@@ -45,8 +45,8 @@
         Selector selector = SelectorProvider.provider().openSelector();
         InetAddress myAddress=InetAddress.getByName(TestUtil.HOST);
         InetSocketAddress isa = new InetSocketAddress(myAddress, port);
+        SocketChannel sc = SocketChannel.open();
         try {
-            SocketChannel sc = SocketChannel.open();
             sc.configureBlocking(false);
             SelectionKey key = sc.register(selector, SelectionKey.OP_CONNECT);
             boolean result = sc.connect(isa);
@@ -80,6 +80,7 @@
                 }
             }
         } finally {
+            sc.close();
             selector.close();
         }
     }
--- a/jdk/test/java/nio/channels/Selector/HelperSlowToDie.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/test/java/nio/channels/Selector/HelperSlowToDie.java	Wed Jul 21 09:57:21 2010 -0700
@@ -33,9 +33,15 @@
 
 public class HelperSlowToDie {
     private static final int CHANNELS_PER_THREAD = 1023;
+    private static final int TEST_ITERATIONS = 200;
     private static volatile boolean done;
 
     public static void main(String[] args) throws IOException {
+        if (!System.getProperty("os.name").startsWith("Windows")) {
+            System.out.println("Test skipped as it verifies a Windows specific bug");
+            return;
+        }
+
         Selector sel = Selector.open();
 
         // register channels
@@ -60,7 +66,7 @@
             new Thread(busy).start();
 
         // Loop changing the number of channels from 1023 to 1024 and back.
-        for (int i=0; i<1000; i++) {
+        for (int i=0; i<TEST_ITERATIONS; i++) {
             SocketChannel sc = SocketChannel.open();
             sc.configureBlocking(false);
             sc.register(sel, SelectionKey.OP_CONNECT);
@@ -71,5 +77,11 @@
 
         // terminate busy threads
         done = true;
+
+        // clean-up
+        for (int i=0; i<CHANNELS_PER_THREAD; i++) {
+            channels[i].close();
+        }
+        sel.close();
     }
 }
--- a/jdk/test/java/nio/channels/Selector/KeysReady.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/test/java/nio/channels/Selector/KeysReady.java	Wed Jul 21 09:57:21 2010 -0700
@@ -49,14 +49,18 @@
 
         // Prepare a selector
         Selector selector = SelectorProvider.provider().openSelector();
-        SelectionKey key = sc.register(selector, SelectionKey.OP_CONNECT);
-        int keysAdded = selector.select();
-        if (keysAdded > 0) {
-            keysAdded = selector.select(1000);
-            if (keysAdded > 0)
-                throw new Exception("Same key reported added twice");
+        try {
+            SelectionKey key = sc.register(selector, SelectionKey.OP_CONNECT);
+            int keysAdded = selector.select();
+            if (keysAdded > 0) {
+                keysAdded = selector.select(1000);
+                if (keysAdded > 0)
+                    throw new Exception("Same key reported added twice");
+            }
+        } finally {
+            selector.close();
+            sc.close();
         }
-        sc.close();
     }
 
     public static void main(String[] args) throws Exception {
--- a/jdk/test/java/nio/channels/Selector/LotsOfChannels.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/test/java/nio/channels/Selector/LotsOfChannels.java	Wed Jul 21 09:57:21 2010 -0700
@@ -35,19 +35,11 @@
 
 public class LotsOfChannels {
 
-    private final static int PIPES_COUNT = 1900;
+    private final static int PIPES_COUNT = 256;
     private final static int BUF_SIZE = 8192;
     private final static int LOOPS = 10;
 
     public static void main(String[] argv) throws Exception {
-
-
-        String os = System.getProperty("os.name");
-        if (!(os.equals("Windows NT")
-           || os.equals("Windows 2000")
-           || os.equals("Windows XP")))
-            return;
-
         Pipe[] pipes = new Pipe[PIPES_COUNT];
         Pipe pipe = Pipe.open();
         Pipe.SinkChannel sink = pipe.sink();
@@ -72,6 +64,13 @@
             sel.selectedKeys().clear();
             source.read(ByteBuffer.allocate(BUF_SIZE));
         }
+
+        for (int i = 0; i < PIPES_COUNT; i++ ) {
+            pipes[i].sink().close();
+            pipes[i].source().close();
+        }
+        pipe.sink().close();
+        pipe.source().close();
         sel.close();
     }
 }
--- a/jdk/test/java/nio/channels/Selector/OpRead.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/test/java/nio/channels/Selector/OpRead.java	Wed Jul 21 09:57:21 2010 -0700
@@ -24,59 +24,63 @@
 /* @test
  * @bug 4755720
  * @summary Test if OP_READ is detected with OP_WRITE in interestOps
- * @library ..
  */
 
 import java.net.*;
-import java.io.*;
 import java.nio.*;
 import java.nio.channels.*;
-import java.nio.channels.spi.SelectorProvider;
 import java.util.*;
 
 public class OpRead {
 
-    static final int DAYTIME_PORT = 13;
-    static final String DAYTIME_HOST = TestUtil.HOST;
+    static void test() throws Exception {
+        ServerSocketChannel ssc = null;
+        SocketChannel sc = null;
+        SocketChannel peer = null;
+        try {
+            ssc = ServerSocketChannel.open().bind(new InetSocketAddress(0));
 
-    static void test() throws Exception {
-        InetSocketAddress isa
-            = new InetSocketAddress(InetAddress.getByName(DAYTIME_HOST),
-                                    DAYTIME_PORT);
-        SocketChannel sc = SocketChannel.open();
+            // loopback connection
+            InetAddress lh = InetAddress.getLocalHost();
+            sc = SocketChannel.open(new InetSocketAddress(lh, ssc.socket().getLocalPort()));
+            peer = ssc.accept();
 
-        sc.connect(isa);
-
-        sc.configureBlocking(false);
+            // peer sends message so that "sc" will be readable
+            int n = peer.write(ByteBuffer.wrap("Hello".getBytes()));
+            assert n > 0;
 
-        Selector selector = SelectorProvider.provider().openSelector();
-        SelectionKey key = sc.register(selector, SelectionKey.OP_READ |
-            SelectionKey.OP_WRITE);
+            sc.configureBlocking(false);
 
-        boolean done = false;
-        int failCount = 0;
-        while (!done) {
-            if (selector.select() > 0) {
-                Set keys = selector.selectedKeys();
-                Iterator iterator = keys.iterator();
-                while (iterator.hasNext()) {
-                    key = (SelectionKey)iterator.next();
-                    iterator.remove();
-                    if (key.isWritable()) {
-                        failCount++;
-                        if (failCount > 10)
-                            throw new RuntimeException("Test failed");
-                        Thread.sleep(100);
-                    }
-                    if (key.isReadable()) {
-                        done = true;
+            Selector selector = Selector.open();
+            SelectionKey key = sc.register(selector, SelectionKey.OP_READ |
+                SelectionKey.OP_WRITE);
+
+            boolean done = false;
+            int failCount = 0;
+            while (!done) {
+                if (selector.select() > 0) {
+                    Set<SelectionKey> keys = selector.selectedKeys();
+                    Iterator<SelectionKey> iterator = keys.iterator();
+                    while (iterator.hasNext()) {
+                        key = iterator.next();
+                        iterator.remove();
+                        if (key.isWritable()) {
+                            failCount++;
+                            if (failCount > 10)
+                                throw new RuntimeException("Test failed");
+                            Thread.sleep(250);
+                        }
+                        if (key.isReadable()) {
+                            done = true;
+                        }
                     }
                 }
             }
+        } finally {
+            if (peer != null) peer.close();
+            if (sc != null) sc.close();
+            if (ssc != null) ssc.close();
         }
-
-
-        sc.close();
     }
 
     public static void main(String[] args) throws Exception {
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/nio/channels/Selector/OutOfBand.java	Wed Jul 21 09:57:21 2010 -0700
@@ -0,0 +1,132 @@
+/*
+ * 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 6213702
+ * @summary OOB data causes a SocketChannel, with OOBINLINE disabled, to be
+ *    selected
+ */
+
+import java.net.*;
+import java.nio.ByteBuffer;
+import java.nio.channels.*;
+import java.io.IOException;
+
+public class OutOfBand {
+
+    public static void main(String[] args) throws Exception {
+        ServerSocketChannel ssc = null;
+        SocketChannel sc = null;
+        Selector sel = null;
+        Socket s = null;
+
+        try {
+            // establish loopback connection.
+            ssc = ServerSocketChannel.open().bind(new InetSocketAddress(0));
+            s = new Socket(InetAddress.getLocalHost(),
+                           ssc.socket().getLocalPort());
+            sc = ssc.accept();
+
+            sel = Selector.open();
+            sc.configureBlocking(false);
+            sc.register(sel, SelectionKey.OP_READ);
+
+            // OOB data should be disabled by default
+            if (sc.socket().getOOBInline())
+                throw new RuntimeException("SO_OOBINLINE enabled");
+            test(s, false, 0,   0,   sel);
+            test(s, false, 512, 0,   sel);
+            test(s, false, 0,   512, sel);
+            test(s, false, 512, 512, sel);
+
+            // enable SO_OOBINLINE
+            sc.socket().setOOBInline(true);
+
+            // OOB data should be received
+            test(s, true, 0,   0,   sel);
+            test(s, true, 512, 0,   sel);
+            test(s, true, 0,   512, sel);
+            test(s, true, 512, 512, sel);
+
+        } finally {
+            if (sel != null) sel.close();
+            if (sc != null) sc.close();
+            if (ssc != null) ssc.close();
+            if (s != null) sc.close();
+        }
+    }
+
+    static void test(Socket s, boolean urgentExpected,
+                     int bytesBefore, int bytesAfter,
+                     Selector sel)
+        throws IOException
+    {
+        // send data
+        int bytesExpected = 0;
+        if (bytesBefore > 0) {
+            s.getOutputStream().write(new byte[bytesBefore]);
+            bytesExpected += bytesBefore;
+        }
+        s.sendUrgentData(0xff);
+        if (urgentExpected)
+            bytesExpected++;
+        if (bytesAfter > 0) {
+            s.getOutputStream().write(new byte[bytesAfter]);
+            bytesExpected += bytesAfter;
+        }
+
+        // receive data, checking for spurious wakeups and reads
+        int spuriousWakeups = 0;
+        int spuriousReads = 0;
+        int bytesRead = 0;
+        ByteBuffer bb = ByteBuffer.allocate(100);
+        for (;;) {
+            int n = sel.select(2000);
+            if (n == 0) {
+                if (bytesRead == bytesExpected) {
+                    System.out.format("Selector wakeups %d\tSpurious reads %d%n",
+                            spuriousWakeups, spuriousReads);
+                    return;
+                }
+                if (++spuriousWakeups >= 3)
+                    throw new RuntimeException("Selector appears to be spinning" +
+                        " or data not received");
+                continue;
+            }
+            if (n > 1)
+                throw new RuntimeException("More than one key selected????");
+            SelectionKey key = sel.selectedKeys().iterator().next();
+            bb.clear();
+            n = ((SocketChannel)key.channel()).read(bb);
+            if (n == 0) {
+                if (++spuriousReads >=3)
+                    throw new RuntimeException("Too many spurious reads");
+            } else {
+                bytesRead += n;
+                if (bytesRead > bytesExpected)
+                    throw new RuntimeException("Received more than expected");
+            }
+            sel.selectedKeys().clear();
+        }
+    }
+}
--- a/jdk/test/java/nio/channels/Selector/ReadAfterConnect.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/test/java/nio/channels/Selector/ReadAfterConnect.java	Wed Jul 21 09:57:21 2010 -0700
@@ -37,7 +37,7 @@
         ByteServer server = new ByteServer(0); // server: accept connection and do nothing
         server.start();
         InetSocketAddress isa = new InetSocketAddress(
-                InetAddress.getByName(ByteServer.LOCALHOST), ByteServer.PORT);
+                InetAddress.getByName(ByteServer.LOCALHOST), server.port());
         Selector sel = Selector.open();
         SocketChannel sc = SocketChannel.open();
         sc.connect(isa);
--- a/jdk/test/java/nio/channels/Selector/RegAfterPreClose.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/test/java/nio/channels/Selector/RegAfterPreClose.java	Wed Jul 21 09:57:21 2010 -0700
@@ -35,6 +35,7 @@
 
 public class RegAfterPreClose {
 
+    static final int TEST_ITERATIONS = 300;
     static volatile boolean done;
 
     /**
@@ -96,26 +97,21 @@
             }
         };
 
-        // schedule test to run for 1 minute
-        Executors.newScheduledThreadPool(1, factory).schedule(new Runnable() {
-            public void run() {
-                done = true;
-                sel.wakeup();
-            }}, 1, TimeUnit.MINUTES);
-
         // create Executor that handles tasks that closes channels
         // "asynchronously" - this creates the conditions to provoke the bug.
-        Executor executor = Executors.newFixedThreadPool(2, factory);
+        ExecutorService executor = Executors.newFixedThreadPool(2, factory);
 
         // submit task that connects to listener
         executor.execute(new Connector(ssc.socket().getLocalPort()));
 
         // loop accepting connections until done (or an IOException is thrown)
-        while (!done) {
+        int remaining = TEST_ITERATIONS;
+        while (remaining > 0) {
             sel.select();
             if (key.isAcceptable()) {
                 SocketChannel sc = ssc.accept();
                 if (sc != null) {
+                    remaining--;
                     sc.configureBlocking(false);
                     sc.register(sel, SelectionKey.OP_READ);
                     executor.execute(new Closer(sc));
@@ -123,5 +119,8 @@
             }
             sel.selectedKeys().clear();
         }
+        done = true;
+        sel.close();
+        executor.shutdown();
     }
 }
--- a/jdk/test/java/nio/channels/Selector/SelectAfterRead.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/test/java/nio/channels/Selector/SelectAfterRead.java	Wed Jul 21 09:57:21 2010 -0700
@@ -37,14 +37,14 @@
     final static int TIMEOUT = 1000;
 
     public static void main(String[] argv) throws Exception {
+        InetAddress lh = InetAddress.getByName(ByteServer.LOCALHOST);
+
         // server: accept connection and write one byte
         ByteServer server = new ByteServer(1);
         server.start();
-        InetSocketAddress isa = new InetSocketAddress(
-                InetAddress.getByName(ByteServer.LOCALHOST), ByteServer.PORT);
         Selector sel = Selector.open();
         SocketChannel sc = SocketChannel.open();
-        sc.connect(isa);
+        sc.connect(new InetSocketAddress(lh, server.port()));
         sc.read(ByteBuffer.allocate(1));
         sc.configureBlocking(false);
         sc.register(sel, SelectionKey.OP_READ);
@@ -61,7 +61,7 @@
         server = new ByteServer(2);
         server.start();
         sc = SocketChannel.open();
-        sc.connect(isa);
+        sc.connect(new InetSocketAddress(lh, server.port()));
         sc.configureBlocking(false);
         sel = Selector.open();
         sc.register(sel, SelectionKey.OP_READ);
--- a/jdk/test/java/nio/channels/Selector/SelectAndCancel.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/test/java/nio/channels/Selector/SelectAndCancel.java	Wed Jul 21 09:57:21 2010 -0700
@@ -31,11 +31,7 @@
 import java.net.*;
 
 public class SelectAndCancel {
-    static ServerSocketChannel ssc;
-    static Selector selector;
     static SelectionKey sk;
-    static InetSocketAddress isa;
-    public static int TEST_PORT = 40170;
 
     /*
      * CancelledKeyException is the failure symptom of 4729342
@@ -43,17 +39,17 @@
      * seen immediately when the bug is present.
      */
     public static void main(String[] args) throws Exception {
-        InetAddress lh = InetAddress.getLocalHost();
-        isa = new InetSocketAddress(lh, TEST_PORT);
-        selector = Selector.open();
-        ssc = ServerSocketChannel.open();
+        final Selector selector = Selector.open();
+        final ServerSocketChannel ssc =
+            ServerSocketChannel.open().bind(new InetSocketAddress(0));
+        final InetSocketAddress isa =
+            new InetSocketAddress(InetAddress.getLocalHost(), ssc.socket().getLocalPort());
 
         // Create and start a selector in a separate thread.
         new Thread(new Runnable() {
                 public void run() {
                     try {
                         ssc.configureBlocking(false);
-                        ssc.socket().bind(isa);
                         sk = ssc.register(selector, SelectionKey.OP_ACCEPT);
                         selector.select();
                     } catch (IOException e) {
--- a/jdk/test/java/nio/channels/Selector/SelectWrite.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/test/java/nio/channels/Selector/SelectWrite.java	Wed Jul 21 09:57:21 2010 -0700
@@ -39,7 +39,7 @@
         // server: accept connection and do nothing
         server.start();
         InetSocketAddress isa = new InetSocketAddress(
-                InetAddress.getByName(ByteServer.LOCALHOST), ByteServer.PORT);
+                InetAddress.getByName(ByteServer.LOCALHOST), server.port());
         Selector sel = Selector.open();
         SocketChannel sc = SocketChannel.open();
         sc.connect(isa);
--- a/jdk/test/java/nio/channels/Selector/SelectorLimit.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/test/java/nio/channels/Selector/SelectorLimit.java	Wed Jul 21 09:57:21 2010 -0700
@@ -26,6 +26,8 @@
  * @summary Ensure that a Selector can return at least 100 selected keys
  * @author Mark Reinhold
  * @library ..
+ * @build SelectorLimit
+ * @run main/othervm SelectorLimit
  */
 
 import java.io.*;
--- a/jdk/test/java/nio/channels/Selector/SelectorTest.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/test/java/nio/channels/Selector/SelectorTest.java	Wed Jul 21 09:57:21 2010 -0700
@@ -57,13 +57,13 @@
      */
     public static void main(String[] args) throws Exception {
         if (args.length == 0) {
-            InetSocketAddress isa
-                = new InetSocketAddress(InetAddress.getLocalHost(), TEST_PORT);
-            Server server = new Server(isa);
+            Server server = new Server(0);
             server.start();
             try {
                 Thread.sleep(1000);
             } catch (InterruptedException e) { }
+            InetSocketAddress isa
+                = new InetSocketAddress(InetAddress.getLocalHost(), server.port());
             Client client = new Client(isa);
             client.start();
             if ((server.finish(FINISH_TIME) & client.finish(FINISH_TIME)) == 0)
@@ -74,9 +74,7 @@
 
             if (args.length > 1)
                 TEST_PORT = Integer.parseInt(args[1]);
-            InetSocketAddress isa
-                = new InetSocketAddress(InetAddress.getLocalHost(), TEST_PORT);
-            Server server = new Server(isa);
+            Server server = new Server(TEST_PORT);
             server.start();
             if (server.finish(FINISH_TIME) == 0)
                 throw new Exception("Failure");
@@ -136,18 +134,22 @@
     }
 
     static class Server extends TestThread {
+        private final ServerSocketChannel ssc;
         private List socketList = new ArrayList();
         private ServerSocket ss;
         private int connectionsAccepted = 0;
         private Selector pollSelector;
         private Selector acceptSelector;
-        private InetSocketAddress isa;
         private Set pkeys;
         private Set pskeys;
 
-        Server(InetSocketAddress isa) {
+        Server(int port) throws IOException {
             super("Server", SelectorTest.log);
-            this.isa = isa;
+            this.ssc = ServerSocketChannel.open().bind(new InetSocketAddress(port));
+        }
+
+        int port() {
+            return ssc.socket().getLocalPort();
         }
 
         public void go() throws Exception {
@@ -162,11 +164,7 @@
 
             requestThread.start();
 
-            ServerSocketChannel ssc = ServerSocketChannel.open();
             ssc.configureBlocking(false);
-            ssc.socket().setReuseAddress(true);
-            ssc.socket().bind(isa);
-
             SelectionKey acceptKey = ssc.register(acceptSelector,
                                                   SelectionKey.OP_ACCEPT);
             while(connectionsAccepted < SelectorTest.NUM_CLIENTS) {
--- a/jdk/test/java/nio/channels/Selector/WakeupNow.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/test/java/nio/channels/Selector/WakeupNow.java	Wed Jul 21 09:57:21 2010 -0700
@@ -44,10 +44,15 @@
         p.source().configureBlocking(false);
         p.source().register(sel, SelectionKey.OP_READ);
         sel.wakeup();
+        // ensure wakeup is consumed by selectNow
+        Thread.sleep(2000);
         sel.selectNow();
         long startTime = System.currentTimeMillis();
         int n = sel.select(2000);
         long endTime = System.currentTimeMillis();
+        p.source().close();
+        p.sink().close();
+        sel.close();
         if (endTime - startTime < 1000)
             throw new RuntimeException("test failed");
     }
@@ -60,10 +65,13 @@
         Pipe p = Pipe.open();
         p.source().configureBlocking(false);
         sel.wakeup();
+        // ensure wakeup is consumed by selectNow
+        Thread.sleep(2000);
         sel.selectNow();
         long startTime = System.currentTimeMillis();
         int n = sel.select(2000);
         long endTime = System.currentTimeMillis();
+        sel.close();
         if (endTime - startTime < 1000)
             throw new RuntimeException("test failed");
     }
--- a/jdk/test/java/nio/channels/Selector/WakeupOverflow.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/test/java/nio/channels/Selector/WakeupOverflow.java	Wed Jul 21 09:57:21 2010 -0700
@@ -31,8 +31,12 @@
 public class WakeupOverflow {
     public static void main( String[] args ) throws Exception {
         Selector selector = Selector.open();
-        for(int i=0; i<10000; i++) {
-            selector.wakeup();
+        try {
+            for(int i=0; i<10000; i++) {
+                selector.wakeup();
+            }
+        } finally {
+            selector.close();
         }
     }
 }
--- a/jdk/test/java/nio/channels/Selector/WakeupSpeed.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/test/java/nio/channels/Selector/WakeupSpeed.java	Wed Jul 21 09:57:21 2010 -0700
@@ -35,16 +35,19 @@
     public static void main(String argv[]) throws Exception {
         int waitTime = 4000;
         Selector selector = Selector.open();
-
-        selector.wakeup();
+        try {
+            selector.wakeup();
 
-        long t1 = System.currentTimeMillis();
-        selector.select(waitTime);
-        long t2 = System.currentTimeMillis();
-        long totalTime = t2 - t1;
+            long t1 = System.currentTimeMillis();
+            selector.select(waitTime);
+            long t2 = System.currentTimeMillis();
+            long totalTime = t2 - t1;
 
-        if (totalTime > waitTime)
-            throw new RuntimeException("Test failed");
+            if (totalTime > waitTime)
+                throw new RuntimeException("Test failed");
+        } finally {
+            selector.close();
+        }
     }
 
 }
--- a/jdk/test/java/nio/channels/ServerSocketChannel/AcceptAddress.java	Tue Jul 20 16:09:44 2010 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,51 +0,0 @@
-/*
- * Copyright (c) 2001, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute 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 address returned in socket from accept
- */
-
-import java.io.*;
-import java.net.*;
-import java.nio.*;
-import java.nio.channels.*;
-
-
-public class AcceptAddress {
-
-    public static void main(String[] args) throws Exception {
-        InetAddress local = InetAddress.getLocalHost();
-        InetSocketAddress isa = new InetSocketAddress(local, 5555);
-
-        ServerSocketChannel ssc;
-        ssc = ServerSocketChannel.open();
-        ssc.socket().bind(isa);
-
-        SocketChannel sc;
-        sc = SocketChannel.open();
-        sc.connect(isa);
-
-        SocketChannel sc2 = ssc.accept();
-        System.err.println("Socket connected to " + sc2);
-    }
-}
--- a/jdk/test/java/nio/channels/SocketChannel/AdaptSocket.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/test/java/nio/channels/SocketChannel/AdaptSocket.java	Wed Jul 21 09:57:21 2010 -0700
@@ -78,8 +78,6 @@
                     throw x;
                 }
             }
-            if (shouldTimeout)
-                throw new Exception("Connection did not time out");
         }
         out.println("connected: " + so);
         out.println("           " + sc);
@@ -118,8 +116,6 @@
             }
             throw x;
         }
-        if (shouldTimeout)
-            throw new Exception("Read did not time out");
     }
 
     static void testRead(String hn, int timeout, boolean shouldTimeout)
--- a/jdk/test/java/nio/channels/SocketChannel/BigReadWrite.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/test/java/nio/channels/SocketChannel/BigReadWrite.java	Wed Jul 21 09:57:21 2010 -0700
@@ -32,7 +32,6 @@
 
 public class BigReadWrite {
 
-    static int port = 40170;
     static int testSize = 15;
 
     public static void main(String[] args) throws Exception {
--- a/jdk/test/java/nio/channels/SocketChannel/Bind.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/test/java/nio/channels/SocketChannel/Bind.java	Wed Jul 21 09:57:21 2010 -0700
@@ -31,13 +31,20 @@
 
 public class Bind {
     public static void main(String[] args) throws Exception {
+        SocketChannel sc1 = SocketChannel.open();
         try {
-            SocketChannel channel1 = SocketChannel.open();
-            channel1.socket().bind(new InetSocketAddress(5555));
-            SocketChannel channel2 = SocketChannel.open();
-            channel2.socket().bind(new InetSocketAddress(5555));
+            sc1.bind(new InetSocketAddress(0));
+            int port = sc1.socket().getLocalPort();
+            SocketChannel sc2 = SocketChannel.open();
+            try {
+                sc2.bind(new InetSocketAddress(port));
+            } finally {
+               sc2.close();
+            }
         } catch (BindException be) {
             // Correct result
+        } finally {
+            sc1.close();
         }
     }
 }
--- a/jdk/test/java/nio/channels/SocketChannel/Close.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/test/java/nio/channels/SocketChannel/Close.java	Wed Jul 21 09:57:21 2010 -0700
@@ -56,8 +56,12 @@
 
     static void testChannelClose() throws IOException {
         SelectionKey sk = open();
-        sk.channel().close();
-        check(sk);
+        try {
+            sk.channel().close();
+            check(sk);
+        } finally {
+            sk.selector().close();
+        }
     }
 
     public static void main(String[] args) throws Exception {
--- a/jdk/test/java/nio/channels/SocketChannel/CloseRegisteredChannel.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/test/java/nio/channels/SocketChannel/CloseRegisteredChannel.java	Wed Jul 21 09:57:21 2010 -0700
@@ -55,5 +55,8 @@
         System.out.println ("Will hang here...");
         int nb = slave.read (ByteBuffer.allocate (1024));
         //System.out.println("read nb=" + nb);
+
+        selector.close();
+        server.close();
     }
 }
--- a/jdk/test/java/nio/channels/SocketChannel/CloseTimeoutChannel.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/test/java/nio/channels/SocketChannel/CloseTimeoutChannel.java	Wed Jul 21 09:57:21 2010 -0700
@@ -33,11 +33,12 @@
 import java.net.*;
 
 public class CloseTimeoutChannel {
-    final static int PORT=6347;
     public static void main(String args[]) throws Exception {
+        int port = -1;
         try {
             ServerSocketChannel listener=ServerSocketChannel.open();
-            listener.socket().bind(new InetSocketAddress(PORT));
+            listener.socket().bind(new InetSocketAddress(0));
+            port = listener.socket().getLocalPort();
             AcceptorThread thread=new AcceptorThread(listener);
             thread.start();
         } catch (IOException e) {
@@ -50,7 +51,7 @@
         try {
             System.out.println("Establishing connection");
             Socket socket=SocketChannel.open(
-                new InetSocketAddress("127.0.0.1", PORT)).socket();
+                new InetSocketAddress("127.0.0.1", port)).socket();
             OutputStream out=socket.getOutputStream();
             InputStream in=socket.getInputStream();
 
@@ -98,7 +99,8 @@
                     Thread.sleep(100);
                 } catch (InterruptedException e) { }
 
-                System.out.println(INDENT+"Listening on port "+ PORT);
+                System.out.println(INDENT+"Listening on port "+
+                    _listener.socket().getLocalPort());
                 ByteBuffer buf=ByteBuffer.allocate(5);
                 Socket client=_listener.accept().socket();;
                 System.out.println(INDENT+"Accepted client");
@@ -123,6 +125,8 @@
                 client.close();
             } catch (IOException e) {
                 System.out.println(INDENT+"Error accepting!");
+            } finally {
+                try { _listener.close(); } catch (IOException ignore) { }
             }
         }
     }
--- a/jdk/test/java/nio/channels/SocketChannel/IsConnectable.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/test/java/nio/channels/SocketChannel/IsConnectable.java	Wed Jul 21 09:57:21 2010 -0700
@@ -48,27 +48,31 @@
         sc.connect(isa);
 
         Selector selector = SelectorProvider.provider().openSelector();
-        SelectionKey key = sc.register(selector, SelectionKey.OP_CONNECT);
-        int keysAdded = selector.select();
-        if (keysAdded > 0) {
-            boolean result = sc.finishConnect();
-            if (result) {
-                keysAdded = selector.select(5000);
-                // 4750573: keysAdded should not be incremented when op is dropped
-                // from a key already in the selected key set
-                if (keysAdded > 0)
-                    throw new Exception("Test failed: 4750573 detected");
-                Set sel = selector.selectedKeys();
-                Iterator i = sel.iterator();
-                SelectionKey sk = (SelectionKey)i.next();
-                // 4737146: isConnectable should be false while connected
-                if (sk.isConnectable())
-                    throw new Exception("Test failed: 4737146 detected");
+        try {
+            SelectionKey key = sc.register(selector, SelectionKey.OP_CONNECT);
+            int keysAdded = selector.select();
+            if (keysAdded > 0) {
+                boolean result = sc.finishConnect();
+                if (result) {
+                    keysAdded = selector.select(5000);
+                    // 4750573: keysAdded should not be incremented when op is dropped
+                    // from a key already in the selected key set
+                    if (keysAdded > 0)
+                        throw new Exception("Test failed: 4750573 detected");
+                    Set<SelectionKey> sel = selector.selectedKeys();
+                    Iterator<SelectionKey> i = sel.iterator();
+                    SelectionKey sk = i.next();
+                    // 4737146: isConnectable should be false while connected
+                    if (sk.isConnectable())
+                        throw new Exception("Test failed: 4737146 detected");
+                }
+            } else {
+                throw new Exception("Select failed");
             }
-        } else {
-            throw new Exception("Select failed");
+        } finally {
+            sc.close();
+            selector.close();
         }
-        sc.close();
     }
 
     public static void main(String[] args) throws Exception {
--- a/jdk/test/java/nio/channels/SocketChannel/LocalAddress.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/test/java/nio/channels/SocketChannel/LocalAddress.java	Wed Jul 21 09:57:21 2010 -0700
@@ -38,25 +38,33 @@
 
     static void test1() throws Exception {
         InetAddress bogus = InetAddress.getByName("0.0.0.0");
-        SocketChannel sc = SocketChannel.open();
         InetSocketAddress saddr = new InetSocketAddress(
             InetAddress.getByName(TestUtil.HOST), 23);
 
         //Test1: connect only
-        sc.connect(saddr);
-        InetAddress isa = sc.socket().getLocalAddress();
-        if (isa == null || isa.equals(bogus))
-            throw new RuntimeException("test failed");
+        SocketChannel sc = SocketChannel.open();
+        try {
+            sc.connect(saddr);
+            InetAddress ia = sc.socket().getLocalAddress();
+            if (ia == null || ia.equals(bogus))
+                throw new RuntimeException("test failed");
+        } finally {
+            sc.close();
+        }
 
         //Test2: bind and connect
         sc = SocketChannel.open();
-        sc.socket().bind(new InetSocketAddress(0));
-        if (sc.socket().getLocalPort() == 0)
-            throw new RuntimeException("test failed");
-        sc.socket().connect(saddr);
-        isa = sc.socket().getLocalAddress();
-        if (isa == null || isa.isAnyLocalAddress())
-            throw new RuntimeException("test failed");
+        try {
+            sc.socket().bind(new InetSocketAddress(0));
+            if (sc.socket().getLocalPort() == 0)
+                throw new RuntimeException("test failed");
+            sc.socket().connect(saddr);
+            InetAddress ia = sc.socket().getLocalAddress();
+            if (ia == null || ia.isAnyLocalAddress())
+                throw new RuntimeException("test failed");
+        } finally {
+            sc.close();
+        }
 
     }
 }
--- a/jdk/test/java/nio/channels/SocketChannel/OpenLeak.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/test/java/nio/channels/SocketChannel/OpenLeak.java	Wed Jul 21 09:57:21 2010 -0700
@@ -25,6 +25,8 @@
  * @bug 6548464
  * @summary SocketChannel.open(SocketAddress) leaks file descriptor if
  *     connection cannot be established
+ * @build OpenLeak
+ * @run main/othervm OpenLeak
  */
 
 import java.net.InetAddress;
--- a/jdk/test/java/nio/channels/SocketChannel/SocketInheritance.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/test/java/nio/channels/SocketChannel/SocketInheritance.java	Wed Jul 21 09:57:21 2010 -0700
@@ -105,7 +105,11 @@
 
         // launch the child
         String cmd = System.getProperty("java.home") + File.separator + "bin" +
-            File.separator + "java SocketInheritance -child " + port;
+            File.separator + "java";
+        String testClasses = System.getProperty("test.classes");
+        if (testClasses != null)
+            cmd += " -cp " + testClasses;
+        cmd += " SocketInheritance -child " + port;
 
         Process p = Runtime.getRuntime().exec(cmd);
 
--- a/jdk/test/java/nio/channels/SocketChannel/Trivial.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/test/java/nio/channels/SocketChannel/Trivial.java	Wed Jul 21 09:57:21 2010 -0700
@@ -33,22 +33,27 @@
     public static void main(String[] args) throws Exception {
         SocketChannel sc = SocketChannel.open();
         Selector sel = Selector.open();
-        if (sc.keyFor(sel) != null)
-            throw new Exception("keyFor != null");
-        sc.configureBlocking(false);
-        SelectionKey sk = sc.register(sel, SelectionKey.OP_READ, args);
-        if (sc.keyFor(sel) != sk)
-            throw new Exception("keyFor returned " + sc.keyFor(sel));
-        if (sk.attachment() != args)
-            throw new Exception("attachment() returned " + sk.attachment());
-        Trivial t = new Trivial();
-        sk.attach(t);
-        if (sk.attachment() != t)
-            throw new Exception("Wrong attachment");
-        sk.isReadable();
-        sk.isWritable();
-        sk.isConnectable();
-        sk.isAcceptable();
+        try {
+            if (sc.keyFor(sel) != null)
+                throw new Exception("keyFor != null");
+            sc.configureBlocking(false);
+            SelectionKey sk = sc.register(sel, SelectionKey.OP_READ, args);
+            if (sc.keyFor(sel) != sk)
+                throw new Exception("keyFor returned " + sc.keyFor(sel));
+            if (sk.attachment() != args)
+                throw new Exception("attachment() returned " + sk.attachment());
+            Trivial t = new Trivial();
+            sk.attach(t);
+            if (sk.attachment() != t)
+                throw new Exception("Wrong attachment");
+            sk.isReadable();
+            sk.isWritable();
+            sk.isConnectable();
+            sk.isAcceptable();
+        } finally {
+            sel.close();
+            sc.close();
+        }
     }
 
 }
--- a/jdk/test/java/nio/channels/SocketChannel/UnboundSocketTests.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/test/java/nio/channels/SocketChannel/UnboundSocketTests.java	Wed Jul 21 09:57:21 2010 -0700
@@ -57,39 +57,47 @@
         System.out.println("\n-- SocketChannel --");
 
         SocketChannel sc = SocketChannel.open();
+        try {
+            check("getLocalPort()", sc.socket().getLocalPort(), -1);
+            checkIsAnyLocalAddress("getLocalAddress()",
+                sc.socket().getLocalAddress());
+            check("getLocalSocketAddress()", sc.socket().getLocalSocketAddress(), null);
 
-        check("getLocalPort()", sc.socket().getLocalPort(), -1);
-        checkIsAnyLocalAddress("getLocalAddress()",
-            sc.socket().getLocalAddress());
-        check("getLocalSocketAddress()", sc.socket().getLocalSocketAddress(), null);
-
-        check("getPort()", sc.socket().getPort(), 0);
-        check("getInetAddress()", sc.socket().getInetAddress(), null);
-        check("getRemoteSocketAddress()", sc.socket().getRemoteSocketAddress(), null);
-
+            check("getPort()", sc.socket().getPort(), 0);
+            check("getInetAddress()", sc.socket().getInetAddress(), null);
+            check("getRemoteSocketAddress()", sc.socket().getRemoteSocketAddress(), null);
+        } finally {
+            sc.close();
+        }
 
         System.out.println("\n-- ServerSocketChannel --");
 
         ServerSocketChannel ssc = ServerSocketChannel.open();
-
-        check("getLocalPort()", ssc.socket().getLocalPort(), -1);
-        check("getInetAddress()", ssc.socket().getInetAddress(), null);
-        check("getLocalSocketAddress()", ssc.socket().getLocalSocketAddress(), null);
+        try {
+            check("getLocalPort()", ssc.socket().getLocalPort(), -1);
+            check("getInetAddress()", ssc.socket().getInetAddress(), null);
+            check("getLocalSocketAddress()", ssc.socket().getLocalSocketAddress(), null);
+        } finally {
+            ssc.close();
+        }
 
         System.out.println("\n-- DatagramChannel --");
 
         DatagramChannel dc = DatagramChannel.open();
-
-        // not specified
-        check("getLocalPort()", dc.socket().getLocalPort(), 0);
+        try {
+            // not specified
+            check("getLocalPort()", dc.socket().getLocalPort(), 0);
 
-        checkIsAnyLocalAddress("getLocalAddress()",
-            dc.socket().getLocalAddress());
-        check("getLocalSocketAddress()", dc.socket().getLocalSocketAddress(), null);
+            checkIsAnyLocalAddress("getLocalAddress()",
+                dc.socket().getLocalAddress());
+            check("getLocalSocketAddress()", dc.socket().getLocalSocketAddress(), null);
 
-        check("getPort()", dc.socket().getPort(), -1);
-        check("getInetAddress()", dc.socket().getInetAddress(), null);
-        check("getRemoteSocketAddress()", dc.socket().getRemoteSocketAddress(), null);
+            check("getPort()", dc.socket().getPort(), -1);
+            check("getInetAddress()", dc.socket().getInetAddress(), null);
+            check("getRemoteSocketAddress()", dc.socket().getRemoteSocketAddress(), null);
+        } finally {
+            dc.close();
+        }
 
         if (failures > 0) {
             throw new RuntimeException(failures + " sub-tests(s) failed.");
--- a/jdk/test/java/nio/channels/SocketChannel/VectorIO.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/test/java/nio/channels/SocketChannel/VectorIO.java	Wed Jul 21 09:57:21 2010 -0700
@@ -36,8 +36,6 @@
 
 public class VectorIO {
 
-    static int port = 40170;
-
     static Random generator = new Random();
 
     static int testSize;
@@ -55,20 +53,12 @@
         System.err.println("Length " + testSize);
         Server sv = new Server(testSize);
         sv.start();
-        do {
-            try {
-                Thread.currentThread().sleep(200);
-            } catch (InterruptedException x) {
-                if (sv.finish(8000) == 0)
-                    throw new Exception("Failed: Error in server thread");
-            }
-        } while (!sv.ready);
-        bufferTest();
+        bufferTest(sv.port());
         if (sv.finish(8000) == 0)
             throw new Exception("Failed: Length = " + testSize);
     }
 
-    static void bufferTest() throws Exception {
+    static void bufferTest(int port) throws Exception {
         ByteBuffer[] bufs = new ByteBuffer[testSize];
         for(int i=0; i<testSize; i++) {
             String source = "buffer" + i;
@@ -105,17 +95,19 @@
     static class Server
         extends TestThread
     {
-        static int port = 40170;
-
         static Random generator = new Random();
 
-        int testSize;
+        final int testSize;
+        final ServerSocketChannel ssc;
 
-        volatile boolean ready = false;
-
-        Server(int testSize) {
+        Server(int testSize) throws IOException {
             super("Server " + testSize);
             this.testSize = testSize;
+            this.ssc = ServerSocketChannel.open().bind(new InetSocketAddress(0));
+        }
+
+        int port() {
+            return ssc.socket().getLocalPort();
         }
 
         void go() throws Exception {
@@ -133,16 +125,11 @@
             }
 
             // Get a connection from client
-            ServerSocketChannel ssc = ServerSocketChannel.open();
             SocketChannel sc = null;
 
             try {
 
                 ssc.configureBlocking(false);
-                InetAddress lh = InetAddress.getLocalHost();
-                InetSocketAddress isa = new InetSocketAddress(lh, port);
-                ssc.socket().bind(isa);
-                ready = true;
 
                 for (;;) {
                     sc = ssc.accept();
--- a/jdk/test/java/nio/channels/SocketChannel/Write.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/test/java/nio/channels/SocketChannel/Write.java	Wed Jul 21 09:57:21 2010 -0700
@@ -37,8 +37,6 @@
 
 public class Write {
 
-    static int port = 40170;
-
     static Random generator = new Random();
 
     static int testSize = 15;
@@ -46,20 +44,12 @@
     public static void main(String[] args) throws Exception {
         WriteServer sv = new WriteServer();
         sv.start();
-        do {
-            try {
-                Thread.currentThread().sleep(200);
-            } catch (InterruptedException x) {
-                if (sv.finish(8000) == 0)
-                    throw new Exception("Failed: Error in server thread");
-            }
-        } while (!sv.ready);
-        bufferTest();
+        bufferTest(sv.port());
         if (sv.finish(8000) == 0)
             throw new Exception("Failed" );
     }
 
-    static void bufferTest() throws Exception {
+    static void bufferTest(int port) throws Exception {
         ByteBuffer[] bufs = new ByteBuffer[testSize];
         for(int i=0; i<testSize; i++) {
             String source =
@@ -94,14 +84,18 @@
 
 class WriteServer extends TestThread {
 
-    static int port = 40170;
-
     static Random generator = new Random();
 
-    volatile boolean ready = false;
+
+    final ServerSocketChannel ssc;
 
-    WriteServer() {
+    WriteServer() throws IOException {
         super("WriteServer");
+        this.ssc = ServerSocketChannel.open().bind(new InetSocketAddress(0));
+    }
+
+    int port() {
+        return ssc.socket().getLocalPort();
     }
 
     void go() throws Exception {
@@ -112,15 +106,10 @@
         ByteBuffer buf = ByteBuffer.allocateDirect(5);
 
         // Get a connection from client
-        ServerSocketChannel ssc = ServerSocketChannel.open();
         SocketChannel sc = null;
 
         try {
             ssc.configureBlocking(false);
-            InetAddress lh = InetAddress.getLocalHost();
-            InetSocketAddress isa = new InetSocketAddress(lh, port);
-            ssc.socket().bind(isa);
-            ready = true;
 
             for (;;) {
                 sc = ssc.accept();
--- a/jdk/test/java/nio/channels/etc/Shadow.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/test/java/nio/channels/etc/Shadow.java	Wed Jul 21 09:57:21 2010 -0700
@@ -35,7 +35,6 @@
 
 public class Shadow {
 
-    private static final int PORT = 2019;
     static PrintStream log = System.err;
 
     private static void dump(ServerSocket s) {
@@ -69,7 +68,7 @@
     public static void main(String[] args) throws Exception {
         boolean useChannels
             = ((args.length == 0) || Boolean.valueOf(args[0]).booleanValue());
-        int port = (args.length > 1 ? Integer.parseInt(args[1]) : PORT);
+        int port = (args.length > 1 ? Integer.parseInt(args[1]) : -1);
 
         // open server socket
         ServerSocket serverSocket;
@@ -86,7 +85,8 @@
         }
 
         // bind server socket to port
-        SocketAddress bindAddr = new InetSocketAddress(port);
+        SocketAddress bindAddr =
+            new InetSocketAddress((port == -1) ? 0 : port);
         serverSocket.bind(bindAddr);
         log.println("bound ServerSocket: " + serverSocket);
 
--- a/jdk/test/java/nio/channels/spi/SelectorProvider/inheritedChannel/ClosedStreams.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/test/java/nio/channels/spi/SelectorProvider/inheritedChannel/ClosedStreams.java	Wed Jul 21 09:57:21 2010 -0700
@@ -26,6 +26,8 @@
  * @bug 4997227
  * @summary Calling inheritedChannel() after FileDescriptor.in was closed
  *          caused an InternalError to be thrown.
+ * @build ClosedStreams
+ * @run main/othervm ClosedStreams
  */
 
 import java.io.FileDescriptor;
--- a/jdk/test/java/nio/channels/spi/SelectorProvider/inheritedChannel/EchoTest.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/test/java/nio/channels/spi/SelectorProvider/inheritedChannel/EchoTest.java	Wed Jul 21 09:57:21 2010 -0700
@@ -141,7 +141,7 @@
         // and receive the echo
         byte b[] = new byte[msg.length() + 100];
         DatagramPacket pkt2 = new DatagramPacket(b, b.length);
-        dc.socket().setSoTimeout(2000);
+        dc.socket().setSoTimeout(5000);
         dc.socket().receive(pkt2);
 
         if (pkt2.getLength() != msg.length()) {
--- a/jdk/test/java/nio/charset/coders/BashStreams.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/test/java/nio/charset/coders/BashStreams.java	Wed Jul 21 09:57:21 2010 -0700
@@ -46,7 +46,7 @@
 
         CharacterGenerator(long seed, String csn, int limit) {
             rand = new Random(seed);
-            this.max = Surrogate.UCS4_MAX + 1;
+            this.max = Character.MAX_CODE_POINT + 1;
             this.limit = limit;
         }
 
@@ -77,17 +77,20 @@
             int c;
             for (;;) {
                 c = rand.nextInt(max);
-                if (Surrogate.is(c) || (c == 0xfffe) || (c == 0xffff))
+                if ((Character.isBmpCodePoint(c)
+                     && (Character.isSurrogate((char) c)
+                         || (c == 0xfffe) || (c == 0xffff))))
                     continue;
-                if (Surrogate.neededFor(c) && (count == limit - 1))
+                if (Character.isSupplementaryCodePoint(c)
+                        && (count == limit - 1))
                     continue;
                 break;
             }
             count++;
-            if (Surrogate.neededFor(c)) {
+            if (Character.isSupplementaryCodePoint(c)) {
                 count++;
-                push(Surrogate.low(c));
-                return Surrogate.high(c);
+                push(Character.lowSurrogate(c));
+                return Character.highSurrogate(c);
             }
             return (char)c;
         }
@@ -137,7 +140,7 @@
                 char d = cg.next();
                 if (c != d) {
                     if (c == '?') {
-                        if (Surrogate.isHigh(d))
+                        if (Character.isHighSurrogate(d))
                             cg.next();
                         continue;
                     }
@@ -187,7 +190,7 @@
             w.write(ca, 0, n);
             count += n;
         }
-        if (Surrogate.isHigh(ca[n - 1]))
+        if (Character.isHighSurrogate(ca[n - 1]))
             w.write(cg.next());
         w.close();
     }
@@ -253,7 +256,8 @@
                         if (!cg.hasNext())
                             break;
                         char c = cg.next();
-                        if (Surrogate.isHigh(c) && (cb.remaining() == 1)) {
+                        if (Character.isHighSurrogate(c)
+                                && cb.remaining() == 1) {
                             cg.push(c);
                             break;
                         }
@@ -311,7 +315,7 @@
                     mismatchedEOF(csn, count + i, cg.count());
                 char d = cg.next();
                 if (c == '?') {
-                    if (Surrogate.isHigh(d)) {
+                    if (Character.isHighSurrogate(d)) {
                         cg.next();
                         continue;
                     }
--- a/jdk/test/java/nio/charset/coders/Surrogate.java	Tue Jul 20 16:09:44 2010 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,66 +0,0 @@
-/*
- * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-public class Surrogate {
-
-    public static final int UCS4_SURROGATE_MIN = 0x10000;
-    public static final int UCS4_MAX = (1 << 20) + UCS4_SURROGATE_MIN - 1;
-
-    // UTF-16 surrogate-character ranges
-    //
-    public static final char MIN_HIGH = '\uD800';
-    public static final char MAX_HIGH = '\uDBFF';
-    public static final char MIN_LOW  = '\uDC00';
-    public static final char MAX_LOW  = '\uDFFF';
-    public static final char MIN = MIN_HIGH;
-    public static final char MAX = MAX_LOW;
-
-    public static boolean neededFor(int uc) {
-        return (uc >= UCS4_SURROGATE_MIN) && (uc <= UCS4_MAX);
-    }
-
-    public static boolean isHigh(int c) {
-        return (MIN_HIGH <= c) && (c <= MAX_HIGH);
-    }
-
-    static char high(int uc) {
-        return (char)(0xd800 | (((uc - UCS4_SURROGATE_MIN) >> 10) & 0x3ff));
-    }
-
-    public static boolean isLow(int c) {
-        return (MIN_LOW <= c) && (c <= MAX_LOW);
-    }
-
-    static char low(int uc) {
-        return (char)(0xdc00 | ((uc - UCS4_SURROGATE_MIN) & 0x3ff));
-    }
-
-    public static boolean is(int c) {
-        return (MIN <= c) && (c <= MAX);
-    }
-
-    static int toUCS4(char c, char d) {
-        return (((c & 0x3ff) << 10) | (d & 0x3ff)) + 0x10000;
-    }
-
-}
--- a/jdk/test/java/nio/charset/coders/Surrogates.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/test/java/nio/charset/coders/Surrogates.java	Wed Jul 21 09:57:21 2010 -0700
@@ -42,9 +42,8 @@
     static void initData() throws IOException {
         StringBuffer sb = new StringBuffer();
         for (int i = 0; i < LEN; i++) {
-            int c = Surrogate.UCS4_SURROGATE_MIN + 1;
-            sb.append(Surrogate.high(c));
-            sb.append(Surrogate.low(c));
+            int c = Character.MIN_SUPPLEMENTARY_CODE_POINT + 1;
+            sb.append(Character.toChars(c));
         }
         input = sb.toString().toCharArray();
         ByteArrayOutputStream bos = new ByteArrayOutputStream();
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/security/cert/CertificateFactory/openssl/BadFooter.java	Wed Jul 21 09:57:21 2010 -0700
@@ -0,0 +1,80 @@
+/*
+ * Copyright (c) 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.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along 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.
+ */
+/*
+ * @test
+ * @bug 6948781
+ * @summary CertificateFactory.generateCertificate doesn't throw
+ * CertificateException for malformed certificate
+ */
+
+import java.io.ByteArrayInputStream;
+import java.security.cert.CertificateFactory;
+import java.security.cert.CertificateException;
+
+public class BadFooter {
+    public static void main(String[] args) throws Exception {
+        // The two sections below are identical, a self-signed cert generated
+        // for a fake principal:
+        // CN=Me, OU=Office, O=A-B-C, L=Backside, ST=Moon, C=EA
+        String cert =
+        "-----BEGIN CERTIFICATE-----\n" +
+        "MIIDGDCCAtWgAwIBAgIERgH/AjALBgcqhkjOOAQDBQAwXTELMAkGA1UEBhMCRUExDTALBgNVBAgT\n" +
+        "BE1vb24xETAPBgNVBAcTCEJhY2tzaWRlMQ4wDAYDVQQKEwVBLUItQzEPMA0GA1UECxMGT2ZmaWNl\n" +
+        "MQswCQYDVQQDEwJNZTAeFw0wNzAzMjIwMzU4NThaFw0wNzA2MjAwMzU4NThaMF0xCzAJBgNVBAYT\n" +
+        "AkVBMQ0wCwYDVQQIEwRNb29uMREwDwYDVQQHEwhCYWNrc2lkZTEOMAwGA1UEChMFQS1CLUMxDzAN\n" +
+        "BgNVBAsTBk9mZmljZTELMAkGA1UEAxMCTWUwggG4MIIBLAYHKoZIzjgEATCCAR8CgYEA/X9TgR11\n" +
+        "EilS30qcLuzk5/YRt1I870QAwx4/gLZRJmlFXUAiUftZPY1Y+r/F9bow9subVWzXgTuAHTRv8mZg\n" +
+        "t2uZUKWkn5/oBHsQIsJPu6nX/rfGG/g7V+fGqKYVDwT7g/bTxR7DAjVUE1oWkTL2dfOuK2HXKu/y\n" +
+        "IgMZndFIAccCFQCXYFCPFSMLzLKSuYKi64QL8Fgc9QKBgQD34aCF1ps93su8q1w2uFe5eZSvu/o6\n" +
+        "6oL5V0wLPQeCZ1FZV4661FlP5nEHEIGAtEkWcSPoTCgWE7fPCTKMyKbhPBZ6i1R8jSjgo64eK7Om\n" +
+        "dZFuo38L+iE1YvH7YnoBJDvMpPG+qFGQiaiD3+Fa5Z8GkotmXoB7VSVkAUw7/s9JKgOBhQACgYEA\n" +
+        "xc7ovvDeJ5yIkiEoz6U4jcFf5ZDSC+rUEsqGuARXHUF0PlIth7h2e9KV12cwdjVH++mGvwU/m/Ju\n" +
+        "OpaaWOEFRHgCMe5fZ2xE0pWPcmKkPicc85SKHguYTMCc9D0XbTbkoBIEAeQ4nr2GmXuEQ5tYaO/O\n" +
+        "PYXjk9EfGhikHlnKgC6jITAfMB0GA1UdDgQWBBTtv4rKVwXtXJpyZWlswQL4MAKkazALBgcqhkjO\n" +
+        "OAQDBQADMAAwLQIVAIU4pnnUcMjh2CUvh/B0PSZZTHHvAhQVMhAdwNHOGPSL6sCL19q6UjoN9w==\n" +
+        "-----BEGIN CERTIFICATE-----\n" +
+        "MIIDGDCCAtWgAwIBAgIERgH/AjALBgcqhkjOOAQDBQAwXTELMAkGA1UEBhMCRUExDTALBgNVBAgT\n" +
+        "BE1vb24xETAPBgNVBAcTCEJhY2tzaWRlMQ4wDAYDVQQKEwVBLUItQzEPMA0GA1UECxMGT2ZmaWNl\n" +
+        "MQswCQYDVQQDEwJNZTAeFw0wNzAzMjIwMzU4NThaFw0wNzA2MjAwMzU4NThaMF0xCzAJBgNVBAYT\n" +
+        "AkVBMQ0wCwYDVQQIEwRNb29uMREwDwYDVQQHEwhCYWNrc2lkZTEOMAwGA1UEChMFQS1CLUMxDzAN\n" +
+        "BgNVBAsTBk9mZmljZTELMAkGA1UEAxMCTWUwggG4MIIBLAYHKoZIzjgEATCCAR8CgYEA/X9TgR11\n" +
+        "EilS30qcLuzk5/YRt1I870QAwx4/gLZRJmlFXUAiUftZPY1Y+r/F9bow9subVWzXgTuAHTRv8mZg\n" +
+        "t2uZUKWkn5/oBHsQIsJPu6nX/rfGG/g7V+fGqKYVDwT7g/bTxR7DAjVUE1oWkTL2dfOuK2HXKu/y\n" +
+        "IgMZndFIAccCFQCXYFCPFSMLzLKSuYKi64QL8Fgc9QKBgQD34aCF1ps93su8q1w2uFe5eZSvu/o6\n" +
+        "6oL5V0wLPQeCZ1FZV4661FlP5nEHEIGAtEkWcSPoTCgWE7fPCTKMyKbhPBZ6i1R8jSjgo64eK7Om\n" +
+        "dZFuo38L+iE1YvH7YnoBJDvMpPG+qFGQiaiD3+Fa5Z8GkotmXoB7VSVkAUw7/s9JKgOBhQACgYEA\n" +
+        "xc7ovvDeJ5yIkiEoz6U4jcFf5ZDSC+rUEsqGuARXHUF0PlIth7h2e9KV12cwdjVH++mGvwU/m/Ju\n" +
+        "OpaaWOEFRHgCMe5fZ2xE0pWPcmKkPicc85SKHguYTMCc9D0XbTbkoBIEAeQ4nr2GmXuEQ5tYaO/O\n" +
+        "PYXjk9EfGhikHlnKgC6jITAfMB0GA1UdDgQWBBTtv4rKVwXtXJpyZWlswQL4MAKkazALBgcqhkjO\n" +
+        "OAQDBQADMAAwLQIVAIU4pnnUcMjh2CUvh/B0PSZZTHHvAhQVMhAdwNHOGPSL6sCL19q6UjoN9w==\n" +
+        "-----END CERTIFICATE-----\n";
+        try {
+            CertificateFactory.getInstance("X509").generateCertificates(
+                    new ByteArrayInputStream(cert.getBytes()));
+            throw new Exception("Fail. certificate generation should fail");
+        } catch (CertificateException ce) {
+            ce.printStackTrace();
+            // This is the correct result
+        }
+    }
+}
--- a/jdk/test/java/util/Arrays/Sorting.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/test/java/util/Arrays/Sorting.java	Wed Jul 21 09:57:21 2010 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2009, 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
@@ -43,10 +43,11 @@
 
     // Array lengths used in a long run (default)
     private static final int[] LONG_RUN_LENGTHS = {
-        1, 2, 3, 5, 8, 13, 21, 34, 55, 100, 1000, 10000, 100000, 1000000};
+        1, 2, 3, 5, 8, 13, 21, 34, 55, 100, 1000, 10000, 100000, 1000000 };
 
     // Array lengths used in a short run
-    private static final int[] SHORT_RUN_LENGTHS = { 1, 2, 3, 21, 55, 1000, 10000 };
+    private static final int[] SHORT_RUN_LENGTHS = {
+        1, 2, 3, 21, 55, 1000, 10000 };
 
     // Random initial values used in a long run (default)
     private static final long[] LONG_RUN_RANDOMS = {666, 0xC0FFEE, 999};
@@ -65,99 +66,338 @@
         }
         long end = System.currentTimeMillis();
 
-        out.format("PASS in %d sec.\n", Math.round((end - start) / 1E3));
+        out.format("\nPASSED in %d sec.\n", Math.round((end - start) / 1E3));
     }
 
     private static void testAndCheck(int[] lengths, long[] randoms) {
+        testEmptyAndNullIntArray();
+        testEmptyAndNullLongArray();
+        testEmptyAndNullShortArray();
+        testEmptyAndNullCharArray();
+        testEmptyAndNullByteArray();
+        testEmptyAndNullFloatArray();
+        testEmptyAndNullDoubleArray();
+
         for (long random : randoms) {
             reset(random);
 
-            for (int len : lengths) {
-                testAndCheckWithCheckSum(len, random);
-            }
-            reset(random);
-
-            for (int len : lengths) {
-                testAndCheckWithScrambling(len, random);
+            for (int length : lengths) {
+                testAndCheckWithCheckSum(length, random);
             }
             reset(random);
 
-            for (int len : lengths) {
-                testAndCheckFloat(len, random);
+            for (int length : lengths) {
+                testAndCheckWithScrambling(length, random);
+            }
+            reset(random);
+
+            for (int length : lengths) {
+                testAndCheckFloat(length, random);
             }
             reset(random);
 
-            for (int len : lengths) {
-                testAndCheckDouble(len, random);
+            for (int length : lengths) {
+                testAndCheckDouble(length, random);
             }
             reset(random);
 
-            for (int len : lengths) {
-                testAndCheckRange(len, random);
+            for (int length : lengths) {
+                testAndCheckRange(length, random);
             }
             reset(random);
 
-            for (int len : lengths) {
-                testAndCheckSubArray(len, random);
+            for (int length : lengths) {
+                testAndCheckSubArray(length, random);
+            }
+            reset(random);
+
+            for (int length : lengths) {
+                testStable(length, random);
             }
         }
     }
 
-    private static void testAndCheckSubArray(int len, long random) {
-        int[] golden = new int[len];
+    private static void testEmptyAndNullIntArray() {
+        ourDescription = "Check empty and null array";
+        Arrays.sort(new int[] {});
+        Arrays.sort(new int[] {}, 0, 0);
+
+        try {
+            Arrays.sort((int[]) null);
+        } catch (NullPointerException expected) {
+            try {
+                Arrays.sort((int[]) null, 0, 0);
+            } catch (NullPointerException expected2) {
+                return;
+            }
+            failed("Arrays.sort(int[],fromIndex,toIndex) shouldn't " +
+                "catch null array");
+        }
+        failed("Arrays.sort(int[]) shouldn't catch null array");
+    }
+
+    private static void testEmptyAndNullLongArray() {
+        ourDescription = "Check empty and null array";
+        Arrays.sort(new long[] {});
+        Arrays.sort(new long[] {}, 0, 0);
+
+        try {
+            Arrays.sort((long[]) null);
+        } catch (NullPointerException expected) {
+            try {
+                Arrays.sort((long[]) null, 0, 0);
+            } catch (NullPointerException expected2) {
+                return;
+            }
+            failed("Arrays.sort(long[],fromIndex,toIndex) shouldn't " +
+                "catch null array");
+        }
+        failed("Arrays.sort(long[]) shouldn't catch null array");
+    }
+
+    private static void testEmptyAndNullShortArray() {
+        ourDescription = "Check empty and null array";
+        Arrays.sort(new short[] {});
+        Arrays.sort(new short[] {}, 0, 0);
+
+        try {
+            Arrays.sort((short[]) null);
+        } catch (NullPointerException expected) {
+            try {
+                Arrays.sort((short[]) null, 0, 0);
+            } catch (NullPointerException expected2) {
+                return;
+            }
+            failed("Arrays.sort(short[],fromIndex,toIndex) shouldn't " +
+                "catch null array");
+        }
+        failed("Arrays.sort(short[]) shouldn't catch null array");
+    }
+
+    private static void testEmptyAndNullCharArray() {
+        ourDescription = "Check empty and null array";
+        Arrays.sort(new char[] {});
+        Arrays.sort(new char[] {}, 0, 0);
 
-        for (int m = 1; m < len / 2; m *= 2) {
+        try {
+            Arrays.sort((char[]) null);
+        } catch (NullPointerException expected) {
+            try {
+                Arrays.sort((char[]) null, 0, 0);
+            } catch (NullPointerException expected2) {
+                return;
+            }
+            failed("Arrays.sort(char[],fromIndex,toIndex) shouldn't " +
+                "catch null array");
+        }
+        failed("Arrays.sort(char[]) shouldn't catch null array");
+    }
+
+    private static void testEmptyAndNullByteArray() {
+        ourDescription = "Check empty and null array";
+        Arrays.sort(new byte[] {});
+        Arrays.sort(new byte[] {}, 0, 0);
+
+        try {
+            Arrays.sort((byte[]) null);
+        } catch (NullPointerException expected) {
+            try {
+                Arrays.sort((byte[]) null, 0, 0);
+            } catch (NullPointerException expected2) {
+                return;
+            }
+            failed("Arrays.sort(byte[],fromIndex,toIndex) shouldn't " +
+                "catch null array");
+        }
+        failed("Arrays.sort(byte[]) shouldn't catch null array");
+    }
+
+    private static void testEmptyAndNullFloatArray() {
+        ourDescription = "Check empty and null array";
+        Arrays.sort(new float[] {});
+        Arrays.sort(new float[] {}, 0, 0);
+
+        try {
+            Arrays.sort((float[]) null);
+        } catch (NullPointerException expected) {
+            try {
+                Arrays.sort((float[]) null, 0, 0);
+            } catch (NullPointerException expected2) {
+                return;
+            }
+            failed("Arrays.sort(float[],fromIndex,toIndex) shouldn't " +
+                "catch null array");
+        }
+        failed("Arrays.sort(float[]) shouldn't catch null array");
+    }
+
+    private static void testEmptyAndNullDoubleArray() {
+        ourDescription = "Check empty and null array";
+        Arrays.sort(new double[] {});
+        Arrays.sort(new double[] {}, 0, 0);
+
+        try {
+            Arrays.sort((double[]) null);
+        } catch (NullPointerException expected) {
+            try {
+                Arrays.sort((double[]) null, 0, 0);
+            } catch (NullPointerException expected2) {
+                return;
+            }
+            failed("Arrays.sort(double[],fromIndex,toIndex) shouldn't " +
+                "catch null array");
+        }
+        failed("Arrays.sort(double[]) shouldn't catch null array");
+    }
+
+    private static void testAndCheckSubArray(int length, long random) {
+        ourDescription = "Check sorting of subarray";
+        int[] golden = new int[length];
+        boolean newLine = false;
+
+        for (int m = 1; m < length / 2; m *= 2) {
+            newLine = true;
             int fromIndex = m;
-            int toIndex = len - m;
+            int toIndex = length - m;
 
             prepareSubArray(golden, fromIndex, toIndex, m);
             int[] test = golden.clone();
 
             for (TypeConverter converter : TypeConverter.values()) {
-                out.println("Test #6: " + converter +
-                   " len = " + len + ", m = " + m);
+                out.println("Test 'subarray': " + converter +
+                   " length = " + length + ", m = " + m);
                 Object convertedGolden = converter.convert(golden);
                 Object convertedTest = converter.convert(test);
-
-                // outArr(test);
+                // outArray(test);
                 sortSubArray(convertedTest, fromIndex, toIndex);
-                // outArr(test);
+                // outArray(test);
                 checkSubArray(convertedTest, fromIndex, toIndex, m);
             }
         }
+        if (newLine) {
+            out.println();
+        }
+    }
+
+    private static void testAndCheckRange(int length, long random) {
+        ourDescription = "Check range check";
+        int[] golden = new int[length];
+
+        for (int m = 1; m < 2 * length; m *= 2) {
+            for (int i = 1; i <= length; i++) {
+                golden[i - 1] = i % m + m % i;
+            }
+            for (TypeConverter converter : TypeConverter.values()) {
+                out.println("Test 'range': " + converter +
+                   ", length = " + length + ", m = " + m);
+                Object convertedGolden = converter.convert(golden);
+                checkRange(convertedGolden, m);
+            }
+        }
         out.println();
     }
 
-    private static void testAndCheckRange(int len, long random) {
-        int[] golden = new int[len];
+    private static void testStable(int length, long random) {
+        ourDescription = "Check if sorting is stable";
+        Pair[] a = build(length);
 
-        for (int m = 1; m < 2 * len; m *= 2) {
-            for (int i = 1; i <= len; i++) {
-                golden[i - 1] = i % m + m % i;
+        out.println("Test 'stable': " + "random = " +  random +
+            ", length = " + length);
+        Arrays.sort(a);
+        checkSorted(a);
+        checkStable(a);
+    }
+
+    private static void checkSorted(Pair[] a) {
+        for (int i = 0; i < a.length - 1; i++) {
+            if (a[i].getKey() > a[i + 1].getKey()) {
+                failed(i, "" + a[i].getKey(), "" + a[i + 1].getKey());
             }
-            for (TypeConverter converter : TypeConverter.values()) {
-                out.println("Test #5: " + converter +
-                   ", len = " + len + ", m = " + m);
-                Object convertedGolden = converter.convert(golden);
-                sortRange(convertedGolden, m);
-                sortEmpty(convertedGolden);
+        }
+    }
+
+    private static void checkStable(Pair[] a) {
+        for (int i = 0; i < a.length / 4; ) {
+            int key1 = a[i].getKey();
+            int value1 = a[i++].getValue();
+            int key2 = a[i].getKey();
+            int value2 = a[i++].getValue();
+            int key3 = a[i].getKey();
+            int value3 = a[i++].getValue();
+            int key4 = a[i].getKey();
+            int value4 = a[i++].getValue();
+
+            if (!(key1 == key2 && key2 == key3 && key3 == key4)) {
+                failed("On position " + i + " must keys are different " +
+                    key1 + ", " + key2 + ", " + key3 + ", " + key4);
+            }
+            if (!(value1 < value2 && value2 < value3 && value3 < value4)) {
+                failed("Sorting is not stable at position " + i +
+                    ". Second values have been changed: " +  value1 + ", " +
+                    value2 + ", " + value3 + ", " + value4);
             }
         }
-        out.println();
+    }
+
+    private static Pair[] build(int length) {
+        Pair[] a = new Pair[length * 4];
+
+        for (int i = 0; i < a.length; ) {
+            int key = ourRandom.nextInt();
+            a[i++] = new Pair(key, 1);
+            a[i++] = new Pair(key, 2);
+            a[i++] = new Pair(key, 3);
+            a[i++] = new Pair(key, 4);
+        }
+        return a;
     }
 
-    private static void testAndCheckWithCheckSum(int len, long random) {
-        int[] golden = new int[len];
+    private static final class Pair implements Comparable<Pair> {
+        Pair(int key, int value) {
+            myKey = key;
+            myValue = value;
+        }
+
+        int getKey() {
+            return myKey;
+        }
+
+        int getValue() {
+            return myValue;
+        }
 
-        for (int m = 1; m < 2 * len; m *= 2) {
+        public int compareTo(Pair pair) {
+            if (myKey < pair.myKey) {
+                return -1;
+            }
+            if (myKey > pair.myKey) {
+                return 1;
+            }
+            return 0;
+        }
+
+        @Override
+        public String toString() {
+            return "(" + myKey + ", " + myValue + ")";
+        }
+
+        private int myKey;
+        private int myValue;
+    }
+
+    private static void testAndCheckWithCheckSum(int length, long random) {
+        ourDescription = "Check sorting with check sum";
+        int[] golden = new int[length];
+
+        for (int m = 1; m < 2 * length; m *= 2) {
             for (UnsortedBuilder builder : UnsortedBuilder.values()) {
                 builder.build(golden, m);
                 int[] test = golden.clone();
 
                 for (TypeConverter converter : TypeConverter.values()) {
-                    out.println("Test #1: " + converter + " " + builder +
-                       "random = " +  random + ", len = " + len +
-                       ", m = " + m);
+                    out.println("Test 'check sum': " + converter + " " +
+                        builder + "random = " +  random + ", length = " +
+                        length + ", m = " + m);
                     Object convertedGolden = converter.convert(golden);
                     Object convertedTest = converter.convert(test);
                     sort(convertedTest);
@@ -168,11 +408,12 @@
         out.println();
     }
 
-    private static void testAndCheckWithScrambling(int len, long random) {
-        int[] golden = new int[len];
+    private static void testAndCheckWithScrambling(int length, long random) {
+        ourDescription = "Check sorting with scrambling";
+        int[] golden = new int[length];
 
         for (int m = 1; m <= 7; m++) {
-            if (m > len) {
+            if (m > length) {
                 break;
             }
             for (SortedBuilder builder : SortedBuilder.values()) {
@@ -181,9 +422,9 @@
                 scramble(test);
 
                 for (TypeConverter converter : TypeConverter.values()) {
-                    out.println("Test #2: " + converter + " " + builder +
-                       "random = " +  random + ", len = " + len +
-                       ", m = " + m);
+                    out.println("Test 'scrambling': " + converter + " " +
+                       builder + "random = " +  random + ", length = " +
+                       length + ", m = " + m);
                     Object convertedGolden = converter.convert(golden);
                     Object convertedTest = converter.convert(test);
                     sort(convertedTest);
@@ -194,8 +435,9 @@
         out.println();
     }
 
-    private static void testAndCheckFloat(int len, long random) {
-        float[] golden = new float[len];
+    private static void testAndCheckFloat(int length, long random) {
+        ourDescription = "Check float sorting";
+        float[] golden = new float[length];
         final int MAX = 10;
         boolean newLine = false;
 
@@ -204,22 +446,23 @@
                 for (int z = 0; z <= MAX; z++) {
                     for (int n = 0; n <= MAX; n++) {
                         for (int p = 0; p <= MAX; p++) {
-                            if (a + g + z + n + p > len) {
+                            if (a + g + z + n + p > length) {
                                 continue;
                             }
-                            if (a + g + z + n + p < len) {
+                            if (a + g + z + n + p < length) {
                                 continue;
                             }
                             for (FloatBuilder builder : FloatBuilder.values()) {
-                                out.println("Test #3: random = " + random +
-                                   ", len = " + len + ", a = " + a + ", g = " + g +
-                                   ", z = " + z + ", n = " + n + ", p = " + p);
+                                out.println("Test 'float': random = " + random +
+                                   ", length = " + length + ", a = " + a +
+                                   ", g = " + g + ", z = " + z + ", n = " + n +
+                                   ", p = " + p);
                                 builder.build(golden, a, g, z, n, p);
                                 float[] test = golden.clone();
                                 scramble(test);
-                                // outArr(test);
+                                // outArray(test);
                                 sort(test);
-                                // outArr(test);
+                                // outArray(test);
                                 compare(test, golden, a, n, g);
                             }
                             newLine = true;
@@ -233,8 +476,9 @@
         }
     }
 
-    private static void testAndCheckDouble(int len, long random) {
-        double[] golden = new double[len];
+    private static void testAndCheckDouble(int length, long random) {
+        ourDescription = "Check double sorting";
+        double[] golden = new double[length];
         final int MAX = 10;
         boolean newLine = false;
 
@@ -243,22 +487,22 @@
                 for (int z = 0; z <= MAX; z++) {
                     for (int n = 0; n <= MAX; n++) {
                         for (int p = 0; p <= MAX; p++) {
-                            if (a + g + z + n + p > len) {
+                            if (a + g + z + n + p > length) {
                                 continue;
                             }
-                            if (a + g + z + n + p < len) {
+                            if (a + g + z + n + p < length) {
                                 continue;
                             }
                             for (DoubleBuilder builder : DoubleBuilder.values()) {
-                                out.println("Test #4: random = " + random +
-                                   ", len = " + len + ", a = " + a + ", g = " + g +
-                                   ", z = " + z + ", n = " + n + ", p = " + p);
+                                out.println("Test 'double': random = " + random +
+                                   ", length = " + length + ", a = " + a + ", g = " +
+                                   g + ", z = " + z + ", n = " + n + ", p = " + p);
                                 builder.build(golden, a, g, z, n, p);
                                 double[] test = golden.clone();
                                 scramble(test);
-                                // outArr(test);
+                                // outArray(test);
                                 sort(test);
-                                // outArr(test);
+                                // outArray(test);
                                 compare(test, golden, a, n, g);
                             }
                             newLine = true;
@@ -276,37 +520,29 @@
         for (int i = 0; i < fromIndex; i++) {
             a[i] = 0xBABA;
         }
-
         for (int i = fromIndex; i < toIndex; i++) {
             a[i] = -i + m;
         }
-
         for (int i = toIndex; i < a.length; i++) {
             a[i] = 0xDEDA;
         }
     }
 
     private static void scramble(int[] a) {
-        int length = a.length;
-
-        for (int i = 0; i < length * 7; i++) {
-            swap(a, ourRandom.nextInt(length), ourRandom.nextInt(length));
+        for (int i = 0; i < a.length * 7; i++) {
+            swap(a, ourRandom.nextInt(a.length), ourRandom.nextInt(a.length));
         }
     }
 
     private static void scramble(float[] a) {
-        int length = a.length;
-
-        for (int i = 0; i < length * 7; i++) {
-            swap(a, ourRandom.nextInt(length), ourRandom.nextInt(length));
+        for (int i = 0; i < a.length * 7; i++) {
+            swap(a, ourRandom.nextInt(a.length), ourRandom.nextInt(a.length));
         }
     }
 
     private static void scramble(double[] a) {
-        int length = a.length;
-
-        for (int i = 0; i < length * 7; i++) {
-            swap(a, ourRandom.nextInt(length), ourRandom.nextInt(length));
+        for (int i = 0; i < a.length * 7; i++) {
+            swap(a, ourRandom.nextInt(a.length), ourRandom.nextInt(a.length));
         }
     }
 
@@ -393,6 +629,16 @@
                 }
                 return b;
             }
+        },
+        INTEGER {
+            Object convert(int[] a) {
+                Integer[] b = new Integer[a.length];
+
+                for (int i = 0; i < a.length; i++) {
+                    b[i] = new Integer(a[i]);
+                }
+                return b;
+            }
         };
 
         abstract Object convert(int[] a);
@@ -691,6 +937,8 @@
             compare((float[]) test, (float[]) golden);
         } else if (test instanceof double[]) {
             compare((double[]) test, (double[]) golden);
+        } else if (test instanceof Integer[]) {
+            compare((Integer[]) test, (Integer[]) golden);
         } else {
             failed("Unknow type of array: " + test + " of class " +
                 test.getClass().getName());
@@ -703,13 +951,13 @@
     }
 
     private static void failed(String message) {
-        err.format("\n*** FAILED: %s\n\n", message);
+        err.format("\n*** TEST FAILED - %s\n\n%s\n\n", ourDescription, message);
         throw new RuntimeException("Test failed - see log file for details");
     }
 
     private static void failed(int index, String value1, String value2) {
-        failed("Array is not sorted at " + index + "-th position: " + value1 +
-               " and " + value2);
+        failed("Array is not sorted at " + index + "-th position: " +
+            value1 + " and " + value2);
     }
 
     private static void checkSorted(Object object) {
@@ -727,12 +975,22 @@
             checkSorted((float[]) object);
         } else if (object instanceof double[]) {
             checkSorted((double[]) object);
+        } else if (object instanceof Integer[]) {
+            checkSorted((Integer[]) object);
         } else {
             failed("Unknow type of array: " + object + " of class " +
                 object.getClass().getName());
         }
     }
 
+    private static void compare(Integer[] a, Integer[] b) {
+        for (int i = 0; i < a.length; i++) {
+            if (a[i].intValue() != b[i].intValue()) {
+                failed(i, "" + a[i], "" + b[i]);
+            }
+        }
+    }
+
     private static void compare(int[] a, int[] b) {
         for (int i = 0; i < a.length; i++) {
             if (a[i] != b[i]) {
@@ -789,6 +1047,14 @@
         }
     }
 
+    private static void checkSorted(Integer[] a) {
+        for (int i = 0; i < a.length - 1; i++) {
+            if (a[i].intValue() > a[i + 1].intValue()) {
+                failed(i, "" + a[i], "" + a[i + 1]);
+            }
+        }
+    }
+
     private static void checkSorted(int[] a) {
         for (int i = 0; i < a.length - 1; i++) {
             if (a[i] > a[i + 1]) {
@@ -847,7 +1113,7 @@
 
     private static void checkCheckSum(Object test, Object golden) {
         if (checkSum(test) != checkSum(golden)) {
-            failed("Original and sorted arrays seems not identical");
+            failed("It seems that original and sorted arrays are not identical");
         }
     }
 
@@ -866,6 +1132,8 @@
             return checkSum((float[]) object);
         } else if (object instanceof double[]) {
             return checkSum((double[]) object);
+        } else if (object instanceof Integer[]) {
+            return checkSum((Integer[]) object);
         } else {
             failed("Unknow type of array: " + object + " of class " +
                 object.getClass().getName());
@@ -873,6 +1141,15 @@
         }
     }
 
+    private static int checkSum(Integer[] a) {
+        int checkXorSum = 0;
+
+        for (Integer e : a) {
+            checkXorSum ^= e.intValue();
+        }
+        return checkXorSum;
+    }
+
     private static int checkSum(int[] a) {
         int checkXorSum = 0;
 
@@ -951,6 +1228,8 @@
             Arrays.sort((float[]) object);
         } else if (object instanceof double[]) {
             Arrays.sort((double[]) object);
+        } else if (object instanceof Integer[]) {
+            Arrays.sort((Integer[]) object);
         } else {
             failed("Unknow type of array: " + object + " of class " +
                 object.getClass().getName());
@@ -972,6 +1251,8 @@
             Arrays.sort((float[]) object, fromIndex, toIndex);
         } else if (object instanceof double[]) {
             Arrays.sort((double[]) object, fromIndex, toIndex);
+        } else if (object instanceof Integer[]) {
+            Arrays.sort((Integer[]) object, fromIndex, toIndex);
         } else {
             failed("Unknow type of array: " + object + " of class " +
                 object.getClass().getName());
@@ -993,12 +1274,36 @@
             checkSubArray((float[]) object, fromIndex, toIndex, m);
         } else if (object instanceof double[]) {
             checkSubArray((double[]) object, fromIndex, toIndex, m);
+        } else if (object instanceof Integer[]) {
+            checkSubArray((Integer[]) object, fromIndex, toIndex, m);
         } else {
             failed("Unknow type of array: " + object + " of class " +
                 object.getClass().getName());
         }
     }
 
+    private static void checkSubArray(Integer[] a, int fromIndex, int toIndex, int m) {
+        for (int i = 0; i < fromIndex; i++) {
+            if (a[i].intValue() != 0xBABA) {
+                failed("Range sort changes left element on position " + i +
+                    ": " + a[i] + ", must be " + 0xBABA);
+            }
+        }
+
+        for (int i = fromIndex; i < toIndex - 1; i++) {
+            if (a[i].intValue() > a[i + 1].intValue()) {
+                failed(i, "" + a[i], "" + a[i + 1]);
+            }
+        }
+
+        for (int i = toIndex; i < a.length; i++) {
+            if (a[i].intValue() != 0xDEDA) {
+                failed("Range sort changes right element on position " + i +
+                    ": " + a[i] + ", must be " + 0xDEDA);
+            }
+        }
+    }
+
     private static void checkSubArray(int[] a, int fromIndex, int toIndex, int m) {
         for (int i = 0; i < fromIndex; i++) {
             if (a[i] != 0xBABA) {
@@ -1153,49 +1458,30 @@
         }
     }
 
-    private static void sortRange(Object object, int m) {
+    private static void checkRange(Object object, int m) {
         if (object instanceof int[]) {
-            sortRange((int[]) object, m);
+            checkRange((int[]) object, m);
         } else if (object instanceof long[]) {
-            sortRange((long[]) object, m);
+            checkRange((long[]) object, m);
         } else if (object instanceof short[]) {
-            sortRange((short[]) object, m);
+            checkRange((short[]) object, m);
         } else if (object instanceof byte[]) {
-            sortRange((byte[]) object, m);
+            checkRange((byte[]) object, m);
         } else if (object instanceof char[]) {
-            sortRange((char[]) object, m);
+            checkRange((char[]) object, m);
         } else if (object instanceof float[]) {
-            sortRange((float[]) object, m);
+            checkRange((float[]) object, m);
         } else if (object instanceof double[]) {
-            sortRange((double[]) object, m);
+            checkRange((double[]) object, m);
+        } else if (object instanceof Integer[]) {
+            checkRange((Integer[]) object, m);
         } else {
             failed("Unknow type of array: " + object + " of class " +
                 object.getClass().getName());
         }
     }
 
-    private static void sortEmpty(Object object) {
-        if (object instanceof int[]) {
-            Arrays.sort(new int [] {});
-        } else if (object instanceof long[]) {
-            Arrays.sort(new long [] {});
-        } else if (object instanceof short[]) {
-            Arrays.sort(new short [] {});
-        } else if (object instanceof byte[]) {
-            Arrays.sort(new byte [] {});
-        } else if (object instanceof char[]) {
-            Arrays.sort(new char [] {});
-        } else if (object instanceof float[]) {
-            Arrays.sort(new float [] {});
-        } else if (object instanceof double[]) {
-            Arrays.sort(new double [] {});
-        } else {
-            failed("Unknow type of array: " + object + " of class " +
-                object.getClass().getName());
-        }
-    }
-
-    private static void sortRange(int[] a, int m) {
+    private static void checkRange(Integer[] a, int m) {
         try {
             Arrays.sort(a, m + 1, m);
 
@@ -1224,7 +1510,36 @@
         }
     }
 
-    private static void sortRange(long[] a, int m) {
+    private static void checkRange(int[] a, int m) {
+        try {
+            Arrays.sort(a, m + 1, m);
+
+            failed("Sort does not throw IllegalArgumentException " +
+                " as expected: fromIndex = " + (m + 1) +
+                " toIndex = " + m);
+        }
+        catch (IllegalArgumentException iae) {
+            try {
+                Arrays.sort(a, -m, a.length);
+
+                failed("Sort does not throw ArrayIndexOutOfBoundsException " +
+                    " as expected: fromIndex = " + (-m));
+            }
+            catch (ArrayIndexOutOfBoundsException aoe) {
+                try {
+                    Arrays.sort(a, 0, a.length + m);
+
+                    failed("Sort does not throw ArrayIndexOutOfBoundsException " +
+                        " as expected: toIndex = " + (a.length + m));
+                }
+                catch (ArrayIndexOutOfBoundsException aie) {
+                    return;
+                }
+            }
+        }
+    }
+
+    private static void checkRange(long[] a, int m) {
         try {
             Arrays.sort(a, m + 1, m);
 
@@ -1253,7 +1568,7 @@
         }
     }
 
-    private static void sortRange(byte[] a, int m) {
+    private static void checkRange(byte[] a, int m) {
         try {
             Arrays.sort(a, m + 1, m);
 
@@ -1282,7 +1597,7 @@
         }
     }
 
-    private static void sortRange(short[] a, int m) {
+    private static void checkRange(short[] a, int m) {
         try {
             Arrays.sort(a, m + 1, m);
 
@@ -1311,7 +1626,7 @@
         }
     }
 
-    private static void sortRange(char[] a, int m) {
+    private static void checkRange(char[] a, int m) {
         try {
             Arrays.sort(a, m + 1, m);
 
@@ -1340,7 +1655,7 @@
         }
     }
 
-    private static void sortRange(float[] a, int m) {
+    private static void checkRange(float[] a, int m) {
         try {
             Arrays.sort(a, m + 1, m);
 
@@ -1369,7 +1684,7 @@
         }
     }
 
-    private static void sortRange(double[] a, int m) {
+    private static void checkRange(double[] a, int m) {
         try {
             Arrays.sort(a, m + 1, m);
 
@@ -1410,31 +1725,36 @@
         ourSecond = 0;
     }
 
-    private static void outArr(int[] a) {
+    private static void outArray(Object[] a) {
+        for (int i = 0; i < a.length; i++) {
+            out.print(a[i] + " ");
+        }
+        out.println();
+    }
+
+    private static void outArray(int[] a) {
         for (int i = 0; i < a.length; i++) {
             out.print(a[i] + " ");
         }
         out.println();
-        out.println();
     }
 
-    private static void outArr(float[] a) {
+    private static void outArray(float[] a) {
         for (int i = 0; i < a.length; i++) {
             out.print(a[i] + " ");
         }
         out.println();
-        out.println();
     }
 
-    private static void outArr(double[] a) {
+    private static void outArray(double[] a) {
         for (int i = 0; i < a.length; i++) {
             out.print(a[i] + " ");
         }
         out.println();
-        out.println();
     }
 
     private static int ourFirst;
     private static int ourSecond;
     private static Random ourRandom;
+    private static String ourDescription;
 }
Binary file jdk/test/java/util/Locale/Bug4184873_he has changed
Binary file jdk/test/java/util/Locale/Bug4184873_id has changed
Binary file jdk/test/java/util/Locale/Bug4184873_yi has changed
--- a/jdk/test/java/util/ResourceBundle/Bug4168625Test.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/test/java/util/ResourceBundle/Bug4168625Test.java	Wed Jul 21 09:57:21 2010 -0700
@@ -427,9 +427,11 @@
         private boolean network = false;
 
         public SimpleLoader() {
+            super(SimpleLoader.class.getClassLoader());
             this.network = false;
         }
         public SimpleLoader(boolean simulateNetworkLoad) {
+            super(SimpleLoader.class.getClassLoader());
             this.network = simulateNetworkLoad;
         }
         public Class loadClass(final String className, final boolean resolveIt)
@@ -444,7 +446,7 @@
                         } catch (java.lang.InterruptedException e) {
                         }
                     }
-                    result = super.findSystemClass(className);
+                    result = getParent().loadClass(className);
                     if ((result != null) && resolveIt) {
                         resolveClass(result);
                     }
@@ -460,11 +462,13 @@
         private String[] classesToWaitFor;
 
         public Loader() {
+            super(Loader.class.getClassLoader());
             classesToLoad = new String[0];
             classesToWaitFor = new String[0];
         }
 
         public Loader(final String[] classesToLoadIn, final String[] classesToWaitForIn) {
+            super(Loader.class.getClassLoader());
             classesToLoad = classesToLoadIn;
             classesToWaitFor = classesToWaitForIn;
         }
@@ -540,10 +544,12 @@
         }
 
         /**
-         * Delegate loading to the system loader
+         * Delegate loading to its parent class loader that loads the test classes.
+         * In othervm mode, the parent class loader is the system class loader;
+         * in samevm mode, the parent class loader is the jtreg URLClassLoader.
          */
         private Class loadFromSystem(String className) throws ClassNotFoundException {
-            return super.findSystemClass(className);
+            return getParent().loadClass(className);
         }
 
         public void logClasses(String title) {
--- a/jdk/test/java/util/ResourceBundle/Bug6359330.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/test/java/util/ResourceBundle/Bug6359330.java	Wed Jul 21 09:57:21 2010 -0700
@@ -26,6 +26,7 @@
  * @summary Make sure that getBundle doesn't cause a security error
  * with a security manager when instantialing RBClassLoader (internal
  * classloader).
+ * @run main/othervm Bug6359330
  */
 
 import javax.xml.parsers.SAXParser;
--- a/jdk/test/java/util/ResourceBundle/Test4300693.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/test/java/util/ResourceBundle/Test4300693.java	Wed Jul 21 09:57:21 2010 -0700
@@ -22,6 +22,7 @@
  */
 /*
     @test
+    @ignore 6876961
     @summary test that ResourceBundle.getBundle can be called recursively
     @build  Test4300693RB
     @run main Test4300693
--- a/jdk/test/java/util/ResourceBundle/TestBug4179766.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/test/java/util/ResourceBundle/TestBug4179766.java	Wed Jul 21 09:57:21 2010 -0700
@@ -209,6 +209,7 @@
          * Create a new loader
          */
         public Loader(boolean sameHash) {
+            super(Loader.class.getClassLoader());
             if (sameHash) {
                 thisHashCode = SAME_HASH_CODE;
             } else {
@@ -287,7 +288,7 @@
          */
         private Class loadFromSystem(String className) throws ClassNotFoundException {
             try {
-                Class result = super.findSystemClass(className);
+                Class result = getParent().loadClass(className);
                 printInfo("        ***Returning system class: "+className, result);
                 return result;
             } catch (ClassNotFoundException e) {
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/util/logging/AnonLoggerWeakRefLeak.java	Wed Jul 21 09:57:21 2010 -0700
@@ -0,0 +1,76 @@
+/*
+ * 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.
+ */
+
+import java.util.logging.*;
+
+public class AnonLoggerWeakRefLeak {
+    public static int DEFAULT_LOOP_TIME = 60;  // time is in seconds
+
+    public static void main(String[] args) {
+        int loop_time = 0;
+        int max_loop_time = DEFAULT_LOOP_TIME;
+
+        if (args.length == 0) {
+            System.out.println("INFO: using default time of "
+                + max_loop_time + " seconds.");
+        } else {
+            try {
+                max_loop_time = Integer.parseInt(args[0]);
+            } catch (NumberFormatException nfe) {
+                System.err.println("Error: '" + args[0]
+                    + "': is not a valid seconds value.");
+                System.err.println("Usage: AnonLoggerWeakRefLeak [seconds]");
+                System.exit(1);
+            }
+        }
+
+        long count = 0;
+        long now = 0;
+        long startTime = System.currentTimeMillis();
+
+        while (now < (startTime + (max_loop_time * 1000))) {
+            if ((count % 1000) == 0) {
+                // Print initial call count to let caller know that
+                // we're up and running and then periodically
+                System.out.println("INFO: call count = " + count);
+            }
+
+            for (int i = 0; i < 100; i++) {
+                // this Logger call is leaking a WeakReference in Logger.kids
+                java.util.logging.Logger.getAnonymousLogger();
+                count++;
+            }
+
+            try {
+                // delay for 1/10 of a second to avoid CPU saturation
+                Thread.sleep(100);
+            } catch (InterruptedException ie) {
+                // ignore any exceptions
+            }
+
+            now = System.currentTimeMillis();
+        }
+
+        System.out.println("INFO: final loop count = " + count);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/util/logging/AnonLoggerWeakRefLeak.sh	Wed Jul 21 09:57:21 2010 -0700
@@ -0,0 +1,247 @@
+#
+# 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 6942989
+# @ignore until 6964018 is fixed
+# @summary Check for WeakReference leak in anonymous Logger objects
+# @author Daniel D. Daugherty
+#
+# @run build AnonLoggerWeakRefLeak
+# @run shell/timeout=180 AnonLoggerWeakRefLeak.sh
+
+# The timeout is: 2 minutes for infrastructure and 1 minute for the test
+#
+
+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
+
+JAVA="${TESTJAVA}"/bin/java
+JMAP="${TESTJAVA}"/bin/jmap
+JPS="${TESTJAVA}"/bin/jps
+
+set -eu
+
+TEST_NAME="AnonLoggerWeakRefLeak"
+TARGET_CLASS="java\.lang\.ref\.WeakReference"
+
+is_cygwin=false
+is_mks=false
+is_windows=false
+
+case `uname -s` in
+CYGWIN*)
+    is_cygwin=true
+    is_windows=true
+    ;;
+Windows_*)
+    is_mks=true
+    is_windows=true
+    ;;
+*)
+    ;;
+esac
+
+
+# wrapper for grep
+#
+grep_cmd() {
+    set +e
+    if $is_windows; then
+        # need dos2unix to get rid of CTRL-M chars from java output
+        dos2unix | grep "$@"
+        status="$?"
+    else
+        grep "$@"
+        status="$?"
+    fi
+    set -e
+}
+
+
+# MAIN begins here
+#
+
+seconds=
+if [ "$#" -gt 0 ]; then
+    seconds="$1"
+fi
+
+# see if this version of jmap supports the '-histo:live' option
+jmap_option="-histo:live"
+set +e
+"${JMAP}" "$jmap_option" 0 > "$TEST_NAME.jmap" 2>&1
+grep '^Usage: ' "$TEST_NAME.jmap" > /dev/null 2>&1
+status="$?"
+set -e
+if [ "$status" = 0 ]; then
+    echo "INFO: switching jmap option from '$jmap_option'\c"
+    jmap_option="-histo"
+    echo " to '$jmap_option'."
+fi
+
+"${JAVA}" ${TESTVMOPTS} -classpath "${TESTCLASSES}" \
+    "$TEST_NAME" $seconds > "$TEST_NAME.log" 2>&1 &
+test_pid="$!"
+echo "INFO: starting $TEST_NAME as pid = $test_pid"
+
+# wait for test program to get going
+count=0
+while [ "$count" -lt 30 ]; do
+    sleep 2
+    grep_cmd '^INFO: call count = 0$' < "$TEST_NAME.log" > /dev/null 2>&1
+    if [ "$status" = 0 ]; then
+        break
+    fi
+    count=`expr $count + 1`
+done
+
+if [ "$count" -ge 30 ]; then
+    echo "ERROR: $TEST_NAME failed to get going." >&2
+    echo "INFO: killing $test_pid"
+    kill "$test_pid"
+    exit 1
+elif [ "$count" -gt 1 ]; then
+    echo "INFO: $TEST_NAME took $count loops to start."
+fi
+
+if $is_cygwin; then
+    # We need the Windows pid for jmap and not the Cygwin pid.
+    # Note: '\t' works on Cygwin, but doesn't seem to work on Solaris.
+    jmap_pid=`"${JPS}"| grep_cmd "[ \t]$TEST_NAME$" | sed 's/[ \t].*//'`
+    if [ -z "$jmap_pid" ]; then
+        echo "FAIL: jps could not map Cygwin pid to Windows pid." >&2
+        echo "INFO: killing $test_pid"
+        kill "$test_pid"
+        exit 2
+    fi
+    echo "INFO: pid = $test_pid maps to Windows pid = $jmap_pid"
+else
+    jmap_pid="$test_pid"
+fi
+
+decreasing_cnt=0
+increasing_cnt=0
+loop_cnt=0
+prev_instance_cnt=0
+
+while true; do
+    # Output format for 'jmap -histo' in JDK1.5.0:
+    #
+    #     <#bytes> <#instances> <class_name>
+    #
+    # Output format for 'jmap -histo:live':
+    #
+    #     <num>: <#instances> <#bytes> <class_name>
+    #
+    set +e
+    "${JMAP}" "$jmap_option" "$jmap_pid" > "$TEST_NAME.jmap" 2>&1
+    status="$?"
+    set -e
+
+    if [ "$status" != 0 ]; then
+        echo "INFO: jmap exited with exit code = $status"
+        if [ "$loop_cnt" = 0 ]; then
+            echo "INFO: on the first iteration so no samples were taken."
+            echo "INFO: start of jmap output:"
+            cat "$TEST_NAME.jmap"
+            echo "INFO: end of jmap output."
+            echo "FAIL: jmap is unable to take any samples." >&2
+            echo "INFO: killing $test_pid"
+            kill "$test_pid"
+            exit 2
+        fi
+        echo "INFO: The likely reason is that $TEST_NAME has finished running."
+        break
+    fi
+
+    instance_cnt=`grep_cmd "[ 	]$TARGET_CLASS$" \
+        < "$TEST_NAME.jmap" \
+        | sed '
+            # strip leading whitespace; does nothing in JDK1.5.0
+            s/^[ 	][ 	]*//
+            # strip <#bytes> in JDK1.5.0; does nothing otherwise
+            s/^[1-9][0-9]*[ 	][ 	]*//
+            # strip <num>: field; does nothing in JDK1.5.0
+            s/^[1-9][0-9]*:[ 	][ 	]*//
+            # strip <class_name> field
+            s/[ 	].*//
+            '`
+    if [ -z "$instance_cnt" ]; then
+        echo "INFO: instance count is unexpectedly empty"
+        if [ "$loop_cnt" = 0 ]; then
+            echo "INFO: on the first iteration so no sample was found."
+            echo "INFO: There is likely a problem with the sed filter."
+            echo "INFO: start of jmap output:"
+            cat "$TEST_NAME.jmap"
+            echo "INFO: end of jmap output."
+            echo "FAIL: cannot find the instance count value." >&2
+            echo "INFO: killing $test_pid"
+            kill "$test_pid"
+            exit 2
+        fi
+    else
+        echo "INFO: instance_cnt = $instance_cnt"
+
+        if [ "$instance_cnt" -gt "$prev_instance_cnt" ]; then
+            increasing_cnt=`expr $increasing_cnt + 1`
+        else
+            decreasing_cnt=`expr $decreasing_cnt + 1`
+        fi
+        prev_instance_cnt="$instance_cnt"
+    fi
+
+    # delay between samples
+    sleep 5
+
+    loop_cnt=`expr $loop_cnt + 1`
+done
+
+echo "INFO: increasing_cnt = $increasing_cnt"
+echo "INFO: decreasing_cnt = $decreasing_cnt"
+
+echo "INFO: The instance count of" `eval echo $TARGET_CLASS` "objects"
+if [ "$decreasing_cnt" = 0 ]; then
+    echo "INFO: is always increasing."
+    echo "FAIL: This indicates that there is a memory leak." >&2
+    exit 2
+fi
+
+echo "INFO: is both increasing and decreasing."
+echo "PASS: This indicates that there is not a memory leak."
+exit 0
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/util/logging/LoggerWeakRefLeak.java	Wed Jul 21 09:57:21 2010 -0700
@@ -0,0 +1,89 @@
+/*
+ * 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.
+ */
+
+import java.util.logging.*;
+
+public class LoggerWeakRefLeak {
+    // AnonLoggerWeakRefLeak checks for one weak reference leak.
+    // LoggerWeakRefLeak checks for two weak reference leaks so
+    // this test runs twice as long, by default.
+    public static int DEFAULT_LOOP_TIME = 120;  // time is in seconds
+
+    public static void main(String[] args) {
+        int loop_time = 0;
+        int max_loop_time = DEFAULT_LOOP_TIME;
+
+        if (args.length == 0) {
+            System.out.println("INFO: using default time of "
+                + max_loop_time + " seconds.");
+        } else {
+            try {
+                max_loop_time = Integer.parseInt(args[0]);
+            } catch (NumberFormatException nfe) {
+                System.err.println("Error: '" + args[0]
+                    + "': is not a valid seconds value.");
+                System.err.println("Usage: LoggerWeakRefLeak [seconds]");
+                System.exit(1);
+            }
+        }
+
+        long count = 0;
+        int  loggerCount = 0;
+        long now = 0;
+        long startTime = System.currentTimeMillis();
+
+        while (now < (startTime + (max_loop_time * 1000))) {
+            if ((count % 1000) == 0) {
+                // Print initial call count to let caller know that
+                // we're up and running and then periodically
+                System.out.println("INFO: call count = " + count);
+            }
+
+            for (int i = 0; i < 100; i++) {
+                // This Logger call is leaking two different WeakReferences:
+                // - one in LogManager.LogNode
+                // - one in Logger.kids
+                java.util.logging.Logger.getLogger("logger-" + loggerCount);
+                count++;
+                if (++loggerCount >= 25000) {
+                    // Limit the Logger namespace used by the test so
+                    // the weak refs in LogManager.loggers that are
+                    // being properly managed don't skew the counts
+                    // by too much.
+                    loggerCount = 0;
+                }
+            }
+
+            try {
+                // delay for 1/10 of a second to avoid CPU saturation
+                Thread.sleep(100);
+            } catch (InterruptedException ie) {
+                // ignore any exceptions
+            }
+
+            now = System.currentTimeMillis();
+        }
+
+        System.out.println("INFO: final loop count = " + count);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/util/logging/LoggerWeakRefLeak.sh	Wed Jul 21 09:57:21 2010 -0700
@@ -0,0 +1,247 @@
+#
+# 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 6942989
+# @ignore until 6964018 is fixed
+# @summary Check for WeakReference leak in Logger objects
+# @author Daniel D. Daugherty
+#
+# @run build LoggerWeakRefLeak
+# @run shell/timeout=240 LoggerWeakRefLeak.sh
+
+# The timeout is: 2 minutes for infrastructure and 1 minute for the test
+#
+
+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
+
+JAVA="${TESTJAVA}"/bin/java
+JMAP="${TESTJAVA}"/bin/jmap
+JPS="${TESTJAVA}"/bin/jps
+
+set -eu
+
+TEST_NAME="LoggerWeakRefLeak"
+TARGET_CLASS="java\.lang\.ref\.WeakReference"
+
+is_cygwin=false
+is_mks=false
+is_windows=false
+
+case `uname -s` in
+CYGWIN*)
+    is_cygwin=true
+    is_windows=true
+    ;;
+Windows_*)
+    is_mks=true
+    is_windows=true
+    ;;
+*)
+    ;;
+esac
+
+
+# wrapper for grep
+#
+grep_cmd() {
+    set +e
+    if $is_windows; then
+        # need dos2unix to get rid of CTRL-M chars from java output
+        dos2unix | grep "$@"
+        status="$?"
+    else
+        grep "$@"
+        status="$?"
+    fi
+    set -e
+}
+
+
+# MAIN begins here
+#
+
+seconds=
+if [ "$#" -gt 0 ]; then
+    seconds="$1"
+fi
+
+# see if this version of jmap supports the '-histo:live' option
+jmap_option="-histo:live"
+set +e
+"${JMAP}" "$jmap_option" 0 > "$TEST_NAME.jmap" 2>&1
+grep '^Usage: ' "$TEST_NAME.jmap" > /dev/null 2>&1
+status="$?"
+set -e
+if [ "$status" = 0 ]; then
+    echo "INFO: switching jmap option from '$jmap_option'\c"
+    jmap_option="-histo"
+    echo " to '$jmap_option'."
+fi
+
+"${JAVA}" ${TESTVMOPTS} -classpath "${TESTCLASSES}" \
+    "$TEST_NAME" $seconds > "$TEST_NAME.log" 2>&1 &
+test_pid="$!"
+echo "INFO: starting $TEST_NAME as pid = $test_pid"
+
+# wait for test program to get going
+count=0
+while [ "$count" -lt 30 ]; do
+    sleep 2
+    grep_cmd '^INFO: call count = 0$' < "$TEST_NAME.log" > /dev/null 2>&1
+    if [ "$status" = 0 ]; then
+        break
+    fi
+    count=`expr $count + 1`
+done
+
+if [ "$count" -ge 30 ]; then
+    echo "ERROR: $TEST_NAME failed to get going." >&2
+    echo "INFO: killing $test_pid"
+    kill "$test_pid"
+    exit 1
+elif [ "$count" -gt 1 ]; then
+    echo "INFO: $TEST_NAME took $count loops to start."
+fi
+
+if $is_cygwin; then
+    # We need the Windows pid for jmap and not the Cygwin pid.
+    # Note: '\t' works on Cygwin, but doesn't seem to work on Solaris.
+    jmap_pid=`"${JPS}"| grep_cmd "[ \t]$TEST_NAME$" | sed 's/[ \t].*//'`
+    if [ -z "$jmap_pid" ]; then
+        echo "FAIL: jps could not map Cygwin pid to Windows pid." >&2
+        echo "INFO: killing $test_pid"
+        kill "$test_pid"
+        exit 2
+    fi
+    echo "INFO: pid = $test_pid maps to Windows pid = $jmap_pid"
+else
+    jmap_pid="$test_pid"
+fi
+
+decreasing_cnt=0
+increasing_cnt=0
+loop_cnt=0
+prev_instance_cnt=0
+
+while true; do
+    # Output format for 'jmap -histo' in JDK1.5.0:
+    #
+    #     <#bytes> <#instances> <class_name>
+    #
+    # Output format for 'jmap -histo:live':
+    #
+    #     <num>: <#instances> <#bytes> <class_name>
+    #
+    set +e
+    "${JMAP}" "$jmap_option" "$jmap_pid" > "$TEST_NAME.jmap" 2>&1
+    status="$?"
+    set -e
+
+    if [ "$status" != 0 ]; then
+        echo "INFO: jmap exited with exit code = $status"
+        if [ "$loop_cnt" = 0 ]; then
+            echo "INFO: on the first iteration so no samples were taken."
+            echo "INFO: start of jmap output:"
+            cat "$TEST_NAME.jmap"
+            echo "INFO: end of jmap output."
+            echo "FAIL: jmap is unable to take any samples." >&2
+            echo "INFO: killing $test_pid"
+            kill "$test_pid"
+            exit 2
+        fi
+        echo "INFO: The likely reason is that $TEST_NAME has finished running."
+        break
+    fi
+
+    instance_cnt=`grep_cmd "[ 	]$TARGET_CLASS$" \
+        < "$TEST_NAME.jmap" \
+        | sed '
+            # strip leading whitespace; does nothing in JDK1.5.0
+            s/^[ 	][ 	]*//
+            # strip <#bytes> in JDK1.5.0; does nothing otherwise
+            s/^[1-9][0-9]*[ 	][ 	]*//
+            # strip <num>: field; does nothing in JDK1.5.0
+            s/^[1-9][0-9]*:[ 	][ 	]*//
+            # strip <class_name> field
+            s/[ 	].*//
+            '`
+    if [ -z "$instance_cnt" ]; then
+        echo "INFO: instance count is unexpectedly empty"
+        if [ "$loop_cnt" = 0 ]; then
+            echo "INFO: on the first iteration so no sample was found."
+            echo "INFO: There is likely a problem with the sed filter."
+            echo "INFO: start of jmap output:"
+            cat "$TEST_NAME.jmap"
+            echo "INFO: end of jmap output."
+            echo "FAIL: cannot find the instance count value." >&2
+            echo "INFO: killing $test_pid"
+            kill "$test_pid"
+            exit 2
+        fi
+    else
+        echo "INFO: instance_cnt = $instance_cnt"
+
+        if [ "$instance_cnt" -gt "$prev_instance_cnt" ]; then
+            increasing_cnt=`expr $increasing_cnt + 1`
+        else
+            decreasing_cnt=`expr $decreasing_cnt + 1`
+        fi
+        prev_instance_cnt="$instance_cnt"
+    fi
+
+    # delay between samples
+    sleep 5
+
+    loop_cnt=`expr $loop_cnt + 1`
+done
+
+echo "INFO: increasing_cnt = $increasing_cnt"
+echo "INFO: decreasing_cnt = $decreasing_cnt"
+
+echo "INFO: The instance count of" `eval echo $TARGET_CLASS` "objects"
+if [ "$decreasing_cnt" = 0 ]; then
+    echo "INFO: is always increasing."
+    echo "FAIL: This indicates that there is a memory leak." >&2
+    exit 2
+fi
+
+echo "INFO: is both increasing and decreasing."
+echo "PASS: This indicates that there is not a memory leak."
+exit 0
--- a/jdk/test/java/util/logging/ParentLoggersTest.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/test/java/util/logging/ParentLoggersTest.java	Wed Jul 21 09:57:21 2010 -0700
@@ -40,7 +40,19 @@
     static final String LOGGER_NAME_1   = PARENT_NAME_1 + ".myLogger";
     static final String LOGGER_NAME_2   = PARENT_NAME_2 + ".myBar.myLogger";
 
+    static final List<String> initialLoggerNames = new ArrayList<String>();
     public static void main(String args[]) throws Exception {
+        // cache the initial set of loggers before this test begins
+        // to add any loggers
+        Enumeration<String> e = logMgr.getLoggerNames();
+        List<String> defaultLoggers = getDefaultLoggerNames();
+        while (e.hasMoreElements()) {
+            String logger = e.nextElement();
+            if (!defaultLoggers.contains(logger)) {
+                initialLoggerNames.add(logger);
+            }
+        };
+
         String tstSrc = System.getProperty(TST_SRC_PROP);
         File   fname  = new File(tstSrc, LM_PROP_FNAME);
         String prop   = fname.getCanonicalPath();
@@ -56,12 +68,12 @@
         }
     }
 
-    public static Vector getDefaultLoggerNames() {
-        Vector expectedLoggerNames = new Vector(0);
+    public static List<String> getDefaultLoggerNames() {
+        List<String> expectedLoggerNames = new ArrayList<String>();
 
         // LogManager always creates two loggers:
-        expectedLoggerNames.addElement("");       // root   logger: ""
-        expectedLoggerNames.addElement("global"); // global logger: "global"
+        expectedLoggerNames.add("");       // root   logger: ""
+        expectedLoggerNames.add("global"); // global logger: "global"
         return expectedLoggerNames;
     }
 
@@ -71,7 +83,7 @@
      */
     public static boolean checkLoggers() {
         String failMsg = "# checkLoggers: getLoggerNames() returned unexpected loggers";
-        Vector expectedLoggerNames = getDefaultLoggerNames();
+        Vector<String> expectedLoggerNames = new Vector<String>(getDefaultLoggerNames());
 
         // Create the logger LOGGER_NAME_1
         Logger logger1 = Logger.getLogger(LOGGER_NAME_1);
@@ -83,18 +95,23 @@
         expectedLoggerNames.addElement(PARENT_NAME_2);
         expectedLoggerNames.addElement(LOGGER_NAME_2);
 
-        Enumeration returnedLoggersEnum = logMgr.getLoggerNames();
-        Vector      returnedLoggerNames = new Vector(0);
+        Enumeration<String> returnedLoggersEnum = logMgr.getLoggerNames();
+        Vector<String>      returnedLoggerNames = new Vector<String>(0);
         while (returnedLoggersEnum.hasMoreElements()) {
-            returnedLoggerNames.addElement(returnedLoggersEnum.nextElement());
+           String logger = returnedLoggersEnum.nextElement();
+            if (!initialLoggerNames.contains(logger)) {
+                // filter out the loggers that have been added before this test runs
+                returnedLoggerNames.addElement(logger);
+            }
+
         };
 
         return checkNames(expectedLoggerNames, returnedLoggerNames, failMsg);
     }
 
     // Returns boolean values: PASSED or FAILED
-    private static boolean checkNames(Vector expNames,
-                                      Vector retNames,
+    private static boolean checkNames(Vector<String> expNames,
+                                      Vector<String> retNames,
                                       String failMsg) {
         boolean status = PASSED;
 
@@ -123,8 +140,8 @@
         return status;
     }
 
-    private static void printFailMsg(Vector expNames,
-                                     Vector retNames,
+    private static void printFailMsg(Vector<String> expNames,
+                                     Vector<String> retNames,
                                      String failMsg) {
         out.println();
         out.println(failMsg);
--- a/jdk/test/java/util/regex/RegExTest.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/test/java/util/regex/RegExTest.java	Wed Jul 21 09:57:21 2010 -0700
@@ -32,7 +32,7 @@
  * 4872664 4803179 4892980 4900747 4945394 4938995 4979006 4994840 4997476
  * 5013885 5003322 4988891 5098443 5110268 6173522 4829857 5027748 6376940
  * 6358731 6178785 6284152 6231989 6497148 6486934 6233084 6504326 6635133
- * 6350801 6676425 6878475 6919132 6931676
+ * 6350801 6676425 6878475 6919132 6931676 6948903
  */
 
 import java.util.regex.*;
@@ -135,7 +135,7 @@
         surrogatesInClassTest();
         namedGroupCaptureTest();
         nonBmpClassComplementTest();
-
+        unicodePropertiesTest();
         if (failure)
             throw new RuntimeException("Failure in the RE handling.");
         else
@@ -3515,7 +3515,7 @@
         report("NamedGroupCapture");
     }
 
-    // This is for bug 6919132
+    // This is for bug 6969132
     private static void nonBmpClassComplementTest() throws Exception {
         Pattern p = Pattern.compile("\\P{Lu}");
         Matcher m = p.matcher(new String(new int[] {0x1d400}, 0, 1));
@@ -3539,4 +3539,79 @@
         report("NonBmpClassComplement");
     }
 
+    private static void unicodePropertiesTest() throws Exception {
+        // different forms
+        if (!Pattern.compile("\\p{IsLu}").matcher("A").matches() ||
+            !Pattern.compile("\\p{Lu}").matcher("A").matches() ||
+            !Pattern.compile("\\p{gc=Lu}").matcher("A").matches() ||
+            !Pattern.compile("\\p{general_category=Lu}").matcher("A").matches() ||
+            !Pattern.compile("\\p{IsLatin}").matcher("B").matches() ||
+            !Pattern.compile("\\p{sc=Latin}").matcher("B").matches() ||
+            !Pattern.compile("\\p{script=Latin}").matcher("B").matches() ||
+            !Pattern.compile("\\p{InBasicLatin}").matcher("c").matches() ||
+            !Pattern.compile("\\p{blk=BasicLatin}").matcher("c").matches() ||
+            !Pattern.compile("\\p{block=BasicLatin}").matcher("c").matches())
+            failCount++;
+
+        Matcher common  = Pattern.compile("\\p{script=Common}").matcher("");
+        Matcher unknown = Pattern.compile("\\p{IsUnknown}").matcher("");
+        Matcher lastSM  = common;
+        Character.UnicodeScript lastScript = Character.UnicodeScript.of(0);
+
+        Matcher latin  = Pattern.compile("\\p{block=basic_latin}").matcher("");
+        Matcher greek  = Pattern.compile("\\p{InGreek}").matcher("");
+        Matcher lastBM = latin;
+        Character.UnicodeBlock lastBlock = Character.UnicodeBlock.of(0);
+
+        for (int cp = 1; cp < Character.MAX_CODE_POINT; cp++) {
+            if (cp >= 0x30000 && (cp & 0x70) == 0){
+                continue;  // only pick couple code points, they are the same
+            }
+
+            // Unicode Script
+            Character.UnicodeScript script = Character.UnicodeScript.of(cp);
+            Matcher m;
+            String str = new String(Character.toChars(cp));
+            if (script == lastScript) {
+                 m = lastSM;
+                 m.reset(str);
+            } else {
+                 m  = Pattern.compile("\\p{Is" + script.name() + "}").matcher(str);
+            }
+            if (!m.matches()) {
+                failCount++;
+            }
+            Matcher other = (script == Character.UnicodeScript.COMMON)? unknown : common;
+            other.reset(str);
+            if (other.matches()) {
+                failCount++;
+            }
+            lastSM = m;
+            lastScript = script;
+
+            // Unicode Block
+            Character.UnicodeBlock block = Character.UnicodeBlock.of(cp);
+            if (block == null) {
+                //System.out.printf("Not a Block: cp=%x%n", cp);
+                continue;
+            }
+            if (block == lastBlock) {
+                 m = lastBM;
+                 m.reset(str);
+            } else {
+                 m  = Pattern.compile("\\p{block=" + block.toString() + "}").matcher(str);
+            }
+            if (!m.matches()) {
+                failCount++;
+            }
+            other = (block == Character.UnicodeBlock.BASIC_LATIN)? greek : latin;
+            other.reset(str);
+            if (other.matches()) {
+                failCount++;
+            }
+            lastBM = m;
+            lastBlock = block;
+        }
+        report("unicodeProperties");
+    }
 }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/util/zip/GZIP/GZIPInputStreamRead.java	Wed Jul 21 09:57:21 2010 -0700
@@ -0,0 +1,100 @@
+/*
+ * Copyright 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.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along 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.
+ */
+
+/* @test
+ * @bug 4691425
+ * @summary Test the read and write of GZIPInput/OutputStream, including
+ *          concatenated .gz inputstream
+ */
+
+import java.io.*;
+import java.util.*;
+import java.util.zip.*;
+
+public class GZIPInputStreamRead {
+    public static void main(String[] args) throws Throwable {
+        Random rnd = new Random();
+        for (int i = 1; i < 100; i++) {
+            int members = rnd.nextInt(10) + 1;
+
+            ByteArrayOutputStream srcBAOS = new ByteArrayOutputStream();
+            ByteArrayOutputStream dstBAOS = new ByteArrayOutputStream();
+            for (int j = 0; j < members; j++) {
+                byte[] src = new byte[rnd.nextInt(8192) + 1];
+                rnd.nextBytes(src);
+                srcBAOS.write(src);
+
+                GZIPOutputStream gzos = new GZIPOutputStream(dstBAOS);
+                gzos.write(src);
+                gzos.close();
+            }
+            byte[] srcBytes = srcBAOS.toByteArray();
+            byte[] dstBytes = dstBAOS.toByteArray();
+            // try different size of buffer to read the
+            // GZIPInputStream
+            /* just for fun when running manually
+            for (int j = 1; j < 10; j++) {
+                test(srcBytes, dstBytes, j);
+            }
+            */
+            for (int j = 0; j < 10; j++) {
+                int readBufSZ = rnd.nextInt(2048) + 1;
+                test(srcBytes,
+                     dstBytes,
+                     readBufSZ,
+                     512);    // the defualt buffer size
+                test(srcBytes,
+                     dstBytes,
+                     readBufSZ,
+                     rnd.nextInt(4096) + 1);
+            }
+        }
+    }
+
+    private static void test(byte[] src, byte[] dst,
+                             int readBufSize, int gzisBufSize)
+        throws Throwable
+    {
+        GZIPInputStream gzis = new GZIPInputStream(
+                                   new ByteArrayInputStream(dst),
+                                   gzisBufSize);
+        byte[] result = new byte[src.length + 10];
+        byte[] buf = new byte[readBufSize];
+        int n = 0;
+        int off = 0;
+
+        while ((n = gzis.read(buf, 0, buf.length)) != -1) {
+            System.arraycopy(buf, 0, result, off, n);
+            off += n;
+            // no range check, if overflow, let it fail
+        }
+        if (off != src.length || gzis.available() != 0 ||
+            !Arrays.equals(src, Arrays.copyOf(result, off))) {
+            throw new RuntimeException(
+                "GZIPInputStream reading failed! " +
+                ", src.len=" + src.length +
+                ", read=" + off);
+        }
+        gzis.close();
+    }
+}
--- a/jdk/test/java/util/zip/InflateIn_DeflateOut.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/test/java/util/zip/InflateIn_DeflateOut.java	Wed Jul 21 09:57:21 2010 -0700
@@ -23,8 +23,8 @@
 
 /**
  * @test
- * @bug 4206909
- * @summary Test basic functionality of DeflaterOutputStream and InflaterInputStream including flush
+ * @bug 4206909 4813885
+ * @summary Test basic functionality of DeflaterOutputStream/InflaterInputStream and GZIPOutputStream/GZIPInputStream, including flush
  */
 
 import java.io.*;
@@ -79,23 +79,23 @@
     }
 
     private static class PairedOutputStream extends ByteArrayOutputStream {
-      private PairedInputStream pairedStream = null;
+        private PairedInputStream pairedStream = null;
 
-      public PairedOutputStream(PairedInputStream inputPair) {
-        super();
-        this.pairedStream = inputPair;
-      }
+        public PairedOutputStream(PairedInputStream inputPair) {
+            super();
+            this.pairedStream = inputPair;
+        }
 
-      public void flush() {
-        if (count > 0) {
-          pairedStream.addBytes(buf, count);
-          reset();
+        public void flush() {
+            if (count > 0) {
+                pairedStream.addBytes(buf, count);
+                reset();
+            }
         }
-      }
 
-      public void close() {
-        flush();
-      }
+        public void close() {
+            flush();
+        }
     }
 
     private static boolean readFully(InputStream in, byte[] buf, int length)
@@ -146,27 +146,20 @@
         check(Arrays.equals(data, buf));
     }
 
-    /** Check that written, flushed and read */
-    private static void WriteFlushRead() throws Throwable {
+    private static void check(InputStream is, OutputStream os)
+        throws Throwable
+    {
         Random random = new Random(new Date().getTime());
-
-        PairedInputStream pis = new PairedInputStream();
-        InflaterInputStream iis = new InflaterInputStream(pis);
-
-        PairedOutputStream pos = new PairedOutputStream(pis);
-        pis.setPairedOutputStream(pos);
-        DeflaterOutputStream dos = new DeflaterOutputStream(pos, true);
-
-        // Large writes
+       // Large writes
         for (int x = 0; x < 200 ; x++) {
             // byte[] data = new byte[random.nextInt(1024 * 1024)];
             byte[] data = new byte[1024];
             byte[] buf = new byte[data.length];
             random.nextBytes(data);
 
-            dos.write(data);
-            dos.flush();
-            check(readFully(iis, buf, buf.length));
+            os.write(data);
+            os.flush();
+            check(readFully(is, buf, buf.length));
             check(Arrays.equals(data, buf));
         }
 
@@ -176,9 +169,9 @@
             byte[] buf = new byte[data.length];
             random.nextBytes(data);
 
-            dos.write(data);
-            dos.flush();
-            if (!readFully(iis, buf, buf.length)) {
+            os.write(data);
+            os.flush();
+            if (!readFully(is, buf, buf.length)) {
                 fail("Didn't read full buffer of " + buf.length);
             }
             check(Arrays.equals(data, buf));
@@ -187,14 +180,62 @@
         String quit = "QUIT\r\n";
 
         // Close it out
-        dos.write(quit.getBytes());
-        dos.close();
+        os.write(quit.getBytes());
+        os.close();
 
         StringBuilder sb = new StringBuilder();
-        check(readLineIfAvailable(iis, sb));
+        check(readLineIfAvailable(is, sb));
         equal(sb.toString(), quit);
     }
 
+    /** Check that written, flushed and read */
+    private static void WriteFlushRead() throws Throwable {
+        PairedInputStream pis = new PairedInputStream();
+        InflaterInputStream iis = new InflaterInputStream(pis);
+
+        PairedOutputStream pos = new PairedOutputStream(pis);
+        pis.setPairedOutputStream(pos);
+        DeflaterOutputStream dos = new DeflaterOutputStream(pos, true);
+
+        check(iis, dos);
+    }
+
+    private static void GZWriteFlushRead() throws Throwable {
+        PairedInputStream pis = new PairedInputStream();
+        PairedOutputStream pos = new PairedOutputStream(pis);
+        pis.setPairedOutputStream(pos);
+
+        GZIPOutputStream gos = new GZIPOutputStream(pos, true);
+        gos.flush();  // flush the head out, so gis can read
+        GZIPInputStream gis = new GZIPInputStream(pis);
+
+        check(gis, gos);
+    }
+
+    private static void checkLOP(InputStream is, OutputStream os)
+        throws Throwable
+    {
+        boolean flushed = false;
+        int count = 0;
+
+        // Do at least a certain number of lines, but too many without a
+        // flush means this test isn't testing anything
+        while ((count < 10 && flushed) || (count < 1000 && !flushed)) {
+            String command = "PING " + count + "\r\n";
+            os.write(command.getBytes());
+
+            StringBuilder buf = new StringBuilder();
+            if (!readLineIfAvailable(is, buf)) {
+                flushed = true;
+                os.flush();
+                check(readLineIfAvailable(is, buf));
+            }
+            equal(buf.toString(), command);
+            count++;
+        }
+        check(flushed);
+    }
+
     /** Validate that we need to use flush at least once on a line
      * oriented protocol */
     private static void LineOrientedProtocol() throws Throwable {
@@ -205,33 +246,27 @@
         pis.setPairedOutputStream(pos);
         DeflaterOutputStream dos = new DeflaterOutputStream(pos, true);
 
-        boolean flushed = false;
-        int count = 0;
-
-        // Do at least a certain number of lines, but too many without a
-        // flush means this test isn't testing anything
-        while ((count < 10 && flushed) || (count < 1000 && !flushed)) {
-            String command = "PING " + count + "\r\n";
-            dos.write(command.getBytes());
+        checkLOP(iis, dos);
+    }
 
-            StringBuilder buf = new StringBuilder();
-            if (!readLineIfAvailable(iis, buf)) {
-                flushed = true;
-                dos.flush();
-                check(readLineIfAvailable(iis, buf));
-            }
-            equal(buf.toString(), command);
-            count++;
-        }
-        check(flushed);
+    private static void GZLineOrientedProtocol() throws Throwable {
+        PairedInputStream pis = new PairedInputStream();
+        PairedOutputStream pos = new PairedOutputStream(pis);
+        pis.setPairedOutputStream(pos);
+
+        GZIPOutputStream gos = new GZIPOutputStream(pos, true);
+        gos.flush();  // flush the head out, so gis can read
+        GZIPInputStream gis = new GZIPInputStream(pis);
+
+        checkLOP(gis, gos);
     }
 
     public static void realMain(String[] args) throws Throwable {
         WriteCloseRead();
-
         WriteFlushRead();
-
         LineOrientedProtocol();
+        GZWriteFlushRead();
+        GZLineOrientedProtocol();
     }
 
     //--------------------- Infrastructure ---------------------------
--- a/jdk/test/java/util/zip/InfoZip.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/test/java/util/zip/InfoZip.java	Wed Jul 21 09:57:21 2010 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 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
@@ -103,19 +103,25 @@
         os.close();
 
         ZipFile zf = new ZipFile(f);
-        Enumeration<? extends ZipEntry> entries = zf.entries();
-        ZipEntry ze = entries.nextElement();
-        check(! entries.hasMoreElements());
-        checkZipEntry(ze, contents(zf, ze));
-        zf.close();
+        ZipEntry ze = null;
+        try {
+            Enumeration<? extends ZipEntry> entries = zf.entries();
+            ze = entries.nextElement();
+            check(! entries.hasMoreElements());
+            checkZipEntry(ze, contents(zf, ze));
+        } finally {
+            zf.close();
+        }
 
         ZipInputStream is = new ZipInputStream(new FileInputStream(f));
-        ze = is.getNextEntry();
-        checkZipEntry(ze, contents(is));
-        check(is.getNextEntry() == null);
-
+        try {
+            ze = is.getNextEntry();
+            checkZipEntry(ze, contents(is));
+            check(is.getNextEntry() == null);
+        } finally {
+            is.close();
+        }
         f.delete();
-
         System.out.printf("passed = %d, failed = %d%n", passed, failed);
         if (failed > 0) throw new Exception("Some tests failed");
     }
--- a/jdk/test/java/util/zip/ZipFile/Comment.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/test/java/util/zip/ZipFile/Comment.java	Wed Jul 21 09:57:21 2010 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 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
@@ -58,13 +58,16 @@
         throws IOException
     {
         ZipOutputStream zos = new ZipOutputStream(new FileOutputStream(name));
-        zos.setComment(comment);
-        ZipEntry ze = new ZipEntry(entryName);
-        ze.setMethod(ZipEntry.DEFLATED);
-        zos.putNextEntry(ze);
-        new DataOutputStream(zos).writeUTF(entryContents);
-        zos.closeEntry();
-        zos.close();
+        try {
+            zos.setComment(comment);
+            ZipEntry ze = new ZipEntry(entryName);
+            ze.setMethod(ZipEntry.DEFLATED);
+            zos.putNextEntry(ze);
+            new DataOutputStream(zos).writeUTF(entryContents);
+            zos.closeEntry();
+        } finally {
+            zos.close();
+        }
     }
 
     private static void verifyZipFile(String name, String comment)
@@ -91,6 +94,8 @@
         file.seek(file.length() - comment.length());
         byte [] bytes = new byte [comment.length()];
         file.readFully(bytes);
+        zipFile.close();
+        file.close();
         if (! comment.equals(new String(bytes, "UTF8")))
             throw new Exception("Zip file comment corrupted");
     }
--- a/jdk/test/java/util/zip/ZipFile/CorruptedZipFiles.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/test/java/util/zip/ZipFile/CorruptedZipFiles.java	Wed Jul 21 09:57:21 2010 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 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
@@ -47,13 +47,14 @@
     }
 
     public static void main(String[] args) throws Exception {
-        ZipOutputStream zos = new ZipOutputStream(
-            new FileOutputStream("x.zip"));
-        ZipEntry e = new ZipEntry("x");
-        zos.putNextEntry(e);
-        zos.write((int)'x');
-        zos.close();
-        zos = null;
+        ZipOutputStream zos = new ZipOutputStream(new FileOutputStream("x.zip"));
+        try {
+            ZipEntry e = new ZipEntry("x");
+            zos.putNextEntry(e);
+            zos.write((int)'x');
+        } finally {
+            zos.close();
+        }
 
         int len = (int)(new File("x.zip").length());
         byte[] good = new byte[len];
@@ -153,12 +154,15 @@
             fos.write(data);
             fos.close();
             ZipFile zf = new ZipFile(zipName);
-            if (getInputStream) {
-                InputStream is = zf.getInputStream(new ZipEntry("x"));
-                is.read();
+            try {
+                if (getInputStream) {
+                    InputStream is = zf.getInputStream(new ZipEntry("x"));
+                    is.read();
+                }
+            } finally {
+                zf.close();
             }
             fail("Failed to throw expected ZipException");
-            zf.close();
         } catch (ZipException e) {
             if (e.getMessage().matches(msgPattern))
                 passed++;
--- a/jdk/test/java/util/zip/ZipFile/ManyEntries.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/test/java/util/zip/ZipFile/ManyEntries.java	Wed Jul 21 09:57:21 2010 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 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
@@ -55,52 +55,58 @@
         File zipFile = new File(++uniquifier + ".zip");
         try {
             zipFile.delete();
-            ZipOutputStream zos =
-                new ZipOutputStream(
-                    new BufferedOutputStream(
-                        new FileOutputStream(zipFile)));
-            for (int i = 0; i < N; i++) {
-                ZipEntry e = new ZipEntry("DIR/"+i);
-                e.setMethod(method);
-                e.setTime(time);
-                if (method == ZipEntry.STORED) {
-                    e.setSize(1);
-                    crc32.reset();
-                    crc32.update((byte)i);
-                    e.setCrc(crc32.getValue());
-                } else {
-                    e.setSize(0);
-                    e.setCrc(0);
+            ZipOutputStream zos = new ZipOutputStream(
+                new BufferedOutputStream(
+                    new FileOutputStream(zipFile)));
+            try {
+                for (int i = 0; i < N; i++) {
+                    ZipEntry e = new ZipEntry("DIR/"+i);
+                    e.setMethod(method);
+                    e.setTime(time);
+                    if (method == ZipEntry.STORED) {
+                        e.setSize(1);
+                        crc32.reset();
+                        crc32.update((byte)i);
+                        e.setCrc(crc32.getValue());
+                    } else {
+                        e.setSize(0);
+                        e.setCrc(0);
+                    }
+                    zos.putNextEntry(e);
+                    zos.write(i);
                 }
-                zos.putNextEntry(e);
-                zos.write(i);
+            } finally {
+                zos.close();
+                zos = null;
             }
-            zos.close();
-            zos = null;
 
-            ZipFile zip = new ZipFile(zipFile);
-            if (! (zip.size() == N))
-                throw new Exception("Bad ZipFile size: " + zip.size());
-            Enumeration entries = zip.entries();
+            ZipFile zip = zip = new ZipFile(zipFile);
+            try {
+                if (! (zip.size() == N))
+                    throw new Exception("Bad ZipFile size: " + zip.size());
+                Enumeration entries = zip.entries();
 
-            for (int i = 0; i < N; i++) {
-                if (i % 1000 == 0) {System.gc(); System.runFinalization();}
-                if (! (entries.hasMoreElements()))
-                    throw new Exception("only " + i + " elements");
-                ZipEntry e = (ZipEntry)entries.nextElement();
-                if (! (e.getSize() == 1))
-                    throw new Exception("bad size: " + e.getSize());
-                if (! (e.getName().equals("DIR/" + i)))
-                    throw new Exception("bad name: " + i);
-                if (! (e.getMethod() == method))
-                    throw new Exception("getMethod="+e.getMethod()+", method=" + method);
-                if (! (e.getTime() == time))
-                    throw new Exception("getTime="+e.getTime()+", time=" + time);
-                if (! (zip.getInputStream(e).read() == (i & 0xff)))
-                    throw new Exception("Bad file contents: " + i);
+                for (int i = 0; i < N; i++) {
+                    if (i % 1000 == 0) {System.gc(); System.runFinalization();}
+                    if (! (entries.hasMoreElements()))
+                        throw new Exception("only " + i + " elements");
+                    ZipEntry e = (ZipEntry)entries.nextElement();
+                    if (! (e.getSize() == 1))
+                        throw new Exception("bad size: " + e.getSize());
+                    if (! (e.getName().equals("DIR/" + i)))
+                        throw new Exception("bad name: " + i);
+                    if (! (e.getMethod() == method))
+                        throw new Exception("getMethod="+e.getMethod()+", method=" + method);
+                    if (! (e.getTime() == time))
+                        throw new Exception("getTime="+e.getTime()+", time=" + time);
+                    if (! (zip.getInputStream(e).read() == (i & 0xff)))
+                        throw new Exception("Bad file contents: " + i);
+                }
+                if (entries.hasMoreElements())
+                    throw new Exception("too many elements");
+            } finally {
+                zip.close();
             }
-            if (entries.hasMoreElements())
-                throw new Exception("too many elements");
         }
         finally {
             zipFile.delete();
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/javax/swing/AbstractButton/6711682/bug6711682.java	Wed Jul 21 09:57:21 2010 -0700
@@ -0,0 +1,151 @@
+/*
+ * 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 6711682
+   @summary  JCheckBox in JTable: checkbox doesn't alaways respond to the first mouse click
+   @author Alexander Potochkin
+   @run main bug6711682
+*/
+
+import sun.awt.SunToolkit;
+
+import javax.swing.*;
+import javax.swing.event.CellEditorListener;
+import javax.swing.table.TableCellEditor;
+import javax.swing.table.TableCellRenderer;
+import java.awt.*;
+import java.awt.event.InputEvent;
+import java.awt.event.KeyEvent;
+import java.util.EventObject;
+
+public class bug6711682 {
+    private static JCheckBox editorCb;
+    private static JCheckBox rendererCb;
+    private static JTable table;
+
+    public static void main(String[] args) throws Exception {
+        Robot robot = new Robot();
+        robot.setAutoDelay(50);
+        SunToolkit toolkit = (SunToolkit) Toolkit.getDefaultToolkit();
+        SwingUtilities.invokeAndWait(new Runnable() {
+            public void run() {
+                createAndShowGUI();
+            }
+        });
+        toolkit.realSync();
+        Point l = table.getLocationOnScreen();
+        int h = table.getRowHeight();
+        for (int i = 0; i < 3; i++) {
+            robot.mouseMove(l.x + 5, l.y + 5 + i * h);
+            robot.mousePress(InputEvent.BUTTON1_MASK);
+            robot.mouseRelease(InputEvent.BUTTON1_MASK);
+        }
+        // Without pressing F2 the last table's cell
+        // reported <code>false</code> value
+        // note that I can't press it inside the for loop
+        // because it doesn't reproduce the bug
+        robot.keyPress(KeyEvent.VK_F2);
+        robot.keyRelease(KeyEvent.VK_F2);
+
+        for (int i = 0; i < 3; i++) {
+            if (!Boolean.TRUE.equals(table.getValueAt(i, 0))) {
+                throw new RuntimeException("Row #" + i + " checkbox is not selected");
+            }
+        }
+        for (int i = 2; i >= 0; i--) {
+            robot.mouseMove(l.x + 5, l.y + 5 + i * h);
+            robot.mousePress(InputEvent.BUTTON1_MASK);
+            robot.mouseRelease(InputEvent.BUTTON1_MASK);
+        }
+        robot.keyPress(KeyEvent.VK_F2);
+        robot.keyRelease(KeyEvent.VK_F2);
+        for (int i = 0; i < 3; i++) {
+            if (Boolean.TRUE.equals(table.getValueAt(i, 0))) {
+                throw new RuntimeException("Row #" + i + " checkbox is selected");
+            }
+        }
+    }
+
+    private static void createAndShowGUI() {
+        editorCb = new JCheckBox();
+        rendererCb = new JCheckBox();
+        JFrame f = new JFrame("Table with CheckBox");
+        Container p = f.getContentPane();
+        p.setLayout(new BorderLayout());
+        table = new JTable(new Object[][]{{false}, {false}, {false}}, new Object[]{"CheckBox"});
+        TableCellEditor editor = new TableCellEditor() {
+            int editedRow;
+
+            public Component getTableCellEditorComponent(JTable table,
+                                                         Object value, boolean isSelected, int row, int column) {
+                this.editedRow = row;
+                editorCb.setSelected(Boolean.TRUE.equals(value));
+                editorCb.setBackground(UIManager.getColor("Table.selectionBackground"));
+                return editorCb;
+            }
+
+            public void addCellEditorListener(CellEditorListener l) {
+            }
+
+            public void cancelCellEditing() {
+            }
+
+            public Object getCellEditorValue() {
+                return editorCb.isSelected();
+            }
+
+            public boolean isCellEditable(EventObject anEvent) {
+                return true;
+            }
+
+            public void removeCellEditorListener(CellEditorListener l) {
+            }
+
+            public boolean shouldSelectCell(EventObject anEvent) {
+                return true;
+            }
+
+            public boolean stopCellEditing() {
+                table.getModel().setValueAt(editorCb.isSelected(), editedRow, 0);
+                return true;
+            }
+        };
+        table.getColumnModel().getColumn(0).setCellEditor(editor);
+
+        TableCellRenderer renderer = new TableCellRenderer() {
+            public Component getTableCellRendererComponent(JTable table,
+                                                           Object value, boolean isSelected, boolean hasFocus,
+                                                           int row, int column) {
+                rendererCb.setSelected(Boolean.TRUE.equals(value));
+                return rendererCb;
+            }
+        };
+        table.getColumnModel().getColumn(0).setCellRenderer(renderer);
+
+        p.add(table, BorderLayout.CENTER);
+
+        f.pack();
+        f.setVisible(true);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/javax/swing/JFileChooser/6520101/bug6520101.java	Wed Jul 21 09:57:21 2010 -0700
@@ -0,0 +1,104 @@
+/*
+ * 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 @(#)bug6520101
+ * @bug 6520101
+ * @summary JFileChooser throws OOM in 1.4.2, 5.0u4 and 1.6.0
+ * @author Praveen Gupta
+ * @run main/othervm/timeout=600 -Xmx8m -verify bug6520101
+*/
+
+import javax.swing.*;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+
+public class bug6520101 implements Runnable {
+
+    private static final int ATTEMPTS = 500;
+    private static final int INTERVAL = 100;
+
+    private static final boolean ALWAYS_NEW_INSTANCE = false;
+    private static final boolean DO_GC_EACH_INTERVAL = false;
+    private static final boolean UPDATE_UI_EACH_INTERVAL = true;
+    private static final boolean AUTO_CLOSE_DIALOG = true;
+
+    private static JFileChooser CHOOSER;
+
+    public static void main(String[] args) throws Exception {
+        UIManager.setLookAndFeel("com.sun.java.swing.plaf.motif.MotifLookAndFeel");
+
+        for (int i = 0; i < ATTEMPTS; i++) {
+            doAttempt();
+        }
+
+        System.out.println("Test passed successfully");
+    }
+
+    private static void doAttempt() throws InterruptedException {
+        if (ALWAYS_NEW_INSTANCE || (CHOOSER == null))
+            CHOOSER = new JFileChooser(".");
+
+        if (UPDATE_UI_EACH_INTERVAL) {
+            CHOOSER.updateUI();
+        }
+
+        if (AUTO_CLOSE_DIALOG) {
+            Thread t = new Thread(new bug6520101(CHOOSER));
+            t.start();
+            CHOOSER.showOpenDialog(null);
+            t.join();
+        } else {
+            CHOOSER.showOpenDialog(null);
+        }
+
+        if (DO_GC_EACH_INTERVAL) {
+            System.gc();
+        }
+    }
+
+    private final JFileChooser chooser;
+
+    bug6520101(JFileChooser chooser) {
+        this.chooser = chooser;
+    }
+
+    public void run() {
+        while (!this.chooser.isShowing()) {
+            try {
+                Thread.sleep(30);
+            } catch (InterruptedException exception) {
+                exception.printStackTrace();
+            }
+        }
+
+        Timer timer = new Timer(INTERVAL, new ActionListener() {
+            public void actionPerformed(ActionEvent e) {
+                chooser.cancelSelection();
+            }
+        });
+
+        timer.setRepeats(false);
+        timer.start();
+    }
+}
--- a/jdk/test/javax/swing/JInternalFrame/6725409/bug6725409.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/test/javax/swing/JInternalFrame/6725409/bug6725409.java	Wed Jul 21 09:57:21 2010 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2008, Oracle and/or its affiliates. All rights reserved.
+ * 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
@@ -43,7 +43,7 @@
                     new com.sun.java.swing.plaf.windows.WindowsClassicLookAndFeel());
         } catch(UnsupportedLookAndFeelException e) {
             System.out.println("The test is for Windows LaF only");
-            System.exit(0);
+            return;
         }
 
         final bug6725409 bug6725409 = new bug6725409();
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/javax/swing/JPopupMenu/6495920/bug6495920.java	Wed Jul 21 09:57:21 2010 -0700
@@ -0,0 +1,112 @@
+/*
+ * 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 6495920
+ * @summary Tests that if the JPopupMenu.setVisible method throws an exception,
+            interaction with GNOME is not crippled
+ * @author Sergey Malenkov
+ * @library ../..
+ */
+
+import sun.awt.AppContext;
+
+import java.awt.Point;
+import java.awt.Robot;
+import java.awt.event.InputEvent;
+import java.lang.reflect.Field;
+import javax.swing.JFrame;
+import javax.swing.JMenuItem;
+import javax.swing.JPanel;
+import javax.swing.JPopupMenu;
+import javax.swing.SwingUtilities;
+import javax.swing.plaf.basic.BasicPopupMenuUI;
+
+public class bug6495920 implements Thread.UncaughtExceptionHandler {
+
+    public static void main(String[] args) throws Throwable {
+        SwingTest.start(bug6495920.class);
+    }
+
+    private static Robot robot;
+    private final JPanel panel;
+
+    public bug6495920(JFrame frame) {
+        JPopupMenu menu = new JPopupMenu() {
+            public void setVisible(boolean visible) {
+                super.setVisible(visible);
+                throw new AssertionError(visible ? "show popup" : "hide popup");
+            }
+        };
+        for (int i = 0; i < 10; i++) {
+            menu.add(new JMenuItem(String.valueOf(i)));
+        }
+        this.panel = new JPanel();
+        this.panel.setComponentPopupMenu(menu);
+        frame.add(this.panel);
+    }
+
+    public void firstShowPopup() throws Exception {
+        Point point = this.panel.getLocation();
+        SwingUtilities.convertPointToScreen(point, this.panel);
+
+        robot = new Robot(); // initialize shared static field first time
+        robot.mouseMove(point.x + 1, point.y + 1);
+        robot.mousePress(InputEvent.BUTTON3_MASK);
+        Thread.currentThread().setUncaughtExceptionHandler(this);
+        robot.mouseRelease(InputEvent.BUTTON3_MASK); // causes first AssertionError on EDT
+    }
+
+    public void secondHidePopup() {
+        Point point = this.panel.getLocation();
+        SwingUtilities.convertPointToScreen(point, this.panel);
+
+        robot.mouseMove(point.x - 1, point.y - 1);
+        Thread.currentThread().setUncaughtExceptionHandler(this);
+        robot.mousePress(InputEvent.BUTTON1_MASK); // causes second AssertionError on EDT
+        robot.mouseRelease(InputEvent.BUTTON1_MASK);
+    }
+
+    public void thirdValidate() throws Exception {
+        Field key = BasicPopupMenuUI.class.getDeclaredField("MOUSE_GRABBER_KEY");
+        key.setAccessible(true);
+
+        Object grabber = AppContext.getAppContext().get(key.get(null));
+        if (grabber == null) {
+            throw new Exception("cannot find a mouse grabber in app's context");
+        }
+
+        Field field = grabber.getClass().getDeclaredField("grabbedWindow");
+        field.setAccessible(true);
+
+        Object window = field.get(grabber);
+        if (window != null) {
+            throw new Exception("interaction with GNOME is crippled");
+        }
+    }
+
+    public void uncaughtException(Thread thread, Throwable throwable) {
+        System.out.println(throwable);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/javax/swing/JTabbedPane/6670274/bug6670274.java	Wed Jul 21 09:57:21 2010 -0700
@@ -0,0 +1,98 @@
+/*
+ * Copyright 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.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along 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.
+ */
+
+/*@test
+  @bug 6670274
+  @summary Incorrect tab titles for JTabbedPane if using HTML (BasicTabbedPanelUI problem)
+  @author Alexander Potochkin
+  @run main bug6670274
+*/
+
+import javax.swing.*;
+import javax.swing.plaf.basic.BasicTabbedPaneUI;
+import javax.swing.text.View;
+
+public class bug6670274 {
+
+    private static void createGui() {
+        final JTabbedPane pane = new JTabbedPane();
+        TestTabbedPaneUI ui = new TestTabbedPaneUI();
+        pane.setUI(ui);
+
+        pane.add("one", new JPanel());
+        pane.add("<html><i>Two</i></html>", new JPanel());
+        pane.add("three", new JPanel());
+        pane.setTitleAt(0, "<html><i>ONE</i></html>");
+        check(ui, 0, 1);
+
+        pane.setTitleAt(1, "hello");
+        check(ui, 0);
+
+        pane.setTitleAt(0, "<html>html</html>");
+        pane.setTitleAt(2, "<html>html</html>");
+        check(ui, 0, 2);
+    }
+
+    private static void check(TestTabbedPaneUI ui, int... indices) {
+        for(int i = 0; i < ui.getTabbedPane().getTabCount(); i++) {
+            System.out.print("Checking tab #" + i);
+            View view = ui.getTextViewForTab(i);
+            boolean found = false;
+            for (int j = 0; j < indices.length; j++) {
+                if (indices[j]== i) {
+                    found = true;
+                    break;
+                }
+            }
+            System.out.print("; view = " + view);
+            if (found) {
+                if (view == null) {
+                    throw new RuntimeException("View is unexpectedly null");
+                }
+            } else if (view != null) {
+                throw new RuntimeException("View is unexpectedly not null");
+            }
+            System.out.println(" ok");
+        }
+        System.out.println("");
+    }
+
+
+    static class TestTabbedPaneUI extends BasicTabbedPaneUI {
+        public View getTextViewForTab(int tabIndex) {
+            return super.getTextViewForTab(tabIndex);
+        }
+
+        public JTabbedPane getTabbedPane() {
+            return tabPane;
+        }
+    }
+
+    public static void main(String[] args) throws Exception {
+        SwingUtilities.invokeAndWait(new Runnable() {
+            public void run() {
+                bug6670274.createGui();
+            }
+        });
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/javax/swing/JTable/6768387/bug6768387.java	Wed Jul 21 09:57:21 2010 -0700
@@ -0,0 +1,59 @@
+/*
+ * Copyright 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.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along 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.
+ */
+
+/* @test
+   @bug 6768387
+   @summary REGRESSION: JTable no longer serializable
+   @author Alexander Potochkin
+   @run main bug6768387
+*/
+
+import javax.swing.*;
+import javax.swing.table.AbstractTableModel;
+import java.io.*;
+
+public class bug6768387 {
+
+    private static void createGui() {
+        JTable table = new JTable();
+        OutputStream os;
+        ObjectOutputStream out;
+        try {
+            os = new ByteArrayOutputStream();
+            out = new ObjectOutputStream(os);
+            out.writeObject(table);
+            out.close();
+        }
+        catch (Exception ex) {
+            throw new RuntimeException(ex);
+        }
+    }
+
+    public static void main(String[] args) throws Exception {
+        SwingUtilities.invokeAndWait(new Runnable() {
+            public void run() {
+                bug6768387.createGui();
+            }
+        });
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/javax/swing/JTable/6777378/bug6777378.java	Wed Jul 21 09:57:21 2010 -0700
@@ -0,0 +1,88 @@
+/*
+ * 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 6777378
+   @summary NullPointerException in XPDefaultRenderer.paint()
+   @author Alexander Potochkin
+   @run main bug6777378
+*/
+
+import sun.awt.SunToolkit;
+
+import javax.swing.*;
+import javax.swing.table.AbstractTableModel;
+import javax.swing.table.JTableHeader;
+import javax.swing.plaf.metal.MetalLookAndFeel;
+import java.awt.event.MouseEvent;
+import java.awt.event.InputEvent;
+import java.awt.*;
+
+public class bug6777378 {
+    private static JFrame frame;
+    private static JTableHeader header;
+
+    public static void main(String[] args) throws Exception {
+        SunToolkit toolkit = (SunToolkit) Toolkit.getDefaultToolkit();
+        Robot robot = new Robot();
+        robot.setAutoDelay(20);
+        SwingUtilities.invokeAndWait(new Runnable() {
+            public void run() {
+                try {
+                    UIManager.setLookAndFeel(new MetalLookAndFeel());
+                } catch (Exception e) {
+                    e.printStackTrace();
+                }
+                JTable table = new JTable(new AbstractTableModel() {
+                    public int getRowCount() {
+                        return 10;
+                    }
+
+                    public int getColumnCount() {
+                        return 10;
+                    }
+
+                    public Object getValueAt(int rowIndex, int columnIndex) {
+                        return "" + rowIndex + " " + columnIndex;
+                    }
+                });
+
+                header = new JTableHeader(table.getColumnModel());
+                header.setToolTipText("hello");
+
+                frame = new JFrame();
+                frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
+                frame.add(header);
+
+                frame.setSize(300, 300);
+                frame.setVisible(true);
+            }
+        });
+        toolkit.realSync();
+        Point point = header.getLocationOnScreen();
+        robot.mouseMove(point.x + 20, point.y + 50);
+        robot.mouseMove(point.x + 30, point.y + 50);
+        robot.mousePress(InputEvent.BUTTON1_MASK);
+        robot.mouseRelease(InputEvent.BUTTON1_MASK);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/javax/swing/JTable/6788484/bug6788484.java	Wed Jul 21 09:57:21 2010 -0700
@@ -0,0 +1,39 @@
+/*
+ * Copyright 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.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along 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.
+ */
+
+/* @test
+   @bug 6788484
+   @summary NPE in DefaultTableCellHeaderRenderer.getColumnSortOrder() with null table
+   @author Alexander Potochkin
+   @run main bug6788484
+*/
+import sun.swing.table.DefaultTableCellHeaderRenderer;
+
+import javax.swing.*;
+
+public class bug6788484 {
+
+    public static void main(String[] args) throws Exception {
+        DefaultTableCellHeaderRenderer.getColumnSortOrder(null, 0);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/javax/swing/JTable/6937798/bug6937798.java	Wed Jul 21 09:57:21 2010 -0700
@@ -0,0 +1,164 @@
+/*
+ * Copyright 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.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along 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.
+ */
+
+/* @test
+   @bug 6937798
+   @summary Nimbus: Issues with JTable grid
+   @author Alexander Potochkin
+   @run main bug6937798
+*/
+
+import com.sun.java.swing.plaf.nimbus.NimbusLookAndFeel;
+
+import javax.swing.*;
+import javax.swing.table.AbstractTableModel;
+import javax.swing.table.TableModel;
+import java.awt.*;
+import java.awt.image.BufferedImage;
+
+public class bug6937798 {
+
+    public static void main(String... args) throws Exception {
+        UIManager.setLookAndFeel(new NimbusLookAndFeel());
+        SwingUtilities.invokeAndWait(new Runnable() {
+            public void run() {
+                new bug6937798();
+            }
+        });
+    }
+
+    public bug6937798() {
+        final JTable table = createCountryTable();
+        table.setShowGrid(true);
+        table.setSize(100, 100);
+
+        BufferedImage im = new BufferedImage(table.getWidth(), table.getHeight(), BufferedImage.TYPE_INT_ARGB);
+        Graphics g = im.getGraphics();
+        table.print(g);
+        g.dispose();
+
+        for (int i = 0; i < im.getHeight(); i++) {
+            for (int j = 0; j < im.getWidth(); j++) {
+                if (im.getRGB(i, j) == table.getGridColor().getRGB()) {
+                    System.out.println("got it!");
+                    return;
+                }
+            }
+        }
+        throw new RuntimeException("no table's grid detected....");
+    }
+
+    protected JTable createCountryTable() {
+        // Column headers
+        final String
+                [] headers = {
+                "Name", "Capital City", "Language(s)", "Monetary Unit(s)", "EC Member"
+        };
+
+        // Table data
+        final Object[][] data = {
+                {"Albania", "Tirane", "Albanian, Greek", "Lek", new Boolean(false)},
+                {"Andorra", "Andorra la Vella", "Catalan, French, Spanish", "French Franc, Spanish Peseta", new Boolean(false)},
+                {"Austria", "Vienna", "German, Slovenian, Croatian", "Schilling", new Boolean(false)},
+                {"Belarus", "Minsk", "Byelorussian, Russian", "Belarusian Rubel", new Boolean(false)},
+                {"Belgium", "Brussels", "French, Flemish, German", "Belgian Franc", new Boolean(true)},
+                {"Bosnia & Herzegovina", "Sarajevo", "Serbo-Croatian", "Dinar", new Boolean(false)},
+                {"Bulgaria", "Sofia", "Bulgarian, Turkish", "Lev", new Boolean(false)},
+                {"Croatia", "Zagreb", "Serbo-Croatian", "Croatian Kuna", new Boolean(false)},
+                {"Czech Republic", "Prague", "Czech, Slovak", "Koruna", new Boolean(false)},
+                {"Denmark", "Copenhagen", "Danish", "Krone", new Boolean(true)},
+                {"Estonia", "Tallinn", "Estonian, Latvian, Lithuanian, Russian", "Estonian Kroon", new Boolean(false)},
+                {"Finland", "Helsinki", "Finnish, Swedish, Lappish", "Markka", new Boolean(false)},
+                {"France", "Paris", "French", "Franc", new Boolean(true)},
+                {"Germany", "Berlin", "German", "Deutsche Mark", new Boolean(true)},
+                {"Greece", "Athens", "Greek, English, French", "Drachma", new Boolean(true)},
+                {"Hungary", "Budapest", "Hungarian", "Forint", new Boolean(false)},
+                {"Iceland", "Reykjavik", "Icelandic", "Icelandic Krona", new Boolean(false)},
+                {"Ireland", "Dublin", "Irish, English", "Pound", new Boolean(true)},
+                {"Italy", "Rome", "Italian", "Lira", new Boolean(true)},
+                {"Latvia", "Riga", "Lettish, Lithuanian, Russian", "Lat", new Boolean(false)},
+                {"Liechtenstein", "Vaduz", "German", "Swiss Franc", new Boolean(false)},
+                {"Lithuania", "Vilnius", "Lithuanian, Polish, Russian", "Lita", new Boolean(false)},
+                {"Luxembourg", "Luxembourg", "French, German, Letzeburgesch", "Luxembourg Franc", new Boolean(true)},
+                {"Macedonia", "Skopje", "Macedonian, Albanian, Turkish, Serbo-Croatian", "Denar", new Boolean(false)},
+                {"Malta", "Valletta", "Maltese, English", "Maltese Lira", new Boolean(false)},
+                {"Moldova", "Chisinau", "Moldovan, Russian", "Leu", new Boolean(false)},
+                {"Monaco", "Monaco", "French, English, Italian", "French Franc", new Boolean(false)},
+                {"the Netherlands", "Amsterdam", "Dutch", "Guilder", new Boolean(true)},
+                {"Norway", "Oslo", "Norwegian", "Krone", new Boolean(false)},
+                {"Poland", "Warsaw", "Polish", "Zloty", new Boolean(false)},
+                {"Portugal", "Lisbon", "Portuguese", "Escudo", new Boolean(true)},
+                {"Romania", "Bucharest", "Romanian", "Leu", new Boolean(false)},
+                {"Russia", "Moscow", "Russian", "Ruble", new Boolean(false)},
+                {"San Marino", "San Marino", "Italian", "Italian Lira", new Boolean(false)},
+                {"Slovakia", "Bratislava", "Slovak, Hungarian", "Koruna", new Boolean(false)},
+                {"Slovenia", "Ljubljana", "Slovenian, Serbo-Croatian", "Tolar", new Boolean(false)},
+                {"Spain", "Madrid", "Spanish", "Peseta", new Boolean(true)},
+                {"Sweden", "Stockholm", "Swedish", "Krona", new Boolean(false)},
+                {"Switzerland", "Bern", "German, French, Italian", "Swiss Franc", new Boolean(false)},
+                {"Turkey", "Ankara", "Turkish", "Turkish Lira", new Boolean(false)},
+                {"Ukraine", "Kiev", "Ukranian, Russian, Romanian, Polish, Hungarian", "Hryvnia", new Boolean(false)},
+                {"United Kingdom", "London", "English, Welsh", "British Pound", new Boolean(true)},
+                {"Yugoslavia", "Belgrade", "Serbo-Croatian, Slovenian, Macedonian", "Dinar", new Boolean(false)},
+        };
+
+        // Table model
+        TableModel dataModel = new AbstractTableModel() {
+
+            public int getColumnCount() {
+                return headers.length;
+            }
+
+            public int getRowCount() {
+                return data.length;
+            }
+
+            public Object getValueAt(int row, int col) {
+                return data[row][col];
+            }
+
+            public String getColumnName(int column) {
+                return headers[column];
+            }
+
+            public Class getColumnClass(int col) {
+                return getValueAt(0, col).getClass();
+            }
+
+            public void setValueAt(Object aValue, int row, int column) {
+                data[row][column] = aValue;
+            }
+
+            public boolean isCellEditable(int row, int col) {
+                return (col == 4);
+            }
+        };
+
+        // Create table with table model
+        JTable countryTable = new JTable(dataModel);
+        countryTable.setGridColor(Color.pink);
+        countryTable.setBackground(Color.white);
+        countryTable.setForeground(Color.black);
+        return countryTable;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/javax/swing/JTableHeader/6884066/bug6884066.java	Wed Jul 21 09:57:21 2010 -0700
@@ -0,0 +1,89 @@
+/*
+ * Copyright 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.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along 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.
+ */
+
+/* @test
+   @bug 6884066
+   @summary JTableHeader listens mouse in disabled state and doesn't work when not attached to a table
+   @author Alexander Potochkin
+   @run main bug6884066
+*/
+
+import sun.awt.SunToolkit;
+
+import javax.swing.*;
+import javax.swing.table.JTableHeader;
+import javax.swing.table.TableColumnModel;
+import javax.swing.table.TableColumn;
+import java.awt.*;
+import java.awt.event.InputEvent;
+
+import com.sun.java.swing.plaf.windows.WindowsLookAndFeel;
+
+public class bug6884066 {
+    private static JTableHeader header;
+
+    public static void main(String[] args) throws Exception {
+
+        UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
+
+        SunToolkit toolkit = (SunToolkit) Toolkit.getDefaultToolkit();
+        Robot robot = new Robot();
+        robot.setAutoDelay(20);
+        SwingUtilities.invokeAndWait(new Runnable() {
+            public void run() {
+                // just to quickly grab a column model
+                JTable table = new JTable(10, 5);
+                header = new JTableHeader(table.getColumnModel());
+                checkColumn(0, "A");
+                JFrame frame = new JFrame("standalone header");
+                frame.add(header);
+                frame.pack();
+                frame.setVisible(true);
+                frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
+            }
+        });
+        toolkit.realSync();
+        Point point = header.getLocationOnScreen();
+        robot.mouseMove(point.x + 3, point.y + 3);
+        robot.mousePress(InputEvent.BUTTON1_MASK);
+        for (int i = 0; i < header.getWidth() - 3; i++) {
+            robot.mouseMove(point.x + i, point.y + 3);
+        }
+        robot.mouseRelease(InputEvent.BUTTON1_MASK);
+        SwingUtilities.invokeAndWait(new Runnable() {
+            public void run() {
+                TableColumnModel model = header.getColumnModel();
+                checkColumn(model.getColumnCount() - 1, "A");
+            }
+        });
+    }
+
+    private static void checkColumn(int index, String str) {
+        TableColumnModel model = header.getColumnModel();
+        Object value = model.getColumn(index).getHeaderValue();
+        if (!str.equals(value)) {
+            throw new RuntimeException("Unexpected header's value; " +
+                    "index = " + index + " value = " + value);
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/javax/swing/JTableHeader/6889007/bug6889007.java	Wed Jul 21 09:57:21 2010 -0700
@@ -0,0 +1,99 @@
+/*
+ * Copyright 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.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along 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.
+ */
+
+/* @test
+   @bug 6889007
+   @summary No resize cursor during hovering mouse over JTable
+   @author Alexander Potochkin
+*/
+
+import sun.awt.SunToolkit;
+
+import javax.swing.*;
+import javax.swing.plaf.basic.BasicTableHeaderUI;
+import javax.swing.table.JTableHeader;
+import java.awt.*;
+
+public class bug6889007 {
+
+    public static void main(String[] args) throws Exception {
+        SunToolkit toolkit = (SunToolkit) Toolkit.getDefaultToolkit();
+        Robot robot = new Robot();
+        robot.setAutoDelay(20);
+
+        final JFrame frame = new JFrame();
+        frame.setUndecorated(true);
+
+        SwingUtilities.invokeAndWait(new Runnable() {
+            public void run() {
+                frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
+
+                JTableHeader th = new JTableHeader();
+                th.setColumnModel(new JTable(20, 5).getColumnModel());
+
+                th.setUI(new MyTableHeaderUI());
+
+                frame.add(th);
+                frame.pack();
+                frame.setLocationRelativeTo(null);
+                frame.setVisible(true);
+            }
+        });
+        toolkit.realSync();
+        Point point = frame.getLocationOnScreen();
+        int shift = 10;
+        int x = point.x;
+        int y = point.y + frame.getHeight()/2;
+        for(int i = -shift; i < frame.getWidth() + 2*shift; i++) {
+            robot.mouseMove(x++, y);
+        }
+        toolkit.realSync();
+        // 9 is a magic test number
+        if (MyTableHeaderUI.getTestValue() != 9) {
+            throw new RuntimeException("Unexpected test number "
+                    + MyTableHeaderUI.getTestValue());
+        }
+        System.out.println("ok");
+    }
+
+    static class MyTableHeaderUI extends BasicTableHeaderUI {
+        private static int testValue;
+
+        protected void rolloverColumnUpdated(int oldColumn, int newColumn) {
+            increaseTestValue(newColumn);
+            Cursor cursor = Cursor.getPredefinedCursor(Cursor.E_RESIZE_CURSOR);
+            if (oldColumn != -1 && newColumn != -1 &&
+                    header.getCursor() != cursor) {
+                throw new RuntimeException("Wrong type of cursor!");
+            }
+        }
+
+        private static synchronized void increaseTestValue(int increment) {
+            testValue += increment;
+        }
+
+        public static synchronized int getTestValue() {
+            return testValue;
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/javax/swing/JTextArea/6925473/bug6925473.java	Wed Jul 21 09:57:21 2010 -0700
@@ -0,0 +1,64 @@
+/*
+ * Copyright 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.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along 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.
+ */
+
+/* @test
+ * @bug 6925473
+ * @summary REGRESSION: JOptionPane in dialog is full-screen height
+ * @author Pavel Porvatov
+ * @run main bug6925473
+ */
+
+import javax.swing.*;
+import java.awt.*;
+
+public class bug6925473 {
+    private static final String LONG_TEXT = "Copyright 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. ";
+
+    public static void main(String[] args) throws Exception {
+        SwingUtilities.invokeAndWait(new Runnable() {
+            public void run() {
+                JTextArea textArea = new JTextArea(LONG_TEXT);
+
+                Dimension preferredSize = textArea.getPreferredSize();
+
+                if (preferredSize.width <= 0 || preferredSize.height <= 0) {
+                    throw new RuntimeException("Invalid preferred size " + preferredSize);
+                }
+
+                JTextArea textAreaLW = new JTextArea(LONG_TEXT);
+
+                textAreaLW.setLineWrap(true);
+
+                Dimension preferredSizeLW = textAreaLW.getPreferredSize();
+
+                if (preferredSizeLW.width <= 0 || preferredSizeLW.height <= 0) {
+                    throw new RuntimeException("Invalid preferred size " + preferredSizeLW);
+                }
+            }
+        });
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/javax/swing/JTextArea/6940863/bug6940863.java	Wed Jul 21 09:57:21 2010 -0700
@@ -0,0 +1,87 @@
+/*
+ * Copyright 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.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along 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.
+ */
+
+/* @test
+ * @bug 6940863
+ * @summary Textarea within scrollpane shows vertical scrollbar
+ * @author Pavel Porvatov
+ * @run main bug6940863
+ */
+
+import sun.awt.OSInfo;
+
+import javax.swing.*;
+import java.awt.*;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+
+public class bug6940863 {
+    private static JFrame frame;
+
+    private static JScrollPane scrollPane;
+
+    private static final Timer timer = new Timer(1000, new ActionListener() {
+        public void actionPerformed(ActionEvent e) {
+            boolean failed = scrollPane.getVerticalScrollBar().isShowing() ||
+                    scrollPane.getHorizontalScrollBar().isShowing();
+
+            frame.dispose();
+
+            if (failed) {
+                throw new RuntimeException("The test failed");
+            }
+        }
+    });
+
+    public static void main(String[] args) throws Exception {
+        if (OSInfo.getOSType() != OSInfo.OSType.WINDOWS) {
+            System.out.println("The test is suitable only for Windows OS. Skipped");
+        }
+
+        UIManager.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsLookAndFeel");
+
+        SwingUtilities.invokeAndWait(new Runnable() {
+            public void run() {
+                JTextArea textArea = new JTextArea();
+
+                textArea.setLineWrap(true);
+                textArea.setWrapStyleWord(true);
+
+                scrollPane = new JScrollPane(textArea);
+
+                scrollPane.setMinimumSize(new Dimension(200, 100));
+                scrollPane.setPreferredSize(new Dimension(300, 150));
+
+                frame = new JFrame("Vertical scrollbar shown without text");
+
+                frame.setContentPane(scrollPane);
+                frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
+                frame.pack();
+                frame.setVisible(true);
+
+                timer.setRepeats(false);
+                timer.start();
+            }
+        });
+    }
+}
--- a/jdk/test/javax/swing/JTextArea/Test6593649.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/test/javax/swing/JTextArea/Test6593649.java	Wed Jul 21 09:57:21 2010 -0700
@@ -30,60 +30,50 @@
 
 import javax.swing.*;
 import java.awt.*;
-
-public class Test6593649 extends JFrame {
-  static JTextArea txt;
-  static JPanel innerPanel;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
 
-  public Test6593649(Dimension d)
-  {
-    super("Word Wrap Testcase");
+public class Test6593649 {
+    private static JFrame frame;
 
-    setSize(d);
+    private static JTextArea textArea;
 
-    final Container contentPane = getContentPane();
+    private static final Timer timer = new Timer(1000, new ActionListener() {
+        public void actionPerformed(ActionEvent e) {
+            boolean failed = !textArea.getParent().getSize().equals(textArea.getSize());
 
-    innerPanel = new JPanel();
-    innerPanel.setLayout(new BoxLayout(innerPanel, BoxLayout.LINE_AXIS));
+            frame.dispose();
 
-    txt = new JTextArea("This is a long line that should wrap, but doesn't...");
-    txt.setLineWrap(true);
-    txt.setWrapStyleWord(true);
-
-    innerPanel.add(txt);
-
-    contentPane.add(innerPanel, BorderLayout.SOUTH);
-  }
+            if (failed) {
+                throw new RuntimeException("The test failed");
+            }
+        }
+    });
 
-  public static void main(String[] args) throws InterruptedException
-  {
-    int size = 100;
-    Dimension d;
-    Test6593649 cp;
-    Dimension txtSize;
-    Dimension innerSize;
-    Dimension cpSize;
+    public static void main(String[] args) throws Exception {
+        SwingUtilities.invokeAndWait(new Runnable() {
+            public void run() {
+                frame = new JFrame();
+
+                frame.setSize(200, 100);
 
-    while (size <= 600)
-    {
-      d = new Dimension(size, size);
-      cp = new Test6593649(d);
-      cp.setVisible(true);
+                textArea = new JTextArea("This is a long line that should wrap, but doesn't...");
+
+                textArea.setLineWrap(true);
+                textArea.setWrapStyleWord(true);
+
+                JPanel innerPanel = new JPanel();
 
-      txtSize = txt.getPreferredSize();
-      innerSize = innerPanel.getPreferredSize();
-      cpSize = cp.getSize();
+                innerPanel.setLayout(new BoxLayout(innerPanel, BoxLayout.LINE_AXIS));
+                innerPanel.add(textArea);
+
+                frame.getContentPane().add(innerPanel, BorderLayout.SOUTH);
+
+                frame.setVisible(true);
 
-      if (!(txtSize.getWidth() == innerPanel.getWidth() && txtSize.getHeight() == innerPanel.getHeight() &&
-           txtSize.getWidth() <= cpSize.getWidth() && txtSize.getHeight() <= cpSize.getHeight()))
-      {
-        throw new RuntimeException("Test failed: Text area size does not properly match panel and frame sizes");
-      }
-
-      Thread.sleep(2000);
-
-      cp.hide();
-      size += 50;
+                timer.setRepeats(false);
+                timer.start();
+            }
+        });
     }
-  }
 }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/javax/swing/JViewport/6953396/bug6953396.java	Wed Jul 21 09:57:21 2010 -0700
@@ -0,0 +1,64 @@
+/*
+ * Copyright 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.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along 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.
+ */
+
+/* @test
+ * @bug 6953396
+ * @summary javax.swing.plaf.basic.BasicViewportUI.uninstallDefaults() is not called when UI is uninstalled
+ * @author Alexander Potochkin
+ */
+
+import javax.swing.*;
+import javax.swing.plaf.basic.BasicViewportUI;
+
+public class bug6953396 {
+    static volatile boolean flag;
+
+    public static void main(String[] args) throws Exception {
+        SwingUtilities.invokeAndWait(new Runnable() {
+            @Override
+            public void run() {
+                BasicViewportUI ui = new BasicViewportUI() {
+
+                    @Override
+                    protected void installDefaults(JComponent c) {
+                        super.installDefaults(c);
+                        flag = true;
+                    }
+
+                    @Override
+                    protected void uninstallDefaults(JComponent c) {
+                        super.uninstallDefaults(c);
+                        flag = false;
+                    }
+                };
+
+                JViewport viewport = new JViewport();
+                viewport.setUI(ui);
+                viewport.setUI(null);
+            }
+        });
+        if (flag) {
+            throw new RuntimeException("uninstallDefaults() hasn't been called");
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/javax/swing/border/Test4129681.html	Wed Jul 21 09:57:21 2010 -0700
@@ -0,0 +1,10 @@
+<html>
+<body>
+When applet starts, you'll see a checkbox and a label with a titled border.
+Turn on the checkbox to disable the label.
+The test passes if the title of the border is disabled as well as the label.
+
+<applet width="300" height="200" code="Test4129681.class">
+</applet>
+</body>
+</html>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/javax/swing/border/Test4129681.java	Wed Jul 21 09:57:21 2010 -0700
@@ -0,0 +1,59 @@
+/*
+ * 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 4129681
+ * @summary Tests enabling/disabling of titled border's caption
+ * @author Sergey Malenkov
+ * @run applet/manual=yesno Test4129681.html
+ */
+
+import java.awt.BorderLayout;
+import java.awt.event.ItemEvent;
+import java.awt.event.ItemListener;
+import javax.swing.BorderFactory;
+import javax.swing.JApplet;
+import javax.swing.JCheckBox;
+import javax.swing.JLabel;
+
+public class Test4129681 extends JApplet implements ItemListener {
+    private JLabel label;
+
+    @Override
+    public void init() {
+        JCheckBox check = new JCheckBox("disable");
+        check.addItemListener(this);
+
+        this.label = new JLabel("message");
+        this.label.setBorder(BorderFactory.createTitledBorder("label"));
+        this.label.setEnabled(!check.isSelected());
+
+        add(BorderLayout.NORTH, check);
+        add(BorderLayout.CENTER, this.label);
+    }
+
+    public void itemStateChanged(ItemEvent event) {
+        this.label.setEnabled(ItemEvent.DESELECTED == event.getStateChange());
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/javax/swing/border/Test4760089.html	Wed Jul 21 09:57:21 2010 -0700
@@ -0,0 +1,10 @@
+<html>
+<body>
+When applet starts, you'll see a panel with a compound titled border.
+If one of its titles is overstriken with the border's line then test fails.
+Otherwise test passes.
+
+<applet width="600" height="300" code="Test4760089.class">
+</applet>
+</body>
+</html>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/javax/swing/border/Test4760089.java	Wed Jul 21 09:57:21 2010 -0700
@@ -0,0 +1,49 @@
+/*
+ * 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 4760089
+ * @summary Tests that titled border do not paint inner titled border over its caption
+ * @author Sergey Malenkov
+ * @run applet/manual=yesno Test4760089.html
+ */
+
+import javax.swing.JApplet;
+import javax.swing.JPanel;
+import javax.swing.border.Border;
+import javax.swing.border.EtchedBorder;
+import javax.swing.border.TitledBorder;
+
+public class Test4760089 extends JApplet {
+    @Override
+    public void init() {
+        Border border = new EtchedBorder();
+        border = new TitledBorder(border, "LEFT",  TitledBorder.LEFT,  TitledBorder.TOP);
+        border = new TitledBorder(border, "RIGHT", TitledBorder.RIGHT, TitledBorder.TOP);
+
+        JPanel panel = new JPanel();
+        panel.setBorder(border);
+        getContentPane().add(panel);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/javax/swing/border/Test6910490.html	Wed Jul 21 09:57:21 2010 -0700
@@ -0,0 +1,9 @@
+<html>
+<body>
+If the border is painted over scroll bars then test fails.
+Otherwise test passes.
+
+<applet width="600" height="300" code="Test6910490.class">
+</applet>
+</body>
+</html>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/javax/swing/border/Test6910490.java	Wed Jul 21 09:57:21 2010 -0700
@@ -0,0 +1,77 @@
+/*
+ * Copyright 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.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along 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.
+ */
+
+import static java.awt.Color.RED;
+import java.awt.Component;
+import java.awt.Dimension;
+import java.awt.Graphics;
+import java.awt.Insets;
+import javax.swing.Icon;
+import javax.swing.JApplet;
+import javax.swing.JButton;
+import javax.swing.JScrollPane;
+import javax.swing.JSplitPane;
+import javax.swing.border.MatteBorder;
+
+/*
+ * @test
+ * @bug 6910490
+ * @summary Tests a matte border around a component inside a scroll pane.
+ * @author Sergey Malenkov
+ * @run applet/manual=yesno Test6910490.html
+ */
+
+public class Test6910490 extends JApplet implements Icon {
+
+    @Override
+    public void init() {
+        Insets insets = new Insets(10, 10, 10, 10);
+        Dimension size = new Dimension(getWidth() / 2, getHeight());
+        JSplitPane pane = new JSplitPane(
+                JSplitPane.HORIZONTAL_SPLIT,
+                create("Color", size, new MatteBorder(insets, RED)),
+                create("Icon", size, new MatteBorder(insets, this)));
+        pane.setDividerLocation(size.width - pane.getDividerSize() / 2);
+        add(pane);
+    }
+
+    private JScrollPane create(String name, Dimension size, MatteBorder border) {
+        JButton button = new JButton(name);
+        button.setPreferredSize(size);
+        button.setBorder(border);
+        return new JScrollPane(button);
+    }
+
+    public int getIconWidth() {
+        return 10;
+    }
+
+    public int getIconHeight() {
+        return 10;
+    }
+
+    public void paintIcon(Component c, Graphics g, int x, int y) {
+        g.setColor(RED);
+        g.fillRect(x, y, getIconWidth(), getIconHeight());
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/javax/swing/plaf/synth/6771547/SynthTest.java	Wed Jul 21 09:57:21 2010 -0700
@@ -0,0 +1,50 @@
+/*
+ * 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 6771547
+ * @author Alexander Potochkin
+ * @summary SynthParser throws StringIndexOutOfBoundsException parsing custom ColorTypes
+ */
+
+import javax.swing.plaf.synth.SynthLookAndFeel;
+import javax.swing.*;
+import java.io.InputStream;
+import java.awt.*;
+
+public class SynthTest {
+
+    public static void main(String[] args) throws Exception {
+        SynthLookAndFeel laf = new SynthLookAndFeel();
+        InputStream in = SynthTest.class.getResourceAsStream(
+                "synthconfig.xml");
+        laf.load(in, SynthTest.class);
+
+        UIManager.setLookAndFeel(laf);
+
+        if (!Color.RED.equals(new JButton().getForeground())) {
+            throw new RuntimeException("The wrong foreground color!");
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/javax/swing/plaf/synth/6771547/synthconfig.xml	Wed Jul 21 09:57:21 2010 -0700
@@ -0,0 +1,10 @@
+<synth>
+    <style id="button">
+        <font name="Verdana" size="16"/>
+        <state>
+            <color value="RED"
+                   type="javax.swing.plaf.synth.ColorType.FOREGROUND"/>
+        </state>
+    </style>
+    <bind style="button" type="region" key="button"/>
+</synth>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/javax/swing/plaf/synth/SynthToolBarUI/6739756/bug6739756.java	Wed Jul 21 09:57:21 2010 -0700
@@ -0,0 +1,59 @@
+/*
+ * Copyright 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.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along 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.
+ */
+
+/**
+ * @test
+ * @bug 6739756
+ * @author Alexander Potochkin
+ * @summary JToolBar leaves space for non-visible items under Nimbus L&F
+ * @run main bug6739756
+ */
+
+import javax.swing.*;
+import java.awt.*;
+
+public class bug6739756 {
+
+    public static void main(String[] args) throws Exception {
+        try {
+           UIManager.setLookAndFeel(
+                   "com.sun.java.swing.plaf.nimbus.NimbusLookAndFeel");
+        }
+        catch (Exception e) {
+            e.printStackTrace();
+            return;
+        }
+        SwingUtilities.invokeAndWait(new Runnable() {
+            public void run() {
+                JToolBar tb = new JToolBar();
+                Dimension preferredSize = tb.getPreferredSize();
+                JButton button = new JButton("Test");
+                button.setVisible(false);
+                tb.add(button);
+                if (!preferredSize.equals(tb.getPreferredSize())) {
+                    throw new RuntimeException("Toolbar's preferredSize is wrong");
+                }
+            }
+        });
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/javax/swing/text/DefaultStyledDocument/6636983/bug6636983.java	Wed Jul 21 09:57:21 2010 -0700
@@ -0,0 +1,152 @@
+/*
+ * 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 6636983
+ * @summary test that composed text at the line starts is handled correctly
+ * @author Sergey Groznyh
+ * @run main bug6636983
+ */
+
+import sun.swing.SwingUtilities2;
+
+import javax.swing.*;
+import javax.swing.text.*;
+import javax.swing.text.html.HTMLDocument;
+import java.awt.*;
+import java.awt.event.InputMethodEvent;
+import java.awt.event.KeyEvent;
+import java.text.AttributedString;
+
+public class bug6636983 {
+    private Robot robot;
+
+    private final AttributedString Hiragana_A = new AttributedString("\u3042");
+
+    void sendInputMethodEvent() {
+        InputMethodEvent ime = new InputMethodEvent(
+                ep,
+                InputMethodEvent.INPUT_METHOD_TEXT_CHANGED,
+                Hiragana_A.getIterator(),
+                0,
+                null,
+                null);
+        ep.dispatchEvent(ime);
+    }
+
+    void checkComposedTextRun() {
+        HTMLDocument d = (HTMLDocument) ep.getDocument();
+        ElementIterator it = new ElementIterator(d.getDefaultRootElement());
+
+        while (true) {
+            Element e = it.next();
+            if (e == null) {
+                throw new RuntimeException("no composed text found");
+            }
+            AttributeSet a = e.getAttributes();
+            if (a.isDefined(StyleConstants.ComposedTextAttribute)) {
+                if (!AbstractDocument.ContentElementName.equals(a.getAttribute(StyleConstants.NameAttribute))) {
+                    throw new RuntimeException("AbstractDocument.ContentElementName.equals(a.getAttribute(StyleConstants.NameAttribute)) is false");
+                }
+
+                if (a.isDefined(SwingUtilities2.IMPLIED_CR)) {
+                    throw new RuntimeException("a.isDefined(SwingUtilities2.IMPLIED_CR) is true");
+                }
+
+                return;
+            }
+        }
+
+    }
+
+    JEditorPane ep;
+
+    void initAtParagraphStart() {
+        ep.setText("A<p>B");
+        hitKey(KeyEvent.VK_LEFT);
+    }
+
+    void sendAtParagraphStart() {
+        sendInputMethodEvent();
+    }
+
+    void checkAtParagraphStart() {
+        checkComposedTextRun();
+    }
+
+    void initAfterBRElement() {
+        ep.setText("A<br>B");
+        hitKey(KeyEvent.VK_LEFT);
+    }
+
+    void sendAtBRElement() {
+        sendInputMethodEvent();
+    }
+
+    void checkAtBrElement() {
+        checkComposedTextRun();
+    }
+
+    private void hitKey(int keycode) {
+        robot.keyPress(keycode);
+        robot.keyRelease(keycode);
+        robot.delay(550); // The magic number equals JRobot.DEFAULT_DELAY
+    }
+
+    private void run() throws Exception {
+        robot = new Robot();
+
+        ep = new JEditorPane();
+        ep.setContentType("text/html");
+        ep.setPreferredSize(new Dimension(100, 100));
+
+        JFrame frame = new JFrame("Test: " + getClass().getName());
+
+        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
+        frame.add(ep);
+        frame.setVisible(true);
+    }
+
+    public static void main(String[] args) throws Throwable {
+        SwingUtilities.invokeAndWait(new Runnable() {
+            public void run() {
+                try {
+                    bug6636983 bug6636983 = new bug6636983();
+
+                    bug6636983.run();
+                    bug6636983.initAtParagraphStart();
+                    bug6636983.sendAtParagraphStart();
+                    bug6636983.checkAtParagraphStart();
+                    bug6636983.initAfterBRElement();
+                    bug6636983.sendAtBRElement();
+                    bug6636983.checkAtBrElement();
+
+                    System.out.println("OK");
+                } catch (Exception e) {
+                    throw new RuntimeException("The test failed", e);
+                }
+            }
+        });
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/javax/swing/text/WrappedPlainView/6857057/StubBranchElement.java	Wed Jul 21 09:57:21 2010 -0700
@@ -0,0 +1,87 @@
+/*
+ * Copyright 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.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along 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.
+ */
+
+import javax.swing.text.*;
+
+class StubBranchElement implements Element {
+    Document document = new DefaultStyledDocument();
+    String context;
+    Element[] children = new StubLeafElement[3];
+
+    public StubBranchElement(String context) {
+        this.context = context;
+        int len = context.length() / 3;
+        for (int i = 0; i < 3; i++) {
+            children[i] = new StubLeafElement(
+                    context.substring(len * i, len * (i + 1)), this, len * i);
+        }
+        try {
+            document.insertString(0, context, new SimpleAttributeSet());
+        } catch (BadLocationException e) {
+        }
+    }
+
+    public Document getDocument() {
+        return document;
+    }
+
+    public Element getParentElement() {
+        return null;
+    }
+
+    public String getName() {
+        return "StubBranchElement";
+    }
+
+    public AttributeSet getAttributes() {
+        return new SimpleAttributeSet();
+    }
+
+    public int getStartOffset() {
+        return 0;
+    }
+
+    public int getEndOffset() {
+        return document.getLength();
+    }
+
+    public int getElementIndex(int offset) {
+        return offset / 3;
+    }
+
+    public int getElementCount() {
+        return 3;
+    }
+
+    public Element getElement(int index) {
+        return children[index];
+    }
+
+    public boolean isLeaf() {
+        return false;
+    }
+
+    public Element[] getChildren() {
+        return children;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/javax/swing/text/WrappedPlainView/6857057/StubLeafElement.java	Wed Jul 21 09:57:21 2010 -0700
@@ -0,0 +1,81 @@
+/*
+ * Copyright 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.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along 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.
+ */
+
+import javax.swing.text.*;
+
+class StubLeafElement implements Element {
+    Document document = new DefaultStyledDocument();
+    String context;
+    Element parent;
+    int position;
+
+    public StubLeafElement(String context, Element parent, int position) {
+        this.context = context;
+        this.parent = parent;
+        this.position = position;
+        try {
+            document.insertString(0, context, new SimpleAttributeSet());
+        } catch (BadLocationException e) {
+        }
+    }
+
+    public Document getDocument() {
+        return document;
+    }
+
+    public Element getParentElement() {
+        return parent;
+    }
+
+    public String getName() {
+        return "StubLeafElement";
+    }
+
+    public AttributeSet getAttributes() {
+        return new SimpleAttributeSet();
+    }
+
+    public int getStartOffset() {
+        return position;
+    }
+
+    public int getEndOffset() {
+        return position + document.getLength();
+    }
+
+    public int getElementIndex(int offset) {
+        return 0;
+    }
+
+    public int getElementCount() {
+        return 0;
+    }
+
+    public Element getElement(int index) {
+        return this;
+    }
+
+    public boolean isLeaf() {
+        return true;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/javax/swing/text/WrappedPlainView/6857057/bug6857057.java	Wed Jul 21 09:57:21 2010 -0700
@@ -0,0 +1,59 @@
+/*
+ * Copyright 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.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along 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.
+ */
+
+/*
+ * @test
+ * @bug 6857057
+ * @summary test that the JCK GlyphView2021 test doesn't fail
+ * @author Sergey Groznyh
+ * @run main bug6857057
+ */
+
+import javax.swing.*;
+import javax.swing.text.Element;
+import javax.swing.text.GlyphView;
+import javax.swing.text.View;
+
+public class bug6857057 {
+
+    bug6857057() {
+        Element elem = new StubBranchElement(" G L Y P H V");
+        GlyphView view = new GlyphView(elem);
+        float pos = elem.getStartOffset();
+        float len = elem.getEndOffset() - pos;
+        int res = view.getBreakWeight(View.X_AXIS, pos, len);
+        if (res != View.ExcellentBreakWeight) {
+            throw new RuntimeException("breakWeight != ExcellentBreakWeight");
+        }
+    }
+
+    public static void main(String[] args) throws Throwable {
+        SwingUtilities.invokeLater(new Runnable() {
+            public void run() {
+                new bug6857057();
+            }
+        });
+
+        System.out.println("OK");
+    }
+}
--- a/jdk/test/sun/jvmstat/testlibrary/utils.sh	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/test/sun/jvmstat/testlibrary/utils.sh	Wed Jul 21 09:57:21 2010 -0700
@@ -189,3 +189,37 @@
         echo "Error sending term signal to ${kpid}!"
     fi
 }
+
+# check to see if a port is free
+checkPort() # port
+{
+    inuse=`netstat -a | egrep "\.$1"`
+    if [ "${inuse}" = "" ] ; then
+      echo "free"
+    else
+      echo "inuse"
+    fi
+}
+
+# Get a free port, where port+1 is also free, return 0 when giving up
+freePort()
+{
+  start=3000
+  while [ ${start} -lt 3030 ] ; do
+    port1=`expr ${start} '+' $$ '%' 1000`
+    port2=`expr ${port1} '+' 1`
+    if [ "`checkPort ${port1}`" = "inuse" \
+         -o "`checkPort ${port2}`" = "inuse" ] ; then
+      start=`expr ${start} '+' 1`
+    else
+      break
+    fi
+  done
+  if [ "`checkPort ${port1}`" = "inuse" \
+       -o "`checkPort ${port2}`" = "inuse" ] ; then
+    port1="0"
+  fi
+  echo "${port1}"
+}
+
+
--- a/jdk/test/sun/nio/ch/Basic.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/test/sun/nio/ch/Basic.java	Wed Jul 21 09:57:21 2010 -0700
@@ -32,5 +32,7 @@
 public class Basic {
     public static void main(String[] args) throws Exception {
         Pipe p = Pipe.open();
+        p.source().close();
+        p.sink().close();
     }
 }
--- a/jdk/test/sun/nio/ch/TempBuffer.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/test/sun/nio/ch/TempBuffer.java	Wed Jul 21 09:57:21 2010 -0700
@@ -54,8 +54,12 @@
                     blah.deleteOnExit();
                     TempBuffer.initTestFile(blah);
                     RandomAccessFile raf = new RandomAccessFile(blah, "rw");
-                    FileChannel fs = raf.getChannel();
-                    fs.transferTo(0, SIZE, Channels.newChannel(out));
+                    FileChannel fc = raf.getChannel();
+                    try {
+                        fc.transferTo(0, SIZE, Channels.newChannel(out));
+                    } finally {
+                        fc.close();
+                    }
                     out.flush();
                 } catch (IOException ioe) {
                     throw new RuntimeException(ioe);
@@ -69,10 +73,17 @@
         File blah = File.createTempFile("blah2", null);
         blah.deleteOnExit();
         RandomAccessFile raf = new RandomAccessFile(blah, "rw");
-        FileChannel fs = raf.getChannel();
-        raf.setLength(SIZE);
-        fs.transferFrom(Channels.newChannel(in), 0, SIZE);
-        fs.close();
+        FileChannel fc = raf.getChannel();
+        try {
+            raf.setLength(SIZE);
+            fc.transferFrom(Channels.newChannel(in), 0, SIZE);
+        } finally {
+            fc.close();
+        }
+
+        sourceChannel.close();
+        sinkChannel.close();
+        blah.delete();
     }
 
     private static void initTestFile(File blah) throws IOException {
--- a/jdk/test/sun/nio/cs/FindDecoderBugs.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/test/sun/nio/cs/FindDecoderBugs.java	Wed Jul 21 09:57:21 2010 -0700
@@ -298,7 +298,7 @@
         void testRandomly(byte[] prefix, int n) {
             int len = prefix.length;
             byte[] ia = Arrays.copyOf(prefix, len + n);
-            for (int i = 0; i < 10000; i++) {
+            for (int i = 0; i < 5000; i++) {
                 for (int j = 0; j < n; j++)
                     ia[len + j] = randomByte();
                 test(ia);
@@ -435,6 +435,9 @@
     static void equal(Object x, Object y) {
         if (x == null ? y == null : x.equals(y)) pass();
         else fail(x + " not equal to " + y);}
+    static void equal(int x, int y) {
+        if (x == 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);
--- a/jdk/test/sun/nio/cs/ReadZero.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/test/sun/nio/cs/ReadZero.java	Wed Jul 21 09:57:21 2010 -0700
@@ -43,15 +43,18 @@
                 return 0;
             }
         };
-
-        is.read(new byte[1], 0, 1); // ok
-        InputStreamReader isr = new InputStreamReader(is);
+        try {
+            is.read(new byte[1], 0, 1); // ok
+            InputStreamReader isr = new InputStreamReader(is);
 
-        try {
-            int res = isr.read(new char[1], 0, 1);
-        } catch (IOException x) {
-            System.out.println("IOException caught");
-            return;
+            try {
+                int res = isr.read(new char[1], 0, 1);
+            } catch (IOException x) {
+                System.out.println("IOException caught");
+                return;
+            }
+        } finally {
+            is.close();
         }
         throw new RuntimeException("IOException not thrown");
     }
--- a/jdk/test/sun/nio/cs/Test4200310.sh	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/test/sun/nio/cs/Test4200310.sh	Wed Jul 21 09:57:21 2010 -0700
@@ -27,9 +27,9 @@
 # @author Norbert Lindenberg
 # @run shell Test4200310.sh
 
-2>1 $TESTJAVA/bin/jar -tf "$TESTJAVA/jre/lib/rt.jar" > class-list
-2>1 $TESTJAVA/bin/jar -tf "$TESTJAVA/jre/lib/charsets.jar" >> class-list
-2>1 $TESTJAVA/bin/jar -tf "$TESTJAVA/jre/lib/ext/localedata.jar" >> class-list
+2>&1 $TESTJAVA/bin/jar -tf "$TESTJAVA/jre/lib/rt.jar" > class-list
+2>&1 $TESTJAVA/bin/jar -tf "$TESTJAVA/jre/lib/charsets.jar" >> class-list
+2>&1 $TESTJAVA/bin/jar -tf "$TESTJAVA/jre/lib/ext/localedata.jar" >> class-list
 duplicates=`grep '\.class$' class-list | sort | uniq -d`
 
 rm -f class-list
--- a/jdk/test/sun/nio/cs/Test4206507.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/test/sun/nio/cs/Test4206507.java	Wed Jul 21 09:57:21 2010 -0700
@@ -32,7 +32,12 @@
 
 public class Test4206507 {
     public static void main(String[] args) throws UnsupportedEncodingException {
-        Locale.setDefault(new Locale("tr", "TR"));
-        byte[] b = "".getBytes("ISO8859-9");
+        Locale l = Locale.getDefault();
+        try {
+            Locale.setDefault(new Locale("tr", "TR"));
+            byte[] b = "".getBytes("ISO8859-9");
+        } finally {
+            Locale.setDefault(l);
+        }
     }
 }
--- a/jdk/test/sun/nio/cs/TestStringCoding.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/test/sun/nio/cs/TestStringCoding.java	Wed Jul 21 09:57:21 2010 -0700
@@ -26,7 +26,7 @@
 /* @test
    @bug 6636323 6636319
    @summary Test if StringCoding and NIO result have the same de/encoding result
- * @run main/timeout=2000 TestStringCoding
+ * @run main/othervm/timeout=2000 TestStringCoding
  */
 
 import java.util.*;
--- a/jdk/test/sun/nio/cs/TestX11CNS.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/test/sun/nio/cs/TestX11CNS.java	Wed Jul 21 09:57:21 2010 -0700
@@ -94,6 +94,8 @@
     }
 
     static void compare(Charset newCS, Charset oldCS) throws Exception {
+        if (newCS == null)
+            return;  // does not exist on this platform
         char[] cc = getChars(newCS, oldCS);
         System.out.printf("    Diff <%s> <%s>...%n", newCS.name(), oldCS.name());
 
@@ -120,14 +122,22 @@
         }
     }
 
+    private static Charset getCharset(String czName)
+        throws Exception {
+        try {
+            return (Charset)Class.forName(czName).newInstance();
+        } catch (ClassNotFoundException e){}
+        return null;  // does not exist
+    }
+
     public static void main(String[] args) throws Exception {
-        compare(new sun.awt.motif.X11CNS11643P1(),
+        compare(getCharset("sun.awt.motif.X11CNS11643P1"),
                 new X11CNS11643P1());
 
-        compare(new sun.awt.motif.X11CNS11643P2(),
+        compare(getCharset("sun.awt.motif.X11CNS11643P2"),
                 new X11CNS11643P2());
 
-        compare(new sun.awt.motif.X11CNS11643P3(),
+        compare(getCharset("sun.awt.motif.X11CNS11643P3"),
                 new X11CNS11643P3());
 
     }
--- a/jdk/test/sun/rmi/rmic/manifestClassPath/run.sh	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/test/sun/rmi/rmic/manifestClassPath/run.sh	Wed Jul 21 09:57:21 2010 -0700
@@ -23,7 +23,7 @@
 
 #!/bin/sh
 # @test
-# @bug 6473331
+# @bug 6473331 6485027 6934615
 # @summary Test handling of the Class-Path attribute in jar file manifests
 #          for the rmic tool
 # @author Andrey Ozerov
@@ -65,26 +65,23 @@
 
 Sys "$javac" pkg/A.java pkg/B.java
 
-# NOTE: Certain lines below are commented out in order to work around
-# bug 6485027, with alternative lines added as part of the workaround
-# as indicated.  In particular, the mutally referential JAR files are
-# placed in the same directory instead of different directories, and
-# javac is not expected to handle the extensions directories cases.
+# NOTE: Previously, some lines were commented out and alternative lines
+# provided, to work around javac bug 6485027. That bug, and related rmic
+# bug 6934615 have now been fixed, so most of the workarounds have been
+# removed. However, javac still does not evaluate jar class paths on
+# the bootclasspath, including -extdirs.
 
-#MkManifestWithClassPath "sub/B.zip"
-MkManifestWithClassPath "B.zip"				# 6485027 workaround
+MkManifestWithClassPath "sub/B.zip"
 Sys "$jar" cmf MANIFEST.MF A.jar pkg/A.class
 
-#MkManifestWithClassPath "../A.jar"
-MkManifestWithClassPath "A.jar"				# 6485027 workaround
+MkManifestWithClassPath "../A.jar"
 Sys "$jar" cmf MANIFEST.MF B.zip pkg/B.class
 
 Sys rm -rf pkg
 Sys mkdir jars
 Sys mv A.jar jars/.
-#Sys mkdir jars/sub
-#Sys mv B.zip jars/sub/.
-Sys mv B.zip jars/.					# 6485027 workaround
+Sys mkdir jars/sub
+Sys mv B.zip jars/sub/.
 
 cat >MainI.java <<EOF
 import pkg.*;
@@ -121,26 +118,22 @@
 
 Sys rm -f Main.class MainI.class Main_Stub.class
 
-#Success "$javac" -classpath "jars/sub/B.zip"       Main.java MainI.java
-#Success "$rmic"  -classpath "jars/sub/B.zip${PS}." Main
-#Success "$java"  -classpath "jars/sub/B.zip${PS}." Main
-Success "$javac" -classpath "jars/B.zip"       \
-				Main.java MainI.java	# 6485027 workaround
-Success "$rmic"  -classpath "jars/B.zip${PS}." Main	# 6485027 workaround
-Success "$java"  -classpath "jars/B.zip${PS}." Main	# 6485027 workaround
+Success "$javac" -classpath "jars/sub/B.zip"       Main.java MainI.java
+Success "$rmic"  -classpath "jars/sub/B.zip${PS}." Main
+Success "$java"  -classpath "jars/sub/B.zip${PS}." Main
 
 #Sys rm -f Main.class MainI.class Main_Stub.class
-Sys rm -f Main_Stub.class				# 6485027 workaround
+Sys rm -f Main_Stub.class				# javac -extdirs workaround
 
 #Success "$javac" -extdirs "jars" -classpath None Main.java MainI.java
 Success "$rmic"  -extdirs "jars" -classpath .    Main
 Success "$java"  -Djava.ext.dirs="jars" -cp .    Main
 
-#Sys rm -f Main_Stub.class
-#
+Sys rm -f Main_Stub.class
+
 #Success "$javac" -extdirs "jars/sub" -classpath None Main.java MainI.java
-#Success "$rmic"  -extdirs "jars/sub" -classpath . Main
-#Success "$java"  -Djava.ext.dirs="jars/sub" -cp . Main
+Success "$rmic"  -extdirs "jars/sub" -classpath . Main
+Success "$java"  -Djava.ext.dirs="jars/sub" -cp . Main
 
 Cleanup
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/sun/security/krb5/MicroTime.java	Wed Jul 21 09:57:21 2010 -0700
@@ -0,0 +1,53 @@
+/*
+ * Copyright 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.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along 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.
+ */
+/*
+ * @test
+ * @bug 6882687
+ * @summary KerberosTime too imprecise
+ */
+
+import sun.security.krb5.internal.KerberosTime;
+
+public class MicroTime {
+    public static void main(String[] args) throws Exception {
+        // We count how many different KerberosTime values
+        // can be acquired within one second.
+        KerberosTime t1 = new KerberosTime(true);
+        KerberosTime last = t1;
+        int count = 0;
+        while (true) {
+            KerberosTime t2 = new KerberosTime(true);
+            if (t2.getTime() - t1.getTime() > 1000) break;
+            if (!last.equals(t2)) {
+                last = t2;
+                count++;
+            }
+        }
+        // We believe a nice KerberosTime can at least tell the
+        // difference of 100 musec.
+        if (count < 10000) {
+            throw new Exception("What? only " + (1000000/count) +
+                    " musec precision?");
+        }
+    }
+}
--- a/jdk/test/sun/security/krb5/auto/Context.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/test/sun/security/krb5/auto/Context.java	Wed Jul 21 09:57:21 2010 -0700
@@ -42,6 +42,7 @@
 import com.sun.security.jgss.ExtendedGSSContext;
 import com.sun.security.jgss.InquireType;
 import com.sun.security.jgss.AuthorizationDataEntry;
+import java.io.File;
 
 /**
  * Context of a JGSS subject, encapsulating Subject and GSSContext.
@@ -107,7 +108,8 @@
      * Logins with a username and a password, using Krb5LoginModule directly
      * @param storeKey true if key should be saved, used on acceptor side
      */
-    public static Context fromUserPass(String user, char[] pass, boolean storeKey) throws Exception {
+    public static Context fromUserPass(String user, char[] pass, boolean storeKey)
+            throws Exception {
         Context out = new Context();
         out.name = user;
         out.s = new Subject();
@@ -137,6 +139,33 @@
     }
 
     /**
+     * Logins with a username and a keytab, using Krb5LoginModule directly
+     * @param storeKey true if key should be saved, used on acceptor side
+     */
+    public static Context fromUserKtab(String user, String ktab, boolean storeKey)
+            throws Exception {
+        Context out = new Context();
+        out.name = user;
+        out.s = new Subject();
+        Krb5LoginModule krb5 = new Krb5LoginModule();
+        Map<String, String> map = new HashMap<String, String>();
+
+        map.put("doNotPrompt", "true");
+        map.put("useTicketCache", "false");
+        map.put("useKeyTab", "true");
+        map.put("keyTab", ktab);
+        map.put("principal", user);
+        if (storeKey) {
+            map.put("storeKey", "true");
+        }
+
+        krb5.initialize(out.s, null, null, map);
+        krb5.login();
+        krb5.commit();
+        return out;
+    }
+
+    /**
      * Starts as a client
      * @param target communication peer
      * @param mech GSS mech
--- a/jdk/test/sun/security/krb5/auto/KDC.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/test/sun/security/krb5/auto/KDC.java	Wed Jul 21 09:57:21 2010 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2008, 2009, Oracle and/or its affiliates. All rights reserved.
+ * 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
@@ -35,6 +35,7 @@
 import sun.security.krb5.*;
 import sun.security.krb5.internal.*;
 import sun.security.krb5.internal.ccache.CredentialsCache;
+import sun.security.krb5.internal.crypto.EType;
 import sun.security.krb5.internal.crypto.KeyUsage;
 import sun.security.krb5.internal.ktab.KeyTab;
 import sun.security.util.DerInputStream;
@@ -153,6 +154,14 @@
          * Whether pre-authentication is required. Default Boolean.TRUE
          */
         PREAUTH_REQUIRED,
+        /**
+         * Only issue TGT in RC4
+         */
+        ONLY_RC4_TGT,
+        /**
+         * Only use RC4 in preauth, enc-type still using eTypes[0]
+         */
+        ONLY_RC4_PREAUTH,
     };
 
     static {
@@ -403,8 +412,11 @@
      */
     private static char[] randomPassword() {
         char[] pass = new char[32];
-        for (int i=0; i<32; i++)
+        for (int i=0; i<31; i++)
             pass[i] = (char)secureRandom.nextInt();
+        // The last char cannot be a number, otherwise, keyForUser()
+        // believes it's a sign of kvno
+        pass[31] = 'Z';
         return pass;
     }
 
@@ -744,6 +756,21 @@
 
             EncryptionKey ckey = keyForUser(body.cname, eType, false);
             EncryptionKey skey = keyForUser(body.sname, eType, true);
+
+            if (options.containsKey(KDC.Option.ONLY_RC4_TGT)) {
+                int tgtEType = EncryptedData.ETYPE_ARCFOUR_HMAC;
+                boolean found = false;
+                for (int i=0; i<eTypes.length; i++) {
+                    if (eTypes[i] == tgtEType) {
+                        found = true;
+                        break;
+                    }
+                }
+                if (!found) {
+                    throw new KrbException(Krb5.KDC_ERR_ETYPE_NOSUPP);
+                }
+                skey = keyForUser(body.sname, tgtEType, true);
+            }
             if (ckey == null) {
                 throw new KrbException(Krb5.KDC_ERR_ETYPE_NOSUPP);
             }
@@ -793,7 +820,8 @@
                     Constructor<EncryptedData> ctor = EncryptedData.class.getDeclaredConstructor(DerValue.class);
                     ctor.setAccessible(true);
                     EncryptedData data = ctor.newInstance(new DerValue(pas[0].getValue()));
-                    data.decrypt(ckey, KeyUsage.KU_PA_ENC_TS);
+                    EncryptionKey pakey = keyForUser(body.cname, data.getEType(), false);
+                    data.decrypt(pakey, KeyUsage.KU_PA_ENC_TS);
                 } catch (Exception e) {
                     throw new KrbException(Krb5.KDC_ERR_PREAUTH_FAILED);
                 }
@@ -881,7 +909,11 @@
                         ke.returnCode() == Krb5.KDC_ERR_PREAUTH_FAILED) {
                     PAData pa;
 
-                    ETypeInfo2 ei2 = new ETypeInfo2(eTypes[0], null, null);
+                    int epa = eTypes[0];
+                    if (options.containsKey(KDC.Option.ONLY_RC4_PREAUTH)) {
+                        epa = EncryptedData.ETYPE_ARCFOUR_HMAC;
+                    }
+                    ETypeInfo2 ei2 = new ETypeInfo2(epa, null, null);
                     DerOutputStream eid = new DerOutputStream();
                     eid.write(DerValue.tag_Sequence, ei2.asn1Encode());
 
@@ -900,7 +932,7 @@
                         }
                     }
                     if (allOld) {
-                        ETypeInfo ei = new ETypeInfo(eTypes[0], null);
+                        ETypeInfo ei = new ETypeInfo(epa, null);
                         eid = new DerOutputStream();
                         eid.write(DerValue.tag_Sequence, ei.asn1Encode());
                         pa = new PAData(Krb5.PA_ETYPE_INFO, eid.toByteArray());
--- a/jdk/test/sun/security/krb5/auto/SSL.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/test/sun/security/krb5/auto/SSL.java	Wed Jul 21 09:57:21 2010 -0700
@@ -25,6 +25,16 @@
  * @test
  * @bug 6894643 6913636
  * @summary Test JSSE Kerberos ciphersuite
+ * @run main SSL TLS_KRB5_WITH_RC4_128_SHA
+ * @run main SSL TLS_KRB5_WITH_RC4_128_MD5
+ * @run main SSL TLS_KRB5_WITH_3DES_EDE_CBC_SHA
+ * @run main SSL TLS_KRB5_WITH_3DES_EDE_CBC_MD5
+ * @run main SSL TLS_KRB5_WITH_DES_CBC_SHA
+ * @run main SSL TLS_KRB5_WITH_DES_CBC_MD5
+ * @run main SSL TLS_KRB5_EXPORT_WITH_RC4_40_SHA
+ * @run main SSL TLS_KRB5_EXPORT_WITH_RC4_40_MD5
+ * @run main SSL TLS_KRB5_EXPORT_WITH_DES_CBC_40_SHA
+ * @run main SSL TLS_KRB5_EXPORT_WITH_DES_CBC_40_MD5
  */
 import java.io.*;
 import java.net.InetAddress;
@@ -37,7 +47,7 @@
 
 public class SSL {
 
-    private static final String KRB5_CIPHER = "TLS_KRB5_WITH_3DES_EDE_CBC_SHA";
+    private static String krb5Cipher;
     private static final int LOOP_LIMIT = 1;
     private static int loopCount = 0;
     private static volatile String server;
@@ -45,6 +55,8 @@
 
     public static void main(String[] args) throws Exception {
 
+        krb5Cipher = args[0];
+
         KDC kdc = KDC.create(OneKDC.REALM);
         // Run this after KDC, so our own DNS service can be started
         try {
@@ -117,7 +129,7 @@
             SSLSocket sslSocket = (SSLSocket) sslsf.createSocket(server, port);
 
             // Enable only a KRB5 cipher suite.
-            String enabledSuites[] = {KRB5_CIPHER};
+            String enabledSuites[] = {krb5Cipher};
             sslSocket.setEnabledCipherSuites(enabledSuites);
             // Should check for exception if enabledSuites is not supported
 
@@ -155,7 +167,7 @@
             port = sslServerSocket.getLocalPort();
 
             // Enable only a KRB5 cipher suite.
-            String enabledSuites[] = {KRB5_CIPHER};
+            String enabledSuites[] = {krb5Cipher};
             sslServerSocket.setEnabledCipherSuites(enabledSuites);
             // Should check for exception if enabledSuites is not supported
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/sun/security/krb5/auto/W83.java	Wed Jul 21 09:57:21 2010 -0700
@@ -0,0 +1,131 @@
+/*
+ * 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 6932525 6951366 6959292
+ * @summary kerberos login failure on win2008 with AD set to win2000 compat mode
+ * and cannot login if session key and preauth does not use the same etype
+ */
+import com.sun.security.auth.module.Krb5LoginModule;
+import java.io.File;
+import sun.security.krb5.Config;
+import sun.security.krb5.EncryptedData;
+import sun.security.krb5.PrincipalName;
+import sun.security.krb5.internal.crypto.EType;
+import sun.security.krb5.internal.ktab.KeyTab;
+
+public class W83 {
+    public static void main(String[] args) throws Exception {
+
+        W83 x = new W83();
+
+        // Cannot use OneKDC. kinit command cannot resolve
+        // hostname kdc.rabbit.hole
+        KDC kdc = new KDC(OneKDC.REALM, "127.0.0.1", 0, true);
+        kdc.addPrincipal(OneKDC.USER, OneKDC.PASS);
+        kdc.addPrincipalRandKey("krbtgt/" + OneKDC.REALM);
+        KDC.saveConfig(OneKDC.KRB5_CONF, kdc);
+        System.setProperty("java.security.krb5.conf", OneKDC.KRB5_CONF);
+        Config.refresh();
+
+        kdc.writeKtab(OneKDC.KTAB);
+        new File(OneKDC.KRB5_CONF).deleteOnExit();
+        new File(OneKDC.KTAB).deleteOnExit();
+
+        KeyTab ktab = KeyTab.getInstance(OneKDC.KTAB);
+        for (int etype: EType.getBuiltInDefaults()) {
+            if (etype != EncryptedData.ETYPE_ARCFOUR_HMAC) {
+                ktab.deleteEntry(new PrincipalName(OneKDC.USER), etype);
+            }
+        }
+        ktab.save();
+
+        // For 6932525 and 6951366, make sure the etypes sent in 2nd AS-REQ
+        // is not restricted to that of preauth
+        kdc.setOption(KDC.Option.ONLY_RC4_TGT, true);
+        x.go();
+
+        // For 6959292, make sure that when etype for enc-part in 2nd AS-REQ
+        // is different from that of preauth, client can still decrypt it
+        kdc.setOption(KDC.Option.ONLY_RC4_PREAUTH, true);
+        x.go();
+    }
+
+    void go() throws Exception {
+        Krb5LoginModule krb5 = new Krb5LoginModule();
+        StringBuffer error = new StringBuffer();
+        try {
+            Context.fromUserPass(OneKDC.USER, OneKDC.PASS, false);
+        } catch (Exception e) {
+            error.append("Krb5LoginModule password login error\n");
+        }
+        try {
+            Context.fromUserKtab(OneKDC.USER, OneKDC.KTAB, false);
+        } catch (Exception e) {
+            error.append("Krb5LoginModule keytab login error\n");
+        }
+        try {
+            Class.forName("sun.security.krb5.internal.tools.Kinit");
+            String cmd = System.getProperty("java.home") +
+                    System.getProperty("file.separator") +
+                    "bin" +
+                    System.getProperty("file.separator") +
+                    "kinit";
+
+            int p = execute(
+                cmd,
+                "-J-Djava.security.krb5.conf=" + OneKDC.KRB5_CONF,
+                "-c", "cache1",
+                OneKDC.USER,
+                new String(OneKDC.PASS));
+            if (p != 0) {
+                error.append("kinit password login error\n");
+            }
+            p = execute(
+                cmd,
+                "-J-Djava.security.krb5.conf=" + OneKDC.KRB5_CONF,
+                "-c", "cache2",
+                "-k", "-t", OneKDC.KTAB,
+                OneKDC.USER);
+            if (p != 0) {
+                error.append("kinit keytab login error\n");
+            }
+        } catch (ClassNotFoundException cnfe) {
+            System.out.println("No kinit, test ignored.");
+            // Ignore, not on windows
+        }
+        if (error.length() != 0) {
+            throw new Exception(error.toString());
+        }
+    }
+
+    private static int execute(String... args) throws Exception {
+        for (String arg: args) {
+            System.out.printf("%s ", arg);
+        }
+        System.out.println();
+        Process p = Runtime.getRuntime().exec(args);
+        return p.waitFor();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/sun/security/krb5/etype/ETypeOrder.java	Wed Jul 21 09:57:21 2010 -0700
@@ -0,0 +1,52 @@
+/*
+ * 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 6844907
+ * @summary krb5 etype order should be from strong to weak
+ */
+
+import sun.security.krb5.internal.crypto.EType;
+
+public class ETypeOrder {
+    public static void main(String[] args) throws Exception {
+
+        // File does not exist, so that the system-default one won't be used
+        System.setProperty("java.security.krb5.conf", "no_such_file");
+        int[] etypes = EType.getBuiltInDefaults();
+
+        // Reference order, note that 2 is not implemented in Java
+        int correct[] = { 18, 17, 16, 23, 1, 3, 2 };
+
+        int match = 0;
+        loopi: for (int i=0; i<etypes.length; i++) {
+            for (; match < correct.length; match++) {
+                if (etypes[i] == correct[match]) {
+                    System.out.println("Find " + etypes[i] + " at #" + match);
+                    continue loopi;
+                }
+            }
+            throw new Exception("No match or bad order for " + etypes[i]);
+        }
+    }
+}
--- a/jdk/test/sun/security/krb5/ktab/HighestKvno.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/test/sun/security/krb5/ktab/HighestKvno.java	Wed Jul 21 09:57:21 2010 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2009, 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
@@ -227,9 +227,6 @@
         if (keys[0].getKeyVersionNumber() != 5) {
             throw new Exception("Highest not first");
         }
-        if (ktab.readServiceKey(pn).getKeyVersionNumber() != 5) {
-            throw new Exception("Highest not chosen");
-        }
         new File("kt").delete();
     }
 }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/sun/security/pkcs12/PKCS12SameKeyId.java	Wed Jul 21 09:57:21 2010 -0700
@@ -0,0 +1,120 @@
+/*
+ * 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 6958026
+ * @summary Problem with PKCS12 keystore
+ */
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileOutputStream;
+import java.security.AlgorithmParameters;
+import java.security.KeyStore;
+import java.security.cert.Certificate;
+import java.security.cert.X509Certificate;
+import javax.crypto.Cipher;
+import javax.crypto.SecretKey;
+import javax.crypto.SecretKeyFactory;
+import javax.crypto.spec.PBEKeySpec;
+import javax.crypto.spec.PBEParameterSpec;
+import sun.security.pkcs.EncryptedPrivateKeyInfo;
+import sun.security.tools.KeyTool;
+import sun.security.util.ObjectIdentifier;
+import sun.security.x509.AlgorithmId;
+import sun.security.x509.X500Name;
+
+public class PKCS12SameKeyId {
+
+    private static final String JKSFILE = "PKCS12SameKeyId.jks";
+    private static final String P12FILE = "PKCS12SameKeyId.p12";
+    private static final char[] PASSWORD = "changeit".toCharArray();
+    private static final int SIZE = 10;
+
+    public static void main(String[] args) throws Exception {
+
+        // Prepare a JKS keystore with many entries
+        new File(JKSFILE).delete();
+        for (int i=0; i<SIZE; i++) {
+            System.err.print(".");
+            String cmd = "-keystore " + JKSFILE
+                    + " -storepass changeit -keypass changeit "
+                    + "-genkeypair -alias p" + i + " -dname CN=" + i;
+            KeyTool.main(cmd.split(" "));
+        }
+
+        // Prepare EncryptedPrivateKeyInfo parameters, copied from various
+        // places in PKCS12KeyStore.java
+        AlgorithmParameters algParams =
+                AlgorithmParameters.getInstance("PBEWithSHA1AndDESede");
+        algParams.init(new PBEParameterSpec("12345678".getBytes(), 1024));
+        AlgorithmId algid = new AlgorithmId(
+                new ObjectIdentifier("1.2.840.113549.1.12.1.3"), algParams);
+
+        PBEKeySpec keySpec = new PBEKeySpec(PASSWORD);
+        SecretKeyFactory skFac = SecretKeyFactory.getInstance("PBE");
+        SecretKey skey = skFac.generateSecret(keySpec);
+
+        Cipher cipher = Cipher.getInstance("PBEWithSHA1AndDESede");
+        cipher.init(Cipher.ENCRYPT_MODE, skey, algParams);
+
+        // Pre-calculated keys and certs and aliases
+        byte[][] keys = new byte[SIZE][];
+        Certificate[][] certChains = new Certificate[SIZE][];
+        String[] aliases = new String[SIZE];
+
+        // Reads from JKS keystore and pre-calculate
+        KeyStore ks = KeyStore.getInstance("jks");
+        ks.load(new FileInputStream(JKSFILE), PASSWORD);
+        for (int i=0; i<SIZE; i++) {
+            aliases[i] = "p" + i;
+            byte[] enckey = cipher.doFinal(
+                    ks.getKey(aliases[i], PASSWORD).getEncoded());
+            keys[i] = new EncryptedPrivateKeyInfo(algid, enckey).getEncoded();
+            certChains[i] = ks.getCertificateChain(aliases[i]);
+        }
+
+        // Write into PKCS12 keystore. Use this overloaded version of
+        // setKeyEntry() to be as fast as possible, so that they would
+        // have same localKeyId.
+        KeyStore p12 = KeyStore.getInstance("pkcs12");
+        p12.load(null, PASSWORD);
+        for (int i=0; i<SIZE; i++) {
+            p12.setKeyEntry(aliases[i], keys[i], certChains[i]);
+        }
+        p12.store(new FileOutputStream(P12FILE), PASSWORD);
+
+        // Check private keys still match certs
+        p12 = KeyStore.getInstance("pkcs12");
+        p12.load(new FileInputStream(P12FILE), PASSWORD);
+        for (int i=0; i<SIZE; i++) {
+            String a = "p" + i;
+            X509Certificate x = (X509Certificate)p12.getCertificate(a);
+            X500Name name = (X500Name)x.getSubjectDN();
+            if (!name.getCommonName().equals(""+i)) {
+                throw new Exception(a + "'s cert is " + name);
+            }
+        }
+    }
+}
--- a/jdk/test/sun/security/tools/jarsigner/crl.sh	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/test/sun/security/tools/jarsigner/crl.sh	Wed Jul 21 09:57:21 2010 -0700
@@ -22,8 +22,8 @@
 #
 
 # @test
-# @bug 6890876
-# @summary jarsigner can add CRL info into signed jar
+# @bug 6890876 6950931
+# @summary jarsigner can add CRL info into signed jar (updated)
 #
 
 if [ "${TESTJAVA}" = "" ] ; then
@@ -53,7 +53,7 @@
 JAR=$TESTJAVA${FS}bin${FS}jar
 JARSIGNER=$TESTJAVA${FS}bin${FS}jarsigner
 
-rm $KS $JFILE
+rm $KS $JFILE 2> /dev/null
 
 # Generates some crl files, each containing two entries
 
@@ -63,8 +63,9 @@
 $KT -alias b -dname CN=b -keyalg rsa -genkey -validity 300
 $KT -alias b -gencrl -id 5:1 -id 6:2 -file crl3
 
+$TESTJAVA${FS}bin${FS}jrunscript -e 'println(new File("crl1").toURI())' > uri
 $KT -alias c -dname CN=c -keyalg rsa -genkey -validity 300 \
-    -ext crl=uri:file://`pwd`/crl1
+    -ext crl=uri:`cat uri`
 
 echo A > A
 
@@ -80,9 +81,9 @@
 
 $JAR cvf $JFILE A
 $JARSIGNER -keystore $KS -storepass changeit $JFILE a \
-        -crl crl1 -crl crl2 || exit 1
+        -crl crl1 -crl crl2 || exit 2
 $JARSIGNER -keystore $KS -storepass changeit $JFILE b \
-        -crl crl3 -crl crl2 || exit 1
+        -crl crl3 -crl crl2 || exit 3
 $JARSIGNER -keystore $KS -verify -debug -strict $JFILE || exit 3
 $KT -printcert -jarfile $JFILE | grep CRLs || exit 4
 CRLCOUNT=`$KT -printcert -jarfile $JFILE | grep SerialNumber | wc -l`
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/sun/security/validator/CertReplace.java	Wed Jul 21 09:57:21 2010 -0700
@@ -0,0 +1,66 @@
+/*
+ * 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.
+ */
+
+/*
+ * This test is called by certreplace.sh
+ */
+
+import java.io.FileInputStream;
+import java.security.KeyStore;
+import java.security.cert.Certificate;
+import java.security.cert.CertificateFactory;
+import java.security.cert.X509Certificate;
+import java.util.Arrays;
+import java.util.ArrayList;
+import java.util.List;
+import sun.security.validator.Validator;
+
+public class CertReplace {
+
+    /**
+     * @param args {cacerts keystore, cert chain}
+     */
+    public static void main(String[] args) throws Exception {
+
+        KeyStore ks = KeyStore.getInstance("JKS");
+        ks.load(new FileInputStream(args[0]), "changeit".toCharArray());
+        Validator v = Validator.getInstance
+            (Validator.TYPE_PKIX, Validator.VAR_GENERIC, ks);
+        X509Certificate[] chain = createPath(args[1]);
+        System.out.println("Chain: ");
+        for (X509Certificate c: v.validate(chain)) {
+            System.out.println("   " + c.getSubjectX500Principal() +
+                    " issued by " + c.getIssuerX500Principal());
+        }
+    }
+
+    public static X509Certificate[] createPath(String chain) throws Exception {
+        CertificateFactory cf = CertificateFactory.getInstance("X.509");
+        List list = new ArrayList();
+        for (Certificate c: cf.generateCertificates(
+                new FileInputStream(chain))) {
+            list.add((X509Certificate)c);
+        }
+        return (X509Certificate[]) list.toArray(new X509Certificate[0]);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/sun/security/validator/certreplace.sh	Wed Jul 21 09:57:21 2010 -0700
@@ -0,0 +1,85 @@
+#
+# 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 6948803
+# @summary CertPath validation regression caused by SHA1 replacement root
+#  and MD2 disable feature
+#
+
+if [ "${TESTSRC}" = "" ] ; then
+  TESTSRC="."
+fi
+if [ "${TESTJAVA}" = "" ] ; then
+  JAVAC_CMD=`which javac`
+  TESTJAVA=`dirname $JAVAC_CMD`/..
+fi
+
+# set platform-dependent variables
+OS=`uname -s`
+case "$OS" in
+  Windows_* )
+    FS="\\"
+    ;;
+  * )
+    FS="/"
+    ;;
+esac
+
+KT="$TESTJAVA${FS}bin${FS}keytool -storepass changeit \
+    -keypass changeit -keystore certreplace.jks"
+JAVAC=$TESTJAVA${FS}bin${FS}javac
+JAVA=$TESTJAVA${FS}bin${FS}java
+
+rm -rf certreplace.jks 2> /dev/null
+
+# 1. Generate 3 aliases in a keystore: ca, int, user
+
+$KT -genkeypair -alias ca -dname CN=CA -keyalg rsa -sigalg md2withrsa -ext bc
+$KT -genkeypair -alias int -dname CN=Int -keyalg rsa
+$KT -genkeypair -alias user -dname CN=User -keyalg rsa
+
+# 2. Signing: ca -> int -> user
+
+$KT -certreq -alias int | $KT -gencert -rfc -alias ca -ext bc \
+    | $KT -import -alias int
+$KT -certreq -alias user | $KT -gencert -rfc -alias int \
+    | $KT -import -alias user
+
+# 3. Create the certchain file
+
+$KT -export -alias user -rfc > certreplace.certs
+$KT -export -rfc -alias int >> certreplace.certs
+$KT -export -rfc -alias ca >> certreplace.certs
+
+# 4. Upgrade ca from MD2withRSA to SHA256withRSA, remove other aliases and
+# make this keystore the cacerts file
+
+$KT -selfcert -alias ca
+$KT -delete -alias int
+$KT -delete -alias user
+
+# 5. Build and run test
+
+$JAVAC -d . ${TESTSRC}${FS}CertReplace.java
+$JAVA CertReplace certreplace.jks certreplace.certs
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/sun/security/validator/samedn.sh	Wed Jul 21 09:57:21 2010 -0700
@@ -0,0 +1,82 @@
+#
+# 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 6958869
+# @summary regression: PKIXValidator fails when multiple trust anchors
+# have same dn
+#
+
+if [ "${TESTSRC}" = "" ] ; then
+  TESTSRC="."
+fi
+if [ "${TESTJAVA}" = "" ] ; then
+  JAVAC_CMD=`which javac`
+  TESTJAVA=`dirname $JAVAC_CMD`/..
+fi
+
+# set platform-dependent variables
+OS=`uname -s`
+case "$OS" in
+  Windows_* )
+    FS="\\"
+    ;;
+  * )
+    FS="/"
+    ;;
+esac
+
+KT="$TESTJAVA${FS}bin${FS}keytool -storepass changeit \
+    -keypass changeit -keystore samedn.jks"
+JAVAC=$TESTJAVA${FS}bin${FS}javac
+JAVA=$TESTJAVA${FS}bin${FS}java
+
+rm -rf samedn.jks 2> /dev/null
+
+# 1. Generate 3 aliases in a keystore: ca1, ca2, user. The CAs' startdate
+# is set to one year ago so that they are expired now
+
+$KT -genkeypair -alias ca1 -dname CN=CA -keyalg rsa -sigalg md5withrsa -ext bc -startdate -1y
+$KT -genkeypair -alias ca2 -dname CN=CA -keyalg rsa -sigalg sha1withrsa -ext bc -startdate -1y
+$KT -genkeypair -alias user -dname CN=User -keyalg rsa
+
+# 2. Signing: ca -> user
+
+$KT -certreq -alias user | $KT -gencert -rfc -alias ca1 > samedn1.certs
+$KT -certreq -alias user | $KT -gencert -rfc -alias ca2 > samedn2.certs
+
+# 3. Append the ca file
+
+$KT -export -rfc -alias ca1 >> samedn1.certs
+$KT -export -rfc -alias ca2 >> samedn2.certs
+
+# 4. Remove user for cacerts
+
+$KT -delete -alias user
+
+# 5. Build and run test. Make sure the CA certs are ignored for validity check.
+# Check both, one of them might be dropped out of map in old codes.
+
+$JAVAC -d . ${TESTSRC}${FS}CertReplace.java
+$JAVA CertReplace samedn.jks samedn1.certs || exit 1
+$JAVA CertReplace samedn.jks samedn2.certs || exit 2
--- a/jdk/test/sun/tools/jps/jps-Vvml_2.sh	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/test/sun/tools/jps/jps-Vvml_2.sh	Wed Jul 21 09:57:21 2010 -0700
@@ -51,3 +51,9 @@
 SLEEPER_PID=$!
 
 ${JPS} -J-XX:Flags=${TESTSRC}/vmflags -Vvml | awk -f ${TESTSRC}/jps-Vvml_Output2.awk
+RC=$?
+
+cleanup
+
+exit ${RC}
+
--- a/jdk/test/sun/tools/jps/jps-m_2.sh	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/test/sun/tools/jps/jps-m_2.sh	Wed Jul 21 09:57:21 2010 -0700
@@ -50,3 +50,9 @@
 SLEEPER_PID=$!
 
 ${JPS} -m | awk -f ${TESTSRC}/jps-m_Output2.awk
+RC=$?
+
+cleanup
+
+exit ${RC}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/sun/tools/jstat/classloadOutput1.awk	Wed Jul 21 09:57:21 2010 -0700
@@ -0,0 +1,31 @@
+#
+# matching the following output specified as a pattern that verifies
+# that the numerical values conform to a specific pattern, rather than
+# specific values.
+#
+# Loaded       Time Inited       Time Shared  Kbytes   LoadTime SysClass  Kbytes   LoadTime     Lookup      Parse Linked       Time Verified       Time AppClass  Kbytes      AppCL DefineClass       Time FindClass       Time Delegation URLCL Read
+#    956      0.115    777      0.032      0     0.0      0.000      956  3437.5      0.085      0.013      0.045    918      0.032      917      0.011       13     1.0      0.003           1      0.000         1      0.004      0.005      0.000
+#
+
+BEGIN	{
+	    headerlines=0; datalines=0; totallines=0
+	}
+
+/^Loaded       Time Inited       Time Shared  Kbytes   LoadTime SysClass  Kbytes   LoadTime     Lookup      Parse Linked       Time Verified       Time AppClass  Kbytes      AppCL DefineClass       Time FindClass       Time Delegation URLCL Read$/ {
+	    headerlines++;
+	}
+
+/^[ ]*[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+[ ]*[0-9]+\.[0-9][ ]*[0-9]+\.[0-9]+[ ]*[0-9]+[ ]*[0-9]+\.[0-9][ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+[ ]*[0-9]+\.[0-9][ ]*[0-9]+\.[0-9]+[ ]*[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+\.[0-9]+$/ {
+	    datalines++;
+	}
+
+	{ totallines++; print $0 }
+
+END	{
+	    if ((headerlines == 1) && (datalines == 1) && (totallines == 2)) {
+	        exit 0
+	    }
+	    else {
+	        exit 1
+	    }
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/sun/tools/jstat/jstatClassloadOutput1.sh	Wed Jul 21 09:57:21 2010 -0700
@@ -0,0 +1,36 @@
+#
+# 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 6959965 
+# @run shell jstatClassloadOutput1.sh
+# @summary Test that output of 'jstat -classload 0' has expected line counts
+
+. ${TESTSRC-.}/../../jvmstat/testlibrary/utils.sh
+
+setup
+verify_os
+
+JSTAT="${TESTJAVA}/bin/jstat"
+
+${JSTAT} -classload -J-Djstat.showUnsupported=true 0 2>&1 | awk -f ${TESTSRC}/classloadOutput1.awk
--- a/jdk/test/sun/tools/jstat/jstatOptions1.sh	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/test/sun/tools/jstat/jstatOptions1.sh	Wed Jul 21 09:57:21 2010 -0700
@@ -32,7 +32,9 @@
 
 JSTAT="${TESTJAVA}/bin/jstat"
 
-rm -f jstat.out 2>/dev/null
-${JSTAT} -options > jstat.out 2>&1
+rm -f jstat.out1 jstat.out2 2>/dev/null
+${JSTAT} -options > jstat.out1 2>&1
+${JSTAT} -options -J-Djstat.showUnsupported=true > jstat.out2 2>&1
 
-diff -w jstat.out ${TESTSRC}/options1.out
+diff -w jstat.out1 ${TESTSRC}/options1.out
+diff -w jstat.out2 ${TESTSRC}/options2.out
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/sun/tools/jstat/options2.out	Wed Jul 21 09:57:21 2010 -0700
@@ -0,0 +1,13 @@
+-class
+-classload
+-compiler
+-gc
+-gccapacity
+-gccause
+-gcnew
+-gcnewcapacity
+-gcold
+-gcoldcapacity
+-gcpermcapacity
+-gcutil
+-printcompilation
--- a/jdk/test/sun/tools/jstatd/jstatdDefaults.sh	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/test/sun/tools/jstatd/jstatdDefaults.sh	Wed Jul 21 09:57:21 2010 -0700
@@ -56,12 +56,11 @@
 if [ $? -ne 0 ]
 then
     echo "Output of jps differs from expected output. Failed."
+    cleanup
     exit 1
 fi
 
-TARGET_PID=`${JPS} | grep "Jstatd" | cut -d" " -f1`
-
-${JSTAT} -gcutil ${TARGET_PID}@${HOSTNAME} 250 5 2>&1 | awk -f ${TESTSRC}/jstatGcutilOutput1.awk
+${JSTAT} -gcutil ${JSTATD_PID}@${HOSTNAME} 250 5 2>&1 | awk -f ${TESTSRC}/jstatGcutilOutput1.awk
 RC=$?
 
 if [ ${RC} -ne 0 ]
@@ -75,4 +74,6 @@
     RC=1
 fi
 
+cleanup
+
 exit ${RC}
--- a/jdk/test/sun/tools/jstatd/jstatdExternalRegistry.sh	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/test/sun/tools/jstatd/jstatdExternalRegistry.sh	Wed Jul 21 09:57:21 2010 -0700
@@ -44,7 +44,11 @@
 JSTAT="${TESTJAVA}/bin/jstat"
 
 HOSTNAME=`uname -n`
-PORT=2099
+PORT=`freePort`
+if [ "${PORT}" = "0" ] ; then
+  echo "Cannot get free port"
+  exit 1
+fi
 
 RMIREGISTRY_OUT="rmiregistry_$$.out"
 JSTATD_OUT="jstatd_$$.out"
@@ -69,12 +73,7 @@
     exit 1
 fi
 
-# get the process id for the target app (jstatd). note, don't rely
-# on JSTATD_PID as mks interposes a shell when starting a process in
-# the background
-TARGET_PID=`${JPS} | grep "Jstatd" | cut -d" " -f1`
-
-${JSTAT} -gcutil ${TARGET_PID}@${HOSTNAME}:${PORT} 250 5 2>&1 | awk -f ${TESTSRC}/jstatGcutilOutput1.awk
+${JSTAT} -gcutil ${JSTATD_PID}@${HOSTNAME}:${PORT} 250 5 2>&1 | awk -f ${TESTSRC}/jstatGcutilOutput1.awk
 RC=$?
 
 if [ ${RC} -ne 0 ]
--- a/jdk/test/sun/tools/jstatd/jstatdPort.sh	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/test/sun/tools/jstatd/jstatdPort.sh	Wed Jul 21 09:57:21 2010 -0700
@@ -42,7 +42,11 @@
 JSTAT="${TESTJAVA}/bin/jstat"
 
 HOSTNAME=`uname -n`
-PORT=2099
+PORT=`freePort`
+if [ "${PORT}" = "0" ] ; then
+  echo "Cannot get free port"
+  exit 1
+fi
 
 JSTATD_OUT="jstatd_$$.out"
 
@@ -57,12 +61,11 @@
 if [ $? -ne 0 ]
 then
     echo "Output of jps differs from expected output. Failed."
+    cleanup
     exit 1
 fi
 
-TARGET_PID=`${JPS} | grep "Jstatd" | cut -d" " -f1`
-
-${JSTAT} -gcutil ${TARGET_PID}@${HOSTNAME}:${PORT} 250 5 2>&1 | awk -f ${TESTSRC}/jstatGcutilOutput1.awk
+${JSTAT} -gcutil ${JSTATD_PID}@${HOSTNAME}:${PORT} 250 5 2>&1 | awk -f ${TESTSRC}/jstatGcutilOutput1.awk
 RC=$?
 
 if [ ${RC} -ne 0 ]
@@ -76,4 +79,6 @@
     RC=1
 fi
 
+cleanup
+
 exit ${RC}
--- a/jdk/test/sun/tools/jstatd/jstatdServerName.sh	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/test/sun/tools/jstatd/jstatdServerName.sh	Wed Jul 21 09:57:21 2010 -0700
@@ -43,8 +43,12 @@
 JSTAT="${TESTJAVA}/bin/jstat"
 
 HOSTNAME=`uname -n`
-PORT_1=2098
-PORT_2=2099
+PORT_1=`freePort`
+if [ "${PORT_1}" = "0" ] ; then
+  echo "ERROR: No free port"
+  exit 1
+fi
+PORT_2=`expr ${PORT_1} '+' 1`
 SERVERNAME="SecondJstatdServer"
 
 JSTATD_1_OUT="jstatd_$$_1.out"
@@ -68,6 +72,7 @@
 if [ $? -ne 0 ]
 then
     echo "Output of jps differs from expected output. Failed."
+    cleanup
     exit 1
 fi
 
@@ -77,13 +82,12 @@
 if [ $? -ne 0 ]
 then
     echo "Output of jps differs from expected output. Failed."
+    cleanup
     exit 1
 fi
 
-TARGET_PID=`${JPS} | grep "Jstatd" | cut -d" " -f1 | head -1`
-
-echo "running: ${JSTAT} -gcutil ${TARGET_PID}@${HOSTNAME}:${PORT_1} 250 5"
-${JSTAT} -gcutil ${TARGET_PID}@${HOSTNAME}:${PORT_1} 250 5 2>&1 | awk -f ${TESTSRC}/jstatGcutilOutput1.awk
+echo "running: ${JSTAT} -gcutil ${JSTATD_1_PID}@${HOSTNAME}:${PORT_1} 250 5"
+${JSTAT} -gcutil ${JSTATD_1_PID}@${HOSTNAME}:${PORT_1} 250 5 2>&1 | awk -f ${TESTSRC}/jstatGcutilOutput1.awk
 RC=$?
 
 if [ ${RC} -ne 0 ]
@@ -91,8 +95,8 @@
     echo "jstat output differs from expected output"
 fi
 
-echo "running: ${JSTAT} -gcutil ${TARGET_PID}@${HOSTNAME}:${PORT_2}/${SERVERNAME} 250 5"
-${JSTAT} -gcutil ${TARGET_PID}@${HOSTNAME}:${PORT_2}/${SERVERNAME} 250 5 2>&1 | awk -f ${TESTSRC}/jstatGcutilOutput1.awk
+echo "running: ${JSTAT} -gcutil ${JSTATD_1_PID}@${HOSTNAME}:${PORT_2}/${SERVERNAME} 250 5"
+${JSTAT} -gcutil ${JSTATD_1_PID}@${HOSTNAME}:${PORT_2}/${SERVERNAME} 250 5 2>&1 | awk -f ${TESTSRC}/jstatGcutilOutput1.awk
 RC=$?
 
 if [ ${RC} -ne 0 ]
@@ -112,4 +116,6 @@
     RC=1
 fi
 
+cleanup
+
 exit ${RC}
--- a/jdk/test/tools/jar/UpdateManifest.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/test/tools/jar/UpdateManifest.java	Wed Jul 21 09:57:21 2010 -0700
@@ -143,6 +143,7 @@
         } else {
             fail("did not match specVersion nor specTitle");
         }
+        zf.close();
     }
 
     // --------------------- Convenience ---------------------------
--- a/jdk/test/tools/jar/index/MetaInf.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/test/tools/jar/index/MetaInf.java	Wed Jul 21 09:57:21 2010 -0700
@@ -62,7 +62,13 @@
 
     static boolean contains(File jarFile, String entryName)
         throws IOException {
-        return new ZipFile(jarFile).getEntry(entryName) != null;
+        ZipFile zf = new ZipFile(jarFile);
+        if ( zf != null ) {
+            boolean result = zf.getEntry(entryName) != null;
+            zf.close();
+            return result;
+        }
+        return false;
     }
 
     static void checkContains(File jarFile, String entryName)
@@ -94,9 +100,13 @@
         String line;
         while ((line = index.readLine()) != null) {
             if (line.equals(SERVICES)) {
+                index.close();
+                f.close();
                 return;
             }
         }
+        index.close();
+        f.close();
         throw new Error(SERVICES + " not indexed.");
     }
 
--- a/jdk/test/tools/launcher/Arrrghs.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/test/tools/launcher/Arrrghs.java	Wed Jul 21 09:57:21 2010 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2007, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2007, 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
@@ -23,7 +23,7 @@
 
 /**
  * @test
- * @bug 5030233 6214916 6356475 6571029 6684582 6742159 4459600 6758881
+ * @bug 5030233 6214916 6356475 6571029 6684582 6742159 4459600 6758881 6753938
  * @summary Argument parsing validation.
  * @compile -XDignore.symbol.file Arrrghs.java TestHelper.java
  * @run main Arrrghs
@@ -223,6 +223,20 @@
         tr.checkPositive();
         tr.isNotZeroOutput();
         System.out.println(tr);
+
+        // 6753938, test for non-negative exit value for an incorrectly formed
+        // command line,  '% java'
+        tr = TestHelper.doExec(TestHelper.javaCmd);
+        tr.checkNegative();
+        tr.isNotZeroOutput();
+        System.out.println(tr);
+
+        // 6753938, test for non-negative exit value for an incorrectly formed
+        // command line,  '% java -Xcomp'
+        tr = TestHelper.doExec(TestHelper.javaCmd, "-Xcomp");
+        tr.checkNegative();
+        tr.isNotZeroOutput();
+        System.out.println(tr);
     }
 
     /*
--- a/jdk/test/tools/launcher/Makefile.SolarisRunpath	Tue Jul 20 16:09:44 2010 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,75 +0,0 @@
-# Copyright (c) 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 is a not quite automated Makefile to generate the Solaris
-# binaries used for the SolarisRunpath.sh test.  First,
-# libraryCaller.java program must be compiled.  Next, javah is called
-# on the class file to generate the needed header file for the jni
-# code.  Then, 2 Solaris executables are generated in separate
-# directories, a default one meant to be pointed to by LD_LIBRARY_PATH
-# (this function returns 0) and another one for the data model
-# specific LD_LIBRARY_PATH (this function returns the size of integers
-# in the data model, 32 or 64).  A better makefile would run, say
-# isainfo -v, and generated binaries for all supported data models.
-# To do this a mapping would be needed from data models to
-# architecture dependent compiler options; e.g. 64 bit on sparc =>
-# -xarch=v9.  Also, the settings for JINCLUDE, JAVAC, and JAVAH should
-# come from the current build.  The C compiler should be the one
-# approved for the build.  To be extra safe, the binaries should be
-# generated on the oldest Solaris release supported by the current
-# Java build.
-
-# Include directory in JRE or JDK install; e.g.
-JINCLUDE=/java/re/jdk/1.4.1/latest/binaries/solaris-sparc/include
-
-# Path to javac executable; e.g.
-JAVAC=/java/re/jdk/1.4.1/promoted/fcs/b21/binaries/solaris-sparc/bin/javac
-
-# Path to javah executable; e.g.
-JAVAH=/java/re/jdk/1.4.1/promoted/fcs/b21/binaries/solaris-sparc/bin/javah
-
-# Path to C compiler; e.g.
-CC=/java/devtools/sparc/SUNWspro/SC6.1/bin/cc
-
-
-ARCH=`uname -p`
-
-# 32-bit Solaris Options
-DM=32
-# Default architecture is fine for both sparc and x86 32-bit builds
-OPTIONS=
-
-# 64-bit Solaris Options
-#DM=64
-#OPTIONS=-xarch=v9
-
-
-all: libraryCaller.java libraryCaller.c
-	$(JAVAC) libraryCaller.java;					\
-	$(JAVAH) libraryCaller;						\
-	$(CC) -G -I$(JINCLUDE) -I$(JINCLUDE)/solaris -DRETURN_VALUE=0 	\
-		$(OPTIONS) libraryCaller.c 				\
-		-o lib/$(ARCH)/lib$(DM)/liblibrary.so;			\
-	$(CC) -G -I$(JINCLUDE) -I$(JINCLUDE)/solaris -DRETURN_VALUE=$(DM)\
-		$(OPTIONS) libraryCaller.c 				\
-		-o lib/$(ARCH)/lib$(DM)/lib$(DM)/liblibrary.so;
--- a/jdk/test/tools/launcher/UnicodeTest.sh	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/test/tools/launcher/UnicodeTest.sh	Wed Jul 21 09:57:21 2010 -0700
@@ -54,7 +54,11 @@
 
 echo "creating test source files"
 "$JAVAC" -d . "${TESTSRC}"/UnicodeTest.java
-CLASS_NAME=`"$JAVA" UnicodeTest | sed -e 's@\\r@@g' `
+if [ "`uname -s | grep CYGWIN`" != "" ] ; then
+  CLASS_NAME=`"$JAVA" UnicodeTest | sed -e 's@\\r@@g' `
+else
+  CLASS_NAME=`"$JAVA" UnicodeTest`
+fi
 
 if [ "$CLASS_NAME" = "" ]
 then
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/tools/launcher/VerifyExceptions.java	Wed Jul 21 09:57:21 2010 -0700
@@ -0,0 +1,65 @@
+/*
+ * 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 6856415
+ * @summary Checks to ensure that proper exceptions are thrown by java
+ * @compile -XDignore.symbol.file VerifyExceptions.java TestHelper.java
+ * @run main VerifyExceptions
+ */
+
+
+import java.io.File;
+import java.io.FileNotFoundException;
+
+
+public class VerifyExceptions {
+
+    static void test6856415() {
+        // No pkcs library on win-x64, so we bail out.
+        if (TestHelper.is64Bit && TestHelper.isWindows) {
+            return;
+        }
+        StringBuilder sb = new StringBuilder();
+        sb.append("public static void main(String... args) {\n");
+        sb.append("java.security.Provider p = new sun.security.pkcs11.SunPKCS11(args[0]);\n");
+        sb.append("java.security.Security.insertProviderAt(p, 1);\n");
+        sb.append("}");
+        File testJar = new File("Foo.jar");
+        testJar.delete();
+        try {
+            TestHelper.createJar(testJar, sb.toString());
+        } catch (FileNotFoundException fnfe) {
+            throw new RuntimeException(fnfe);
+        }
+        TestHelper.TestResult tr = TestHelper.doExec(TestHelper.javacCmd,
+                "-Djava.security.manager", "-jar", testJar.getName(), "foo.bak");
+        tr.checkNegative();
+        tr.contains("Exception in thread \"main\" java.security.AccessControlException: access denied (\"java.lang.RuntimePermission\" \"accessClassInPackage.sun.security.pkcs11\")\")");
+    }
+
+    public static void main(String... args) {
+        test6856415();
+    }
+}
Binary file jdk/test/tools/launcher/lib/i386/lib32/lib32/liblibrary.so has changed
Binary file jdk/test/tools/launcher/lib/i386/lib32/liblibrary.so has changed
Binary file jdk/test/tools/launcher/lib/sparc/lib32/lib32/liblibrary.so has changed
Binary file jdk/test/tools/launcher/lib/sparc/lib32/liblibrary.so has changed
Binary file jdk/test/tools/launcher/lib/sparc/lib64/lib64/liblibrary.so has changed
Binary file jdk/test/tools/launcher/lib/sparc/lib64/liblibrary.so has changed
--- a/jdk/test/tools/pack200/Pack200Test.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/jdk/test/tools/pack200/Pack200Test.java	Wed Jul 21 09:57:21 2010 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2007, 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
@@ -39,8 +39,8 @@
  */
 public class Pack200Test {
 
-    private static ArrayList <File> jarList = new ArrayList();
-    private static final String PACKEXT = ".pack";
+    private static ArrayList <File> jarList = new ArrayList<File>();
+    static final String PACKEXT = ".pack";
 
     /** Creates a new instance of Pack200Test */
     private Pack200Test() {}
@@ -48,7 +48,7 @@
     private static void doPackUnpack() {
         for (File in : jarList) {
             Pack200.Packer packer = Pack200.newPacker();
-            Map p = packer.properties();
+            Map<String, String> p = packer.properties();
             // Take the time optimization vs. space
             p.put(packer.EFFORT, "1");  // CAUTION: do not use 0.
             // Make the memory consumption as effective as possible
@@ -96,7 +96,7 @@
     }
 
     private static ArrayList <String> getZipFileEntryNames(ZipFile z) {
-        ArrayList <String> out = new ArrayList();
+        ArrayList <String> out = new ArrayList<String>();
         for (ZipEntry ze : Collections.list(z.entries())) {
             out.add(ze.getName());
         }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/tools/pack200/PackageVersionTest.java	Wed Jul 21 09:57:21 2010 -0700
@@ -0,0 +1,169 @@
+
+/*
+ * 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 6712743
+  * @summary verify package versioning
+  * @compile -XDignore.symbol.file PackageVersionTest.java
+  * @run main PackageVersionTest
+  */
+
+import java.io.ByteArrayOutputStream;
+import java.io.Closeable;
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.PrintStream;
+import java.util.jar.JarFile;
+import java.util.jar.Pack200;
+import java.util.jar.Pack200.Packer;
+
+public class PackageVersionTest {
+    private static final File  javaHome = new File(System.getProperty("java.home"));
+
+    public final static int JAVA5_PACKAGE_MAJOR_VERSION = 150;
+    public final static int JAVA5_PACKAGE_MINOR_VERSION = 7;
+
+    public final static int JAVA6_PACKAGE_MAJOR_VERSION = 160;
+    public final static int JAVA6_PACKAGE_MINOR_VERSION = 1;
+
+    public static void main(String... args) {
+        if (!javaHome.getName().endsWith("jre")) {
+            throw new RuntimeException("Error: requires an SDK to run");
+        }
+
+        File out = new File("test.pack");
+        createClassFile("Test5");
+        createClassFile("Test6");
+        createClassFile("Test7");
+
+        verifyPack("Test5.class", JAVA5_PACKAGE_MAJOR_VERSION,
+                JAVA5_PACKAGE_MINOR_VERSION);
+
+        verifyPack("Test6.class", JAVA6_PACKAGE_MAJOR_VERSION,
+                JAVA6_PACKAGE_MINOR_VERSION);
+
+        // TODO: change this to the java7 package version as needed.
+        verifyPack("Test7.class", JAVA6_PACKAGE_MAJOR_VERSION,
+                JAVA6_PACKAGE_MINOR_VERSION);
+
+        // test for resource file, ie. no class files
+        verifyPack("Test6.java", JAVA5_PACKAGE_MAJOR_VERSION,
+                JAVA5_PACKAGE_MINOR_VERSION);
+    }
+
+    static void close(Closeable c) {
+        if (c == null) {
+            return;
+        }
+        try {
+            c.close();
+        } catch (IOException ignore) {}
+    }
+
+    static void createClassFile(String name) {
+        createJavaFile(name);
+        String target = name.substring(name.length() - 1);
+        String javacCmds[] = {
+            "-source",
+            "5",
+            "-target",
+            name.substring(name.length() - 1),
+            name + ".java"
+        };
+        compileJava(javacCmds);
+    }
+
+    static void createJavaFile(String name) {
+        PrintStream ps = null;
+        FileOutputStream fos = null;
+        File outputFile = new File(name + ".java");
+        outputFile.delete();
+        try {
+            fos = new FileOutputStream(outputFile);
+            ps = new PrintStream(fos);
+            ps.format("public class %s {}", name);
+        } catch (IOException ioe) {
+            throw new RuntimeException("creation of test file failed");
+        } finally {
+            close(ps);
+            close(fos);
+        }
+    }
+
+    static void compileJava(String... javacCmds) {
+        if (com.sun.tools.javac.Main.compile(javacCmds) != 0) {
+            throw new RuntimeException("compilation failed");
+        }
+    }
+
+    static void makeJar(String... jargs) {
+        sun.tools.jar.Main jarTool =
+                new sun.tools.jar.Main(System.out, System.err, "jartool");
+        if (!jarTool.run(jargs)) {
+            throw new RuntimeException("jar command failed");
+        }
+    }
+
+    static void verifyPack(String filename, int expected_major, int expected_minor) {
+
+        File jarFileName = new File("test.jar");
+        jarFileName.delete();
+        String jargs[] = {
+            "cvf",
+            jarFileName.getName(),
+            filename
+        };
+        makeJar(jargs);
+        JarFile jfin = null;
+
+        try {
+            jfin = new JarFile(jarFileName);
+            Packer packer = Pack200.newPacker();
+            ByteArrayOutputStream baos = new ByteArrayOutputStream();
+            packer.pack(jfin, baos);
+            baos.flush();
+            baos.close();
+            byte[] buf = baos.toByteArray();
+
+            int minor = buf[4] & 0x000000ff;
+            int major = buf[5] & 0x000000ff;
+
+            if (major != expected_major || minor != expected_minor) {
+                String msg =
+                        String.format("test fails: expected:%d.%d but got %d.%d\n",
+                        expected_major, expected_minor,
+                        major, minor);
+                throw new Error(msg);
+            }
+
+            System.out.println(filename + ": OK");
+        } catch (IOException ioe) {
+            throw new RuntimeException(ioe.getMessage());
+        } finally {
+            close(jfin);
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/tools/pack200/SegmentLimit.java	Wed Jul 21 09:57:21 2010 -0700
@@ -0,0 +1,134 @@
+/*
+ * 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 6575373
+ * @summary verify default segment limit
+ * @compile SegmentLimit.java
+ * @run main SegmentLimit
+ */
+
+import java.io.BufferedReader;
+import java.io.Closeable;
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.io.PrintStream;
+
+/*
+ * Run this against a large jar file, by default the packer should generate only
+ * one segment, parse the output of the packer to verify if this is indeed true.
+ */
+
+public class SegmentLimit {
+
+    private static final File  javaHome = new File(System.getProperty("java.home"));
+
+    public static void main(String... args) {
+        if (!javaHome.getName().endsWith("jre")) {
+            throw new RuntimeException("Error: requires an SDK to run");
+        }
+
+        File out = new File("test" + Pack200Test.PACKEXT);
+        out.delete();
+        runPack200(out);
+    }
+
+    static void close(Closeable c) {
+        if (c == null) {
+            return;
+        }
+        try {
+            c.close();
+        } catch (IOException ignore) {}
+    }
+
+    static void runPack200(File outFile) {
+        File binDir = new File(javaHome, "bin");
+        File pack200Exe = System.getProperty("os.name").startsWith("Windows")
+                ? new File(binDir, "pack200.exe")
+                : new File(binDir, "pack200");
+        File sdkHome = javaHome.getParentFile();
+        File testJar = new File(new File(sdkHome, "lib"), "tools.jar");
+
+        System.out.println("using pack200: " + pack200Exe.getAbsolutePath());
+
+        String[] cmds = { pack200Exe.getAbsolutePath(),
+                          "--effort=1",
+                          "--verbose",
+                          "--no-gzip",
+                          outFile.getName(),
+                          testJar.getAbsolutePath()
+        };
+        InputStream is = null;
+        BufferedReader br = null;
+        InputStreamReader ir = null;
+
+        FileOutputStream fos = null;
+        PrintStream ps = null;
+
+        try {
+            ProcessBuilder pb = new ProcessBuilder(cmds);
+            pb.redirectErrorStream(true);
+            Process p = pb.start();
+            is = p.getInputStream();
+            ir = new InputStreamReader(is);
+            br = new BufferedReader(ir);
+
+            File logFile = new File("pack200.log");
+            fos = new FileOutputStream(logFile);
+            ps  = new PrintStream(fos);
+
+            String line = br.readLine();
+            int count = 0;
+            while (line != null) {
+                line = line.trim();
+                if (line.matches(".*Transmitted.*files of.*input bytes in a segment of.*bytes")) {
+                    count++;
+                }
+                ps.println(line);
+                line=br.readLine();
+            }
+            p.waitFor();
+            if (p.exitValue() != 0) {
+                throw new RuntimeException("pack200 failed");
+            }
+            p.destroy();
+            if (count > 1) {
+                throw new Error("test fails: check for multiple segments(" +
+                        count + ") in: " + logFile.getAbsolutePath());
+            }
+        } catch (IOException ex) {
+            throw new RuntimeException(ex.getMessage());
+        } catch (InterruptedException ignore){
+        } finally {
+            close(is);
+            close(ps);
+            close(fos);
+        }
+    }
+}
+
--- a/langtools/.hgtags	Tue Jul 20 16:09:44 2010 -0700
+++ b/langtools/.hgtags	Wed Jul 21 09:57:21 2010 -0700
@@ -70,3 +70,9 @@
 683cd1f6bc4b562b0ddf29d5f80f05c2123b76b0 jdk7-b93
 bb3d7c75a56df0c00246072b996fad1858a771a1 jdk7-b94
 752bb790fc2d6df91e91d84420c9c87136eb81eb jdk7-b95
+89cd267c216751bdacf8629bb07a40c0950fc4f2 jdk7-b96
+c0a41294297ed397098dd92b647f481f0e1bb8fa jdk7-b97
+3b38f3aa3dc388eef0737a9fba99f54a1602ee3b jdk7-b98
+005bec70ca27239bdd4e6169b9b078507401aa72 jdk7-b99
+d1d7595fa824925651f09b8ffcb86c9cf39807be jdk7-b100
+20a8fe72ee7b673f59c319a5222fe0eebbd92082 jdk7-b101
--- a/langtools/make/Makefile	Tue Jul 20 16:09:44 2010 -0700
+++ b/langtools/make/Makefile	Wed Jul 21 09:57:21 2010 -0700
@@ -26,9 +26,9 @@
 # Makefile for langtools: wrapper around Ant build.xml file
 
 #
-# On Solaris, the 'make' utility from Sun will not work with these makefiles.
-#    This little rule is only understood by Sun's make, and is harmless
-#    when seen by the GNU make tool. If using Sun's make, this causes the
+# On Solaris, the standard 'make' utility will not work with these makefiles.
+#    This little rule is only understood by Solaris make, and is harmless
+#    when seen by the GNU make tool. If using Solaris make, this causes the
 #    make command to fail.
 #
 SUN_MAKE_TEST:sh = @echo "ERROR: PLEASE USE GNU VERSION OF MAKE"; exit 33
@@ -40,15 +40,16 @@
 
 SYSTEM_UNAME := $(shell uname)
 
+# Where is unwanted output to be delivered?
+# On Windows, MKS uses the special file "NUL", cygwin uses the customary unix file.
 ifeq ($(SYSTEM_UNAME), Windows_NT)
 DEV_NULL = NUL
 else
+DEV_NULL = /dev/null 
+endif
+
 ifneq (,$(findstring CYGWIN,$(SYSTEM_UNAME)))
-DEV_NULL = NUL
 USING_CYGWIN = true
-else
-DEV_NULL = /dev/null
-endif 
 endif
 
 ifdef USING_CYGWIN
@@ -202,7 +203,7 @@
 
 #-------------------------------------------------------------------
 #
-# Targets for Sun's internal JPRT build system
+# Targets for Oracle's internal JPRT build system
 
 CD = cd
 ZIP = zip
--- a/langtools/make/Makefile-classic	Tue Jul 20 16:09:44 2010 -0700
+++ b/langtools/make/Makefile-classic	Wed Jul 21 09:57:21 2010 -0700
@@ -28,9 +28,9 @@
 #
 
 #
-# On Solaris, the 'make' utility from Sun will not work with these makefiles.
-#    This little rule is only understood by Sun's make, and is harmless
-#    when seen by the GNU make tool. If using Sun's make, this causes the
+# On Solaris, the standard 'make' utility will not work with these makefiles.
+#    This little rule is only understood by Solaris make, and is harmless
+#    when seen by the GNU make tool. If using Solaris make, this causes the
 #    make command to fail.
 #
 SUN_MAKE_TEST:sh = @echo "ERROR: PLEASE USE GNU VERSION OF MAKE"; exit 33
--- a/langtools/make/build.properties	Tue Jul 20 16:09:44 2010 -0700
+++ b/langtools/make/build.properties	Wed Jul 21 09:57:21 2010 -0700
@@ -76,17 +76,27 @@
 javadoc.jls3.option=-tag "jls3:a:See &lt;cite&gt;${javadoc.jls3.cite}&lt;/cite&gt;:"
 
 # jtreg, used to run the JDK regression tests
+# See http://openjdk.java.net/jtreg/
 # Override this path as needed, either on the command line or in
 # one of the standard user build.properties files (see build.xml)
 
-# jtreg.home = /opt/jtreg/3.2.2_02
+# jtreg.home = /opt/jtreg/4.1
 
 # findbugs
+# See http://findbugs.sourceforge.net/
 # Override this path as needed, either on the command line or in
 # one of the standard user build.properties files (see build.xml)
 
 # findbugs.home = /opt/findbugs/1.2.1
 
+# vizant (graph visualization tool for Ant)
+# See http://vizant.sourceforge.net/
+# Override this path as needed, either on the command line or in
+# one of the standard user build.properties files (see build.xml)
+
+# vizant.jar = /opt/vizant/0.1.2/vizant-0.1.2.jar
+# dot = dot
+
 #------------------------------------------------------------
 
 # The following properties define the packages for each of the tools.
@@ -148,12 +158,14 @@
 
 #
 
-# The following files require the import JDK to be available
-require.import.jdk.files = \
+# The following files require the latest JDK to be available.
+# The API can be provided by using a suitable boot.java.home
+# or by setting import.jdk
+require.latest.jdk.files = \
     com/sun/tools/javac/nio/*.java
 
 # The following files in the import jdk source directory are required
-# in order to compile the files defined in ${require.import.jdk.files}
+# in order to compile the files defined in ${require.latest.jdk.files}
 #
 # For NIO, the list of stub files is defined by the contents of the primary
 # API packages, together with such types that may be required in order to
--- a/langtools/make/build.xml	Tue Jul 20 16:09:44 2010 -0700
+++ b/langtools/make/build.xml	Wed Jul 21 09:57:21 2010 -0700
@@ -25,12 +25,79 @@
 -->
 
 <!--
- This is the main build file for the complete langtools workspace.
- It is used both when working on the tools in NetBeans, and when building
- JDK itself, in which case it is invoked from the wrapper Makefile.
+ This is the main build file for the complete langtools repository.
+ It is used when building JDK (in which case it is invoked from the
+ Makefile), and it can be used when working on the tools themselves,
+ in an IDE such as NetBeans.
+
+ External dependencies are specified via properties. These can be given
+ on the command line, or by providing a local build.properties file.
+ (They can also be edited into make/build.properties, although that is not
+ recommended.)  At a minimum, boot.java.home must be set to the installed
+ location of the version of JDK used to build this repository. Additional
+ properties may be required, depending on the targets that are built.
+ For example, to run any of the jtreg tests you must set jtreg.home,
+ to run findbugs on the code you must set findbugs.home, and so on.
+
+ For the most part, javac can be built using the previous version of JDK.
+ However, a small number of javac files require access to the latest JDK,
+ which may not yet have been compiled. To compile these files, you can do
+ one of the following:
+ - Set boot.java.home to a recent build of the latest version of JDK.
+ - Set import.jdk to either a recent build (containing jre/lib/rt.jar)
+   or to jdk source repository.  In the latter case, stub files will
+   automatically be generated and used for the required API, to avoid
+   unnecessary compilation of the source repository.
+ If you do neither, the relevant files will not be built.
+
+ The main build happens in two phases:
+ - First, javac and other tools as needed are built using ${boot.java.home}.
+   (This implies a constraint on the source code that they can be compiled
+   with the previous version of JDK.
+ - Second, all required classes are compiled with the latest javac, created
+   in the previous step.
+ The first phase is called the bootstrap phase. All targets, properties and
+ tasks that are specific to that phase have "bootstrap" in their name.
+
+ For more details on the JDK build, see
+    http://blogs.sun.com/kto/entry/anatomy_of_the_jdk_build
+    http://openjdk.java.net/groups/build/
+ For more details on the stub generator, see
+    http://blogs.sun.com/jjg/entry/building_javac_for_jdk7
+
+ Internal details ...
+
+ Interim build products are created in the build/ directory.
+ Final build products are created in the dist/ directory.
+ When building JDK, the dist/directory will contain:
+ - A bootstrap compiler suitable for running with ${boot.java.home}
+   suitable for compiling downstream parts of JDK
+ - Source files and class files for inclusion in the JDK being built
+ When building standalone, the dist/directory will contain:
+ - Separate jar files for each of the separate langtools components
+ - Simple scripts to invoke the tools by executing the corresponding
+   jar files.
+ These jar files and scripts are "for developer use only".
+
+ This file is organized into sections as follows:
+ - global property definitions
+ - general top level targets
+ - general diagnostic/debugging targets
+ - groups of targets for each tool: javac, javadoc, doclets, javah, javap, apt
+    Within each group, the following targets are provided, where applicable
+      build-bootstrap-TOOL      build the bootstrap version of the tool
+      build-classes-TOOL        build the classes for the tool
+      build-TOOL                build the jar file and script for the tool
+      jtreg-TOOL                build the tool and run the appropriate tests
+      findbugs-TOOL             run findbugs on the tool's source oode
+      TOOL                      build the tool, run the tests, and run findbugs
+ - utility definitions
  -->
 
 <project name="langtools" default="build" basedir="..">
+    <!--
+    **** Global property definitions.
+    -->
 
     <!-- Force full debuginfo for javac if the debug.classfiles
     property is set.  This must be BEFORE the include of
@@ -107,35 +174,55 @@
         ignoresystemclasses="true"
         classpath="${import.jdk}/jre/lib/rt.jar" classname="java.nio.file.Path"/>
 
-    <!-- Set the default value of the sourcepath used for javac. -->
-    <condition property="javac.sourcepath" value="${build.genstubs.dir}" else="">
-        <isset property="import.jdk.src.dir"/>
-    </condition>
-
-    <!-- Set the default value of the classpath used for javac. -->
-    <property name="javac.classpath" value=""/>
-
-    <!-- Set the default bootclasspath option used for javac. 
-	Note that different variants of the option are used, meaning we can't just 
-	define the value for the option.
-	Note the explicit use of the standard property ${path.separator} in the following.
-	This is because Ant is not clever enough to handle direct use of : or ; -->
+    <!-- Set the default bootclasspath option used for javac.
+        Note that different variants of the option are used, meaning we can't just
+        define the value for the option.
+        Note the explicit use of the standard property ${path.separator} in the following.
+        This is because Ant is not clever enough to handle direct use of : or ; -->
     <condition property="javac.bootclasspath.opt"
             value="-Xbootclasspath:${build.classes.dir}${path.separator}${import.jdk.jar}"
             else="-Xbootclasspath/p:${build.classes.dir}">
         <isset property="import.jdk.jar"/>
     </condition>
 
-    <condition property="exclude.files" value="" else="${require.import.jdk.files}">
-        <isset property="import.jdk"/>
+    <condition property="boot.java.provides.latest.jdk">
+        <available
+            ignoresystemclasses="true"
+            classpath="${boot.java.home}/jre/lib/rt.jar" classname="java.nio.file.Path"/>
+    </condition>
+
+    <condition property="bootstrap.exclude.files" value="" else="${require.latest.jdk.files}">
+        <isset property="boot.java.provides.latest.jdk"/>
+    </condition>
+
+    <condition property="exclude.files" value="" else="${require.latest.jdk.files}">
+        <or>
+            <isset property="boot.java.provides.latest.jdk"/>
+            <isset property="import.jdk"/>
+        </or>
     </condition>
 
-    <!-- for debugging -->
-    <target name="check-import.jdk">
-        <echo message="import.jdk: ${import.jdk}"/>
-        <echo message="import.jdk.jar: ${import.jdk.jar}"/>
-        <echo message="import.jdk.src.dir: ${import.jdk.src.dir}"/>
-    </target>
+    <condition property="require.import.jdk.stubs">
+        <and>
+            <not>
+                <isset property="boot.java.provides.latest.jdk"/>
+            </not>
+            <isset property="import.jdk.src.dir"/>
+        </and>
+    </condition>
+
+    <!-- Set the default value of the sourcepath used for javac. -->
+    <condition property="javac.sourcepath" value="${build.genstubs.dir}" else="">
+        <isset property="require.import.jdk.stubs"/>
+    </condition>
+
+    <!-- Set the default value of the classpath used for javac. -->
+    <property name="javac.classpath" value=""/>
+
+
+    <!--
+    **** General top level targets.
+    -->
 
     <!-- Standard target to build deliverables for JDK build. -->
 
@@ -235,7 +322,61 @@
             datafile="${build.coverage.dir}/cobertura.ser"/>
     </target>
 
-    <!-- javac targets -->
+
+    <!--
+    **** Debugging/diagnostic targets.
+    -->
+
+    <!-- standard JDK target -->
+    <target name="sanity"
+        description="display settings of configuration values">
+        <echo level="info">ant.home = ${ant.home}</echo>
+        <echo level="info">boot.java.home = ${boot.java.home}</echo>
+        <echo level="info">target.java.home = ${target.java.home}</echo>
+        <echo level="info">jtreg.home = ${jtreg.home}</echo>
+        <echo level="info">findbugs.home = ${findbugs.home}</echo>
+    </target>
+
+    <target name="post-sanity" depends="-def-jtreg,sanity,build"
+        description="perform basic validation after a standard build">
+        <jtreg
+            dir="make/test"
+            workDir="${build.jtreg.dir}/post-sanity/work"
+            reportDir="${build.jtreg.dir}/post-sanity/report"
+            jdk="${target.java.home}"
+            verbose="summary"
+            failonerror="false" resultproperty="jtreg.post-sanity.result">
+        </jtreg>
+    </target>
+
+    <!-- use vizant tool to generate graphical image of this Ant file.-->
+    <target name="vizant" depends="-def-vizant">
+        <mkdir dir="${build.dir}"/>
+        <echo message="Generating ${build.dir}/build.dot"/>
+        <vizant antfile="${make.dir}/build.xml" outfile="${build.dir}/build.dot"/>
+        <echo message="Generating ${build.dir}/build.png"/>
+        <exec executable="${dot}" >
+            <arg value="-Tpng"/>
+            <arg value="-o"/>
+            <arg file="${build.dir}/build.png"/>
+            <arg file="${build.dir}/build.dot"/>
+        </exec>
+    </target>
+
+    <target name="check-import.jdk">
+        <echo message="import.jdk: ${import.jdk}"/>
+        <echo message="import.jdk.jar: ${import.jdk.jar}"/>
+        <echo message="import.jdk.src.dir: ${import.jdk.src.dir}"/>
+    </target>
+
+    <target name="diagnostics">
+        <diagnostics/>
+    </target>
+
+
+    <!--
+    **** javac targets.
+    -->
 
     <target name="build-bootstrap-javac"
             depends="-def-build-bootstrap-classes,-def-build-bootstrap-jar,-def-build-bootstrap-tool">
@@ -267,7 +408,10 @@
 
     <target name="javac" depends="build-javac,jtreg-javac,findbugs-javac"/>
 
-    <!-- javadoc targets -->
+
+    <!--
+    **** javadoc targets.
+    -->
 
     <target name="build-bootstrap-javadoc" depends="build-bootstrap-javac">
         <build-bootstrap-classes includes="${javadoc.includes}"/>
@@ -300,7 +444,10 @@
 
     <target name="javadoc" depends="build-javadoc,jtreg-javadoc,findbugs-javadoc"/>
 
-    <!-- doclets targets -->
+
+    <!--
+    **** doclets targets.
+    -->
 
     <target name="build-bootstrap-doclets" depends="build-bootstrap-javadoc,-def-build-bootstrap-jar">
         <build-bootstrap-classes includes="${doclets.includes}"/>
@@ -330,7 +477,10 @@
 
     <target name="doclets" depends="build-doclets,jtreg-doclets,findbugs-doclets"/>
 
-    <!-- javah targets -->
+
+    <!--
+    **** javah targets.
+    -->
 
     <target name="build-bootstrap-javah" depends="build-bootstrap-javadoc">
         <build-bootstrap-classes includes="${javah.includes}"/>
@@ -360,7 +510,10 @@
 
     <target name="javah" depends="build-javah,jtreg-javah,findbugs-javah"/>
 
-    <!-- javap targets -->
+
+    <!--
+    **** javap targets.
+    -->
 
     <target name="build-bootstrap-javap"
             depends="-def-build-bootstrap-classes,-def-build-bootstrap-jar,-def-build-bootstrap-tool">
@@ -393,7 +546,10 @@
 
     <target name="javap" depends="build-javap,jtreg-javap,findbugs-javap"/>
 
-    <!-- apt targets -->
+
+    <!--
+    **** apt targets.
+    -->
 
     <target name="build-bootstrap-apt" depends="build-bootstrap-javac">
         <build-bootstrap-classes includes="${apt.includes}"/>
@@ -426,9 +582,12 @@
 
     <target name="apt" depends="build-apt,jtreg-apt,findbugs-apt"/>
 
-    <!-- Create import JDK stubs -->
 
-    <target name="-create-import-jdk-stubs" depends="-def-genstubs" if="import.jdk.src.dir">
+    <!--
+    **** Create import JDK stubs.
+    -->
+
+    <target name="-create-import-jdk-stubs" depends="-def-genstubs" if="require.import.jdk.stubs">
         <mkdir dir="${build.genstubs.dir}"/>
         <genstubs
             srcdir="${import.jdk.src.dir}" destdir="${build.genstubs.dir}"
@@ -437,7 +596,12 @@
         />
     </target>
 
-    <!-- Check targets -->
+
+    <!--
+    **** Check targets.
+    **** "-check-*" targets check that a required property is set, and set to a reasonable value.
+    **** A user friendly message is generated if not, and the build exits.
+    -->
 
     <target name="-check-boot.java.home" depends="-def-check">
         <check name="bootstrap java" property="boot.java.home" marker="${java.marker}"/>
@@ -459,7 +623,15 @@
         <check name="jtreg" property="jtreg.home" marker="lib/jtreg.jar"/>
     </target>
 
-    <!-- Ant macro and preset defs -->
+    <target name="-check-vizant" depends="-def-check">
+        <check name="vizant" property="vizant.jar"/>
+        <check name="dot" property="dot"/>
+    </target>
+
+
+    <!--
+    **** Targets for Ant macro and task definitions.
+    -->
 
     <target name="-def-build-tool">
         <macrodef name="build-tool">
@@ -599,7 +771,7 @@
                 sourcepath=""
                 release="${bootstrap.release}"
                 full.version="${bootstrap.full.version}"
-                excludes="${require.import.jdk.files} **/package-info.java"/>
+                excludes="${bootstrap.exclude.files} **/package-info.java"/>
         </presetdef>
     </target>
 
@@ -617,7 +789,7 @@
                  classpath="${build.toolclasses.dir}/"/>
     </target>
 
-    <target name="-def-genstubs" depends="build-bootstrap-javac">
+    <target name="-def-genstubs" depends="build-bootstrap-javac" if="require.import.jdk.stubs">
         <mkdir dir="${build.toolclasses.dir}"/>
         <javac fork="true"
                source="${boot.javac.source}"
@@ -640,7 +812,7 @@
             <sequential>
                 <property name="javadoc.options" value=""/> <!-- default, can be overridden per user or per project -->
                 <!-- Note: even with this default value, includes
-         from src.classes.dir get javadoc'd; see packageset below -->
+                from src.classes.dir get javadoc'd; see packageset below -->
                 <property name="javadoc.packagenames" value="none"/> <!-- default, can be overridden per user or per project -->
                 <javadoc
                     executable="${target.java.home}/bin/javadoc"
@@ -691,13 +863,15 @@
             <attribute name="tests"/>
             <attribute name="jdk" default="${target.java.home}"/>
             <attribute name="samevm" default="true"/>
-            <attribute name="verbose" default="summary"/>
-            <attribute name="options" default=""/>
+            <attribute name="verbose" default="${default.jtreg.verbose}"/>
+            <attribute name="options" default="${other.jtreg.options}"/>
             <attribute name="keywords" default="-keywords:!ignore"/>
             <attribute name="jpda.jvmargs" default=""/>
             <sequential>
-                <property name="coverage.options" value=""/>    <!-- default -->
-                <property name="coverage.classpath" value=""/>    <!-- default -->
+                <property name="coverage.options" value=""/>              <!-- default -->
+                <property name="coverage.classpath" value=""/>            <!-- default -->
+                <property name="default.jtreg.verbose" value="summary"/>  <!-- default -->
+                <property name="other.jtreg.options" value=""/>           <!-- default -->
                 <jtreg
                     dir="${test.dir}"
                     workDir="${build.jtreg.dir}/@{name}/work"
@@ -766,11 +940,16 @@
         <property name="findbugs.defined" value="true"/>
     </target>
 
+    <target name="-def-vizant" unless="vizant.defined" depends="-check-vizant">
+        <taskdef name="vizant" classname="net.sourceforge.vizant.Vizant" classpath="${vizant.jar}"/>
+        <property name="vizant.defined" value="true"/>
+    </target>
+
     <target name="-def-check">
         <macrodef name="check">
             <attribute name="name"/>
             <attribute name="property"/>
-            <attribute name="marker"/>
+            <attribute name="marker" default=""/>
             <sequential>
                 <fail message="Cannot locate @{name}: please set @{property} to its location">
                     <condition>
@@ -781,41 +960,19 @@
                 </fail>
                 <fail message="@{name} is not installed in ${@{property}}">
                     <condition>
-                        <not>
-                            <available file="${@{property}}/@{marker}"/>
-                        </not>
+                        <and>
+                            <not>
+                                <equals arg1="@{marker}" arg2=""/>
+                            </not>
+                            <not>
+                                <available file="${@{property}}/@{marker}"/>
+                            </not>
+                        </and>
                     </condition>
                 </fail>
             </sequential>
         </macrodef>
     </target>
 
-    <!-- standard JDK target -->
-    <target name="sanity"
-        description="display settings of configuration values">
-        <echo level="info">ant.home = ${ant.home}</echo>
-        <echo level="info">boot.java.home = ${boot.java.home}</echo>
-        <echo level="info">target.java.home = ${target.java.home}</echo>
-        <echo level="info">jtreg.home = ${jtreg.home}</echo>
-        <echo level="info">findbugs.home = ${findbugs.home}</echo>
-    </target>
-
-    <!-- useful debugging targets -->
-    <target name="diagnostics">
-        <diagnostics/>
-    </target>
-
-    <target name="post-sanity" depends="-def-jtreg,sanity,build"
-        description="perform basic validation after a standard build">
-        <jtreg
-            dir="make/test"
-            workDir="${build.jtreg.dir}/post-sanity/work"
-            reportDir="${build.jtreg.dir}/post-sanity/report"
-            jdk="${target.java.home}"
-            verbose="summary"
-            failonerror="false" resultproperty="jtreg.post-sanity.result">
-        </jtreg>
-
-    </target>
 </project>
 
--- a/langtools/src/share/classes/com/sun/source/tree/Tree.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/langtools/src/share/classes/com/sun/source/tree/Tree.java	Wed Jul 21 09:57:21 2010 -0700
@@ -30,7 +30,7 @@
  *
  * <p><b>WARNING:</b> This interface and its sub-interfaces are
  * subject to change as the Java&trade; programming language evolves.
- * These interfaces are implemented by Sun's Java compiler (javac)
+ * These interfaces are implemented by the JDK Java compiler (javac)
  * and should not be implemented either directly or indirectly by
  * other applications.
  *
--- a/langtools/src/share/classes/com/sun/source/util/JavacTask.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/langtools/src/share/classes/com/sun/source/util/JavacTask.java	Wed Jul 21 09:57:21 2010 -0700
@@ -36,7 +36,7 @@
 import javax.tools.JavaFileObject;
 
 /**
- * Provides access to functionality specific to the Sun Java Compiler, javac.
+ * Provides access to functionality specific to the JDK Java Compiler, javac.
  *
  * @author Peter von der Ah&eacute;
  * @author Jonathan Gibbons
--- a/langtools/src/share/classes/com/sun/source/util/TaskEvent.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/langtools/src/share/classes/com/sun/source/util/TaskEvent.java	Wed Jul 21 09:57:21 2010 -0700
@@ -30,7 +30,7 @@
 import javax.tools.JavaFileObject;
 
 /**
- * Provides details about work that has been done by the Sun Java Compiler, javac.
+ * Provides details about work that has been done by the JDK Java Compiler, javac.
  *
  * @author Jonathan Gibbons
  * @since 1.6
--- a/langtools/src/share/classes/com/sun/source/util/TaskListener.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/langtools/src/share/classes/com/sun/source/util/TaskListener.java	Wed Jul 21 09:57:21 2010 -0700
@@ -27,7 +27,7 @@
 
 
 /**
- * Provides a listener to monitor the activity of the Sun Java Compiler, javac.
+ * Provides a listener to monitor the activity of the JDK Java Compiler, javac.
  *
  * @author Jonathan Gibbons
  * @since 1.6
--- a/langtools/src/share/classes/com/sun/tools/apt/comp/Apt.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/langtools/src/share/classes/com/sun/tools/apt/comp/Apt.java	Wed Jul 21 09:57:21 2010 -0700
@@ -60,7 +60,7 @@
 /**
  * Apt compiler phase.
  *
- *  <p><b>This is NOT part of any API supported by Sun Microsystems.
+ *  <p><b>This is NOT part of any supported API.
  *  If you write code that depends on this, you do so at your own
  *  risk.  This code and its internal interfaces are subject to change
  *  or deletion without notice.</b>
--- a/langtools/src/share/classes/com/sun/tools/apt/main/CommandLine.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/langtools/src/share/classes/com/sun/tools/apt/main/CommandLine.java	Wed Jul 21 09:57:21 2010 -0700
@@ -35,8 +35,8 @@
 /**
  * Various utility methods for processing Java tool command line arguments.
  *
- *  <p><b>This is NOT part of any API supported by Sun Microsystems.  If
- *  you write code that depends on this, you do so at your own risk.
+ *  <p><b>This is NOT part of any supported API.
+ *  If you write code that depends on this, you do so at your own risk.
  *  This code and its internal interfaces are subject to change or
  *  deletion without notice.</b>
  */
--- a/langtools/src/share/classes/com/sun/tools/apt/main/JavaCompiler.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/langtools/src/share/classes/com/sun/tools/apt/main/JavaCompiler.java	Wed Jul 21 09:57:21 2010 -0700
@@ -45,7 +45,7 @@
 import com.sun.tools.javac.parser.DocCommentScanner;
 
 /**
- *  <p><b>This is NOT part of any API supported by Sun Microsystems.
+ *  <p><b>This is NOT part of any supported API.
  *  If you write code that depends on this, you do so at your own
  *  risk.  This code and its internal interfaces are subject to change
  *  or deletion without notice.</b>
--- a/langtools/src/share/classes/com/sun/tools/apt/main/Main.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/langtools/src/share/classes/com/sun/tools/apt/main/Main.java	Wed Jul 21 09:57:21 2010 -0700
@@ -61,7 +61,7 @@
 /** This class provides a commandline interface to the apt build-time
  *  tool.
  *
- *  <p><b>This is NOT part of any API supported by Sun Microsystems.
+ *  <p><b>This is NOT part of any supported API.
  *  If you write code that depends on this, you do so at your own
  *  risk.  This code and its internal interfaces are subject to change
  *  or deletion without notice.</b>
--- a/langtools/src/share/classes/com/sun/tools/apt/util/Bark.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/langtools/src/share/classes/com/sun/tools/apt/util/Bark.java	Wed Jul 21 09:57:21 2010 -0700
@@ -34,8 +34,8 @@
 
 /** A subtype of Log for use in APT.
  *
- *  <p><b>This is NOT part of any API supported by Sun Microsystems.  If
- *  you write code that depends on this, you do so at your own risk.
+ *  <p><b>This is NOT part of any supported API.
+ *  If you write code that depends on this, you do so at your own risk.
  *  This code and its internal interfaces are subject to change or
  *  deletion without notice.</b>
  */
--- a/langtools/src/share/classes/com/sun/tools/classfile/AccessFlags.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/langtools/src/share/classes/com/sun/tools/classfile/AccessFlags.java	Wed Jul 21 09:57:21 2010 -0700
@@ -32,8 +32,8 @@
 /**
  * See JVMS3, sections 4.2, 4.6, 4.7.
  *
- *  <p><b>This is NOT part of any API supported by Sun Microsystems.  If
- *  you write code that depends on this, you do so at your own risk.
+ *  <p><b>This is NOT part of any supported API.
+ *  If you write code that depends on this, you do so at your own risk.
  *  This code and its internal interfaces are subject to change or
  *  deletion without notice.</b>
  */
--- a/langtools/src/share/classes/com/sun/tools/classfile/Annotation.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/langtools/src/share/classes/com/sun/tools/classfile/Annotation.java	Wed Jul 21 09:57:21 2010 -0700
@@ -30,8 +30,8 @@
 /**
  * See JVMS3, section 4.8.16.
  *
- *  <p><b>This is NOT part of any API supported by Sun Microsystems.  If
- *  you write code that depends on this, you do so at your own risk.
+ *  <p><b>This is NOT part of any supported API.
+ *  If you write code that depends on this, you do so at your own risk.
  *  This code and its internal interfaces are subject to change or
  *  deletion without notice.</b>
  */
--- a/langtools/src/share/classes/com/sun/tools/classfile/AnnotationDefault_attribute.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/langtools/src/share/classes/com/sun/tools/classfile/AnnotationDefault_attribute.java	Wed Jul 21 09:57:21 2010 -0700
@@ -30,8 +30,8 @@
 /**
  * See JVMS3, section 4.8.15.
  *
- *  <p><b>This is NOT part of any API supported by Sun Microsystems.  If
- *  you write code that depends on this, you do so at your own risk.
+ *  <p><b>This is NOT part of any supported API.
+ *  If you write code that depends on this, you do so at your own risk.
  *  This code and its internal interfaces are subject to change or
  *  deletion without notice.</b>
  */
--- a/langtools/src/share/classes/com/sun/tools/classfile/Attribute.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/langtools/src/share/classes/com/sun/tools/classfile/Attribute.java	Wed Jul 21 09:57:21 2010 -0700
@@ -31,8 +31,8 @@
 import java.util.Map;
 
 /**
- *  <p><b>This is NOT part of any API supported by Sun Microsystems.  If
- *  you write code that depends on this, you do so at your own risk.
+ *  <p><b>This is NOT part of any supported API.
+ *  If you write code that depends on this, you do so at your own risk.
  *  This code and its internal interfaces are subject to change or
  *  deletion without notice.</b>
  */
--- a/langtools/src/share/classes/com/sun/tools/classfile/AttributeException.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/langtools/src/share/classes/com/sun/tools/classfile/AttributeException.java	Wed Jul 21 09:57:21 2010 -0700
@@ -26,8 +26,8 @@
 package com.sun.tools.classfile;
 
 /*
- *  <p><b>This is NOT part of any API supported by Sun Microsystems.  If
- *  you write code that depends on this, you do so at your own risk.
+ *  <p><b>This is NOT part of any supported API.
+ *  If you write code that depends on this, you do so at your own risk.
  *  This code and its internal interfaces are subject to change or
  *  deletion without notice.</b>
  */
--- a/langtools/src/share/classes/com/sun/tools/classfile/Attributes.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/langtools/src/share/classes/com/sun/tools/classfile/Attributes.java	Wed Jul 21 09:57:21 2010 -0700
@@ -32,8 +32,8 @@
 import java.util.Map;
 
 /*
- *  <p><b>This is NOT part of any API supported by Sun Microsystems.  If
- *  you write code that depends on this, you do so at your own risk.
+ *  <p><b>This is NOT part of any supported API.
+ *  If you write code that depends on this, you do so at your own risk.
  *  This code and its internal interfaces are subject to change or
  *  deletion without notice.</b>
  */
--- a/langtools/src/share/classes/com/sun/tools/classfile/CharacterRangeTable_attribute.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/langtools/src/share/classes/com/sun/tools/classfile/CharacterRangeTable_attribute.java	Wed Jul 21 09:57:21 2010 -0700
@@ -28,8 +28,8 @@
 import java.io.IOException;
 
 /**
- *  <p><b>This is NOT part of any API supported by Sun Microsystems.  If
- *  you write code that depends on this, you do so at your own risk.
+ *  <p><b>This is NOT part of any supported API.
+ *  If you write code that depends on this, you do so at your own risk.
  *  This code and its internal interfaces are subject to change or
  *  deletion without notice.</b>
  */
--- a/langtools/src/share/classes/com/sun/tools/classfile/ClassFile.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/langtools/src/share/classes/com/sun/tools/classfile/ClassFile.java	Wed Jul 21 09:57:21 2010 -0700
@@ -35,8 +35,8 @@
 /**
  * See JVMS3, section 4.2.
  *
- *  <p><b>This is NOT part of any API supported by Sun Microsystems.  If
- *  you write code that depends on this, you do so at your own risk.
+ *  <p><b>This is NOT part of any supported API.
+ *  If you write code that depends on this, you do so at your own risk.
  *  This code and its internal interfaces are subject to change or
  *  deletion without notice.</b>
  */
--- a/langtools/src/share/classes/com/sun/tools/classfile/ClassReader.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/langtools/src/share/classes/com/sun/tools/classfile/ClassReader.java	Wed Jul 21 09:57:21 2010 -0700
@@ -32,8 +32,8 @@
 import java.io.InputStream;
 
 /**
- *  <p><b>This is NOT part of any API supported by Sun Microsystems.  If
- *  you write code that depends on this, you do so at your own risk.
+ *  <p><b>This is NOT part of any supported API.
+ *  If you write code that depends on this, you do so at your own risk.
  *  This code and its internal interfaces are subject to change or
  *  deletion without notice.</b>
  */
--- a/langtools/src/share/classes/com/sun/tools/classfile/ClassTranslator.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/langtools/src/share/classes/com/sun/tools/classfile/ClassTranslator.java	Wed Jul 21 09:57:21 2010 -0700
@@ -42,8 +42,8 @@
 /**
  * Rewrites a class file using a map of translations.
  *
- *  <p><b>This is NOT part of any API supported by Sun Microsystems.  If
- *  you write code that depends on this, you do so at your own risk.
+ *  <p><b>This is NOT part of any supported API.
+ *  If you write code that depends on this, you do so at your own risk.
  *  This code and its internal interfaces are subject to change or
  *  deletion without notice.</b>
  */
--- a/langtools/src/share/classes/com/sun/tools/classfile/ClassWriter.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/langtools/src/share/classes/com/sun/tools/classfile/ClassWriter.java	Wed Jul 21 09:57:21 2010 -0700
@@ -41,8 +41,8 @@
 /**
  * Write a ClassFile data structure to a file or stream.
  *
- *  <p><b>This is NOT part of any API supported by Sun Microsystems.  If
- *  you write code that depends on this, you do so at your own risk.
+ *  <p><b>This is NOT part of any supported API.
+ *  If you write code that depends on this, you do so at your own risk.
  *  This code and its internal interfaces are subject to change or
  *  deletion without notice.</b>
  */
--- a/langtools/src/share/classes/com/sun/tools/classfile/Code_attribute.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/langtools/src/share/classes/com/sun/tools/classfile/Code_attribute.java	Wed Jul 21 09:57:21 2010 -0700
@@ -32,8 +32,8 @@
 /**
  * See JVMS3, section 4.8.3.
  *
- *  <p><b>This is NOT part of any API supported by Sun Microsystems.  If
- *  you write code that depends on this, you do so at your own risk.
+ *  <p><b>This is NOT part of any supported API.
+ *  If you write code that depends on this, you do so at your own risk.
  *  This code and its internal interfaces are subject to change or
  *  deletion without notice.</b>
  */
--- a/langtools/src/share/classes/com/sun/tools/classfile/CompilationID_attribute.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/langtools/src/share/classes/com/sun/tools/classfile/CompilationID_attribute.java	Wed Jul 21 09:57:21 2010 -0700
@@ -27,8 +27,8 @@
 import java.io.IOException;
 
 /**
- *  <p><b>This is NOT part of any API supported by Sun Microsystems.  If
- *  you write code that depends on this, you do so at your own risk.
+ *  <p><b>This is NOT part of any supported API.
+ *  If you write code that depends on this, you do so at your own risk.
  *  This code and its internal interfaces are subject to change or
  *  deletion without notice.</b>
  */
--- a/langtools/src/share/classes/com/sun/tools/classfile/ConstantPool.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/langtools/src/share/classes/com/sun/tools/classfile/ConstantPool.java	Wed Jul 21 09:57:21 2010 -0700
@@ -33,8 +33,8 @@
 /**
  * See JVMS3, section 4.5.
  *
- *  <p><b>This is NOT part of any API supported by Sun Microsystems.  If
- *  you write code that depends on this, you do so at your own risk.
+ *  <p><b>This is NOT part of any supported API.
+ *  If you write code that depends on this, you do so at your own risk.
  *  This code and its internal interfaces are subject to change or
  *  deletion without notice.</b>
  */
--- a/langtools/src/share/classes/com/sun/tools/classfile/ConstantPoolException.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/langtools/src/share/classes/com/sun/tools/classfile/ConstantPoolException.java	Wed Jul 21 09:57:21 2010 -0700
@@ -27,8 +27,8 @@
 package com.sun.tools.classfile;
 
 /*
- *  <p><b>This is NOT part of any API supported by Sun Microsystems.  If
- *  you write code that depends on this, you do so at your own risk.
+ *  <p><b>This is NOT part of any supported API.
+ *  If you write code that depends on this, you do so at your own risk.
  *  This code and its internal interfaces are subject to change or
  *  deletion without notice.</b>
  */
--- a/langtools/src/share/classes/com/sun/tools/classfile/ConstantValue_attribute.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/langtools/src/share/classes/com/sun/tools/classfile/ConstantValue_attribute.java	Wed Jul 21 09:57:21 2010 -0700
@@ -30,8 +30,8 @@
 /**
  * See JVMS3, section 4.8.2.
  *
- *  <p><b>This is NOT part of any API supported by Sun Microsystems.  If
- *  you write code that depends on this, you do so at your own risk.
+ *  <p><b>This is NOT part of any supported API.
+ *  If you write code that depends on this, you do so at your own risk.
  *  This code and its internal interfaces are subject to change or
  *  deletion without notice.</b>
  */
--- a/langtools/src/share/classes/com/sun/tools/classfile/DefaultAttribute.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/langtools/src/share/classes/com/sun/tools/classfile/DefaultAttribute.java	Wed Jul 21 09:57:21 2010 -0700
@@ -26,8 +26,8 @@
 package com.sun.tools.classfile;
 
 /*
- *  <p><b>This is NOT part of any API supported by Sun Microsystems.  If
- *  you write code that depends on this, you do so at your own risk.
+ *  <p><b>This is NOT part of any supported API.
+ *  If you write code that depends on this, you do so at your own risk.
  *  This code and its internal interfaces are subject to change or
  *  deletion without notice.</b>
  */
--- a/langtools/src/share/classes/com/sun/tools/classfile/Deprecated_attribute.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/langtools/src/share/classes/com/sun/tools/classfile/Deprecated_attribute.java	Wed Jul 21 09:57:21 2010 -0700
@@ -30,8 +30,8 @@
 /**
  * See JVMS3, section 4.8.15.
  *
- *  <p><b>This is NOT part of any API supported by Sun Microsystems.  If
- *  you write code that depends on this, you do so at your own risk.
+ *  <p><b>This is NOT part of any supported API.
+ *  If you write code that depends on this, you do so at your own risk.
  *  This code and its internal interfaces are subject to change or
  *  deletion without notice.</b>
  */
--- a/langtools/src/share/classes/com/sun/tools/classfile/Descriptor.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/langtools/src/share/classes/com/sun/tools/classfile/Descriptor.java	Wed Jul 21 09:57:21 2010 -0700
@@ -31,8 +31,8 @@
 /**
  * See JVMS3, section 4.4.
  *
- *  <p><b>This is NOT part of any API supported by Sun Microsystems.  If
- *  you write code that depends on this, you do so at your own risk.
+ *  <p><b>This is NOT part of any supported API.
+ *  If you write code that depends on this, you do so at your own risk.
  *  This code and its internal interfaces are subject to change or
  *  deletion without notice.</b>
  */
--- a/langtools/src/share/classes/com/sun/tools/classfile/DescriptorException.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/langtools/src/share/classes/com/sun/tools/classfile/DescriptorException.java	Wed Jul 21 09:57:21 2010 -0700
@@ -27,8 +27,8 @@
 package com.sun.tools.classfile;
 
 /*
- *  <p><b>This is NOT part of any API supported by Sun Microsystems.  If
- *  you write code that depends on this, you do so at your own risk.
+ *  <p><b>This is NOT part of any supported API.
+ *  If you write code that depends on this, you do so at your own risk.
  *  This code and its internal interfaces are subject to change or
  *  deletion without notice.</b>
  */
--- a/langtools/src/share/classes/com/sun/tools/classfile/EnclosingMethod_attribute.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/langtools/src/share/classes/com/sun/tools/classfile/EnclosingMethod_attribute.java	Wed Jul 21 09:57:21 2010 -0700
@@ -31,8 +31,8 @@
 /**
  * See JVMS3, section 4.8.7.
  *
- *  <p><b>This is NOT part of any API supported by Sun Microsystems.  If
- *  you write code that depends on this, you do so at your own risk.
+ *  <p><b>This is NOT part of any supported API.
+ *  If you write code that depends on this, you do so at your own risk.
  *  This code and its internal interfaces are subject to change or
  *  deletion without notice.</b>
  */
--- a/langtools/src/share/classes/com/sun/tools/classfile/Exceptions_attribute.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/langtools/src/share/classes/com/sun/tools/classfile/Exceptions_attribute.java	Wed Jul 21 09:57:21 2010 -0700
@@ -30,8 +30,8 @@
 /**
  * See JVMS3, section 4.8.5.
  *
- *  <p><b>This is NOT part of any API supported by Sun Microsystems.  If
- *  you write code that depends on this, you do so at your own risk.
+ *  <p><b>This is NOT part of any supported API.
+ *  If you write code that depends on this, you do so at your own risk.
  *  This code and its internal interfaces are subject to change or
  *  deletion without notice.</b>
  */
--- a/langtools/src/share/classes/com/sun/tools/classfile/ExtendedAnnotation.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/langtools/src/share/classes/com/sun/tools/classfile/ExtendedAnnotation.java	Wed Jul 21 09:57:21 2010 -0700
@@ -36,8 +36,8 @@
 /**
  * See JSR 308 specification, section 4.1
  *
- *  <p><b>This is NOT part of any API supported by Sun Microsystems.  If
- *  you write code that depends on this, you do so at your own risk.
+ *  <p><b>This is NOT part of any supported API.
+ *  If you write code that depends on this, you do so at your own risk.
  *  This code and its internal interfaces are subject to change or
  *  deletion without notice.</b>
  */
--- a/langtools/src/share/classes/com/sun/tools/classfile/Field.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/langtools/src/share/classes/com/sun/tools/classfile/Field.java	Wed Jul 21 09:57:21 2010 -0700
@@ -28,8 +28,8 @@
 import java.io.IOException;
 
 /*
- *  <p><b>This is NOT part of any API supported by Sun Microsystems.  If
- *  you write code that depends on this, you do so at your own risk.
+ *  <p><b>This is NOT part of any supported API.
+ *  If you write code that depends on this, you do so at your own risk.
  *  This code and its internal interfaces are subject to change or
  *  deletion without notice.</b>
  */
--- a/langtools/src/share/classes/com/sun/tools/classfile/InnerClasses_attribute.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/langtools/src/share/classes/com/sun/tools/classfile/InnerClasses_attribute.java	Wed Jul 21 09:57:21 2010 -0700
@@ -32,8 +32,8 @@
 /**
  * See JVMS3, section 4.8.6.
  *
- *  <p><b>This is NOT part of any API supported by Sun Microsystems.  If
- *  you write code that depends on this, you do so at your own risk.
+ *  <p><b>This is NOT part of any supported API.
+ *  If you write code that depends on this, you do so at your own risk.
  *  This code and its internal interfaces are subject to change or
  *  deletion without notice.</b>
  */
--- a/langtools/src/share/classes/com/sun/tools/classfile/Instruction.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/langtools/src/share/classes/com/sun/tools/classfile/Instruction.java	Wed Jul 21 09:57:21 2010 -0700
@@ -28,8 +28,8 @@
 /**
  * See JVMS3, chapter 6.
  *
- *  <p><b>This is NOT part of any API supported by Sun Microsystems.  If
- *  you write code that depends on this, you do so at your own risk.
+ *  <p><b>This is NOT part of any supported API.
+ *  If you write code that depends on this, you do so at your own risk.
  *  This code and its internal interfaces are subject to change or
  *  deletion without notice.</b>
  *
--- a/langtools/src/share/classes/com/sun/tools/classfile/LineNumberTable_attribute.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/langtools/src/share/classes/com/sun/tools/classfile/LineNumberTable_attribute.java	Wed Jul 21 09:57:21 2010 -0700
@@ -30,8 +30,8 @@
 /**
  * See JVMS3, section 4.8.12.
  *
- *  <p><b>This is NOT part of any API supported by Sun Microsystems.  If
- *  you write code that depends on this, you do so at your own risk.
+ *  <p><b>This is NOT part of any supported API.
+ *  If you write code that depends on this, you do so at your own risk.
  *  This code and its internal interfaces are subject to change or
  *  deletion without notice.</b>
  */
--- a/langtools/src/share/classes/com/sun/tools/classfile/LocalVariableTable_attribute.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/langtools/src/share/classes/com/sun/tools/classfile/LocalVariableTable_attribute.java	Wed Jul 21 09:57:21 2010 -0700
@@ -30,8 +30,8 @@
 /**
  * See JVMS3, section 4.8.13.
  *
- *  <p><b>This is NOT part of any API supported by Sun Microsystems.  If
- *  you write code that depends on this, you do so at your own risk.
+ *  <p><b>This is NOT part of any supported API.
+ *  If you write code that depends on this, you do so at your own risk.
  *  This code and its internal interfaces are subject to change or
  *  deletion without notice.</b>
  */
--- a/langtools/src/share/classes/com/sun/tools/classfile/LocalVariableTypeTable_attribute.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/langtools/src/share/classes/com/sun/tools/classfile/LocalVariableTypeTable_attribute.java	Wed Jul 21 09:57:21 2010 -0700
@@ -30,8 +30,8 @@
 /**
  * See JVMS3, section 4.8.14.
  *
- *  <p><b>This is NOT part of any API supported by Sun Microsystems.  If
- *  you write code that depends on this, you do so at your own risk.
+ *  <p><b>This is NOT part of any supported API.
+ *  If you write code that depends on this, you do so at your own risk.
  *  This code and its internal interfaces are subject to change or
  *  deletion without notice.</b>
  */
--- a/langtools/src/share/classes/com/sun/tools/classfile/Method.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/langtools/src/share/classes/com/sun/tools/classfile/Method.java	Wed Jul 21 09:57:21 2010 -0700
@@ -28,8 +28,8 @@
 import java.io.IOException;
 
 /*
- *  <p><b>This is NOT part of any API supported by Sun Microsystems.  If
- *  you write code that depends on this, you do so at your own risk.
+ *  <p><b>This is NOT part of any supported API.
+ *  If you write code that depends on this, you do so at your own risk.
  *  This code and its internal interfaces are subject to change or
  *  deletion without notice.</b>
  */
--- a/langtools/src/share/classes/com/sun/tools/classfile/Opcode.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/langtools/src/share/classes/com/sun/tools/classfile/Opcode.java	Wed Jul 21 09:57:21 2010 -0700
@@ -34,8 +34,8 @@
  * <p>In addition to providing all the standard opcodes defined in JVMS,
  * this class also provides legacy support for the PicoJava extensions.
  *
- *  <p><b>This is NOT part of any API supported by Sun Microsystems.  If
- *  you write code that depends on this, you do so at your own risk.
+ *  <p><b>This is NOT part of any supported API.
+ *  If you write code that depends on this, you do so at your own risk.
  *  This code and its internal interfaces are subject to change or
  *  deletion without notice.</b>
  */
--- a/langtools/src/share/classes/com/sun/tools/classfile/RuntimeAnnotations_attribute.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/langtools/src/share/classes/com/sun/tools/classfile/RuntimeAnnotations_attribute.java	Wed Jul 21 09:57:21 2010 -0700
@@ -30,8 +30,8 @@
 /**
  * See JVMS3, section 4.8.16 and 4.8.17.
  *
- *  <p><b>This is NOT part of any API supported by Sun Microsystems.  If
- *  you write code that depends on this, you do so at your own risk.
+ *  <p><b>This is NOT part of any supported API.
+ *  If you write code that depends on this, you do so at your own risk.
  *  This code and its internal interfaces are subject to change or
  *  deletion without notice.</b>
  */
--- a/langtools/src/share/classes/com/sun/tools/classfile/RuntimeInvisibleAnnotations_attribute.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/langtools/src/share/classes/com/sun/tools/classfile/RuntimeInvisibleAnnotations_attribute.java	Wed Jul 21 09:57:21 2010 -0700
@@ -30,8 +30,8 @@
 /**
  * See JVMS3, section 4.8.17.
  *
- *  <p><b>This is NOT part of any API supported by Sun Microsystems.  If
- *  you write code that depends on this, you do so at your own risk.
+ *  <p><b>This is NOT part of any supported API.
+ *  If you write code that depends on this, you do so at your own risk.
  *  This code and its internal interfaces are subject to change or
  *  deletion without notice.</b>
  */
--- a/langtools/src/share/classes/com/sun/tools/classfile/RuntimeInvisibleParameterAnnotations_attribute.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/langtools/src/share/classes/com/sun/tools/classfile/RuntimeInvisibleParameterAnnotations_attribute.java	Wed Jul 21 09:57:21 2010 -0700
@@ -30,8 +30,8 @@
 /**
  * See JVMS3, section 4.8.18.
  *
- *  <p><b>This is NOT part of any API supported by Sun Microsystems.  If
- *  you write code that depends on this, you do so at your own risk.
+ *  <p><b>This is NOT part of any supported API.
+ *  If you write code that depends on this, you do so at your own risk.
  *  This code and its internal interfaces are subject to change or
  *  deletion without notice.</b>
  */
--- a/langtools/src/share/classes/com/sun/tools/classfile/RuntimeInvisibleTypeAnnotations_attribute.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/langtools/src/share/classes/com/sun/tools/classfile/RuntimeInvisibleTypeAnnotations_attribute.java	Wed Jul 21 09:57:21 2010 -0700
@@ -30,8 +30,8 @@
 /**
  * See JSR 308 specification, section 4.1
  *
- *  <p><b>This is NOT part of any API supported by Sun Microsystems.  If
- *  you write code that depends on this, you do so at your own risk.
+ *  <p><b>This is NOT part of any supported API.
+ *  If you write code that depends on this, you do so at your own risk.
  *  This code and its internal interfaces are subject to change or
  *  deletion without notice.</b>
  */
--- a/langtools/src/share/classes/com/sun/tools/classfile/RuntimeParameterAnnotations_attribute.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/langtools/src/share/classes/com/sun/tools/classfile/RuntimeParameterAnnotations_attribute.java	Wed Jul 21 09:57:21 2010 -0700
@@ -30,8 +30,8 @@
 /**
  * See JVMS3, section 4.8.18 and 4.8.19.
  *
- *  <p><b>This is NOT part of any API supported by Sun Microsystems.  If
- *  you write code that depends on this, you do so at your own risk.
+ *  <p><b>This is NOT part of any supported API.
+ *  If you write code that depends on this, you do so at your own risk.
  *  This code and its internal interfaces are subject to change or
  *  deletion without notice.</b>
  */
--- a/langtools/src/share/classes/com/sun/tools/classfile/RuntimeTypeAnnotations_attribute.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/langtools/src/share/classes/com/sun/tools/classfile/RuntimeTypeAnnotations_attribute.java	Wed Jul 21 09:57:21 2010 -0700
@@ -30,8 +30,8 @@
 /**
  * See JSR 308 specification, section 4
  *
- *  <p><b>This is NOT part of any API supported by Sun Microsystems.  If
- *  you write code that depends on this, you do so at your own risk.
+ *  <p><b>This is NOT part of any supported API.
+ *  If you write code that depends on this, you do so at your own risk.
  *  This code and its internal interfaces are subject to change or
  *  deletion without notice.</b>
  */
--- a/langtools/src/share/classes/com/sun/tools/classfile/RuntimeVisibleAnnotations_attribute.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/langtools/src/share/classes/com/sun/tools/classfile/RuntimeVisibleAnnotations_attribute.java	Wed Jul 21 09:57:21 2010 -0700
@@ -30,8 +30,8 @@
 /**
  * See JVMS3, section 4.8.16.
  *
- *  <p><b>This is NOT part of any API supported by Sun Microsystems.  If
- *  you write code that depends on this, you do so at your own risk.
+ *  <p><b>This is NOT part of any supported API.
+ *  If you write code that depends on this, you do so at your own risk.
  *  This code and its internal interfaces are subject to change or
  *  deletion without notice.</b>
  */
--- a/langtools/src/share/classes/com/sun/tools/classfile/RuntimeVisibleParameterAnnotations_attribute.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/langtools/src/share/classes/com/sun/tools/classfile/RuntimeVisibleParameterAnnotations_attribute.java	Wed Jul 21 09:57:21 2010 -0700
@@ -30,8 +30,8 @@
 /**
  * See JVMS3, section 4.8.18.
  *
- *  <p><b>This is NOT part of any API supported by Sun Microsystems.  If
- *  you write code that depends on this, you do so at your own risk.
+ *  <p><b>This is NOT part of any supported API.
+ *  If you write code that depends on this, you do so at your own risk.
  *  This code and its internal interfaces are subject to change or
  *  deletion without notice.</b>
  */
--- a/langtools/src/share/classes/com/sun/tools/classfile/RuntimeVisibleTypeAnnotations_attribute.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/langtools/src/share/classes/com/sun/tools/classfile/RuntimeVisibleTypeAnnotations_attribute.java	Wed Jul 21 09:57:21 2010 -0700
@@ -30,8 +30,8 @@
 /**
  * See JSR 308 specification, section 4.1
  *
- *  <p><b>This is NOT part of any API supported by Sun Microsystems.  If
- *  you write code that depends on this, you do so at your own risk.
+ *  <p><b>This is NOT part of any supported API.
+ *  If you write code that depends on this, you do so at your own risk.
  *  This code and its internal interfaces are subject to change or
  *  deletion without notice.</b>
  */
--- a/langtools/src/share/classes/com/sun/tools/classfile/Signature.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/langtools/src/share/classes/com/sun/tools/classfile/Signature.java	Wed Jul 21 09:57:21 2010 -0700
@@ -32,8 +32,8 @@
 /**
  * See JVMS3 4.4.4.
  *
- *  <p><b>This is NOT part of any API supported by Sun Microsystems.  If
- *  you write code that depends on this, you do so at your own risk.
+ *  <p><b>This is NOT part of any supported API.
+ *  If you write code that depends on this, you do so at your own risk.
  *  This code and its internal interfaces are subject to change or
  *  deletion without notice.</b>
  */
--- a/langtools/src/share/classes/com/sun/tools/classfile/Signature_attribute.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/langtools/src/share/classes/com/sun/tools/classfile/Signature_attribute.java	Wed Jul 21 09:57:21 2010 -0700
@@ -30,8 +30,8 @@
 /**
  * See JVMS3, section 4.8.9.
  *
- *  <p><b>This is NOT part of any API supported by Sun Microsystems.  If
- *  you write code that depends on this, you do so at your own risk.
+ *  <p><b>This is NOT part of any supported API.
+ *  If you write code that depends on this, you do so at your own risk.
  *  This code and its internal interfaces are subject to change or
  *  deletion without notice.</b>
  */
--- a/langtools/src/share/classes/com/sun/tools/classfile/SourceDebugExtension_attribute.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/langtools/src/share/classes/com/sun/tools/classfile/SourceDebugExtension_attribute.java	Wed Jul 21 09:57:21 2010 -0700
@@ -32,8 +32,8 @@
 /**
  * See JVMS3, section 4.8.15.
  *
- *  <p><b>This is NOT part of any API supported by Sun Microsystems.  If
- *  you write code that depends on this, you do so at your own risk.
+ *  <p><b>This is NOT part of any supported API.
+ *  If you write code that depends on this, you do so at your own risk.
  *  This code and its internal interfaces are subject to change or
  *  deletion without notice.</b>
  */
--- a/langtools/src/share/classes/com/sun/tools/classfile/SourceFile_attribute.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/langtools/src/share/classes/com/sun/tools/classfile/SourceFile_attribute.java	Wed Jul 21 09:57:21 2010 -0700
@@ -30,8 +30,8 @@
 /**
  * See JVMS3, section 4.8.10.
  *
- *  <p><b>This is NOT part of any API supported by Sun Microsystems.  If
- *  you write code that depends on this, you do so at your own risk.
+ *  <p><b>This is NOT part of any supported API.
+ *  If you write code that depends on this, you do so at your own risk.
  *  This code and its internal interfaces are subject to change or
  *  deletion without notice.</b>
  */
--- a/langtools/src/share/classes/com/sun/tools/classfile/SourceID_attribute.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/langtools/src/share/classes/com/sun/tools/classfile/SourceID_attribute.java	Wed Jul 21 09:57:21 2010 -0700
@@ -27,8 +27,8 @@
 import java.io.IOException;
 
 /**
- *  <p><b>This is NOT part of any API supported by Sun Microsystems.  If
- *  you write code that depends on this, you do so at your own risk.
+ *  <p><b>This is NOT part of any supported API.
+ *  If you write code that depends on this, you do so at your own risk.
  *  This code and its internal interfaces are subject to change or
  *  deletion without notice.</b>
  */
--- a/langtools/src/share/classes/com/sun/tools/classfile/StackMapTable_attribute.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/langtools/src/share/classes/com/sun/tools/classfile/StackMapTable_attribute.java	Wed Jul 21 09:57:21 2010 -0700
@@ -30,8 +30,8 @@
 /**
  * See JVMS3, section 4.8.4.
  *
- *  <p><b>This is NOT part of any API supported by Sun Microsystems.  If
- *  you write code that depends on this, you do so at your own risk.
+ *  <p><b>This is NOT part of any supported API.
+ *  If you write code that depends on this, you do so at your own risk.
  *  This code and its internal interfaces are subject to change or
  *  deletion without notice.</b>
  */
--- a/langtools/src/share/classes/com/sun/tools/classfile/StackMap_attribute.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/langtools/src/share/classes/com/sun/tools/classfile/StackMap_attribute.java	Wed Jul 21 09:57:21 2010 -0700
@@ -28,8 +28,8 @@
 import java.io.IOException;
 
 /**
- *  <p><b>This is NOT part of any API supported by Sun Microsystems.  If
- *  you write code that depends on this, you do so at your own risk.
+ *  <p><b>This is NOT part of any supported API.
+ *  If you write code that depends on this, you do so at your own risk.
  *  This code and its internal interfaces are subject to change or
  *  deletion without notice.</b>
  */
--- a/langtools/src/share/classes/com/sun/tools/classfile/Synthetic_attribute.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/langtools/src/share/classes/com/sun/tools/classfile/Synthetic_attribute.java	Wed Jul 21 09:57:21 2010 -0700
@@ -30,8 +30,8 @@
 /**
  * See JVMS3, section 4.8.8.
  *
- *  <p><b>This is NOT part of any API supported by Sun Microsystems.  If
- *  you write code that depends on this, you do so at your own risk.
+ *  <p><b>This is NOT part of any supported API.
+ *  If you write code that depends on this, you do so at your own risk.
  *  This code and its internal interfaces are subject to change or
  *  deletion without notice.</b>
  */
--- a/langtools/src/share/classes/com/sun/tools/classfile/Type.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/langtools/src/share/classes/com/sun/tools/classfile/Type.java	Wed Jul 21 09:57:21 2010 -0700
@@ -34,8 +34,8 @@
  *  Family of classes used to represent the parsed form of a {@link Descriptor}
  *  or {@link Signature}.
  *
- *  <p><b>This is NOT part of any API supported by Sun Microsystems.  If
- *  you write code that depends on this, you do so at your own risk.
+ *  <p><b>This is NOT part of any supported API.
+ *  If you write code that depends on this, you do so at your own risk.
  *  This code and its internal interfaces are subject to change or
  *  deletion without notice.</b>
  */
--- a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/package.html	Tue Jul 20 16:09:44 2010 -0700
+++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/package.html	Wed Jul 21 09:57:21 2010 -0700
@@ -28,8 +28,7 @@
 <title>com.sun.tools.doclets.formats.html package</title>
 </head>
 <body bgcolor="white">
-        This is the default doclet provided by doclet provided by 
-        Sun<font size="-2"><sup>TM</sup></font> that produces Javadoc's 
+        This is the default doclet provided with JDK that produces Javadoc's 
         default HTML-formatted API output.  For more documentation
         on this doclet, please refer to the link below.
         
--- a/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/AbstractBuilder.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/AbstractBuilder.java	Wed Jul 21 09:57:21 2010 -0700
@@ -92,44 +92,42 @@
     public abstract void build() throws IOException;
 
     /**
-     * Build the documentation, as specified by the given XML elements.
+     * Build the documentation, as specified by the given XML element.
      *
-     * @param elements the XML elements that specify which components to
-     *                 document.
+     * @param node the XML element that specifies which component to document.
      */
-    protected void build(List<?> elements) {
-        for (int i = 0; i < elements.size(); i++ ) {
-            Object element = elements.get(i);
-            String component = (String)
-                ((element instanceof String) ?
-                     element :
-                    ((List<?>) element).get(0));
-            try {
-                invokeMethod("build" + component,
-                    element instanceof String ?
-                        new Class<?>[] {} :
-                        new Class<?>[] {List.class},
-                    element instanceof String ?
-                        new Object[] {} :
-                        new Object[] {((List<?>) element).subList(1,
-                            ((List<?>) element).size())});
-            } catch (NoSuchMethodException e) {
-                e.printStackTrace();
-                configuration.root.printError("Unknown element: " + component);
-                throw new DocletAbortException();
-            } catch (InvocationTargetException e) {
-                e.getCause().printStackTrace();
-            } catch (Exception e) {
-                e.printStackTrace();
-                configuration.root.printError("Exception " +
-                    e.getClass().getName() +
-                    " thrown while processing element: " + component);
-                throw new DocletAbortException();
-            }
+    protected void build(XMLNode node) {
+        String component = node.name;
+        try {
+            invokeMethod("build" + component,
+                    new Class<?>[] { XMLNode.class },
+                    new Object[] { node });
+        } catch (NoSuchMethodException e) {
+            e.printStackTrace();
+            configuration.root.printError("Unknown element: " + component);
+            throw new DocletAbortException();
+        } catch (InvocationTargetException e) {
+            e.getCause().printStackTrace();
+        } catch (Exception e) {
+            e.printStackTrace();
+            configuration.root.printError("Exception " +
+                e.getClass().getName() +
+                " thrown while processing element: " + component);
+            throw new DocletAbortException();
         }
     }
 
     /**
+     * Build the documentation, as specified by the children of the given XML element.
+     *
+     * @param node the XML element that specifies which components to document.
+     */
+    protected void buildChildren(XMLNode node) {
+        for (XMLNode child: node.children)
+            build(child);
+    }
+
+    /**
      * Given the name and parameters, invoke the method in the builder.  This
      * method is required to invoke the appropriate build method as instructed
      * by the builder XML file.
@@ -138,7 +136,14 @@
      * @param paramClasses the types for each parameter.
      * @param params       the parameters of the method.
      */
-    protected abstract void invokeMethod(String methodName, Class<?>[] paramClasses,
+    protected void invokeMethod(String methodName, Class<?>[] paramClasses,
             Object[] params)
-    throws Exception;
+    throws Exception {
+        if (DEBUG) {
+            configuration.root.printError("DEBUG: " + this.getClass().getName()
+                + "." + methodName);
+        }
+        Method method = this.getClass().getMethod(methodName, paramClasses);
+        method.invoke(this, params);
+    }
 }
--- a/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/AbstractMemberBuilder.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/AbstractMemberBuilder.java	Wed Jul 21 09:57:21 2010 -0700
@@ -27,7 +27,6 @@
 
 import com.sun.tools.doclets.internal.toolkit.*;
 import com.sun.tools.doclets.internal.toolkit.util.*;
-import java.util.*;
 
 /**
  * The superclass for all member builders.  Member builders are only executed
@@ -69,9 +68,10 @@
      *
      * @param elements {@inheritDoc}
      */
-    public void build(List<?> elements) {
+    @Override
+    public void build(XMLNode node) {
         if (hasMembersToDocument()) {
-            super.build(elements);
+            super.build(node);
         }
     }
 
--- a/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/AnnotationTypeBuilder.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/AnnotationTypeBuilder.java	Wed Jul 21 09:57:21 2010 -0700
@@ -30,7 +30,6 @@
 import com.sun.javadoc.*;
 import java.io.*;
 import java.util.*;
-import java.lang.reflect.*;
 
 /**
  * Builds the summary for a given annotation type.
@@ -92,20 +91,6 @@
     /**
      * {@inheritDoc}
      */
-    public void invokeMethod(String methodName, Class<?>[] paramClasses,
-            Object[] params)
-    throws Exception {
-        if (DEBUG) {
-            configuration.root.printError("DEBUG: " + this.getClass().getName()
-                + "." + methodName);
-        }
-        Method method = this.getClass().getMethod(methodName, paramClasses);
-        method.invoke(this, params);
-    }
-
-    /**
-     * {@inheritDoc}
-     */
     public void build() throws IOException {
         build(LayoutParser.getInstance(configuration).parseXML(ROOT));
     }
@@ -122,8 +107,8 @@
       *
       * @param elements the XML elements that specify how to document a class.
       */
-     public void buildAnnotationTypeDoc(List<?> elements) throws Exception {
-        build(elements);
+     public void buildAnnotationTypeDoc(XMLNode node) throws Exception {
+        buildChildren(node);
         writer.close();
         copyDocFiles();
      }
@@ -154,7 +139,7 @@
     /**
      * Build the header of the page.
      */
-    public void buildAnnotationTypeHeader() {
+    public void buildAnnotationTypeHeader(XMLNode node) {
         writer.writeHeader(configuration.getText("doclet.AnnotationType") +
             " " + annotationTypeDoc.name());
     }
@@ -162,14 +147,14 @@
     /**
      * If this class is deprecated, print the appropriate information.
      */
-    public void buildDeprecationInfo () {
+    public void buildDeprecationInfo (XMLNode node) {
         writer.writeAnnotationTypeDeprecationInfo();
     }
 
     /**
      * Build the signature of the current annotation type.
      */
-    public void buildAnnotationTypeSignature() {
+    public void buildAnnotationTypeSignature(XMLNode node) {
         StringBuffer modifiers = new StringBuffer(
             annotationTypeDoc.modifiers() + " ");
         writer.writeAnnotationTypeSignature(
@@ -180,14 +165,14 @@
     /**
      * Build the class description.
      */
-    public void buildAnnotationTypeDescription() {
+    public void buildAnnotationTypeDescription(XMLNode node) {
        writer.writeAnnotationTypeDescription();
     }
 
     /**
      * Build the tag information for the current class.
      */
-    public void buildAnnotationTypeTagInfo() {
+    public void buildAnnotationTypeTagInfo(XMLNode node) {
        writer.writeAnnotationTypeTagInfo();
     }
 
@@ -197,9 +182,9 @@
      * @param elements the XML elements that specify how a member summary is
      *                 documented.
      */
-    public void buildMemberSummary(List<?> elements) throws Exception {
+    public void buildMemberSummary(XMLNode node) throws Exception {
         configuration.getBuilderFactory().
-            getMemberSummaryBuilder(writer).build(elements);
+            getMemberSummaryBuilder(writer).buildChildren(node);
         writer.completeMemberSummaryBuild();
     }
 
@@ -209,10 +194,10 @@
      * @param elements the XML elements that specify how a annotation type
      *                 members are documented.
      */
-    public void buildAnnotationTypeOptionalMemberDetails(List<?> elements)
+    public void buildAnnotationTypeOptionalMemberDetails(XMLNode node)
     throws Exception {
         configuration.getBuilderFactory().
-            getAnnotationTypeOptionalMemberBuilder(writer).build(elements);
+            getAnnotationTypeOptionalMemberBuilder(writer).buildChildren(node);
     }
 
     /**
@@ -221,17 +206,17 @@
      * @param elements the XML elements that specify how a annotation type
      *                 members are documented.
      */
-    public void buildAnnotationTypeRequiredMemberDetails(List<?> elements)
+    public void buildAnnotationTypeRequiredMemberDetails(XMLNode node)
     throws Exception {
         configuration.getBuilderFactory().
-            getAnnotationTypeRequiredMemberBuilder(writer).build(elements);
+            getAnnotationTypeRequiredMemberBuilder(writer).buildChildren(node);
     }
 
 
     /**
      * Build the footer of the page.
      */
-    public void buildAnnotationTypeFooter() {
+    public void buildAnnotationTypeFooter(XMLNode node) {
         writer.writeFooter();
     }
 }
--- a/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/AnnotationTypeOptionalMemberBuilder.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/AnnotationTypeOptionalMemberBuilder.java	Wed Jul 21 09:57:21 2010 -0700
@@ -30,7 +30,6 @@
 import com.sun.tools.doclets.internal.toolkit.*;
 import com.sun.javadoc.*;
 import java.util.*;
-import java.lang.reflect.*;
 
 /**
  * Builds documentation for optional annotation type members.
@@ -85,6 +84,7 @@
     /**
      * {@inheritDoc}
      */
+    @Override
     public String getName() {
         return "AnnotationTypeOptionalMemberDetails";
     }
@@ -95,34 +95,20 @@
      * @param elements the XML elements that specify how to construct this
      *                documentation.
      */
-    public void buildAnnotationTypeOptionalMember(List<?> elements) {
+    public void buildAnnotationTypeOptionalMember(XMLNode node) {
         if (writer == null) {
             return;
         }
         for (currentMemberIndex = 0; currentMemberIndex < members.size();
             currentMemberIndex++) {
-            build(elements);
+            buildChildren(node);
         }
     }
 
     /**
-     * {@inheritDoc}
-     */
-    public void invokeMethod(String methodName, Class<?>[] paramClasses,
-            Object[] params)
-    throws Exception {
-        if (DEBUG) {
-            configuration.root.printError("DEBUG: " + this.getClass().getName()
-                + "." + methodName);
-        }
-        Method method = this.getClass().getMethod(methodName, paramClasses);
-        method.invoke(this, params);
-    }
-
-    /**
      * Document the default value for this optional member.
      */
-    public void buildDefaultValueInfo() {
+    public void buildDefaultValueInfo(XMLNode node) {
         ((AnnotationTypeOptionalMemberWriter) writer).writeDefaultValueInfo(
             (MemberDoc) members.get(currentMemberIndex));
     }
@@ -130,6 +116,7 @@
     /**
      * {@inheritDoc}
      */
+    @Override
     public AnnotationTypeRequiredMemberWriter getWriter() {
         return writer;
     }
--- a/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/AnnotationTypeRequiredMemberBuilder.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/AnnotationTypeRequiredMemberBuilder.java	Wed Jul 21 09:57:21 2010 -0700
@@ -30,7 +30,6 @@
 import com.sun.tools.doclets.internal.toolkit.*;
 import com.sun.javadoc.*;
 import java.util.*;
-import java.lang.reflect.*;
 
 /**
  * Builds documentation for required annotation type members.
@@ -114,20 +113,6 @@
     }
 
     /**
-     * {@inheritDoc}
-     */
-    public void invokeMethod(String methodName, Class<?>[] paramClasses,
-            Object[] params)
-    throws Exception {
-        if (DEBUG) {
-            configuration.root.printError("DEBUG: " + this.getClass().getName()
-                + "." + methodName);
-        }
-        Method method = this.getClass().getMethod(methodName, paramClasses);
-        method.invoke(this, params);
-    }
-
-    /**
      * Returns a list of members that will be documented for the given class.
      * This information can be used for doclet specific documentation
      * generation.
@@ -161,20 +146,20 @@
      * @param elements the XML elements that specify how to construct this
      *                documentation.
      */
-    public void buildAnnotationTypeRequiredMember(List<?> elements) {
+    public void buildAnnotationTypeRequiredMember(XMLNode node) {
         if (writer == null) {
             return;
         }
         for (currentMemberIndex = 0; currentMemberIndex < members.size();
             currentMemberIndex++) {
-            build(elements);
+            buildChildren(node);
         }
     }
 
     /**
      * Build the overall header.
      */
-    public void buildHeader() {
+    public void buildHeader(XMLNode node) {
         writer.writeHeader(classDoc,
             configuration.getText("doclet.Annotation_Type_Member_Detail"));
     }
@@ -182,7 +167,7 @@
     /**
      * Build the header for the individual members.
      */
-    public void buildMemberHeader() {
+    public void buildMemberHeader(XMLNode node) {
         writer.writeMemberHeader((MemberDoc) members.get(
                 currentMemberIndex),
             currentMemberIndex == 0);
@@ -191,14 +176,14 @@
     /**
      * Build the signature.
      */
-    public void buildSignature() {
+    public void buildSignature(XMLNode node) {
         writer.writeSignature((MemberDoc) members.get(currentMemberIndex));
     }
 
     /**
      * Build the deprecation information.
      */
-    public void buildDeprecationInfo() {
+    public void buildDeprecationInfo(XMLNode node) {
         writer.writeDeprecated((MemberDoc) members.get(currentMemberIndex));
     }
 
@@ -206,7 +191,7 @@
      * Build the comments for the member.  Do nothing if
      * {@link Configuration#nocomment} is set to true.
      */
-    public void buildMemberComments() {
+    public void buildMemberComments(XMLNode node) {
         if(! configuration.nocomment){
             writer.writeComments((MemberDoc) members.get(currentMemberIndex));
         }
@@ -215,21 +200,21 @@
     /**
      * Build the tag information.
      */
-    public void buildTagInfo() {
+    public void buildTagInfo(XMLNode node) {
         writer.writeTags((MemberDoc) members.get(currentMemberIndex));
     }
 
     /**
      * Build the footer for the individual member.
      */
-    public void buildMemberFooter() {
+    public void buildMemberFooter(XMLNode node) {
         writer.writeMemberFooter();
     }
 
     /**
      * Build the overall footer.
      */
-    public void buildFooter() {
+    public void buildFooter(XMLNode node) {
         writer.writeFooter(classDoc);
     }
 
--- a/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/ClassBuilder.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/ClassBuilder.java	Wed Jul 21 09:57:21 2010 -0700
@@ -30,7 +30,6 @@
 import com.sun.javadoc.*;
 import java.io.*;
 import java.util.*;
-import java.lang.reflect.*;
 
 /**
  * Builds the summary for a given class.
@@ -108,20 +107,6 @@
     /**
      * {@inheritDoc}
      */
-    public void invokeMethod(String methodName, Class<?>[] paramClasses,
-            Object[] params)
-    throws Exception {
-        if (DEBUG) {
-            configuration.root.printError("DEBUG: " + this.getClass().getName()
-                + "." + methodName);
-        }
-        Method method = this.getClass().getMethod(methodName, paramClasses);
-        method.invoke(this, params);
-    }
-
-    /**
-     * {@inheritDoc}
-     */
     public void build() throws IOException {
         build(LayoutParser.getInstance(configuration).parseXML(ROOT));
     }
@@ -138,8 +123,8 @@
       *
       * @param elements the XML elements that specify how to document a class.
       */
-     public void buildClassDoc(List<?> elements) throws Exception {
-        build(elements);
+     public void buildClassDoc(XMLNode node) throws Exception {
+        buildChildren(node);
         writer.close();
         copyDocFiles();
      }
@@ -169,7 +154,7 @@
     /**
      * Build the header of the page.
      */
-    public void buildClassHeader() {
+    public void buildClassHeader(XMLNode node) {
         String key;
         if (isInterface) {
             key =  "doclet.Interface";
@@ -185,7 +170,7 @@
     /**
      * Build the class tree documentation.
      */
-    public void buildClassTree() {
+    public void buildClassTree(XMLNode node) {
         writer.writeClassTree();
     }
 
@@ -193,42 +178,42 @@
      * If this is a class, list all interfaces
      * implemented by this class.
      */
-    public void buildImplementedInterfacesInfo() {
+    public void buildImplementedInterfacesInfo(XMLNode node) {
         writer.writeImplementedInterfacesInfo();
     }
 
     /**
      * If this is an interface, list all super interfaces.
      */
-    public void buildSuperInterfacesInfo() {
+    public void buildSuperInterfacesInfo(XMLNode node) {
         writer.writeSuperInterfacesInfo();
     }
 
     /**
      * List the parameters of this class.
      */
-    public void buildTypeParamInfo() {
+    public void buildTypeParamInfo(XMLNode node) {
         writer.writeTypeParamInfo();
     }
 
     /**
      * List all the classes extend this one.
      */
-    public void buildSubClassInfo() {
+    public void buildSubClassInfo(XMLNode node) {
         writer.writeSubClassInfo();
     }
 
     /**
      * List all the interfaces that extend this one.
      */
-    public void buildSubInterfacesInfo() {
+    public void buildSubInterfacesInfo(XMLNode node) {
         writer.writeSubInterfacesInfo();
     }
 
     /**
      * If this is an interface, list all classes that implement this interface.
      */
-    public void buildInterfaceUsageInfo () {
+    public void buildInterfaceUsageInfo (XMLNode node) {
         writer.writeInterfaceUsageInfo();
     }
 
@@ -236,21 +221,21 @@
      * If this is an inner class or interface, list the enclosing class or
      * interface.
      */
-    public void buildNestedClassInfo () {
+    public void buildNestedClassInfo (XMLNode node) {
         writer.writeNestedClassInfo();
     }
 
     /**
      * If this class is deprecated, print the appropriate information.
      */
-    public void buildDeprecationInfo () {
+    public void buildDeprecationInfo (XMLNode node) {
         writer.writeClassDeprecationInfo();
     }
 
     /**
      * Build the signature of the current class.
      */
-    public void buildClassSignature() {
+    public void buildClassSignature(XMLNode node) {
         StringBuffer modifiers = new StringBuffer(classDoc.modifiers() + " ");
         if (isEnum) {
             modifiers.append("enum ");
@@ -276,14 +261,14 @@
     /**
      * Build the class description.
      */
-    public void buildClassDescription() {
+    public void buildClassDescription(XMLNode node) {
        writer.writeClassDescription();
     }
 
     /**
      * Build the tag information for the current class.
      */
-    public void buildClassTagInfo() {
+    public void buildClassTagInfo(XMLNode node) {
        writer.writeClassTagInfo();
     }
 
@@ -293,9 +278,9 @@
      * @param elements the XML elements that specify how a member summary is
      *                 documented.
      */
-    public void buildMemberSummary(List<?> elements) throws Exception {
+    public void buildMemberSummary(XMLNode node) throws Exception {
         configuration.getBuilderFactory().
-            getMemberSummaryBuilder(writer).build(elements);
+            getMemberSummaryBuilder(writer).buildChildren(node);
         writer.completeMemberSummaryBuild();
     }
 
@@ -305,9 +290,9 @@
      * @param elements the XML elements that specify how a enum constants are
      *                 documented.
      */
-    public void buildEnumConstantsDetails(List<?> elements) throws Exception {
+    public void buildEnumConstantsDetails(XMLNode node) throws Exception {
         configuration.getBuilderFactory().
-            getEnumConstantsBuilder(writer).build(elements);
+            getEnumConstantsBuilder(writer).buildChildren(node);
     }
 
     /**
@@ -315,9 +300,9 @@
      *
      * @param elements the XML elements that specify how a field is documented.
      */
-    public void buildFieldDetails(List<?> elements) throws Exception {
+    public void buildFieldDetails(XMLNode node) throws Exception {
         configuration.getBuilderFactory().
-            getFieldBuilder(writer).build(elements);
+            getFieldBuilder(writer).buildChildren(node);
     }
 
     /**
@@ -326,9 +311,9 @@
      * @param elements the XML elements that specify how to document a
      * constructor.
      */
-    public void buildConstructorDetails(List<?> elements) throws Exception {
+    public void buildConstructorDetails(XMLNode node) throws Exception {
         configuration.getBuilderFactory().
-            getConstructorBuilder(writer).build(elements);
+            getConstructorBuilder(writer).buildChildren(node);
     }
 
     /**
@@ -336,15 +321,15 @@
      *
      * @param elements the XML elements that specify how a method is documented.
      */
-    public void buildMethodDetails(List<?> elements) throws Exception {
+    public void buildMethodDetails(XMLNode node) throws Exception {
         configuration.getBuilderFactory().
-                getMethodBuilder(writer).build(elements);
+                getMethodBuilder(writer).buildChildren(node);
     }
 
     /**
      * Build the footer of the page.
      */
-    public void buildClassFooter() {
+    public void buildClassFooter(XMLNode node) {
         writer.writeFooter();
     }
 }
--- a/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/ConstantsSummaryBuilder.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/ConstantsSummaryBuilder.java	Wed Jul 21 09:57:21 2010 -0700
@@ -30,7 +30,6 @@
 import com.sun.javadoc.*;
 import java.io.*;
 import java.util.*;
-import java.lang.reflect.*;
 
 /**
  * Builds the Constants Summary Page.
@@ -109,20 +108,6 @@
     /**
      * {@inheritDoc}
      */
-    public void invokeMethod(String methodName, Class<?>[] paramClasses,
-            Object[] params)
-    throws Exception {
-        if (DEBUG) {
-            configuration.root.printError("DEBUG: " + this.getClass().getName()
-                + "." + methodName);
-        }
-        Method method = this.getClass().getMethod(methodName, paramClasses);
-        method.invoke(this, params);
-    }
-
-    /**
-     * {@inheritDoc}
-     */
     public void build() throws IOException {
         if (writer == null) {
             //Doclet does not support this output.
@@ -144,29 +129,29 @@
      * @param elements the list of elements describing constant summary
      *                 documentation.
      */
-    public void buildConstantSummary(List<?> elements) throws Exception {
-        build(elements);
+    public void buildConstantSummary(XMLNode node) throws Exception {
+        buildChildren(node);
         writer.close();
     }
 
     /**
      * Build the header.
      */
-    public void buildHeader() {
+    public void buildHeader(XMLNode node) {
         writer.writeHeader();
     }
 
     /**
      * Build the footer.
      */
-    public void buildFooter() {
+    public void buildFooter(XMLNode node) {
         writer.writeFooter();
     }
 
     /**
      * Build the table of contents.
      */
-    public void buildContents() {
+    public void buildContents(XMLNode node) {
         writer.writeContentsHeader();
         PackageDoc[] packages = configuration.packages;
         printedPackageHeaders = new HashSet<String>();
@@ -186,14 +171,14 @@
      * @param elements the XML elements that represent the components
      *                 of documentation for each package.
      */
-    public void buildConstantSummaries(List<?> elements) {
+    public void buildConstantSummaries(XMLNode node) {
         PackageDoc[] packages = configuration.packages;
         printedPackageHeaders = new HashSet<String>();
         for (int i = 0; i < packages.length; i++) {
             if (hasConstantField(packages[i])) {
                 currentPackage = packages[i];
                 //Build the documentation for the current package.
-                build(elements);
+                buildChildren(node);
             }
         }
     }
@@ -204,8 +189,8 @@
      * @param elements the list of XML elements that make up package
      *                 documentation.
      */
-    public void buildPackageConstantSummary(List<?> elements) {
-        build(elements);
+    public void buildPackageConstantSummary(XMLNode node) {
+        buildChildren(node);
     }
 
     /**
@@ -214,7 +199,7 @@
      * @param elements the list of XML elements that make up the class
      *                 constant summary.
      */
-    public void buildClassConstantSummary(List<?> elements) {
+    public void buildClassConstantSummary(XMLNode node) {
         ClassDoc[] classes = currentPackage.name().length() > 0 ?
             currentPackage.allClasses() :
             configuration.classDocCatalog.allClasses(
@@ -227,14 +212,14 @@
             }
             currentClass = classes[i];
             //Build the documentation for the current class.
-            build(elements);
+            buildChildren(node);
         }
     }
 
     /**
      * Build the header for the given class.
      */
-    public void buildPackageHeader() {
+    public void buildPackageHeader(XMLNode node) {
         String parsedPackageName = parsePackageName(currentPackage.name());
         if (! printedPackageHeaders.contains(parsedPackageName)) {
             writer.writePackageName(currentPackage,
@@ -246,7 +231,7 @@
     /**
      * Build the header for the given class.
      */
-    public void buildClassHeader() {
+    public void buildClassHeader(XMLNode node) {
         writer.writeConstantMembersHeader(currentClass);
     }
 
@@ -254,14 +239,14 @@
      * Print summary of constant members in the
      * class.
      */
-    public void buildConstantMembers() {
-        new ConstantFieldBuilder(currentClass).buildMembersSummary();
+    public void buildConstantMembers(XMLNode node) {
+        new ConstantFieldBuilder(currentClass).buildMembersSummary(node);
     }
 
     /**
      * Build the footer for the given class.
      */
-    public void buildClassFooter() {
+    public void buildClassFooter(XMLNode node) {
         writer.writeConstantMembersFooter(currentClass);
     }
 
@@ -362,7 +347,7 @@
         /**
          * Builds the table of constants for a given class.
          */
-        protected void buildMembersSummary() {
+        protected void buildMembersSummary(XMLNode node) {
             List<FieldDoc> members = new ArrayList<FieldDoc>(members());
             if (members.size() > 0) {
                 Collections.sort(members);
--- a/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/ConstructorBuilder.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/ConstructorBuilder.java	Wed Jul 21 09:57:21 2010 -0700
@@ -28,7 +28,6 @@
 import com.sun.tools.doclets.internal.toolkit.util.*;
 import com.sun.tools.doclets.internal.toolkit.*;
 import com.sun.javadoc.*;
-import java.lang.reflect.*;
 import java.util.*;
 
 /**
@@ -134,22 +133,6 @@
         }
 
         /**
-         * {@inheritDoc}
-         */
-        public void invokeMethod(
-                String methodName,
-                Class<?>[] paramClasses,
-                Object[] params)
-                throws Exception {
-                if (DEBUG) {
-                        configuration.root.printError(
-                                "DEBUG: " + this.getClass().getName() + "." + methodName);
-                }
-                Method method = this.getClass().getMethod(methodName, paramClasses);
-                method.invoke(this, params);
-        }
-
-        /**
          * Returns a list of constructors that will be documented for the given class.
          * This information can be used for doclet specific documentation
          * generation.
@@ -175,21 +158,21 @@
          * @param elements the XML elements that specify how to construct this
          *                documentation.
          */
-        public void buildConstructorDoc(List<?> elements) {
+        public void buildConstructorDoc(XMLNode node) {
                 if (writer == null) {
                         return;
                 }
                 for (currentMethodIndex = 0;
                         currentMethodIndex < constructors.size();
                         currentMethodIndex++) {
-                        build(elements);
+                        buildChildren(node);
                 }
         }
 
         /**
          * Build the overall header.
          */
-        public void buildHeader() {
+        public void buildHeader(XMLNode node) {
                 writer.writeHeader(
                         classDoc,
                         configuration.getText("doclet.Constructor_Detail"));
@@ -198,7 +181,7 @@
         /**
          * Build the header for the individual constructor.
          */
-        public void buildConstructorHeader() {
+        public void buildConstructorHeader(XMLNode node) {
                 writer.writeConstructorHeader(
                         (ConstructorDoc) constructors.get(currentMethodIndex),
                         currentMethodIndex == 0);
@@ -207,7 +190,7 @@
         /**
          * Build the signature.
          */
-        public void buildSignature() {
+        public void buildSignature(XMLNode node) {
                 writer.writeSignature(
                         (ConstructorDoc) constructors.get(currentMethodIndex));
         }
@@ -215,7 +198,7 @@
         /**
          * Build the deprecation information.
          */
-        public void buildDeprecationInfo() {
+        public void buildDeprecationInfo(XMLNode node) {
                 writer.writeDeprecated(
                         (ConstructorDoc) constructors.get(currentMethodIndex));
         }
@@ -224,7 +207,7 @@
          * Build the comments for the constructor.  Do nothing if
          * {@link Configuration#nocomment} is set to true.
          */
-        public void buildConstructorComments() {
+        public void buildConstructorComments(XMLNode node) {
                 if (!configuration.nocomment) {
                         writer.writeComments(
                                 (ConstructorDoc) constructors.get(currentMethodIndex));
@@ -234,21 +217,21 @@
         /**
          * Build the tag information.
          */
-        public void buildTagInfo() {
+        public void buildTagInfo(XMLNode node) {
                 writer.writeTags((ConstructorDoc) constructors.get(currentMethodIndex));
         }
 
         /**
          * Build the footer for the individual constructor.
          */
-        public void buildConstructorFooter() {
+        public void buildConstructorFooter(XMLNode node) {
                 writer.writeConstructorFooter();
         }
 
         /**
          * Build the overall footer.
          */
-        public void buildFooter() {
+        public void buildFooter(XMLNode node) {
                 writer.writeFooter(classDoc);
         }
 }
--- a/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/EnumConstantBuilder.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/EnumConstantBuilder.java	Wed Jul 21 09:57:21 2010 -0700
@@ -29,7 +29,6 @@
 import com.sun.tools.doclets.internal.toolkit.*;
 import com.sun.javadoc.*;
 import java.util.*;
-import java.lang.reflect.*;
 
 /**
  * Builds documentation for a enum constants.
@@ -116,22 +115,6 @@
         }
 
         /**
-         * {@inheritDoc}
-         */
-        public void invokeMethod(
-                String methodName,
-                Class<?>[] paramClasses,
-                Object[] params)
-                throws Exception {
-                if (DEBUG) {
-                        configuration.root.printError(
-                                "DEBUG: " + this.getClass().getName() + "." + methodName);
-                }
-                Method method = this.getClass().getMethod(methodName, paramClasses);
-                method.invoke(this, params);
-        }
-
-        /**
          * Returns a list of enum constants that will be documented for the given class.
          * This information can be used for doclet specific documentation
          * generation.
@@ -165,21 +148,21 @@
          * @param elements the XML elements that specify how to construct this
          *                documentation.
          */
-        public void buildEnumConstant(List<?> elements) {
+        public void buildEnumConstant(XMLNode node) {
                 if (writer == null) {
                         return;
                 }
                 for (currentEnumConstantsIndex = 0;
                         currentEnumConstantsIndex < enumConstants.size();
                         currentEnumConstantsIndex++) {
-                        build(elements);
+                        buildChildren(node);
                 }
         }
 
         /**
          * Build the overall header.
          */
-        public void buildHeader() {
+        public void buildHeader(XMLNode node) {
                 writer.writeHeader(
                         classDoc,
                         configuration.getText("doclet.Enum_Constant_Detail"));
@@ -188,7 +171,7 @@
         /**
          * Build the header for the individual enum constants.
          */
-        public void buildEnumConstantHeader() {
+        public void buildEnumConstantHeader(XMLNode node) {
                 writer.writeEnumConstantHeader(
                         (FieldDoc) enumConstants.get(currentEnumConstantsIndex),
                         currentEnumConstantsIndex == 0);
@@ -197,7 +180,7 @@
         /**
          * Build the signature.
          */
-        public void buildSignature() {
+        public void buildSignature(XMLNode node) {
                 writer.writeSignature(
                         (FieldDoc) enumConstants.get(currentEnumConstantsIndex));
         }
@@ -205,7 +188,7 @@
         /**
          * Build the deprecation information.
          */
-        public void buildDeprecationInfo() {
+        public void buildDeprecationInfo(XMLNode node) {
                 writer.writeDeprecated(
                         (FieldDoc) enumConstants.get(currentEnumConstantsIndex));
         }
@@ -214,7 +197,7 @@
          * Build the comments for the enum constant.  Do nothing if
          * {@link Configuration#nocomment} is set to true.
          */
-        public void buildEnumConstantComments() {
+        public void buildEnumConstantComments(XMLNode node) {
                 if (!configuration.nocomment) {
                         writer.writeComments(
                                 (FieldDoc) enumConstants.get(currentEnumConstantsIndex));
@@ -224,7 +207,7 @@
         /**
          * Build the tag information.
          */
-        public void buildTagInfo() {
+        public void buildTagInfo(XMLNode node) {
                 writer.writeTags(
                         (FieldDoc) enumConstants.get(currentEnumConstantsIndex));
         }
@@ -232,14 +215,14 @@
         /**
          * Build the footer for the individual enum constants.
          */
-        public void buildEnumConstantFooter() {
+        public void buildEnumConstantFooter(XMLNode node) {
                 writer.writeEnumConstantFooter();
         }
 
         /**
          * Build the overall footer.
          */
-        public void buildFooter() {
+        public void buildFooter(XMLNode node) {
                 writer.writeFooter(classDoc);
         }
 
--- a/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/FieldBuilder.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/FieldBuilder.java	Wed Jul 21 09:57:21 2010 -0700
@@ -29,7 +29,6 @@
 import com.sun.tools.doclets.internal.toolkit.*;
 import com.sun.javadoc.*;
 import java.util.*;
-import java.lang.reflect.*;
 
 /**
  * Builds documentation for a field.
@@ -117,22 +116,6 @@
         }
 
         /**
-         * {@inheritDoc}
-         */
-        public void invokeMethod(
-                String methodName,
-                Class<?>[] paramClasses,
-                Object[] params)
-                throws Exception {
-                if (DEBUG) {
-                        configuration.root.printError(
-                                "DEBUG: " + this.getClass().getName() + "." + methodName);
-                }
-                Method method = this.getClass().getMethod(methodName, paramClasses);
-                method.invoke(this, params);
-        }
-
-        /**
          * Returns a list of fields that will be documented for the given class.
          * This information can be used for doclet specific documentation
          * generation.
@@ -166,21 +149,21 @@
          * @param elements the XML elements that specify how to construct this
          *                documentation.
          */
-        public void buildFieldDoc(List<?> elements) {
+        public void buildFieldDoc(XMLNode node) {
                 if (writer == null) {
                         return;
                 }
                 for (currentFieldIndex = 0;
                         currentFieldIndex < fields.size();
                         currentFieldIndex++) {
-                        build(elements);
+                        buildChildren(node);
                 }
         }
 
         /**
          * Build the overall header.
          */
-        public void buildHeader() {
+        public void buildHeader(XMLNode node) {
                 writer.writeHeader(
                         classDoc,
                         configuration.getText("doclet.Field_Detail"));
@@ -189,7 +172,7 @@
         /**
          * Build the header for the individual field.
          */
-        public void buildFieldHeader() {
+        public void buildFieldHeader(XMLNode node) {
                 writer.writeFieldHeader(
                         (FieldDoc) fields.get(currentFieldIndex),
                         currentFieldIndex == 0);
@@ -198,14 +181,14 @@
         /**
          * Build the signature.
          */
-        public void buildSignature() {
+        public void buildSignature(XMLNode node) {
                 writer.writeSignature((FieldDoc) fields.get(currentFieldIndex));
         }
 
         /**
          * Build the deprecation information.
          */
-        public void buildDeprecationInfo() {
+        public void buildDeprecationInfo(XMLNode node) {
                 writer.writeDeprecated((FieldDoc) fields.get(currentFieldIndex));
         }
 
@@ -213,7 +196,7 @@
          * Build the comments for the field.  Do nothing if
          * {@link Configuration#nocomment} is set to true.
          */
-        public void buildFieldComments() {
+        public void buildFieldComments(XMLNode node) {
                 if (!configuration.nocomment) {
                         writer.writeComments((FieldDoc) fields.get(currentFieldIndex));
                 }
@@ -222,21 +205,21 @@
         /**
          * Build the tag information.
          */
-        public void buildTagInfo() {
+        public void buildTagInfo(XMLNode node) {
                 writer.writeTags((FieldDoc) fields.get(currentFieldIndex));
         }
 
         /**
          * Build the footer for the individual field.
          */
-        public void buildFieldFooter() {
+        public void buildFieldFooter(XMLNode node) {
                 writer.writeFieldFooter();
         }
 
         /**
          * Build the overall footer.
          */
-        public void buildFooter() {
+        public void buildFooter(XMLNode node) {
                 writer.writeFooter(classDoc);
         }
 
--- a/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/LayoutParser.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/LayoutParser.java	Wed Jul 21 09:57:21 2010 -0700
@@ -45,8 +45,8 @@
     /**
      * The map of XML elements that have been parsed.
      */
-    private Map<String,List<Object>> xmlElementsMap;
-
+    private Map<String,XMLNode> xmlElementsMap;
+    private XMLNode currentNode;
     private Configuration configuration;
     private static LayoutParser instance;
     private String currentRoot;
@@ -56,7 +56,7 @@
      * This class is a singleton.
      */
     private LayoutParser(Configuration configuration) {
-        xmlElementsMap = new HashMap<String,List<Object>>();
+        xmlElementsMap = new HashMap<String,XMLNode>();
         this.configuration = configuration;
     }
 
@@ -78,20 +78,18 @@
      *
      * @return List the list of XML elements parsed.
      */
-    public List<?> parseXML(String root) {
+    public XMLNode parseXML(String root) {
         if (xmlElementsMap.containsKey(root)) {
             return xmlElementsMap.get(root);
         }
         try {
-            List<Object> xmlElements = new ArrayList<Object>();
-            xmlElementsMap.put(root, xmlElements);
             currentRoot = root;
             isParsing = false;
             SAXParserFactory factory = SAXParserFactory.newInstance();
             SAXParser saxParser = factory.newSAXParser();
             InputStream in = configuration.getBuilderXML();
             saxParser.parse(in, this);
-            return xmlElements;
+            return xmlElementsMap.get(root);
         } catch (Throwable t) {
             t.printStackTrace();
             throw new DocletAbortException();
@@ -101,39 +99,30 @@
     /**
      * {@inheritDoc}
      */
+    @Override
     public void startElement(String namespaceURI, String sName, String qName,
         Attributes attrs)
     throws SAXException {
         if (isParsing || qName.equals(currentRoot)) {
             isParsing = true;
-            List<Object> xmlElements = xmlElementsMap.get(currentRoot);
-            xmlElements.add(qName);
+            currentNode = new XMLNode(currentNode, qName);
+            for (int i = 0; i < attrs.getLength(); i++)
+                currentNode.attrs.put(attrs.getLocalName(i), attrs.getValue(i));
+            if (qName.equals(currentRoot))
+                xmlElementsMap.put(qName, currentNode);
         }
     }
 
     /**
      * {@inheritDoc}
      */
+    @Override
     public void endElement(String namespaceURI, String sName, String qName)
     throws SAXException {
         if (! isParsing) {
-            isParsing = false;
             return;
         }
-        List<Object> xmlElements = xmlElementsMap.get(currentRoot);
-        if (xmlElements.get(xmlElements.size()-1).equals(qName)) {
-            return;
-        } else {
-            List<Object> subElements = new ArrayList<Object>();
-            int targetIndex = xmlElements.indexOf(qName);
-            int size = xmlElements.size();
-            for (int i = targetIndex; i < size; i++) {
-                subElements.add(xmlElements.get(targetIndex));
-                xmlElements.remove(targetIndex);
-            }
-            //Save the sub elements as a list.
-            xmlElements.add(subElements);
-        }
+        currentNode = currentNode.parent;
         isParsing = ! qName.equals(currentRoot);
     }
 }
--- a/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/MemberSummaryBuilder.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/MemberSummaryBuilder.java	Wed Jul 21 09:57:21 2010 -0700
@@ -29,7 +29,6 @@
 import com.sun.tools.doclets.internal.toolkit.*;
 import com.sun.javadoc.*;
 import java.util.*;
-import java.lang.reflect.*;
 
 /**
  * Builds the member summary.
@@ -175,22 +174,6 @@
         }
 
         /**
-         * {@inheritDoc}
-         */
-        public void invokeMethod(
-                String methodName,
-                Class<?>[] paramClasses,
-                Object[] params)
-                throws Exception {
-                if (DEBUG) {
-                        configuration.root.printError(
-                                "DEBUG: " + this.getClass().getName() + "." + methodName);
-                }
-                Method method = this.getClass().getMethod(methodName, paramClasses);
-                method.invoke(this, params);
-        }
-
-        /**
          * Return true it there are any members to summarize.
          *
          * @return true if there are any members to summarize.
@@ -211,7 +194,7 @@
         /**
          * Build the summary for the enum constants.
          */
-        public void buildEnumConstantsSummary() {
+        public void buildEnumConstantsSummary(XMLNode node) {
                 buildSummary(
                         memberSummaryWriters[VisibleMemberMap.ENUM_CONSTANTS],
                         visibleMemberMaps[VisibleMemberMap.ENUM_CONSTANTS]);
@@ -220,7 +203,7 @@
     /**
      * Build the summary for the optional members.
      */
-    public void buildAnnotationTypeOptionalMemberSummary() {
+    public void buildAnnotationTypeOptionalMemberSummary(XMLNode node) {
         buildSummary(
             memberSummaryWriters[VisibleMemberMap.ANNOTATION_TYPE_MEMBER_OPTIONAL],
                 visibleMemberMaps[VisibleMemberMap.ANNOTATION_TYPE_MEMBER_OPTIONAL]);
@@ -229,7 +212,7 @@
     /**
      * Build the summary for the optional members.
      */
-    public void buildAnnotationTypeRequiredMemberSummary() {
+    public void buildAnnotationTypeRequiredMemberSummary(XMLNode node) {
         buildSummary(
             memberSummaryWriters[VisibleMemberMap.ANNOTATION_TYPE_MEMBER_REQUIRED],
                 visibleMemberMaps[VisibleMemberMap.ANNOTATION_TYPE_MEMBER_REQUIRED]);
@@ -238,7 +221,7 @@
         /**
          * Build the summary for the fields.
          */
-        public void buildFieldsSummary() {
+        public void buildFieldsSummary(XMLNode node) {
                 buildSummary(
                         memberSummaryWriters[VisibleMemberMap.FIELDS],
                         visibleMemberMaps[VisibleMemberMap.FIELDS]);
@@ -247,7 +230,7 @@
         /**
          * Build the inherited summary for the fields.
          */
-        public void buildFieldsInheritedSummary() {
+        public void buildFieldsInheritedSummary(XMLNode node) {
                 buildInheritedSummary(
                         memberSummaryWriters[VisibleMemberMap.FIELDS],
                         visibleMemberMaps[VisibleMemberMap.FIELDS]);
@@ -256,7 +239,7 @@
         /**
          * Build the summary for the nested classes.
          */
-        public void buildNestedClassesSummary() {
+        public void buildNestedClassesSummary(XMLNode node) {
                 buildSummary(
                         memberSummaryWriters[VisibleMemberMap.INNERCLASSES],
                         visibleMemberMaps[VisibleMemberMap.INNERCLASSES]);
@@ -265,7 +248,7 @@
         /**
          * Build the inherited summary for the nested classes.
          */
-        public void buildNestedClassesInheritedSummary() {
+        public void buildNestedClassesInheritedSummary(XMLNode node) {
                 buildInheritedSummary(
                         memberSummaryWriters[VisibleMemberMap.INNERCLASSES],
                         visibleMemberMaps[VisibleMemberMap.INNERCLASSES]);
@@ -274,7 +257,7 @@
         /**
          * Build the method summary.
          */
-        public void buildMethodsSummary() {
+        public void buildMethodsSummary(XMLNode node) {
                 buildSummary(
                         memberSummaryWriters[VisibleMemberMap.METHODS],
                         visibleMemberMaps[VisibleMemberMap.METHODS]);
@@ -283,7 +266,7 @@
         /**
          * Build the inherited method summary.
          */
-        public void buildMethodsInheritedSummary() {
+        public void buildMethodsInheritedSummary(XMLNode node) {
                 buildInheritedSummary(
                         memberSummaryWriters[VisibleMemberMap.METHODS],
                         visibleMemberMaps[VisibleMemberMap.METHODS]);
@@ -292,7 +275,7 @@
         /**
          * Build the constructor summary.
          */
-        public void buildConstructorsSummary() {
+        public void buildConstructorsSummary(XMLNode node) {
                 buildSummary(
                         memberSummaryWriters[VisibleMemberMap.CONSTRUCTORS],
                         visibleMemberMaps[VisibleMemberMap.CONSTRUCTORS]);
--- a/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/MethodBuilder.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/MethodBuilder.java	Wed Jul 21 09:57:21 2010 -0700
@@ -29,7 +29,7 @@
 import com.sun.tools.doclets.internal.toolkit.*;
 import com.sun.javadoc.*;
 import java.util.*;
-import java.lang.reflect.*;
+
 /**
  * Builds documentation for a method.
  *
@@ -112,22 +112,6 @@
         }
 
         /**
-         * {@inheritDoc}
-         */
-        public void invokeMethod(
-                String methodName,
-                Class<?>[] paramClasses,
-                Object[] params)
-                throws Exception {
-                if (DEBUG) {
-                        configuration.root.printError(
-                                "DEBUG: " + this.getClass().getName() + "." + methodName);
-                }
-                Method method = this.getClass().getMethod(methodName, paramClasses);
-                method.invoke(this, params);
-        }
-
-        /**
          * Returns a list of methods that will be documented for the given class.
          * This information can be used for doclet specific documentation
          * generation.
@@ -158,21 +142,21 @@
         /**
          * Build the method documentation.
          */
-        public void buildMethodDoc(List<?> elements) {
+        public void buildMethodDoc(XMLNode node) {
                 if (writer == null) {
                         return;
                 }
                 for (currentMethodIndex = 0;
                         currentMethodIndex < methods.size();
                         currentMethodIndex++) {
-                        build(elements);
+                        buildChildren(node);
                 }
         }
 
         /**
          * Build the overall header.
          */
-        public void buildHeader() {
+        public void buildHeader(XMLNode node) {
                 writer.writeHeader(
                         classDoc,
                         configuration.getText("doclet.Method_Detail"));
@@ -181,7 +165,7 @@
         /**
          * Build the header for the individual method.
          */
-        public void buildMethodHeader() {
+        public void buildMethodHeader(XMLNode node) {
                 writer.writeMethodHeader(
                         (MethodDoc) methods.get(currentMethodIndex),
                         currentMethodIndex == 0);
@@ -190,14 +174,14 @@
         /**
          * Build the signature.
          */
-        public void buildSignature() {
+        public void buildSignature(XMLNode node) {
                 writer.writeSignature((MethodDoc) methods.get(currentMethodIndex));
         }
 
         /**
          * Build the deprecation information.
          */
-        public void buildDeprecationInfo() {
+        public void buildDeprecationInfo(XMLNode node) {
                 writer.writeDeprecated((MethodDoc) methods.get(currentMethodIndex));
         }
 
@@ -205,7 +189,7 @@
          * Build the comments for the method.  Do nothing if
          * {@link Configuration#nocomment} is set to true.  If this method
          */
-        public void buildMethodComments() {
+        public void buildMethodComments(XMLNode node) {
                 if (!configuration.nocomment) {
             MethodDoc method = (MethodDoc) methods.get(currentMethodIndex);
 
@@ -228,21 +212,21 @@
         /**
          * Build the tag information.
          */
-        public void buildTagInfo() {
+        public void buildTagInfo(XMLNode node) {
                 writer.writeTags((MethodDoc) methods.get(currentMethodIndex));
         }
 
         /**
          * Build the footer of the method.
          */
-        public void buildMethodFooter() {
+        public void buildMethodFooter(XMLNode node) {
                 writer.writeMethodFooter();
         }
 
         /**
          * Build the overall footer.
          */
-        public void buildFooter() {
+        public void buildFooter(XMLNode node) {
                 writer.writeFooter(classDoc);
         }
 
--- a/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/PackageSummaryBuilder.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/PackageSummaryBuilder.java	Wed Jul 21 09:57:21 2010 -0700
@@ -29,8 +29,6 @@
 import com.sun.tools.doclets.internal.toolkit.*;
 import com.sun.javadoc.*;
 import java.io.*;
-import java.util.*;
-import java.lang.reflect.*;
 
 /**
  * Builds the summary for a given package.
@@ -85,22 +83,6 @@
         }
 
         /**
-         * {@inheritDoc}
-         */
-        public void invokeMethod(
-                String methodName,
-                Class<?>[] paramClasses,
-                Object[] params)
-                throws Exception {
-                if (DEBUG) {
-                        configuration.root.printError(
-                                "DEBUG: " + this.getClass().getName() + "." + methodName);
-                }
-                Method method = this.getClass().getMethod(methodName, paramClasses);
-                method.invoke(this, params);
-        }
-
-        /**
          * Build the package summary.
          */
         public void build() throws IOException {
@@ -121,8 +103,8 @@
         /**
          * Build the package documentation.
          */
-        public void buildPackageDoc(List<?> elements) throws Exception {
-                build(elements);
+        public void buildPackageDoc(XMLNode node) throws Exception {
+                buildChildren(node);
                 packageWriter.close();
                 Util.copyDocFiles(
                         configuration,
@@ -136,14 +118,14 @@
         /**
          * Build the header of the summary.
          */
-        public void buildPackageHeader() {
+        public void buildPackageHeader(XMLNode node) {
                 packageWriter.writePackageHeader(Util.getPackageName(packageDoc));
         }
 
         /**
          * Build the description of the summary.
          */
-        public void buildPackageDescription() {
+        public void buildPackageDescription(XMLNode node) {
                 if (configuration.nocomment) {
                         return;
                 }
@@ -153,7 +135,7 @@
         /**
          * Build the tags of the summary.
          */
-        public void buildPackageTags() {
+        public void buildPackageTags(XMLNode node) {
                 if (configuration.nocomment) {
                         return;
                 }
@@ -163,28 +145,28 @@
         /**
          * Build the package summary.
          */
-        public void buildSummary(List<?> elements) {
-                build(elements);
+        public void buildSummary(XMLNode node) {
+                buildChildren(node);
         }
 
         /**
          * Build the overall header.
          */
-        public void buildSummaryHeader() {
+        public void buildSummaryHeader(XMLNode node) {
                 packageWriter.writeSummaryHeader();
         }
 
         /**
          * Build the overall footer.
          */
-        public void buildSummaryFooter() {
+        public void buildSummaryFooter(XMLNode node) {
                 packageWriter.writeSummaryFooter();
         }
 
         /**
          * Build the summary for the classes in this package.
          */
-        public void buildClassSummary() {
+        public void buildClassSummary(XMLNode node) {
             String classTableSummary =
                     configuration.getText("doclet.Member_Table_Summary",
                     configuration.getText("doclet.Class_Summary"),
@@ -209,7 +191,7 @@
         /**
          * Build the summary for the interfaces in this package.
          */
-        public void buildInterfaceSummary() {
+        public void buildInterfaceSummary(XMLNode node) {
             String interfaceTableSummary =
                     configuration.getText("doclet.Member_Table_Summary",
                     configuration.getText("doclet.Interface_Summary"),
@@ -234,7 +216,7 @@
         /**
          * Build the summary for the enums in this package.
          */
-        public void buildAnnotationTypeSummary() {
+        public void buildAnnotationTypeSummary(XMLNode node) {
             String annotationtypeTableSummary =
                     configuration.getText("doclet.Member_Table_Summary",
                     configuration.getText("doclet.Annotation_Types_Summary"),
@@ -259,7 +241,7 @@
         /**
          * Build the summary for the enums in this package.
          */
-        public void buildEnumSummary() {
+        public void buildEnumSummary(XMLNode node) {
             String enumTableSummary =
                     configuration.getText("doclet.Member_Table_Summary",
                     configuration.getText("doclet.Enum_Summary"),
@@ -284,7 +266,7 @@
         /**
          * Build the summary for the exceptions in this package.
          */
-        public void buildExceptionSummary() {
+        public void buildExceptionSummary(XMLNode node) {
             String exceptionTableSummary =
                     configuration.getText("doclet.Member_Table_Summary",
                     configuration.getText("doclet.Exception_Summary"),
@@ -309,7 +291,7 @@
         /**
          * Build the summary for the errors in this package.
          */
-        public void buildErrorSummary() {
+        public void buildErrorSummary(XMLNode node) {
             String errorTableSummary =
                     configuration.getText("doclet.Member_Table_Summary",
                     configuration.getText("doclet.Error_Summary"),
@@ -334,7 +316,7 @@
         /**
          * Build the footer of the summary.
          */
-        public void buildPackageFooter() {
+        public void buildPackageFooter(XMLNode node) {
                 packageWriter.writePackageFooter();
         }
 }
--- a/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/SerializedFormBuilder.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/SerializedFormBuilder.java	Wed Jul 21 09:57:21 2010 -0700
@@ -26,7 +26,6 @@
 package com.sun.tools.doclets.internal.toolkit.builders;
 
 import java.io.*;
-import java.lang.reflect.*;
 import java.util.*;
 
 import com.sun.javadoc.*;
@@ -132,47 +131,33 @@
     /**
      * Build the serialized form.
      */
-    public void buildSerializedForm(List<?> elements) throws Exception {
-        build(elements);
+    public void buildSerializedForm(XMLNode node) throws Exception {
+        buildChildren(node);
         writer.close();
     }
 
     /**
-     * {@inheritDoc}
-     */
-    public void invokeMethod(String methodName, Class<?>[] paramClasses,
-            Object[] params)
-    throws Exception {
-        if (DEBUG) {
-            configuration.root.printError("DEBUG: " + this.getClass().getName()
-                + "." + methodName);
-        }
-        Method method = this.getClass().getMethod(methodName, paramClasses);
-        method.invoke(this, params);
-    }
-
-    /**
      * Build the header.
      */
-    public void buildHeader() {
+    public void buildHeader(XMLNode node) {
         writer.writeHeader(configuration.getText("doclet.Serialized_Form"));
     }
 
     /**
      * Build the contents.
      */
-    public void buildSerializedFormSummaries(List<?> elements) {
+    public void buildSerializedFormSummaries(XMLNode node) {
         PackageDoc[] packages = configuration.packages;
         for (int i = 0; i < packages.length; i++) {
             currentPackage = packages[i];
-            build(elements);
+            buildChildren(node);
         }
     }
 
     /**
      * Build the package serialized for for the current package being processed.
      */
-    public void buildPackageSerializedForm(List<?> elements) {
+    public void buildPackageSerializedForm(XMLNode node) {
         String foo = currentPackage.name();
         ClassDoc[] classes = currentPackage.allClasses(false);
         if (classes == null || classes.length == 0) {
@@ -184,14 +169,14 @@
         if (!serialClassFoundToDocument(classes)) {
             return;
         }
-        build(elements);
+        buildChildren(node);
     }
 
-    public void buildPackageHeader() {
+    public void buildPackageHeader(XMLNode node) {
         writer.writePackageHeader(Util.getPackageName(currentPackage));
     }
 
-    public void buildClassSerializedForm(List<?> elements) {
+    public void buildClassSerializedForm(XMLNode node) {
         ClassDoc[] classes = currentPackage.allClasses(false);
         Arrays.sort(classes);
         for (int j = 0; j < classes.length; j++) {
@@ -202,19 +187,19 @@
                 if(!serialClassInclude(currentClass)) {
                     continue;
                 }
-                build(elements);
+                buildChildren(node);
             }
         }
     }
 
-    public void buildClassHeader() {
+    public void buildClassHeader(XMLNode node) {
         writer.writeClassHeader(currentClass);
     }
 
     /**
      * Build the serial UID information for the given class.
      */
-    public void buildSerialUIDInfo() {
+    public void buildSerialUIDInfo(XMLNode node) {
         FieldDoc[] fields = currentClass.fields(false);
         for (int i = 0; i < fields.length; i++) {
             if (fields[i].name().equals("serialVersionUID") &&
@@ -229,7 +214,7 @@
     /**
      * Build the footer.
      */
-    public void buildFooter() {
+    public void buildFooter(XMLNode node) {
         writer.writeFooter();
     }
 
@@ -316,7 +301,7 @@
     /**
      * Build the method header.
      */
-    public void buildMethodHeader() {
+    public void buildMethodHeader(XMLNode node) {
         if (currentClass.serializationMethods().length > 0) {
             methodWriter.writeHeader(
                 configuration.getText("doclet.Serialized_Form_methods"));
@@ -333,28 +318,28 @@
     /**
      * Build the method sub header.
      */
-    public void buildMethodSubHeader()  {
+    public void buildMethodSubHeader(XMLNode node)  {
         methodWriter.writeMemberHeader((MethodDoc) currentMember);
     }
 
     /**
      * Build the deprecated method description.
      */
-    public void buildDeprecatedMethodInfo() {
+    public void buildDeprecatedMethodInfo(XMLNode node) {
         methodWriter.writeDeprecatedMemberInfo((MethodDoc) currentMember);
     }
 
     /**
      * Build method tags.
      */
-    public void buildMethodDescription() {
+    public void buildMethodDescription(XMLNode node) {
         methodWriter.writeMemberDescription((MethodDoc) currentMember);
     }
 
     /**
      * Build the method tags.
      */
-    public void buildMethodTags() {
+    public void buildMethodTags(XMLNode node) {
         methodWriter.writeMemberTags((MethodDoc) currentMember);
         MethodDoc method = (MethodDoc)currentMember;
         if (method.name().compareTo("writeExternal") == 0
@@ -370,24 +355,24 @@
     /**
      * build the information for the method.
      */
-    public void buildMethodInfo(List<?> elements)  {
+    public void buildMethodInfo(XMLNode node)  {
         if(configuration.nocomment){
             return;
         }
-        build(elements);
+        buildChildren(node);
     }
 
     /**
      * Build the method footer.
      */
-    public void buildMethodFooter() {
+    public void buildMethodFooter(XMLNode node) {
         methodWriter.writeMemberFooter();
     }
 
     /**
      * Build the field header.
      */
-    public void buildFieldHeader() {
+    public void buildFieldHeader(XMLNode node) {
         if (currentClass.serializableFields().length > 0) {
             buildFieldSerializationOverview(currentClass);
             fieldWriter.writeHeader(configuration.getText(
@@ -426,7 +411,7 @@
     /**
      * Build the field sub header.
      */
-    public void buildFieldSubHeader() {
+    public void buildFieldSubHeader(XMLNode node) {
         if (! currentClass.definesSerializableFields() ){
             FieldDoc field = (FieldDoc) currentMember;
             fieldWriter.writeMemberHeader(field.type().asClassDoc(),
@@ -437,7 +422,7 @@
     /**
      * Build the field deprecation information.
      */
-    public void buildFieldDeprecationInfo() {
+    public void buildFieldDeprecationInfo(XMLNode node) {
         if (!currentClass.definesSerializableFields()) {
             FieldDoc field = (FieldDoc)currentMember;
             fieldWriter.writeMemberDeprecatedInfo(field);
@@ -447,7 +432,7 @@
     /**
      * Build the field information.
      */
-    public void buildFieldInfo() {
+    public void buildFieldInfo(XMLNode node) {
         if(configuration.nocomment){
             return;
         }
@@ -483,7 +468,7 @@
     /**
      * Build the field sub footer.
      */
-    public void buildFieldSubFooter() {
+    public void buildFieldSubFooter(XMLNode node) {
         if (! currentClass.definesSerializableFields()) {
             fieldWriter.writeMemberFooter();
         }
@@ -493,12 +478,12 @@
      * Build the summaries for the methods that belong to the given
      * class.
      */
-    public void buildSerializableMethods(List<?> elements) {
+    public void buildSerializableMethods(XMLNode node) {
         MemberDoc[] members = currentClass.serializationMethods();
         if (members.length > 0) {
             for (int i = 0; i < members.length; i++) {
                 currentMember = members[i];
-                build(elements);
+                buildChildren(node);
             }
         }
     }
@@ -507,12 +492,12 @@
      * Build the summaries for the fields that belong to the given
      * class.
      */
-    public void buildSerializableFields(List<?> elements) {
+    public void buildSerializableFields(XMLNode node) {
         MemberDoc[] members = currentClass.serializableFields();
         if (members.length > 0) {
             for (int i = 0; i < members.length; i++) {
                 currentMember = members[i];
-                build(elements);
+                buildChildren(node);
             }
         }
     }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/XMLNode.java	Wed Jul 21 09:57:21 2010 -0700
@@ -0,0 +1,69 @@
+/*
+ * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package com.sun.tools.doclets.internal.toolkit.builders;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * Simple class to represent the attribute and elements of an XML node.
+ */
+public class XMLNode {
+    XMLNode(XMLNode parent, String qname) {
+        this.parent = parent;
+        name = qname;
+        attrs = new HashMap<String,String>();
+        children = new ArrayList<XMLNode>();
+
+        if (parent != null)
+            parent.children.add(this);
+    }
+
+    @Override
+    public String toString() {
+        StringBuilder sb = new StringBuilder();
+        sb.append("<");
+        sb.append(name);
+        for (Map.Entry<String,String> e: attrs.entrySet())
+            sb.append(" " + e.getKey() + "=\"" + e.getValue() + "\"");
+        if (children.size() == 0)
+            sb.append("/>");
+        else {
+            sb.append(">");
+            for (XMLNode c: children)
+                sb.append(c.toString());
+            sb.append("</" + name + ">");
+        }
+        return sb.toString();
+    }
+
+    final XMLNode parent;
+    final String name;
+    final Map<String,String> attrs;
+    final List<XMLNode> children;
+}
--- a/langtools/src/share/classes/com/sun/tools/javac/Launcher.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/langtools/src/share/classes/com/sun/tools/javac/Launcher.java	Wed Jul 21 09:57:21 2010 -0700
@@ -41,7 +41,7 @@
  * of a <em>project</em>).  Simply ensure that this class is added to
  * the project and make it the main class of the project.</p>
  *
- * <p><b>This is NOT part of any API supported by Sun Microsystems.
+ * <p><b>This is NOT part of any supported API.
  * If you write code that depends on this, you do so at your own
  * risk.  This code and its internal interfaces are subject to change
  * or deletion without notice.</b></p>
--- a/langtools/src/share/classes/com/sun/tools/javac/Server.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/langtools/src/share/classes/com/sun/tools/javac/Server.java	Wed Jul 21 09:57:21 2010 -0700
@@ -36,7 +36,7 @@
  * Java Compiler Server.  Can be used to speed up a set of (small)
  * compilation tasks by caching jar files between compilations.
  *
- * <p><b>This is NOT part of any API supported by Sun Microsystems.
+ * <p><b>This is NOT part of any supported API.
  * If you write code that depends on this, you do so at your own
  * risk.  This code and its internal interfaces are subject to change
  * or deletion without notice.</b></p>
--- a/langtools/src/share/classes/com/sun/tools/javac/api/DiagnosticFormatter.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/langtools/src/share/classes/com/sun/tools/javac/api/DiagnosticFormatter.java	Wed Jul 21 09:57:21 2010 -0700
@@ -33,7 +33,7 @@
  * Provides simple functionalities for javac diagnostic formatting.
  * @param <D> type of diagnostic handled by this formatter
  *
- * <p><b>This is NOT part of any API supported by Sun Microsystems.
+ * <p><b>This is NOT part of any supported API.
  * If you write code that depends on this, you do so at your own risk.
  * This code and its internal interfaces are subject to change or
  * deletion without notice.</b>
--- a/langtools/src/share/classes/com/sun/tools/javac/api/Formattable.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/langtools/src/share/classes/com/sun/tools/javac/api/Formattable.java	Wed Jul 21 09:57:21 2010 -0700
@@ -31,7 +31,7 @@
  * This interface must be implemented by any javac class that has non-trivial
  * formatting needs (e.g. where toString() does not apply because of localization).
  *
- * <p><b>This is NOT part of any API supported by Sun Microsystems.
+ * <p><b>This is NOT part of any supported API.
  * If you write code that depends on this, you do so at your own risk.
  * This code and its internal interfaces are subject to change or
  * deletion without notice.</b>
--- a/langtools/src/share/classes/com/sun/tools/javac/api/JavacScope.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/langtools/src/share/classes/com/sun/tools/javac/api/JavacScope.java	Wed Jul 21 09:57:21 2010 -0700
@@ -38,7 +38,7 @@
 /**
  * Provides an implementation of Scope.
  *
- * <p><b>This is NOT part of any API supported by Sun Microsystems.
+ * <p><b>This is NOT part of any supported API.
  * If you write code that depends on this, you do so at your own
  * risk.  This code and its internal interfaces are subject to change
  * or deletion without notice.</b></p>
--- a/langtools/src/share/classes/com/sun/tools/javac/api/JavacTaskImpl.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/langtools/src/share/classes/com/sun/tools/javac/api/JavacTaskImpl.java	Wed Jul 21 09:57:21 2010 -0700
@@ -54,9 +54,9 @@
 import com.sun.tools.javac.main.JavaCompiler;
 
 /**
- * Provides access to functionality specific to the Sun Java Compiler, javac.
+ * Provides access to functionality specific to the JDK Java Compiler, javac.
  *
- * <p><b>This is NOT part of any API supported by Sun Microsystems.
+ * <p><b>This is NOT part of any supported API.
  * If you write code that depends on this, you do so at your own
  * risk.  This code and its internal interfaces are subject to change
  * or deletion without notice.</b></p>
@@ -502,7 +502,7 @@
     }
 
     /**
-     * For internal use by Sun Microsystems only.  This method will be
+     * For internal use only.  This method will be
      * removed without warning.
      */
     public Context getContext() {
@@ -510,7 +510,7 @@
     }
 
     /**
-     * For internal use by Sun Microsystems only.  This method will be
+     * For internal use only.  This method will be
      * removed without warning.
      */
     public void updateContext(Context newContext) {
@@ -518,7 +518,7 @@
     }
 
     /**
-     * For internal use by Sun Microsystems only.  This method will be
+     * For internal use only.  This method will be
      * removed without warning.
      */
     public Type parseType(String expr, TypeElement scope) {
--- a/langtools/src/share/classes/com/sun/tools/javac/api/JavacTool.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/langtools/src/share/classes/com/sun/tools/javac/api/JavacTool.java	Wed Jul 21 09:57:21 2010 -0700
@@ -57,7 +57,7 @@
 /**
  * TODO: describe com.sun.tools.javac.api.Tool
  *
- * <p><b>This is NOT part of any API supported by Sun Microsystems.
+ * <p><b>This is NOT part of any supported API.
  * If you write code that depends on this, you do so at your own
  * risk.  This code and its internal interfaces are subject to change
  * or deletion without notice.</b></p>
--- a/langtools/src/share/classes/com/sun/tools/javac/api/JavacTrees.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/langtools/src/share/classes/com/sun/tools/javac/api/JavacTrees.java	Wed Jul 21 09:57:21 2010 -0700
@@ -71,7 +71,7 @@
 /**
  * Provides an implementation of Trees.
  *
- * <p><b>This is NOT part of any API supported by Sun Microsystems.
+ * <p><b>This is NOT part of any supported API.
  * If you write code that depends on this, you do so at your own
  * risk.  This code and its internal interfaces are subject to change
  * or deletion without notice.</b></p>
--- a/langtools/src/share/classes/com/sun/tools/javac/api/Messages.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/langtools/src/share/classes/com/sun/tools/javac/api/Messages.java	Wed Jul 21 09:57:21 2010 -0700
@@ -32,7 +32,7 @@
  * This interface defines the minimum requirements in order to provide support
  * for localized formatted strings.
  *
- * <p><b>This is NOT part of any API supported by Sun Microsystems.
+ * <p><b>This is NOT part of any supported API.
  * If you write code that depends on this, you do so at your own risk.
  * This code and its internal interfaces are subject to change or
  * deletion without notice.</b>
--- a/langtools/src/share/classes/com/sun/tools/javac/api/WrappingJavaFileManager.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/langtools/src/share/classes/com/sun/tools/javac/api/WrappingJavaFileManager.java	Wed Jul 21 09:57:21 2010 -0700
@@ -42,7 +42,7 @@
  * <p>This class might be moved to {@link javax.tools} in a future
  * release.
  *
- * <p><b>This is NOT part of any API supported by Sun Microsystems.
+ * <p><b>This is NOT part of any supported API.
  * If you write code that depends on this, you do so at your own
  * risk.  This code and its internal interfaces are subject to change
  * or deletion without notice.</b></p>
--- a/langtools/src/share/classes/com/sun/tools/javac/code/Attribute.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/langtools/src/share/classes/com/sun/tools/javac/code/Attribute.java	Wed Jul 21 09:57:21 2010 -0700
@@ -38,8 +38,8 @@
 
 /** An annotation value.
  *
- *  <p><b>This is NOT part of any API supported by Sun Microsystems.  If
- *  you write code that depends on this, you do so at your own risk.
+ *  <p><b>This is NOT part of any supported API.
+ *  If you write code that depends on this, you do so at your own risk.
  *  This code and its internal interfaces are subject to change or
  *  deletion without notice.</b>
  */
--- a/langtools/src/share/classes/com/sun/tools/javac/code/BoundKind.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/langtools/src/share/classes/com/sun/tools/javac/code/BoundKind.java	Wed Jul 21 09:57:21 2010 -0700
@@ -27,7 +27,7 @@
 
 /**
  *
- * <p><b>This is NOT part of any API supported by Sun Microsystems.
+ * <p><b>This is NOT part of any supported API.
  * If you write code that depends on this, you do so at your own risk.
  * This code and its internal interfaces are subject to change or
  * deletion without notice.</b>
--- a/langtools/src/share/classes/com/sun/tools/javac/code/Flags.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/langtools/src/share/classes/com/sun/tools/javac/code/Flags.java	Wed Jul 21 09:57:21 2010 -0700
@@ -33,8 +33,8 @@
 
 /** Access flags and other modifiers for Java classes and members.
  *
- *  <p><b>This is NOT part of any API supported by Sun Microsystems.  If
- *  you write code that depends on this, you do so at your own risk.
+ *  <p><b>This is NOT part of any supported API.
+ *  If you write code that depends on this, you do so at your own risk.
  *  This code and its internal interfaces are subject to change or
  *  deletion without notice.</b>
  */
@@ -226,7 +226,7 @@
     public static final long HYPOTHETICAL   = 1L<<37;
 
     /**
-     * Flag that marks a Sun proprietary class.
+     * Flag that marks an internal proprietary class.
      */
     public static final long PROPRIETARY = 1L<<38;
 
@@ -235,6 +235,12 @@
      */
     public static final long DISJOINT = 1L<<39;
 
+    /**
+     * Flag that marks a signature-polymorphic invoke method.
+     * (These occur inside java.dyn.MethodHandle.)
+     */
+    public static final long POLYMORPHIC_SIGNATURE = 1L<<40;
+
     /** Modifier masks.
      */
     public static final int
--- a/langtools/src/share/classes/com/sun/tools/javac/code/Kinds.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/langtools/src/share/classes/com/sun/tools/javac/code/Kinds.java	Wed Jul 21 09:57:21 2010 -0700
@@ -38,8 +38,8 @@
  *  different subclasses of Symbol. Symbol kinds are organized so they can be
  *  or'ed to sets.
  *
- *  <p><b>This is NOT part of any API supported by Sun Microsystems.  If
- *  you write code that depends on this, you do so at your own risk.
+ *  <p><b>This is NOT part of any supported API.
+ *  If you write code that depends on this, you do so at your own risk.
  *  This code and its internal interfaces are subject to change or
  *  deletion without notice.</b>
  */
@@ -92,7 +92,7 @@
     public static final int ABSENT_TYP   = ERRONEOUS+8; // missing type
 
     public enum KindName implements Formattable {
-        ANNOTATION("kindname.interface"),
+        ANNOTATION("kindname.annotation"),
         CONSTRUCTOR("kindname.constructor"),
         INTERFACE("kindname.interface"),
         ENUM("kindname.enum"),
--- a/langtools/src/share/classes/com/sun/tools/javac/code/Lint.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/langtools/src/share/classes/com/sun/tools/javac/code/Lint.java	Wed Jul 21 09:57:21 2010 -0700
@@ -39,8 +39,8 @@
 /**
  * A class for handling -Xlint suboptions and @SuppresssWarnings.
  *
- *  <p><b>This is NOT part of any API supported by Sun Microsystems.  If
- *  you write code that depends on this, you do so at your own risk.
+ *  <p><b>This is NOT part of any supported API.
+ *  If you write code that depends on this, you do so at your own risk.
  *  This code and its internal interfaces are subject to change or
  *  deletion without notice.</b>
  */
@@ -196,14 +196,19 @@
         RAW("rawtypes"),
 
         /**
-         * Warn about Sun proprietary API that may be removed in a future release.
+         * Warn about proprietary API that may be removed in a future release.
          */
         SUNAPI("sunapi", true),
 
         /**
          * Warn about issues relating to use of statics
          */
-        STATIC("static");
+        STATIC("static"),
+
+        /**
+         * Warn about potentially unsafe vararg methods
+         */
+        VARARGS("varargs");
 
         LintCategory(String option) {
             this(option, false);
--- a/langtools/src/share/classes/com/sun/tools/javac/code/Printer.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/langtools/src/share/classes/com/sun/tools/javac/code/Printer.java	Wed Jul 21 09:57:21 2010 -0700
@@ -41,7 +41,7 @@
  * A combined type/symbol visitor for generating non-trivial localized string
  * representation of types and symbols.
  *
- * <p><b>This is NOT part of any API supported by Sun Microsystems.
+ * <p><b>This is NOT part of any supported API.
  * If you write code that depends on this, you do so at your own risk.
  * This code and its internal interfaces are subject to change or
  * deletion without notice.</b>
--- a/langtools/src/share/classes/com/sun/tools/javac/code/Scope.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/langtools/src/share/classes/com/sun/tools/javac/code/Scope.java	Wed Jul 21 09:57:21 2010 -0700
@@ -34,8 +34,8 @@
  *  as hash tables. Scopes can be nested; the next field of a scope points
  *  to its next outer scope. Nested scopes can share their hash tables.
  *
- *  <p><b>This is NOT part of any API supported by Sun Microsystems.  If
- *  you write code that depends on this, you do so at your own risk.
+ *  <p><b>This is NOT part of any supported API.
+ *  If you write code that depends on this, you do so at your own risk.
  *  This code and its internal interfaces are subject to change or
  *  deletion without notice.</b>
  */
--- a/langtools/src/share/classes/com/sun/tools/javac/code/Source.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/langtools/src/share/classes/com/sun/tools/javac/code/Source.java	Wed Jul 21 09:57:21 2010 -0700
@@ -33,8 +33,8 @@
 
 /** The source language version accepted.
  *
- *  <p><b>This is NOT part of any API supported by Sun Microsystems.  If
- *  you write code that depends on this, you do so at your own risk.
+ *  <p><b>This is NOT part of any supported API.
+ *  If you write code that depends on this, you do so at your own risk.
  *  This code and its internal interfaces are subject to change or
  *  deletion without notice.</b>
  */
@@ -171,6 +171,10 @@
     public boolean allowStringsInSwitch() {
         return compareTo(JDK1_7) >= 0;
     }
+    // JSR 292: recognize @PolymorphicSignature on java/dyn names
+    public boolean allowPolymorphicSignature() {
+        return compareTo(JDK1_7) >= 0;
+    }
     public static SourceVersion toSourceVersion(Source source) {
         switch(source) {
         case JDK1_2:
--- a/langtools/src/share/classes/com/sun/tools/javac/code/Symbol.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/langtools/src/share/classes/com/sun/tools/javac/code/Symbol.java	Wed Jul 21 09:57:21 2010 -0700
@@ -49,8 +49,8 @@
  *  types, packages. Each subclass is represented as a static inner class
  *  inside Symbol.
  *
- *  <p><b>This is NOT part of any API supported by Sun Microsystems.  If
- *  you write code that depends on this, you do so at your own risk.
+ *  <p><b>This is NOT part of any supported API.
+ *  If you write code that depends on this, you do so at your own risk.
  *  This code and its internal interfaces are subject to change or
  *  deletion without notice.</b>
  */
--- a/langtools/src/share/classes/com/sun/tools/javac/code/Symtab.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/langtools/src/share/classes/com/sun/tools/javac/code/Symtab.java	Wed Jul 21 09:57:21 2010 -0700
@@ -42,8 +42,8 @@
  *  fields. This makes it possible to work in multiple concurrent
  *  projects, which might use different class files for library classes.
  *
- *  <p><b>This is NOT part of any API supported by Sun Microsystems.  If
- *  you write code that depends on this, you do so at your own risk.
+ *  <p><b>This is NOT part of any supported API.
+ *  If you write code that depends on this, you do so at your own risk.
  *  This code and its internal interfaces are subject to change or
  *  deletion without notice.</b>
  */
@@ -120,6 +120,7 @@
     public final Type cloneableType;
     public final Type serializableType;
     public final Type methodHandleType;
+    public final Type polymorphicSignatureType;
     public final Type invokeDynamicType;
     public final Type throwableType;
     public final Type errorType;
@@ -291,24 +292,6 @@
         }
     }
 
-    public void synthesizeMHTypeIfMissing(final Type type) {
-        final Completer completer = type.tsym.completer;
-        if (completer != null) {
-            type.tsym.completer = new Completer() {
-                public void complete(Symbol sym) throws CompletionFailure {
-                    try {
-                        completer.complete(sym);
-                    } catch (CompletionFailure e) {
-                        sym.flags_field |= (PUBLIC | ABSTRACT);
-                        ((ClassType) sym.type).supertype_field = objectType;
-                        // do not bother to create MH.type if not visibly declared
-                        // this sym just accumulates invoke(...) methods
-                    }
-                }
-            };
-        }
-    }
-
     public void synthesizeBoxTypeIfMissing(final Type type) {
         ClassSymbol sym = reader.enterClass(boxedName[type.tag]);
         final Completer completer = sym.completer;
@@ -426,6 +409,7 @@
         throwableType = enterClass("java.lang.Throwable");
         serializableType = enterClass("java.io.Serializable");
         methodHandleType = enterClass("java.dyn.MethodHandle");
+        polymorphicSignatureType = enterClass("java.dyn.MethodHandle$PolymorphicSignature");
         invokeDynamicType = enterClass("java.dyn.InvokeDynamic");
         errorType = enterClass("java.lang.Error");
         illegalArgumentExceptionType = enterClass("java.lang.IllegalArgumentException");
@@ -463,13 +447,12 @@
 
         synthesizeEmptyInterfaceIfMissing(cloneableType);
         synthesizeEmptyInterfaceIfMissing(serializableType);
-        synthesizeMHTypeIfMissing(methodHandleType);
-        synthesizeMHTypeIfMissing(invokeDynamicType);
+        synthesizeEmptyInterfaceIfMissing(polymorphicSignatureType);
         synthesizeBoxTypeIfMissing(doubleType);
         synthesizeBoxTypeIfMissing(floatType);
         synthesizeBoxTypeIfMissing(voidType);
 
-        // Enter a synthetic class that is used to mark Sun
+        // Enter a synthetic class that is used to mark internal
         // proprietary classes in ct.sym.  This class does not have a
         // class file.
         ClassType proprietaryType = (ClassType)enterClass("sun.Proprietary+Annotation");
--- a/langtools/src/share/classes/com/sun/tools/javac/code/TargetType.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/langtools/src/share/classes/com/sun/tools/javac/code/TargetType.java	Wed Jul 21 09:57:21 2010 -0700
@@ -39,8 +39,8 @@
  * annotation targets a type argument in a local variable, method return type,
  * or a typecast).
  *
- *  <p><b>This is NOT part of any API supported by Sun Microsystems.  If
- *  you write code that depends on this, you do so at your own risk.
+ *  <p><b>This is NOT part of any supported API.
+ *  If you write code that depends on this, you do so at your own risk.
  *  This code and its internal interfaces are subject to change or
  *  deletion without notice.</b>
  */
--- a/langtools/src/share/classes/com/sun/tools/javac/code/Type.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/langtools/src/share/classes/com/sun/tools/javac/code/Type.java	Wed Jul 21 09:57:21 2010 -0700
@@ -56,8 +56,8 @@
  *  the error type (tag: ERROR, class: ErrorType).
  *  </pre>
  *
- *  <p><b>This is NOT part of any API supported by Sun Microsystems.  If
- *  you write code that depends on this, you do so at your own risk.
+ *  <p><b>This is NOT part of any supported API.
+ *  If you write code that depends on this, you do so at your own risk.
  *  This code and its internal interfaces are subject to change or
  *  deletion without notice.</b>
  *
--- a/langtools/src/share/classes/com/sun/tools/javac/code/TypeAnnotationPosition.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/langtools/src/share/classes/com/sun/tools/javac/code/TypeAnnotationPosition.java	Wed Jul 21 09:57:21 2010 -0700
@@ -29,8 +29,8 @@
 
 /** A type annotation position.
 *
-*  <p><b>This is NOT part of any API supported by Sun Microsystems.  If
-*  you write code that depends on this, you do so at your own risk.
+*  <p><b>This is NOT part of any supported API.
+*  If you write code that depends on this, you do so at your own risk.
 *  This code and its internal interfaces are subject to change or
 *  deletion without notice.</b>
 */
--- a/langtools/src/share/classes/com/sun/tools/javac/code/TypeTags.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/langtools/src/share/classes/com/sun/tools/javac/code/TypeTags.java	Wed Jul 21 09:57:21 2010 -0700
@@ -29,8 +29,8 @@
 /** An interface for type tag values, which distinguish between different
  *  sorts of types.
  *
- *  <p><b>This is NOT part of any API supported by Sun Microsystems.  If
- *  you write code that depends on this, you do so at your own risk.
+ *  <p><b>This is NOT part of any supported API.
+ *  If you write code that depends on this, you do so at your own risk.
  *  This code and its internal interfaces are subject to change or
  *  deletion without notice.</b>
  */
--- a/langtools/src/share/classes/com/sun/tools/javac/code/Types.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/langtools/src/share/classes/com/sun/tools/javac/code/Types.java	Wed Jul 21 09:57:21 2010 -0700
@@ -58,7 +58,7 @@
  * <dd>A second list of types should be named ss.</dd>
  * </dl>
  *
- * <p><b>This is NOT part of any API supported by Sun Microsystems.
+ * <p><b>This is NOT part of any supported API.
  * If you write code that depends on this, you do so at your own risk.
  * This code and its internal interfaces are subject to change or
  * deletion without notice.</b>
@@ -588,10 +588,21 @@
                 case BYTE: case CHAR: case SHORT: case INT: case LONG: case FLOAT:
                 case DOUBLE: case BOOLEAN: case VOID: case BOT: case NONE:
                     return t.tag == s.tag;
-                case TYPEVAR:
-                    return s.isSuperBound()
-                        && !s.isExtendsBound()
-                        && visit(t, upperBound(s));
+                case TYPEVAR: {
+                    if (s.tag == TYPEVAR) {
+                        //type-substitution does not preserve type-var types
+                        //check that type var symbols and bounds are indeed the same
+                        return t.tsym == s.tsym &&
+                                visit(t.getUpperBound(), s.getUpperBound());
+                    }
+                    else {
+                        //special case for s == ? super X, where upper(s) = u
+                        //check that u == t, where u has been set by Type.withTypeVar
+                        return s.isSuperBound() &&
+                                !s.isExtendsBound() &&
+                                visit(t, upperBound(s));
+                    }
+                }
                 default:
                     throw new AssertionError("isSameType " + t.tag);
                 }
@@ -1850,13 +1861,16 @@
 
     /**
      * Same as {@link #setBounds(Type.TypeVar,List,Type)}, except that
-     * third parameter is computed directly.  Note that this test
-     * might cause a symbol completion.  Hence, this version of
+     * third parameter is computed directly, as follows: if all
+     * all bounds are interface types, the computed supertype is Object,
+     * otherwise the supertype is simply left null (in this case, the supertype
+     * is assumed to be the head of the bound list passed as second argument).
+     * Note that this check might cause a symbol completion. Hence, this version of
      * setBounds may not be called during a classfile read.
      */
     public void setBounds(TypeVar t, List<Type> bounds) {
         Type supertype = (bounds.head.tsym.flags() & INTERFACE) != 0 ?
-            supertype(bounds.head) : null;
+            syms.objectType : null;
         setBounds(t, bounds, supertype);
         t.rank_field = -1;
     }
--- a/langtools/src/share/classes/com/sun/tools/javac/comp/Annotate.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/langtools/src/share/classes/com/sun/tools/javac/comp/Annotate.java	Wed Jul 21 09:57:21 2010 -0700
@@ -35,8 +35,8 @@
  *  which is processed at the top level of any set of recursive calls
  *  requesting it be processed.
  *
- *  <p><b>This is NOT part of any API supported by Sun Microsystems.  If
- *  you write code that depends on this, you do so at your own risk.
+ *  <p><b>This is NOT part of any supported API.
+ *  If you write code that depends on this, you do so at your own risk.
  *  This code and its internal interfaces are subject to change or
  *  deletion without notice.</b>
  */
--- a/langtools/src/share/classes/com/sun/tools/javac/comp/Attr.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/langtools/src/share/classes/com/sun/tools/javac/comp/Attr.java	Wed Jul 21 09:57:21 2010 -0700
@@ -59,8 +59,8 @@
  *  @see ConstFold
  *  @see Infer
  *
- *  <p><b>This is NOT part of any API supported by Sun Microsystems.  If
- *  you write code that depends on this, you do so at your own risk.
+ *  <p><b>This is NOT part of any supported API.
+ *  If you write code that depends on this, you do so at your own risk.
  *  This code and its internal interfaces are subject to change or
  *  deletion without notice.</b>
  */
@@ -122,7 +122,6 @@
         relax = (options.get("-retrofit") != null ||
                  options.get("-relax") != null);
         useBeforeDeclarationWarning = options.get("useBeforeDeclarationWarning") != null;
-        allowInvokedynamic = options.get("invokedynamic") != null;
         enableSunApiLintControl = options.get("enableSunApiLintControl") != null;
     }
 
@@ -155,10 +154,6 @@
      */
     boolean allowAnonOuterThis;
 
-    /** Switch: allow invokedynamic syntax
-     */
-    boolean allowInvokedynamic;
-
     /**
      * Switch: warn about use of variable before declaration?
      * RFE: 6425594
@@ -166,7 +161,7 @@
     boolean useBeforeDeclarationWarning;
 
     /**
-     * Switch: allow lint infrastructure to control Sun proprietary
+     * Switch: allow lint infrastructure to control proprietary
      * API warnings.
      */
     boolean enableSunApiLintControl;
@@ -657,6 +652,8 @@
                 attribStat(l.head, localEnv);
             }
 
+            chk.checkVarargMethodDecl(tree);
+
             // Check that type parameters are well-formed.
             chk.validate(tree.typarams, localEnv);
             if ((owner.flags() & ANNOTATION) != 0 &&
@@ -1384,9 +1381,15 @@
             // as a special case, MethodHandle.<T>invoke(abc) and InvokeDynamic.<T>foo(abc)
             // has type <T>, and T can be a primitive type.
             if (tree.meth.getTag() == JCTree.SELECT && !typeargtypes.isEmpty()) {
-              Type selt = ((JCFieldAccess) tree.meth).selected.type;
-              if ((selt == syms.methodHandleType && methName == names.invoke) || selt == syms.invokeDynamicType) {
+              JCFieldAccess mfield = (JCFieldAccess) tree.meth;
+              if ((mfield.selected.type.tsym != null &&
+                   (mfield.selected.type.tsym.flags() & POLYMORPHIC_SIGNATURE) != 0)
+                  ||
+                  (mfield.sym != null &&
+                   (mfield.sym.flags() & POLYMORPHIC_SIGNATURE) != 0)) {
                   assert types.isSameType(restype, typeargtypes.head) : mtype;
+                  assert mfield.selected.type == syms.methodHandleType
+                      || mfield.selected.type == syms.invokeDynamicType;
                   typeargtypesNonRefOK = true;
               }
             }
@@ -1472,7 +1475,7 @@
         // Attribute clazz expression and store
         // symbol + type back into the attributed tree.
         Type clazztype = attribType(clazz, env);
-        Pair<Scope,Scope> mapping = getSyntheticScopeMapping((ClassType)clazztype);
+        Pair<Scope,Scope> mapping = getSyntheticScopeMapping(clazztype);
         if (!TreeInfo.isDiamond(tree)) {
             clazztype = chk.checkClassType(
                 tree.clazz.pos(), clazztype, true);
@@ -1640,9 +1643,10 @@
                         List<Type> argtypes,
                         List<Type> typeargtypes,
                         boolean reportErrors) {
-        if (clazztype.isErroneous()) {
-            //if the type of the instance creation expression is erroneous
-            //return the erroneous type itself
+        if (clazztype.isErroneous() || mapping == erroneousMapping) {
+            //if the type of the instance creation expression is erroneous,
+            //or something prevented us to form a valid mapping, return the
+            //(possibly erroneous) type unchanged
             return clazztype;
         }
         else if (clazztype.isInterface()) {
@@ -1740,7 +1744,10 @@
      *  inference. The inferred return type of the synthetic constructor IS
      *  the inferred type for the diamond operator.
      */
-    private Pair<Scope, Scope> getSyntheticScopeMapping(ClassType ctype) {
+    private Pair<Scope, Scope> getSyntheticScopeMapping(Type ctype) {
+        if (ctype.tag != CLASS) {
+            return erroneousMapping;
+        }
         Pair<Scope, Scope> mapping =
                 new Pair<Scope, Scope>(ctype.tsym.members(), new Scope(ctype.tsym));
         List<Type> typevars = ctype.tsym.type.getTypeArguments();
@@ -1763,6 +1770,8 @@
         return mapping;
     }
 
+    private final Pair<Scope,Scope> erroneousMapping = new Pair<Scope,Scope>(null, null);
+
     /** Make an attributed null check tree.
      */
     public JCExpression makeNullCheck(JCExpression arg) {
@@ -2628,10 +2637,11 @@
             }
             if (useVarargs) {
                 JCTree tree = env.tree;
+                Type argtype = owntype.getParameterTypes().last();
                 if (owntype.getReturnType().tag != FORALL || warned) {
-                    chk.checkVararg(env.tree.pos(), owntype.getParameterTypes());
+                    chk.checkVararg(env.tree.pos(), owntype.getParameterTypes(), sym, env);
                 }
-                Type elemtype = types.elemtype(owntype.getParameterTypes().last());
+                Type elemtype = types.elemtype(argtype);
                 switch (tree.getTag()) {
                 case JCTree.APPLY:
                     ((JCMethodInvocation) tree).varargsElement = elemtype;
--- a/langtools/src/share/classes/com/sun/tools/javac/comp/AttrContext.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/langtools/src/share/classes/com/sun/tools/javac/comp/AttrContext.java	Wed Jul 21 09:57:21 2010 -0700
@@ -31,8 +31,8 @@
 /** Contains information specific to the attribute and enter
  *  passes, to be used in place of the generic field in environments.
  *
- *  <p><b>This is NOT part of any API supported by Sun Microsystems.  If
- *  you write code that depends on this, you do so at your own risk.
+ *  <p><b>This is NOT part of any supported API.
+ *  If you write code that depends on this, you do so at your own risk.
  *  This code and its internal interfaces are subject to change or
  *  deletion without notice.</b>
  */
--- a/langtools/src/share/classes/com/sun/tools/javac/comp/AttrContextEnv.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/langtools/src/share/classes/com/sun/tools/javac/comp/AttrContextEnv.java	Wed Jul 21 09:57:21 2010 -0700
@@ -30,8 +30,8 @@
 
 /** {@code Env<A>} specialized as {@code Env<AttrContext>}
  *
- *  <p><b>This is NOT part of any API supported by Sun Microsystems.  If
- *  you write code that depends on this, you do so at your own risk.
+ *  <p><b>This is NOT part of any supported API.
+ *  If you write code that depends on this, you do so at your own risk.
  *  This code and its internal interfaces are subject to change or
  *  deletion without notice.</b>
  */
--- a/langtools/src/share/classes/com/sun/tools/javac/comp/Check.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/langtools/src/share/classes/com/sun/tools/javac/comp/Check.java	Wed Jul 21 09:57:21 2010 -0700
@@ -47,8 +47,8 @@
 
 /** Type checking helper class for the attribution phase.
  *
- *  <p><b>This is NOT part of any API supported by Sun Microsystems.  If
- *  you write code that depends on this, you do so at your own risk.
+ *  <p><b>This is NOT part of any supported API.
+ *  If you write code that depends on this, you do so at your own risk.
  *  This code and its internal interfaces are subject to change or
  *  deletion without notice.</b>
  */
@@ -64,6 +64,7 @@
     private final JCDiagnostic.Factory diags;
     private final boolean skipAnnotations;
     private boolean warnOnSyntheticConflicts;
+    private boolean suppressAbortOnBadClassFile;
     private final TreeInfo treeinfo;
 
     // The set of lint options currently in effect. It is initialized
@@ -98,12 +99,14 @@
         complexInference = options.get("-complexinference") != null;
         skipAnnotations = options.get("skipAnnotations") != null;
         warnOnSyntheticConflicts = options.get("warnOnSyntheticConflicts") != null;
+        suppressAbortOnBadClassFile = options.get("suppressAbortOnBadClassFile") != null;
 
         Target target = Target.instance(context);
         syntheticNameChar = target.syntheticNameChar();
 
         boolean verboseDeprecated = lint.isEnabled(LintCategory.DEPRECATION);
         boolean verboseUnchecked = lint.isEnabled(LintCategory.UNCHECKED);
+        boolean verboseVarargs = lint.isEnabled(LintCategory.VARARGS);
         boolean verboseSunApi = lint.isEnabled(LintCategory.SUNAPI);
         boolean enforceMandatoryWarnings = source.enforceMandatoryWarnings();
 
@@ -111,6 +114,8 @@
                 enforceMandatoryWarnings, "deprecated");
         uncheckedHandler = new MandatoryWarningHandler(log, verboseUnchecked,
                 enforceMandatoryWarnings, "unchecked");
+        unsafeVarargsHandler = new MandatoryWarningHandler(log, verboseVarargs,
+                enforceMandatoryWarnings, "varargs");
         sunApiHandler = new MandatoryWarningHandler(log, verboseSunApi,
                 enforceMandatoryWarnings, "sunapi");
     }
@@ -148,7 +153,11 @@
      */
     private MandatoryWarningHandler uncheckedHandler;
 
-    /** A handler for messages about using Sun proprietary API.
+    /** A handler for messages about unchecked or unsafe vararg method decl.
+     */
+    private MandatoryWarningHandler unsafeVarargsHandler;
+
+    /** A handler for messages about using proprietary API.
      */
     private MandatoryWarningHandler sunApiHandler;
 
@@ -180,7 +189,16 @@
             uncheckedHandler.report(pos, msg, args);
     }
 
-    /** Warn about using Sun proprietary API.
+    /** Warn about unsafe vararg method decl.
+     *  @param pos        Position to be used for error reporting.
+     *  @param sym        The deprecated symbol.
+     */
+    void warnUnsafeVararg(DiagnosticPosition pos, Type elemType) {
+        if (!lint.isSuppressed(LintCategory.VARARGS))
+            unsafeVarargsHandler.report(pos, "varargs.non.reifiable.type", elemType);
+    }
+
+    /** Warn about using proprietary API.
      *  @param pos        Position to be used for error reporting.
      *  @param msg        A string describing the problem.
      */
@@ -200,6 +218,7 @@
     public void reportDeferredDiagnostics() {
         deprecationHandler.reportDeferredDiagnostic();
         uncheckedHandler.reportDeferredDiagnostic();
+        unsafeVarargsHandler.reportDeferredDiagnostic();
         sunApiHandler.reportDeferredDiagnostic();
     }
 
@@ -210,7 +229,8 @@
      */
     public Type completionError(DiagnosticPosition pos, CompletionFailure ex) {
         log.error(pos, "cant.access", ex.sym, ex.getDetailValue());
-        if (ex instanceof ClassReader.BadClassFile) throw new Abort();
+        if (ex instanceof ClassReader.BadClassFile
+                && !suppressAbortOnBadClassFile) throw new Abort();
         else return syms.errType;
     }
 
@@ -543,7 +563,7 @@
             while (args.nonEmpty()) {
                 if (args.head.tag == WILDCARD)
                     return typeTagError(pos,
-                                        Log.getLocalizedString("type.req.exact"),
+                                        diags.fragment("type.req.exact"),
                                         args.head);
                 args = args.tail;
             }
@@ -677,17 +697,33 @@
         }
     }
 
+    void checkVarargMethodDecl(JCMethodDecl tree) {
+        MethodSymbol m = tree.sym;
+        //check the element type of the vararg
+        if (m.isVarArgs()) {
+            Type varargElemType = types.elemtype(tree.params.last().type);
+            if (!types.isReifiable(varargElemType)) {
+                warnUnsafeVararg(tree.params.head.pos(), varargElemType);
+            }
+        }
+    }
+
     /**
      * Check that vararg method call is sound
      * @param pos Position to be used for error reporting.
      * @param argtypes Actual arguments supplied to vararg method.
      */
-    void checkVararg(DiagnosticPosition pos, List<Type> argtypes) {
+    void checkVararg(DiagnosticPosition pos, List<Type> argtypes, Symbol msym, Env<AttrContext> env) {
+        Env<AttrContext> calleeLintEnv = env;
+        while (calleeLintEnv.info.lint == null)
+            calleeLintEnv = calleeLintEnv.next;
+        Lint calleeLint = calleeLintEnv.info.lint.augment(msym.attributes_field, msym.flags());
         Type argtype = argtypes.last();
-        if (!types.isReifiable(argtype))
+        if (!types.isReifiable(argtype) && !calleeLint.isSuppressed(Lint.LintCategory.VARARGS)) {
             warnUnchecked(pos,
                               "unchecked.generic.array.creation",
                               argtype);
+        }
     }
 
     /** Check that given modifiers are legal for given symbol and
@@ -886,6 +922,7 @@
     void checkRaw(JCTree tree, Env<AttrContext> env) {
         if (lint.isEnabled(Lint.LintCategory.RAW) &&
             tree.type.tag == CLASS &&
+            !TreeInfo.isDiamond(tree) &&
             !env.enclClass.name.isEmpty() &&  //anonymous or intersection
             tree.type.isRaw()) {
             log.warning(tree.pos(), "raw.class.use", tree.type, tree.type.tsym.type);
@@ -915,7 +952,7 @@
                 List<Type> actuals = tree.type.allparams();
                 List<JCExpression> args = tree.arguments;
                 List<Type> forms = tree.type.tsym.type.getTypeArguments();
-                ListBuffer<TypeVar> tvars_buf = new ListBuffer<TypeVar>();
+                ListBuffer<Type> tvars_buf = new ListBuffer<Type>();
 
                 // For matching pairs of actual argument types `a' and
                 // formal type parameters with declared bound `b' ...
@@ -946,12 +983,15 @@
                 }
 
                 args = tree.arguments;
-                List<TypeVar> tvars = tvars_buf.toList();
+                List<Type> tvars = tvars_buf.toList();
 
                 while (args.nonEmpty() && tvars.nonEmpty()) {
+                    Type actual = types.subst(args.head.type,
+                        tree.type.tsym.type.getTypeArguments(),
+                        tvars_buf.toList());
                     checkExtends(args.head.pos(),
-                                 args.head.type,
-                                 tvars.head);
+                                 actual,
+                                 (TypeVar)tvars.head);
                     args = args.tail;
                     tvars = tvars.tail;
                 }
--- a/langtools/src/share/classes/com/sun/tools/javac/comp/ConstFold.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/langtools/src/share/classes/com/sun/tools/javac/comp/ConstFold.java	Wed Jul 21 09:57:21 2010 -0700
@@ -37,8 +37,8 @@
 /** Helper class for constant folding, used by the attribution phase.
  *  This class is marked strictfp as mandated by JLS 15.4.
  *
- *  <p><b>This is NOT part of any API supported by Sun Microsystems.  If
- *  you write code that depends on this, you do so at your own risk.
+ *  <p><b>This is NOT part of any supported API.
+ *  If you write code that depends on this, you do so at your own risk.
  *  This code and its internal interfaces are subject to change or
  *  deletion without notice.</b>
  */
--- a/langtools/src/share/classes/com/sun/tools/javac/comp/Enter.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/langtools/src/share/classes/com/sun/tools/javac/comp/Enter.java	Wed Jul 21 09:57:21 2010 -0700
@@ -82,8 +82,8 @@
  *                                              (only for toplevel classes)
  *  </pre>
  *
- *  <p><b>This is NOT part of any API supported by Sun Microsystems.  If
- *  you write code that depends on this, you do so at your own risk.
+ *  <p><b>This is NOT part of any supported API.
+ *  If you write code that depends on this, you do so at your own risk.
  *  This code and its internal interfaces are subject to change or
  *  deletion without notice.</b>
  */
--- a/langtools/src/share/classes/com/sun/tools/javac/comp/Env.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/langtools/src/share/classes/com/sun/tools/javac/comp/Env.java	Wed Jul 21 09:57:21 2010 -0700
@@ -36,8 +36,8 @@
  *  a generic component, represented as a type parameter, to carry further
  *  information specific to individual passes.
  *
- *  <p><b>This is NOT part of any API supported by Sun Microsystems.  If
- *  you write code that depends on this, you do so at your own risk.
+ *  <p><b>This is NOT part of any supported API.
+ *  If you write code that depends on this, you do so at your own risk.
  *  This code and its internal interfaces are subject to change or
  *  deletion without notice.</b>
  */
--- a/langtools/src/share/classes/com/sun/tools/javac/comp/Flow.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/langtools/src/share/classes/com/sun/tools/javac/comp/Flow.java	Wed Jul 21 09:57:21 2010 -0700
@@ -170,8 +170,8 @@
  *  allow unqualified forms only, parentheses optional, and phase out
  *  support for assigning to a final field via this.x.
  *
- *  <p><b>This is NOT part of any API supported by Sun Microsystems.  If
- *  you write code that depends on this, you do so at your own risk.
+ *  <p><b>This is NOT part of any supported API.
+ *  If you write code that depends on this, you do so at your own risk.
  *  This code and its internal interfaces are subject to change or
  *  deletion without notice.</b>
  */
--- a/langtools/src/share/classes/com/sun/tools/javac/comp/Infer.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/langtools/src/share/classes/com/sun/tools/javac/comp/Infer.java	Wed Jul 21 09:57:21 2010 -0700
@@ -37,8 +37,8 @@
 
 /** Helper class for type parameter inference, used by the attribution phase.
  *
- *  <p><b>This is NOT part of any API supported by Sun Microsystems.  If
- *  you write code that depends on this, you do so at your own risk.
+ *  <p><b>This is NOT part of any supported API.
+ *  If you write code that depends on this, you do so at your own risk.
  *  This code and its internal interfaces are subject to change or
  *  deletion without notice.</b>
  */
@@ -290,6 +290,7 @@
     public Type instantiateMethod(final Env<AttrContext> env,
                                   List<Type> tvars,
                                   MethodType mt,
+                                  final Symbol msym,
                                   final List<Type> argtypes,
                                   final boolean allowBoxing,
                                   final boolean useVarargs,
@@ -418,7 +419,7 @@
                     checkWithinBounds(all_tvars,
                            types.subst(inferredTypes, tvars, inferred), warn);
                     if (useVarargs) {
-                        chk.checkVararg(env.tree.pos(), formals);
+                        chk.checkVararg(env.tree.pos(), formals, msym, env);
                     }
                     return super.inst(inferred, types);
             }};
--- a/langtools/src/share/classes/com/sun/tools/javac/comp/Lower.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/langtools/src/share/classes/com/sun/tools/javac/comp/Lower.java	Wed Jul 21 09:57:21 2010 -0700
@@ -48,8 +48,8 @@
 /** This pass translates away some syntactic sugar: inner classes,
  *  class literals, assertions, foreach loops, etc.
  *
- *  <p><b>This is NOT part of any API supported by Sun Microsystems.  If
- *  you write code that depends on this, you do so at your own risk.
+ *  <p><b>This is NOT part of any supported API.
+ *  If you write code that depends on this, you do so at your own risk.
  *  This code and its internal interfaces are subject to change or
  *  deletion without notice.</b>
  */
@@ -674,6 +674,40 @@
         return rs.resolveInternalField(pos, attrEnv, qual, name);
     }
 
+    /** Anon inner classes are used as access constructor tags.
+     * accessConstructorTag will use an existing anon class if one is available,
+     * and synthethise a class (with makeEmptyClass) if one is not available.
+     * However, there is a small possibility that an existing class will not
+     * be generated as expected if it is inside a conditional with a constant
+     * expression. If that is found to be the case, create an empty class here.
+     */
+    private void checkAccessConstructorTags() {
+        for (List<ClassSymbol> l = accessConstrTags; l.nonEmpty(); l = l.tail) {
+            ClassSymbol c = l.head;
+            if (isTranslatedClassAvailable(c))
+                continue;
+            // Create class definition tree.
+            JCClassDecl cdef = make.ClassDef(
+                make.Modifiers(STATIC | SYNTHETIC), names.empty,
+                List.<JCTypeParameter>nil(),
+                null, List.<JCExpression>nil(), List.<JCTree>nil());
+            cdef.sym = c;
+            cdef.type = c.type;
+            // add it to the list of classes to be generated
+            translated.append(cdef);
+        }
+    }
+    // where
+    private boolean isTranslatedClassAvailable(ClassSymbol c) {
+        for (JCTree tree: translated) {
+            if (tree.getTag() == JCTree.CLASSDEF
+                    && ((JCClassDecl) tree).sym == c) {
+                return true;
+            }
+        }
+        return false;
+    }
+
 /**************************************************************************
  * Access methods
  *************************************************************************/
@@ -718,6 +752,10 @@
      */
     private Map<Symbol,MethodSymbol> accessConstrs;
 
+    /** A list of all class symbols used for access constructor tags.
+     */
+    private List<ClassSymbol> accessConstrTags;
+
     /** A queue for all accessed symbols.
      */
     private ListBuffer<Symbol> accessed;
@@ -1138,6 +1176,8 @@
         ClassSymbol ctag = chk.compiled.get(flatname);
         if (ctag == null)
             ctag = makeEmptyClass(STATIC | SYNTHETIC, topClass);
+        // keep a record of all tags, to verify that all are generated as required
+        accessConstrTags = accessConstrTags.prepend(ctag);
         return ctag;
     }
 
@@ -3394,6 +3434,7 @@
             accessNums = new HashMap<Symbol,Integer>();
             accessSyms = new HashMap<Symbol,MethodSymbol[]>();
             accessConstrs = new HashMap<Symbol,MethodSymbol>();
+            accessConstrTags = List.nil();
             accessed = new ListBuffer<Symbol>();
             translate(cdef, (JCExpression)null);
             for (List<Symbol> l = accessed.toList(); l.nonEmpty(); l = l.tail)
@@ -3401,6 +3442,7 @@
             for (EnumMapping map : enumSwitchMap.values())
                 map.translate();
             checkConflicts(this.translated.toList());
+            checkAccessConstructorTags();
             translated = this.translated;
         } finally {
             // note that recursive invocations of this method fail hard
@@ -3420,6 +3462,7 @@
             accessNums = null;
             accessSyms = null;
             accessConstrs = null;
+            accessConstrTags = null;
             accessed = null;
             enumSwitchMap.clear();
         }
--- a/langtools/src/share/classes/com/sun/tools/javac/comp/MemberEnter.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/langtools/src/share/classes/com/sun/tools/javac/comp/MemberEnter.java	Wed Jul 21 09:57:21 2010 -0700
@@ -48,8 +48,8 @@
  *  by entering their members into the class scope using
  *  MemberEnter.complete().  See Enter for an overview.
  *
- *  <p><b>This is NOT part of any API supported by Sun Microsystems.  If
- *  you write code that depends on this, you do so at your own risk.
+ *  <p><b>This is NOT part of any supported API.
+ *  If you write code that depends on this, you do so at your own risk.
  *  This code and its internal interfaces are subject to change or
  *  deletion without notice.</b>
  */
@@ -768,6 +768,12 @@
                 && s.owner.kind != MTH
                 && types.isSameType(c.type, syms.deprecatedType))
                 s.flags_field |= Flags.DEPRECATED;
+            // Internally to java.dyn, a @PolymorphicSignature annotation
+            // translates to a classfile attribute.
+            if (!c.type.isErroneous()
+                && types.isSameType(c.type, syms.polymorphicSignatureType)) {
+                s.flags_field |= Flags.POLYMORPHIC_SIGNATURE;
+            }
             if (!annotated.add(a.type.tsym))
                 log.error(a.pos, "duplicate.annotation");
         }
--- a/langtools/src/share/classes/com/sun/tools/javac/comp/Resolve.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/langtools/src/share/classes/com/sun/tools/javac/comp/Resolve.java	Wed Jul 21 09:57:21 2010 -0700
@@ -47,8 +47,8 @@
 
 /** Helper class for name resolution, used mostly by the attribution phase.
  *
- *  <p><b>This is NOT part of any API supported by Sun Microsystems.  If
- *  you write code that depends on this, you do so at your own risk.
+ *  <p><b>This is NOT part of any supported API.
+ *  If you write code that depends on this, you do so at your own risk.
  *  This code and its internal interfaces are subject to change or
  *  deletion without notice.</b>
  */
@@ -67,7 +67,7 @@
     JCDiagnostic.Factory diags;
     public final boolean boxingEnabled; // = source.allowBoxing();
     public final boolean varargsEnabled; // = source.allowVarargs();
-    public final boolean allowInvokedynamic; // = options.get("invokedynamic");
+    public final boolean allowPolymorphicSignature;
     private final boolean debugResolve;
 
     public static Resolve instance(Context context) {
@@ -105,7 +105,7 @@
         varargsEnabled = source.allowVarargs();
         Options options = Options.instance(context);
         debugResolve = options.get("debugresolve") != null;
-        allowInvokedynamic = options.get("invokedynamic") != null;
+        allowPolymorphicSignature = source.allowPolymorphicSignature() || options.get("invokedynamic") != null;
     }
 
     /** error symbols, which are returned when resolution fails
@@ -301,6 +301,7 @@
                         boolean useVarargs,
                         Warner warn)
         throws Infer.InferenceException {
+        assert ((m.flags() & (POLYMORPHIC_SIGNATURE|HYPOTHETICAL)) != POLYMORPHIC_SIGNATURE);
         if (useVarargs && (m.flags() & VARARGS) == 0) return null;
         Type mt = types.memberType(site, m);
 
@@ -348,6 +349,7 @@
             infer.instantiateMethod(env,
                                     tvars,
                                     (MethodType)mt,
+                                    m,
                                     argtypes,
                                     allowBoxing,
                                     useVarargs,
@@ -576,6 +578,14 @@
         if (sym.kind == ERR) return bestSoFar;
         if (!sym.isInheritedIn(site.tsym, types)) return bestSoFar;
         assert sym.kind < AMBIGUOUS;
+        if ((sym.flags() & POLYMORPHIC_SIGNATURE) != 0 && allowPolymorphicSignature) {
+            assert(site.tag == CLASS);
+            // Never match a MethodHandle.invoke directly.
+            if (useVarargs | allowBoxing | operator)
+                return bestSoFar;
+            // Supply an exactly-typed implicit method instead.
+            sym = findPolymorphicSignatureInstance(env, sym.owner.type, sym.name, (MethodSymbol) sym, argtypes, typeargtypes);
+        }
         try {
             if (rawInstantiate(env, site, sym, argtypes, typeargtypes,
                                allowBoxing, useVarargs, Warner.noWarnings) == null) {
@@ -746,6 +756,14 @@
                       boolean allowBoxing,
                       boolean useVarargs,
                       boolean operator) {
+        Symbol bestSoFar = methodNotFound;
+        if ((site.tsym.flags() & POLYMORPHIC_SIGNATURE) != 0 &&
+            allowPolymorphicSignature &&
+            site.tag == CLASS &&
+            !(useVarargs | allowBoxing | operator)) {
+            // supply an exactly-typed implicit method in java.dyn.InvokeDynamic
+            bestSoFar = findPolymorphicSignatureInstance(env, site, name, null, argtypes, typeargtypes);
+        }
         return findMethod(env,
                           site,
                           name,
@@ -753,7 +771,7 @@
                           typeargtypes,
                           site.tsym.type,
                           true,
-                          methodNotFound,
+                          bestSoFar,
                           allowBoxing,
                           useVarargs,
                           operator);
@@ -897,13 +915,14 @@
      *  @param argtypes  The method's value arguments.
      *  @param typeargtypes The method's type arguments
      */
-    Symbol findImplicitMethod(Env<AttrContext> env,
-                              Type site,
-                              Name name,
-                              List<Type> argtypes,
-                              List<Type> typeargtypes) {
-        assert allowInvokedynamic;
-        assert site == syms.invokeDynamicType || (site == syms.methodHandleType && name == names.invoke);
+    Symbol findPolymorphicSignatureInstance(Env<AttrContext> env,
+                                            Type site,
+                                            Name name,
+                                            MethodSymbol spMethod,  // sig. poly. method or null if none
+                                            List<Type> argtypes,
+                                            List<Type> typeargtypes) {
+        assert allowPolymorphicSignature;
+        //assert site == syms.invokeDynamicType || site == syms.methodHandleType : site;
         ClassSymbol c = (ClassSymbol) site.tsym;
         Scope implicit = c.members().next;
         if (implicit == null) {
@@ -918,12 +937,22 @@
                 return methodNotFound;
         }
         List<Type> paramtypes = Type.map(argtypes, implicitArgType);
+        long flags;
+        List<Type> exType;
+        if (spMethod != null) {
+            exType = spMethod.getThrownTypes();
+            flags = spMethod.flags() & AccessFlags;
+        } else {
+            // make it throw all exceptions
+            //assert(site == syms.invokeDynamicType);
+            exType = List.of(syms.throwableType);
+            flags = PUBLIC | STATIC;
+        }
         MethodType mtype = new MethodType(paramtypes,
                                           restype,
-                                          List.<Type>nil(),
+                                          exType,
                                           syms.methodClass);
-        int flags = PUBLIC | ABSTRACT;
-        if (site == syms.invokeDynamicType)  flags |= STATIC;
+        flags |= ABSTRACT | HYPOTHETICAL | POLYMORPHIC_SIGNATURE;
         Symbol m = null;
         for (Scope.Entry e = implicit.lookup(name);
              e.scope != null;
@@ -1338,14 +1367,6 @@
             methodResolutionCache.put(steps.head, sym);
             steps = steps.tail;
         }
-        if (sym.kind >= AMBIGUOUS &&
-            allowInvokedynamic &&
-            (site == syms.invokeDynamicType ||
-             site == syms.methodHandleType && name == names.invoke)) {
-            // lookup failed; supply an exactly-typed implicit method
-            sym = findImplicitMethod(env, site, name, argtypes, typeargtypes);
-            env.info.varArgs = false;
-        }
         if (sym.kind >= AMBIGUOUS) {//if nothing is found return the 'first' error
             MethodResolutionPhase errPhase =
                     firstErroneousResolutionPhase();
--- a/langtools/src/share/classes/com/sun/tools/javac/comp/Todo.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/langtools/src/share/classes/com/sun/tools/javac/comp/Todo.java	Wed Jul 21 09:57:21 2010 -0700
@@ -36,8 +36,8 @@
 
 /** A queue of all as yet unattributed classes.
  *
- *  <p><b>This is NOT part of any API supported by Sun Microsystems.  If
- *  you write code that depends on this, you do so at your own risk.
+ *  <p><b>This is NOT part of any supported API.
+ *  If you write code that depends on this, you do so at your own risk.
  *  This code and its internal interfaces are subject to change or
  *  deletion without notice.</b>
  */
--- a/langtools/src/share/classes/com/sun/tools/javac/comp/TransTypes.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/langtools/src/share/classes/com/sun/tools/javac/comp/TransTypes.java	Wed Jul 21 09:57:21 2010 -0700
@@ -43,8 +43,8 @@
 
 /** This pass translates Generic Java to conventional Java.
  *
- *  <p><b>This is NOT part of any API supported by Sun Microsystems.  If
- *  you write code that depends on this, you do so at your own risk.
+ *  <p><b>This is NOT part of any supported API.
+ *  If you write code that depends on this, you do so at your own risk.
  *  This code and its internal interfaces are subject to change or
  *  deletion without notice.</b>
  */
--- a/langtools/src/share/classes/com/sun/tools/javac/file/BaseFileObject.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/langtools/src/share/classes/com/sun/tools/javac/file/BaseFileObject.java	Wed Jul 21 09:57:21 2010 -0700
@@ -42,7 +42,7 @@
 import com.sun.tools.javac.util.BaseFileManager;
 
 /**
- * <p><b>This is NOT part of any API supported by Sun Microsystems.
+ * <p><b>This is NOT part of any supported API.
  * If you write code that depends on this, you do so at your own risk.
  * This code and its internal interfaces are subject to change or
  * deletion without notice.</b>
--- a/langtools/src/share/classes/com/sun/tools/javac/file/CacheFSInfo.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/langtools/src/share/classes/com/sun/tools/javac/file/CacheFSInfo.java	Wed Jul 21 09:57:21 2010 -0700
@@ -36,7 +36,7 @@
 /**
  * Caching implementation of FSInfo.
  *
- * <p><b>This is NOT part of any API supported by Sun Microsystems.
+ * <p><b>This is NOT part of any supported API.
  * If you write code that depends on this, you do so at your own risk.
  * This code and its internal interfaces are subject to change or
  * deletion without notice.</b>
--- a/langtools/src/share/classes/com/sun/tools/javac/file/FSInfo.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/langtools/src/share/classes/com/sun/tools/javac/file/FSInfo.java	Wed Jul 21 09:57:21 2010 -0700
@@ -17,7 +17,7 @@
  * Get meta-info about files. Default direct (non-caching) implementation.
  * @see CacheFSInfo
  *
- * <p><b>This is NOT part of any API supported by Sun Microsystems.
+ * <p><b>This is NOT part of any supported API.
  * If you write code that depends on this, you do so at your own risk.
  * This code and its internal interfaces are subject to change or
  * deletion without notice.</b>
--- a/langtools/src/share/classes/com/sun/tools/javac/file/JavacFileManager.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/langtools/src/share/classes/com/sun/tools/javac/file/JavacFileManager.java	Wed Jul 21 09:57:21 2010 -0700
@@ -68,7 +68,7 @@
  * This class provides access to the source, class and other files
  * used by the compiler and related tools.
  *
- * <p><b>This is NOT part of any API supported by Sun Microsystems.
+ * <p><b>This is NOT part of any supported API.
  * If you write code that depends on this, you do so at your own risk.
  * This code and its internal interfaces are subject to change or
  * deletion without notice.</b>
--- a/langtools/src/share/classes/com/sun/tools/javac/file/Paths.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/langtools/src/share/classes/com/sun/tools/javac/file/Paths.java	Wed Jul 21 09:57:21 2010 -0700
@@ -54,8 +54,8 @@
  *  into a boot class path, user class path, and source path (in
  *  Collection<String> form).
  *
- *  <p><b>This is NOT part of any API supported by Sun Microsystems.  If
- *  you write code that depends on this, you do so at your own risk.
+ *  <p><b>This is NOT part of any supported API.
+ *  If you write code that depends on this, you do so at your own risk.
  *  This code and its internal interfaces are subject to change or
  *  deletion without notice.</b>
  */
--- a/langtools/src/share/classes/com/sun/tools/javac/file/RegularFileObject.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/langtools/src/share/classes/com/sun/tools/javac/file/RegularFileObject.java	Wed Jul 21 09:57:21 2010 -0700
@@ -44,7 +44,7 @@
 /**
  * A subclass of JavaFileObject representing regular files.
  *
- * <p><b>This is NOT part of any API supported by Sun Microsystems.
+ * <p><b>This is NOT part of any supported API.
  * If you write code that depends on this, you do so at your own risk.
  * This code and its internal interfaces are subject to change or
  * deletion without notice.</b>
--- a/langtools/src/share/classes/com/sun/tools/javac/file/RelativePath.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/langtools/src/share/classes/com/sun/tools/javac/file/RelativePath.java	Wed Jul 21 09:57:21 2010 -0700
@@ -35,7 +35,7 @@
  * container, such as a directory or zip file.
  * Internally, the file separator is always '/'.
  *
- * <p><b>This is NOT part of any API supported by Sun Microsystems.
+ * <p><b>This is NOT part of any supported API.
  * If you write code that depends on this, you do so at your own risk.
  * This code and its internal interfaces are subject to change or
  * deletion without notice.</b>
--- a/langtools/src/share/classes/com/sun/tools/javac/file/SymbolArchive.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/langtools/src/share/classes/com/sun/tools/javac/file/SymbolArchive.java	Wed Jul 21 09:57:21 2010 -0700
@@ -36,7 +36,7 @@
 import com.sun.tools.javac.util.List;
 
 /**
- * <p><b>This is NOT part of any API supported by Sun Microsystems.
+ * <p><b>This is NOT part of any supported API.
  * If you write code that depends on this, you do so at your own risk.
  * This code and its internal interfaces are subject to change or
  * deletion without notice.</b>
--- a/langtools/src/share/classes/com/sun/tools/javac/file/ZipArchive.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/langtools/src/share/classes/com/sun/tools/javac/file/ZipArchive.java	Wed Jul 21 09:57:21 2010 -0700
@@ -51,7 +51,7 @@
 import java.lang.ref.SoftReference;
 
 /**
- * <p><b>This is NOT part of any API supported by Sun Microsystems.
+ * <p><b>This is NOT part of any supported API.
  * If you write code that depends on this, you do so at your own risk.
  * This code and its internal interfaces are subject to change or
  * deletion without notice.</b>
--- a/langtools/src/share/classes/com/sun/tools/javac/file/ZipFileIndex.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/langtools/src/share/classes/com/sun/tools/javac/file/ZipFileIndex.java	Wed Jul 21 09:57:21 2010 -0700
@@ -69,7 +69,7 @@
  * checking to reindex the zip files if it is needed. In batch mode the timestamps are not checked
  * and the compiler uses the cached indexes.
  *
- * <p><b>This is NOT part of any API supported by Sun Microsystems.
+ * <p><b>This is NOT part of any supported API.
  * If you write code that depends on this, you do so at your own risk.
  * This code and its internal interfaces are subject to change or
  * deletion without notice.</b>
--- a/langtools/src/share/classes/com/sun/tools/javac/file/ZipFileIndexArchive.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/langtools/src/share/classes/com/sun/tools/javac/file/ZipFileIndexArchive.java	Wed Jul 21 09:57:21 2010 -0700
@@ -45,7 +45,7 @@
 import com.sun.tools.javac.util.List;
 
 /**
- * <p><b>This is NOT part of any API supported by Sun Microsystems.
+ * <p><b>This is NOT part of any supported API.
  * If you write code that depends on this, you do so at your own risk.
  * This code and its internal interfaces are subject to change or
  * deletion without notice.</b>
--- a/langtools/src/share/classes/com/sun/tools/javac/jvm/ByteCodes.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/langtools/src/share/classes/com/sun/tools/javac/jvm/ByteCodes.java	Wed Jul 21 09:57:21 2010 -0700
@@ -29,8 +29,8 @@
 /** Bytecode instruction codes, as well as typecodes used as
  *  instruction modifiers.
  *
- *  <p><b>This is NOT part of any API supported by Sun Microsystems.  If
- *  you write code that depends on this, you do so at your own risk.
+ *  <p><b>This is NOT part of any supported API.
+ *  If you write code that depends on this, you do so at your own risk.
  *  This code and its internal interfaces are subject to change or
  *  deletion without notice.</b>
  */
--- a/langtools/src/share/classes/com/sun/tools/javac/jvm/CRTFlags.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/langtools/src/share/classes/com/sun/tools/javac/jvm/CRTFlags.java	Wed Jul 21 09:57:21 2010 -0700
@@ -28,8 +28,8 @@
 
 /** The CharacterRangeTable flags indicating type of an entry.
  *
- *  <p><b>This is NOT part of any API supported by Sun Microsystems.  If
- *  you write code that depends on this, you do so at your own risk.
+ *  <p><b>This is NOT part of any supported API.
+ *  If you write code that depends on this, you do so at your own risk.
  *  This code and its internal interfaces are subject to change or
  *  deletion without notice.</b>
  */
--- a/langtools/src/share/classes/com/sun/tools/javac/jvm/CRTable.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/langtools/src/share/classes/com/sun/tools/javac/jvm/CRTable.java	Wed Jul 21 09:57:21 2010 -0700
@@ -36,8 +36,8 @@
  *  and the hashtable for mapping trees or lists of trees to their
  *  ending positions.
  *
- *  <p><b>This is NOT part of any API supported by Sun Microsystems.  If
- *  you write code that depends on this, you do so at your own risk.
+ *  <p><b>This is NOT part of any supported API.
+ *  If you write code that depends on this, you do so at your own risk.
  *  This code and its internal interfaces are subject to change or
  *  deletion without notice.</b>
  */
--- a/langtools/src/share/classes/com/sun/tools/javac/jvm/ClassFile.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/langtools/src/share/classes/com/sun/tools/javac/jvm/ClassFile.java	Wed Jul 21 09:57:21 2010 -0700
@@ -59,8 +59,8 @@
  *  as routines to convert between internal ``.'' and external ``/''
  *  separators in class names.
  *
- *  <p><b>This is NOT part of any API supported by Sun Microsystems.  If
- *  you write code that depends on this, you do so at your own risk.
+ *  <p><b>This is NOT part of any supported API.
+ *  If you write code that depends on this, you do so at your own risk.
  *  This code and its internal interfaces are subject to change or
  *  deletion without notice.</b> */
 public class ClassFile {
--- a/langtools/src/share/classes/com/sun/tools/javac/jvm/ClassReader.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/langtools/src/share/classes/com/sun/tools/javac/jvm/ClassReader.java	Wed Jul 21 09:57:21 2010 -0700
@@ -62,8 +62,8 @@
  *  for all other definitions in the classfile. Top-level Classes themselves
  *  appear as members of the scopes of PackageSymbols.
  *
- *  <p><b>This is NOT part of any API supported by Sun Microsystems.  If
- *  you write code that depends on this, you do so at your own risk.
+ *  <p><b>This is NOT part of any supported API.
+ *  If you write code that depends on this, you do so at your own risk.
  *  This code and its internal interfaces are subject to change or
  *  deletion without notice.</b>
  */
@@ -1098,6 +1098,12 @@
                 }
             },
 
+            new AttributeReader(names.PolymorphicSignature, V45_3/*S.B.V51*/, CLASS_OR_MEMBER_ATTRIBUTE) {
+                void read(Symbol sym, int attrLen) {
+                    sym.flags_field |= POLYMORPHIC_SIGNATURE;
+                }
+            },
+
 
             // The following attributes for a Code attribute are not currently handled
             // StackMapTable
--- a/langtools/src/share/classes/com/sun/tools/javac/jvm/ClassWriter.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/langtools/src/share/classes/com/sun/tools/javac/jvm/ClassWriter.java	Wed Jul 21 09:57:21 2010 -0700
@@ -49,8 +49,8 @@
 /** This class provides operations to map an internal symbol table graph
  *  rooted in a ClassSymbol into a classfile.
  *
- *  <p><b>This is NOT part of any API supported by Sun Microsystems.  If
- *  you write code that depends on this, you do so at your own risk.
+ *  <p><b>This is NOT part of any supported API.
+ *  If you write code that depends on this, you do so at your own risk.
  *  This code and its internal interfaces are subject to change or
  *  deletion without notice.</b>
  */
@@ -651,6 +651,13 @@
             endAttr(alenIdx);
             acount++;
         }
+        if ((flags & POLYMORPHIC_SIGNATURE) != 0) {
+            if (target.majorVersion < 51)
+                throw new AssertionError("PolymorphicSignature attributes in java/dyn must be written with -target 7 (required major version is 51, current is"+target.majorVersion+")");
+            int alenIdx = writeAttr(names.PolymorphicSignature);
+            endAttr(alenIdx);
+            acount++;
+        }
         return acount;
     }
 
--- a/langtools/src/share/classes/com/sun/tools/javac/jvm/Code.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/langtools/src/share/classes/com/sun/tools/javac/jvm/Code.java	Wed Jul 21 09:57:21 2010 -0700
@@ -39,8 +39,8 @@
  *  methods in a classfile. The class also provides some utility operations to
  *  generate bytecode instructions.
  *
- *  <p><b>This is NOT part of any API supported by Sun Microsystems.  If
- *  you write code that depends on this, you do so at your own risk.
+ *  <p><b>This is NOT part of any supported API.
+ *  If you write code that depends on this, you do so at your own risk.
  *  This code and its internal interfaces are subject to change or
  *  deletion without notice.</b>
  */
--- a/langtools/src/share/classes/com/sun/tools/javac/jvm/Gen.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/langtools/src/share/classes/com/sun/tools/javac/jvm/Gen.java	Wed Jul 21 09:57:21 2010 -0700
@@ -49,8 +49,8 @@
 
 /** This pass maps flat Java (i.e. without inner classes) to bytecodes.
  *
- *  <p><b>This is NOT part of any API supported by Sun Microsystems.  If
- *  you write code that depends on this, you do so at your own risk.
+ *  <p><b>This is NOT part of any supported API.
+ *  If you write code that depends on this, you do so at your own risk.
  *  This code and its internal interfaces are subject to change or
  *  deletion without notice.</b>
  */
@@ -121,7 +121,7 @@
             : options.get("-g:vars") != null;
         genCrt = options.get("-Xjcov") != null;
         debugCode = options.get("debugcode") != null;
-        allowInvokedynamic = options.get("invokedynamic") != null;
+        allowInvokedynamic = target.hasInvokedynamic() || options.get("invokedynamic") != null;
 
         generateIproxies =
             target.requiresIproxy() ||
--- a/langtools/src/share/classes/com/sun/tools/javac/jvm/Items.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/langtools/src/share/classes/com/sun/tools/javac/jvm/Items.java	Wed Jul 21 09:57:21 2010 -0700
@@ -43,8 +43,8 @@
  *  special values this or super, etc. Individual items are represented as
  *  inner classes in class Items.
  *
- *  <p><b>This is NOT part of any API supported by Sun Microsystems.  If
- *  you write code that depends on this, you do so at your own risk.
+ *  <p><b>This is NOT part of any supported API.
+ *  If you write code that depends on this, you do so at your own risk.
  *  This code and its internal interfaces are subject to change or
  *  deletion without notice.</b>
  */
--- a/langtools/src/share/classes/com/sun/tools/javac/jvm/Pool.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/langtools/src/share/classes/com/sun/tools/javac/jvm/Pool.java	Wed Jul 21 09:57:21 2010 -0700
@@ -31,8 +31,8 @@
 
 /** An internal structure that corresponds to the constant pool of a classfile.
  *
- *  <p><b>This is NOT part of any API supported by Sun Microsystems.  If
- *  you write code that depends on this, you do so at your own risk.
+ *  <p><b>This is NOT part of any supported API.
+ *  If you write code that depends on this, you do so at your own risk.
  *  This code and its internal interfaces are subject to change or
  *  deletion without notice.</b>
  */
--- a/langtools/src/share/classes/com/sun/tools/javac/jvm/Target.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/langtools/src/share/classes/com/sun/tools/javac/jvm/Target.java	Wed Jul 21 09:57:21 2010 -0700
@@ -33,8 +33,8 @@
 
 /** The classfile version target.
  *
- *  <p><b>This is NOT part of any API supported by Sun Microsystems.  If
- *  you write code that depends on this, you do so at your own risk.
+ *  <p><b>This is NOT part of any supported API.
+ *  If you write code that depends on this, you do so at your own risk.
  *  This code and its internal interfaces are subject to change or
  *  deletion without notice.</b>
  */
--- a/langtools/src/share/classes/com/sun/tools/javac/jvm/UninitializedType.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/langtools/src/share/classes/com/sun/tools/javac/jvm/UninitializedType.java	Wed Jul 21 09:57:21 2010 -0700
@@ -31,8 +31,8 @@
 /** These pseudo-types appear in the generated verifier tables to
  *  indicate objects that have been allocated but not yet constructed.
  *
- *  <p><b>This is NOT part of any API supported by Sun Microsystems.  If
- *  you write code that depends on this, you do so at your own risk.
+ *  <p><b>This is NOT part of any supported API.
+ *  If you write code that depends on this, you do so at your own risk.
  *  This code and its internal interfaces are subject to change or
  *  deletion without notice.</b>
  */
--- a/langtools/src/share/classes/com/sun/tools/javac/main/CommandLine.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/langtools/src/share/classes/com/sun/tools/javac/main/CommandLine.java	Wed Jul 21 09:57:21 2010 -0700
@@ -35,8 +35,8 @@
 /**
  * Various utility methods for processing Java tool command line arguments.
  *
- *  <p><b>This is NOT part of any API supported by Sun Microsystems.  If
- *  you write code that depends on this, you do so at your own risk.
+ *  <p><b>This is NOT part of any supported API.
+ *  If you write code that depends on this, you do so at your own risk.
  *  This code and its internal interfaces are subject to change or
  *  deletion without notice.</b>
  */
--- a/langtools/src/share/classes/com/sun/tools/javac/main/JavaCompiler.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/langtools/src/share/classes/com/sun/tools/javac/main/JavaCompiler.java	Wed Jul 21 09:57:21 2010 -0700
@@ -73,8 +73,8 @@
  *  construct a new compiler, and to run a new compiler on a set of source
  *  files.
  *
- *  <p><b>This is NOT part of any API supported by Sun Microsystems.  If
- *  you write code that depends on this, you do so at your own risk.
+ *  <p><b>This is NOT part of any supported API.
+ *  If you write code that depends on this, you do so at your own risk.
  *  This code and its internal interfaces are subject to change or
  *  deletion without notice.</b>
  */
@@ -111,14 +111,14 @@
             try {
                 versionRB = ResourceBundle.getBundle(versionRBName);
             } catch (MissingResourceException e) {
-                return Log.getLocalizedString("version.resource.missing", System.getProperty("java.version"));
+                return Log.getLocalizedString("version.not.available");
             }
         }
         try {
             return versionRB.getString(key);
         }
         catch (MissingResourceException e) {
-            return Log.getLocalizedString("version.unknown", System.getProperty("java.version"));
+            return Log.getLocalizedString("version.not.available");
         }
     }
 
--- a/langtools/src/share/classes/com/sun/tools/javac/main/JavacOption.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/langtools/src/share/classes/com/sun/tools/javac/main/JavacOption.java	Wed Jul 21 09:57:21 2010 -0700
@@ -34,7 +34,7 @@
 /**
  * TODO: describe com.sun.tools.javac.main.JavacOption
  *
- * <p><b>This is NOT part of any API supported by Sun Microsystems.
+ * <p><b>This is NOT part of any supported API.
  * If you write code that depends on this, you do so at your own
  * risk.  This code and its internal interfaces are subject to change
  * or deletion without notice.</b></p>
--- a/langtools/src/share/classes/com/sun/tools/javac/main/Main.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/langtools/src/share/classes/com/sun/tools/javac/main/Main.java	Wed Jul 21 09:57:21 2010 -0700
@@ -47,8 +47,8 @@
 
 /** This class provides a commandline interface to the GJC compiler.
  *
- *  <p><b>This is NOT part of any API supported by Sun Microsystems.  If
- *  you write code that depends on this, you do so at your own risk.
+ *  <p><b>This is NOT part of any supported API.
+ *  If you write code that depends on this, you do so at your own risk.
  *  This code and its internal interfaces are subject to change or
  *  deletion without notice.</b>
  */
@@ -281,9 +281,6 @@
                 }
             }
         }
-        if (target.hasInvokedynamic()) {
-            options.put("invokedynamic",  "invokedynamic");
-        }
 
         // handle this here so it works even if no other options given
         String showClass = options.get("showClass");
--- a/langtools/src/share/classes/com/sun/tools/javac/main/OptionName.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/langtools/src/share/classes/com/sun/tools/javac/main/OptionName.java	Wed Jul 21 09:57:21 2010 -0700
@@ -29,7 +29,7 @@
 /**
  * TODO: describe com.sun.tools.javac.main.OptionName
  *
- * <p><b>This is NOT part of any API supported by Sun Microsystems.
+ * <p><b>This is NOT part of any supported API.
  * If you write code that depends on this, you do so at your own
  * risk.  This code and its internal interfaces are subject to change
  * or deletion without notice.</b></p>
--- a/langtools/src/share/classes/com/sun/tools/javac/main/RecognizedOptions.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/langtools/src/share/classes/com/sun/tools/javac/main/RecognizedOptions.java	Wed Jul 21 09:57:21 2010 -0700
@@ -49,7 +49,7 @@
 /**
  * TODO: describe com.sun.tools.javac.main.RecognizedOptions
  *
- * <p><b>This is NOT part of any API supported by Sun Microsystems.
+ * <p><b>This is NOT part of any supported API.
  * If you write code that depends on this, you do so at your own
  * risk.  This code and its internal interfaces are subject to change
  * or deletion without notice.</b></p>
--- a/langtools/src/share/classes/com/sun/tools/javac/model/AnnotationProxyMaker.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/langtools/src/share/classes/com/sun/tools/javac/model/AnnotationProxyMaker.java	Wed Jul 21 09:57:21 2010 -0700
@@ -50,8 +50,8 @@
  * <p> The "dynamic proxy return form" of an annotation element value is
  * the form used by sun.reflect.annotation.AnnotationInvocationHandler.
  *
- * <p><b>This is NOT part of any API supported by Sun Microsystems.  If
- * you write code that depends on this, you do so at your own risk.
+ * <p><b>This is NOT part of any supported API.
+ * If you write code that depends on this, you do so at your own risk.
  * This code and its internal interfaces are subject to change or
  * deletion without notice.</b>
  */
@@ -181,16 +181,16 @@
         }
 
         public void visitArray(Attribute.Array a) {
-            Name elemName = ((ArrayType) a.type).elemtype.tsym.name;
+            Name elemName = ((ArrayType) a.type).elemtype.tsym.getQualifiedName();
 
-            if (elemName == elemName.table.names.java_lang_Class) {   // Class[]
+            if (elemName.equals(elemName.table.names.java_lang_Class)) {   // Class[]
                 // Construct a proxy for a MirroredTypesException
-                List<TypeMirror> elems = List.nil();
+                ListBuffer<TypeMirror> elems = new ListBuffer<TypeMirror>();
                 for (Attribute value : a.values) {
                     Type elem = ((Attribute.Class) value).type;
-                    elems.add(elem);
+                    elems.append(elem);
                 }
-                value = new MirroredTypesExceptionProxy(elems);
+                value = new MirroredTypesExceptionProxy(elems.toList());
 
             } else {
                 int len = a.values.length;
--- a/langtools/src/share/classes/com/sun/tools/javac/model/FilteredMemberList.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/langtools/src/share/classes/com/sun/tools/javac/model/FilteredMemberList.java	Wed Jul 21 09:57:21 2010 -0700
@@ -38,8 +38,8 @@
  * filtering out unwanted elements such as synthetic ones.
  * This view is most efficiently accessed through its iterator() method.
  *
- * <p><b>This is NOT part of any API supported by Sun Microsystems.  If
- * you write code that depends on this, you do so at your own risk.
+ * <p><b>This is NOT part of any supported API.
+ * If you write code that depends on this, you do so at your own risk.
  * This code and its internal interfaces are subject to change or
  * deletion without notice.</b>
  */
--- a/langtools/src/share/classes/com/sun/tools/javac/model/JavacElements.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/langtools/src/share/classes/com/sun/tools/javac/model/JavacElements.java	Wed Jul 21 09:57:21 2010 -0700
@@ -53,7 +53,7 @@
 /**
  * Utility methods for operating on program elements.
  *
- * <p><b>This is NOT part of any API supported by Sun Microsystems.
+ * <p><b>This is NOT part of any supported API.
  * If you write code that depends on this, you do so at your own
  * risk.  This code and its internal interfaces are subject to change
  * or deletion without notice.</b></p>
--- a/langtools/src/share/classes/com/sun/tools/javac/model/JavacSourcePosition.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/langtools/src/share/classes/com/sun/tools/javac/model/JavacSourcePosition.java	Wed Jul 21 09:57:21 2010 -0700
@@ -31,7 +31,7 @@
 /**
  * Implementation of model API SourcePosition based on javac internal state.
  *
- * <p><b>This is NOT part of any API supported by Sun Microsystems.
+ * <p><b>This is NOT part of any supported API.
  * If you write code that depends on this, you do so at your own
  * risk.  This code and its internal interfaces are subject to change
  * or deletion without notice.</b></p>
--- a/langtools/src/share/classes/com/sun/tools/javac/model/JavacTypes.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/langtools/src/share/classes/com/sun/tools/javac/model/JavacTypes.java	Wed Jul 21 09:57:21 2010 -0700
@@ -37,7 +37,7 @@
 /**
  * Utility methods for operating on types.
  *
- * <p><b>This is NOT part of any API supported by Sun Microsystems.
+ * <p><b>This is NOT part of any supported API.
  * If you write code that depends on this, you do so at your own
  * risk.  This code and its internal interfaces are subject to change
  * or deletion without notice.</b></p>
--- a/langtools/src/share/classes/com/sun/tools/javac/nio/JavacPathFileManager.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/langtools/src/share/classes/com/sun/tools/javac/nio/JavacPathFileManager.java	Wed Jul 21 09:57:21 2010 -0700
@@ -101,8 +101,8 @@
  *  <p>To reduce confusion with Path objects, the locations such as "class path",
  *  "source path", etc, are generically referred to here as "search paths".
  *
- *  <p><b>This is NOT part of any API supported by Sun Microsystems.  If
- *  you write code that depends on this, you do so at your own risk.
+ *  <p><b>This is NOT part of any supported API.
+ *  If you write code that depends on this, you do so at your own risk.
  *  This code and its internal interfaces are subject to change or
  *  deletion without notice.</b>
  */
--- a/langtools/src/share/classes/com/sun/tools/javac/nio/PathFileManager.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/langtools/src/share/classes/com/sun/tools/javac/nio/PathFileManager.java	Wed Jul 21 09:57:21 2010 -0700
@@ -41,8 +41,8 @@
  *  getStandardFileManager}. However, would need to be handled carefully
  *  as another forward reference from langtools to jdk.
  *
- *  <p><b>This is NOT part of any API supported by Sun Microsystems.  If
- *  you write code that depends on this, you do so at your own risk.
+ *  <p><b>This is NOT part of any supported API.
+ *  If you write code that depends on this, you do so at your own risk.
  *  This code and its internal interfaces are subject to change or
  *  deletion without notice.</b>
  */
--- a/langtools/src/share/classes/com/sun/tools/javac/nio/PathFileObject.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/langtools/src/share/classes/com/sun/tools/javac/nio/PathFileObject.java	Wed Jul 21 09:57:21 2010 -0700
@@ -56,8 +56,8 @@
  *  different factory methods, which compute the binary name based on
  *  information available at the time the file object is created.
  *
- *  <p><b>This is NOT part of any API supported by Sun Microsystems.  If
- *  you write code that depends on this, you do so at your own risk.
+ *  <p><b>This is NOT part of any supported API.
+ *  If you write code that depends on this, you do so at your own risk.
  *  This code and its internal interfaces are subject to change or
  *  deletion without notice.</b>
  */
--- a/langtools/src/share/classes/com/sun/tools/javac/parser/DocCommentScanner.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/langtools/src/share/classes/com/sun/tools/javac/parser/DocCommentScanner.java	Wed Jul 21 09:57:21 2010 -0700
@@ -35,8 +35,8 @@
  *  translating Unicode escape sequences and by stripping the
  *  leading whitespace and starts from each line of the comment.
  *
- *  <p><b>This is NOT part of any API supported by Sun Microsystems.  If
- *  you write code that depends on this, you do so at your own risk.
+ *  <p><b>This is NOT part of any supported API.
+ *  If you write code that depends on this, you do so at your own risk.
  *  This code and its internal interfaces are subject to change or
  *  deletion without notice.</b>
  */
--- a/langtools/src/share/classes/com/sun/tools/javac/parser/EndPosParser.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/langtools/src/share/classes/com/sun/tools/javac/parser/EndPosParser.java	Wed Jul 21 09:57:21 2010 -0700
@@ -36,7 +36,7 @@
  * This class is similar to Parser except that it stores ending
  * positions for the tree nodes.
  *
- * <p><b>This is NOT part of any API supported by Sun Microsystems.
+ * <p><b>This is NOT part of any supported API.
  * If you write code that depends on this, you do so at your own risk.
  * This code and its internal interfaces are subject to change or
  * deletion without notice.</b></p>
--- a/langtools/src/share/classes/com/sun/tools/javac/parser/JavacParser.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/langtools/src/share/classes/com/sun/tools/javac/parser/JavacParser.java	Wed Jul 21 09:57:21 2010 -0700
@@ -43,8 +43,8 @@
  *  operator precedence scheme is used for parsing binary operation
  *  expressions.
  *
- *  <p><b>This is NOT part of any API supported by Sun Microsystems.  If
- *  you write code that depends on this, you do so at your own risk.
+ *  <p><b>This is NOT part of any supported API.
+ *  If you write code that depends on this, you do so at your own risk.
  *  This code and its internal interfaces are subject to change or
  *  deletion without notice.</b>
  */
--- a/langtools/src/share/classes/com/sun/tools/javac/parser/Keywords.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/langtools/src/share/classes/com/sun/tools/javac/parser/Keywords.java	Wed Jul 21 09:57:21 2010 -0700
@@ -35,7 +35,7 @@
 /**
  * Map from Name to Token and Token to String.
  *
- * <p><b>This is NOT part of any API supported by Sun Microsystems.
+ * <p><b>This is NOT part of any supported API.
  * If you write code that depends on this, you do so at your own risk.
  * This code and its internal interfaces are subject to change or
  * deletion without notice.</b>
--- a/langtools/src/share/classes/com/sun/tools/javac/parser/Lexer.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/langtools/src/share/classes/com/sun/tools/javac/parser/Lexer.java	Wed Jul 21 09:57:21 2010 -0700
@@ -32,7 +32,7 @@
  * The lexical analyzer maps an input stream consisting of ASCII
  * characters and Unicode escapes into a token sequence.
  *
- * <p><b>This is NOT part of any API supported by Sun Microsystems.
+ * <p><b>This is NOT part of any supported API.
  * If you write code that depends on this, you do so at your own risk.
  * This code and its internal interfaces are subject to change or
  * deletion without notice.</b>
--- a/langtools/src/share/classes/com/sun/tools/javac/parser/Parser.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/langtools/src/share/classes/com/sun/tools/javac/parser/Parser.java	Wed Jul 21 09:57:21 2010 -0700
@@ -34,7 +34,7 @@
  * Reads syntactic units from source code.
  * Parsers are normally created from a ParserFactory.
  *
- * <p><b>This is NOT part of any API supported by Sun Microsystems.
+ * <p><b>This is NOT part of any supported API.
  * If you write code that depends on this, you do so at your own risk.
  * This code and its internal interfaces are subject to change or
  * deletion without notice.</b>
--- a/langtools/src/share/classes/com/sun/tools/javac/parser/ParserFactory.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/langtools/src/share/classes/com/sun/tools/javac/parser/ParserFactory.java	Wed Jul 21 09:57:21 2010 -0700
@@ -35,7 +35,7 @@
 /**
  * A factory for creating parsers.
  *
- * <p><b>This is NOT part of any API supported by Sun Microsystems.
+ * <p><b>This is NOT part of any supported API.
  * If you write code that depends on this, you do so at your own risk.
  * This code and its internal interfaces are subject to change or
  * deletion without notice.</b>
--- a/langtools/src/share/classes/com/sun/tools/javac/parser/Scanner.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/langtools/src/share/classes/com/sun/tools/javac/parser/Scanner.java	Wed Jul 21 09:57:21 2010 -0700
@@ -38,8 +38,8 @@
 /** The lexical analyzer maps an input stream consisting of
  *  ASCII characters and Unicode escapes into a token sequence.
  *
- *  <p><b>This is NOT part of any API supported by Sun Microsystems.  If
- *  you write code that depends on this, you do so at your own risk.
+ *  <p><b>This is NOT part of any supported API.
+ *  If you write code that depends on this, you do so at your own risk.
  *  This code and its internal interfaces are subject to change or
  *  deletion without notice.</b>
  */
@@ -419,7 +419,7 @@
                 putChar(ch);
             } else {
                 if (!allowUnderscoresInLiterals) {
-                    lexError("unsupported.underscore", source.name);
+                    lexError("unsupported.underscore.lit", source.name);
                     allowUnderscoresInLiterals = true;
                 }
             }
--- a/langtools/src/share/classes/com/sun/tools/javac/parser/Token.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/langtools/src/share/classes/com/sun/tools/javac/parser/Token.java	Wed Jul 21 09:57:21 2010 -0700
@@ -33,8 +33,8 @@
 /** An interface that defines codes for Java source tokens
  *  returned from lexical analysis.
  *
- *  <p><b>This is NOT part of any API supported by Sun Microsystems.  If
- *  you write code that depends on this, you do so at your own risk.
+ *  <p><b>This is NOT part of any supported API.
+ *  If you write code that depends on this, you do so at your own risk.
  *  This code and its internal interfaces are subject to change or
  *  deletion without notice.</b>
  */
--- a/langtools/src/share/classes/com/sun/tools/javac/processing/AnnotationProcessingError.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/langtools/src/share/classes/com/sun/tools/javac/processing/AnnotationProcessingError.java	Wed Jul 21 09:57:21 2010 -0700
@@ -29,7 +29,7 @@
 /**
  * Error thrown for problems encountered during annotation processing.
  *
- * <p><b>This is NOT part of any API supported by Sun Microsystems.
+ * <p><b>This is NOT part of any supported API.
  * If you write code that depends on this, you do so at your own risk.
  * This code and its internal interfaces are subject to change or
  * deletion without notice.</b>
--- a/langtools/src/share/classes/com/sun/tools/javac/processing/JavacFiler.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/langtools/src/share/classes/com/sun/tools/javac/processing/JavacFiler.java	Wed Jul 21 09:57:21 2010 -0700
@@ -87,7 +87,7 @@
  * class path can alter the behavior of the tool and any final
  * compile.
  *
- * <p><b>This is NOT part of any API supported by Sun Microsystems.
+ * <p><b>This is NOT part of any supported API.
  * If you write code that depends on this, you do so at your own risk.
  * This code and its internal interfaces are subject to change or
  * deletion without notice.</b>
--- a/langtools/src/share/classes/com/sun/tools/javac/processing/JavacMessager.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/langtools/src/share/classes/com/sun/tools/javac/processing/JavacMessager.java	Wed Jul 21 09:57:21 2010 -0700
@@ -37,7 +37,7 @@
 /**
  * An implementation of the Messager built on top of log.
  *
- * <p><b>This is NOT part of any API supported by Sun Microsystems.
+ * <p><b>This is NOT part of any supported API.
  * If you write code that depends on this, you do so at your own risk.
  * This code and its internal interfaces are subject to change or
  * deletion without notice.</b>
--- a/langtools/src/share/classes/com/sun/tools/javac/processing/JavacProcessingEnvironment.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/langtools/src/share/classes/com/sun/tools/javac/processing/JavacProcessingEnvironment.java	Wed Jul 21 09:57:21 2010 -0700
@@ -81,7 +81,7 @@
  * Objects of this class hold and manage the state needed to support
  * annotation processing.
  *
- * <p><b>This is NOT part of any API supported by Sun Microsystems.
+ * <p><b>This is NOT part of any supported API.
  * If you write code that depends on this, you do so at your own risk.
  * This code and its internal interfaces are subject to change or
  * deletion without notice.</b>
@@ -745,7 +745,7 @@
      * Leave class public for external testing purposes.
      */
     public static class ComputeAnnotationSet extends
-        ElementScanner6<Set<TypeElement>, Set<TypeElement>> {
+        ElementScanner7<Set<TypeElement>, Set<TypeElement>> {
         final Elements elements;
 
         public ComputeAnnotationSet(Elements elements) {
@@ -1380,7 +1380,7 @@
     }
 
     /**
-     * For internal use by Sun Microsystems only.  This method will be
+     * For internal use only.  This method will be
      * removed without warning.
      */
     public Context getContext() {
--- a/langtools/src/share/classes/com/sun/tools/javac/processing/JavacRoundEnvironment.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/langtools/src/share/classes/com/sun/tools/javac/processing/JavacRoundEnvironment.java	Wed Jul 21 09:57:21 2010 -0700
@@ -40,7 +40,7 @@
  * <p>The methods in this class do not take type annotations into account,
  * as target types, not java elements.
  *
- * <p><b>This is NOT part of any API supported by Sun Microsystems.
+ * <p><b>This is NOT part of any supported API.
  * If you write code that depends on this, you do so at your own risk.
  * This code and its internal interfaces are subject to change or
  * deletion without notice.</b>
@@ -125,7 +125,7 @@
         else
             throw new AssertionError("Bad implementation type for " + tm);
 
-        ElementScanner6<Set<Element>, DeclaredType> scanner =
+        ElementScanner7<Set<Element>, DeclaredType> scanner =
             new AnnotationSetScanner(result, typeUtil);
 
         for (Element element : rootElements)
@@ -136,7 +136,7 @@
 
     // Could be written as a local class inside getElementsAnnotatedWith
     private class AnnotationSetScanner extends
-        ElementScanner6<Set<Element>, DeclaredType> {
+        ElementScanner7<Set<Element>, DeclaredType> {
         // Insertion-order preserving set
         Set<Element> annotatedElements = new LinkedHashSet<Element>();
         Types typeUtil;
--- a/langtools/src/share/classes/com/sun/tools/javac/processing/PrintingProcessor.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/langtools/src/share/classes/com/sun/tools/javac/processing/PrintingProcessor.java	Wed Jul 21 09:57:21 2010 -0700
@@ -42,7 +42,7 @@
  * -Xprint option; the included visitor class is used to implement
  * Elements.printElements.
  *
- * <p><b>This is NOT part of any API supported by Sun Microsystems.
+ * <p><b>This is NOT part of any supported API.
  * If you write code that depends on this, you do so at your own risk.
  * This code and its internal interfaces are subject to change or
  * deletion without notice.</b>
@@ -83,7 +83,7 @@
      * Used for the -Xprint option and called by Elements.printElements
      */
     public static class PrintingElementVisitor
-        extends SimpleElementVisitor6<PrintingElementVisitor, Boolean> {
+        extends SimpleElementVisitor7<PrintingElementVisitor, Boolean> {
         int indentation; // Indentation level;
         final PrintWriter writer;
         final Elements elementUtils;
@@ -117,7 +117,7 @@
                     enclosing != null &&
                     NestingKind.ANONYMOUS ==
                     // Use an anonymous class to determine anonymity!
-                    (new SimpleElementVisitor6<NestingKind, Void>() {
+                    (new SimpleElementVisitor7<NestingKind, Void>() {
                         @Override
                         public NestingKind visitType(TypeElement e, Void p) {
                             return e.getNestingKind();
--- a/langtools/src/share/classes/com/sun/tools/javac/processing/ServiceProxy.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/langtools/src/share/classes/com/sun/tools/javac/processing/ServiceProxy.java	Wed Jul 21 09:57:21 2010 -0700
@@ -37,7 +37,7 @@
  * Utility class to determine if a service can be found on the
  * path that might be used to create a class loader.
  *
- * <p><b>This is NOT part of any API supported by Sun Microsystems.
+ * <p><b>This is NOT part of any supported API.
  * If you write code that depends on this, you do so at your own risk.
  * This code and its internal interfaces are subject to change or
  * deletion without notice.</b>
--- a/langtools/src/share/classes/com/sun/tools/javac/resources/compiler.properties	Tue Jul 20 16:09:44 2010 -0700
+++ b/langtools/src/share/classes/com/sun/tools/javac/resources/compiler.properties	Wed Jul 21 09:57:21 2010 -0700
@@ -593,18 +593,32 @@
 compiler.note.unchecked.plural.additional=\
     Some input files additionally use unchecked or unsafe operations.
 
+compiler.note.varargs.filename=\
+    {0} declares unsafe vararg methods.
+compiler.note.varargs.plural=\
+    Some input files declare unsafe vararg methods.
+# The following string may appear after one of the above unsafe varargs
+# messages.
+compiler.note.varargs.recompile=\
+    Recompile with -Xlint:varargs for details.
+
+compiler.note.varargs.filename.additional=\
+    {0} declares additional unsafe vararg methods.
+compiler.note.varargs.plural.additional=\
+    Some input files additionally declares unsafe vararg methods.
+
 compiler.note.sunapi.filename=\
-    {0} uses Sun proprietary API that may be removed in a future release.
+    {0} uses internal proprietary API that may be removed in a future release.
 compiler.note.sunapi.plural=\
-    Some input files use Sun proprietary API that may be removed in a future release.
+    Some input files use internal proprietary API that may be removed in a future release.
 # The following string may appear after one of the above sunapi messages.
 compiler.note.sunapi.recompile=\
     Recompile with -Xlint:sunapi for details.
 
 compiler.note.sunapi.filename.additional=\
-    {0} uses additional Sun proprietary API that may be removed in a future release.
+    {0} uses additional internal proprietary API that may be removed in a future release.
 compiler.note.sunapi.plural.additional=\
-    Some input files additionally use Sun proprietary API that may be removed in a future release.
+    Some input files additionally use internal proprietary API that may be removed in a future release.
 
 # Notes related to annotation processing
 
@@ -623,6 +637,9 @@
 compiler.misc.count.warn.plural=\
     {0} warnings
 
+compiler.misc.version.not.available=\
+    (version info not available)
+
 ## extra output when using -verbose (JavaCompiler)
 
 compiler.misc.verbose.checking.attribution=\
@@ -687,7 +704,7 @@
     [deprecation] {0} in {1} has been deprecated
 
 compiler.warn.sun.proprietary=\
-    {0} is Sun proprietary API and may be removed in a future release
+    {0} is internal proprietary API and may be removed in a future release
 
 compiler.warn.illegal.char.for.encoding=\
     unmappable character for encoding {0}
@@ -796,6 +813,9 @@
 compiler.warn.unchecked.generic.array.creation=\
     [unchecked] unchecked generic array creation for varargs parameter of type {0}
 
+compiler.warn.varargs.non.reifiable.type=\
+    [varargs] Possible heap pollution from parameterized vararg type {0}
+
 compiler.warn.missing.deprecated.annotation=\
     [dep-ann] deprecated item is not annotated with @Deprecated
 
@@ -1019,7 +1039,7 @@
 ## diagnostics whose key ends in ".1"
 compiler.misc.undetermined.type=\
     undetermined type
-ncompiler.misc.type.variable.has.undetermined.type=\
+compiler.misc.type.variable.has.undetermined.type=\
     type variable {0} has undetermined type
 compiler.misc.no.unique.maximal.instance.exists=\
     no unique maximal instance exists for type variable {0} with upper bounds {1}
@@ -1105,6 +1125,8 @@
     @interface
 compiler.misc.kindname.constructor=\
     constructor
+compiler.misc.kindname.enum=\
+    enum
 compiler.misc.kindname.interface=\
     interface
 compiler.misc.kindname.static=\
@@ -1239,6 +1261,10 @@
     enums are not supported in -source {0}\n\
 (use -source 5 or higher to enable enums)
 
+compiler.err.diamond.not.supported.in.source=\
+    diamond operator is not supported in -source {0}\n\
+(use -source 7 or higher to enable multi-catch statement)
+
 compiler.err.multicatch.not.supported.in.source=\
     multi-catch statement is not supported in -source {0}\n\
 (use -source 7 or higher to enable multi-catch statement)
--- a/langtools/src/share/classes/com/sun/tools/javac/sym/CreateSymbols.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/langtools/src/share/classes/com/sun/tools/javac/sym/CreateSymbols.java	Wed Jul 21 09:57:21 2010 -0700
@@ -77,7 +77,7 @@
  * <dd>Specifies the destination directory.</dd>
  * </dl>
  *
- * <p><b>This is NOT part of any API supported by Sun Microsystems.
+ * <p><b>This is NOT part of any supported API.
  * If you write code that depends on this, you do so at your own
  * risk.  This code and its internal interfaces are subject to change
  * or deletion without notice.</b></p>
--- a/langtools/src/share/classes/com/sun/tools/javac/tree/JCTree.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/langtools/src/share/classes/com/sun/tools/javac/tree/JCTree.java	Wed Jul 21 09:57:21 2010 -0700
@@ -66,7 +66,7 @@
  * <p>To avoid ambiguities with the Tree API in com.sun.source all sub
  * classes should, by convention, start with JC (javac).
  *
- * <p><b>This is NOT part of any API supported by Sun Microsystems.
+ * <p><b>This is NOT part of any supported API.
  * If you write code that depends on this, you do so at your own risk.
  * This code and its internal interfaces are subject to change or
  * deletion without notice.</b>
--- a/langtools/src/share/classes/com/sun/tools/javac/tree/Pretty.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/langtools/src/share/classes/com/sun/tools/javac/tree/Pretty.java	Wed Jul 21 09:57:21 2010 -0700
@@ -39,8 +39,8 @@
 
 /** Prints out a tree as an indented Java source program.
  *
- *  <p><b>This is NOT part of any API supported by Sun Microsystems.  If
- *  you write code that depends on this, you do so at your own risk.
+ *  <p><b>This is NOT part of any supported API.
+ *  If you write code that depends on this, you do so at your own risk.
  *  This code and its internal interfaces are subject to change or
  *  deletion without notice.</b>
  */
--- a/langtools/src/share/classes/com/sun/tools/javac/tree/TreeCopier.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/langtools/src/share/classes/com/sun/tools/javac/tree/TreeCopier.java	Wed Jul 21 09:57:21 2010 -0700
@@ -34,8 +34,8 @@
  * Creates a copy of a tree, using a given TreeMaker.
  * Names, literal values, etc are shared with the original.
  *
- *  <p><b>This is NOT part of any API supported by Sun Microsystems.  If
- *  you write code that depends on this, you do so at your own risk.
+ *  <p><b>This is NOT part of any supported API.
+ *  If you write code that depends on this, you do so at your own risk.
  *  This code and its internal interfaces are subject to change or
  *  deletion without notice.</b>
  */
--- a/langtools/src/share/classes/com/sun/tools/javac/tree/TreeInfo.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/langtools/src/share/classes/com/sun/tools/javac/tree/TreeInfo.java	Wed Jul 21 09:57:21 2010 -0700
@@ -38,8 +38,8 @@
 
 /** Utility class containing inspector methods for trees.
  *
- *  <p><b>This is NOT part of any API supported by Sun Microsystems.  If
- *  you write code that depends on this, you do so at your own risk.
+ *  <p><b>This is NOT part of any supported API.
+ *  If you write code that depends on this, you do so at your own risk.
  *  This code and its internal interfaces are subject to change or
  *  deletion without notice.</b>
  */
--- a/langtools/src/share/classes/com/sun/tools/javac/tree/TreeMaker.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/langtools/src/share/classes/com/sun/tools/javac/tree/TreeMaker.java	Wed Jul 21 09:57:21 2010 -0700
@@ -39,8 +39,8 @@
 
 /** Factory class for trees.
  *
- *  <p><b>This is NOT part of any API supported by Sun Microsystems.  If
- *  you write code that depends on this, you do so at your own risk.
+ *  <p><b>This is NOT part of any supported API.
+ *  If you write code that depends on this, you do so at your own risk.
  *  This code and its internal interfaces are subject to change or
  *  deletion without notice.</b>
  */
--- a/langtools/src/share/classes/com/sun/tools/javac/tree/TreeScanner.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/langtools/src/share/classes/com/sun/tools/javac/tree/TreeScanner.java	Wed Jul 21 09:57:21 2010 -0700
@@ -36,8 +36,8 @@
  *  do some interesting work. The scanner class itself takes care of all
  *  navigational aspects.
  *
- *  <p><b>This is NOT part of any API supported by Sun Microsystems.  If
- *  you write code that depends on this, you do so at your own risk.
+ *  <p><b>This is NOT part of any supported API.
+ *  If you write code that depends on this, you do so at your own risk.
  *  This code and its internal interfaces are subject to change or
  *  deletion without notice.</b>
  */
--- a/langtools/src/share/classes/com/sun/tools/javac/tree/TreeTranslator.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/langtools/src/share/classes/com/sun/tools/javac/tree/TreeTranslator.java	Wed Jul 21 09:57:21 2010 -0700
@@ -37,8 +37,8 @@
  *  do some interesting work. The translator class itself takes care of all
  *  navigational aspects.
  *
- *  <p><b>This is NOT part of any API supported by Sun Microsystems.  If
- *  you write code that depends on this, you do so at your own risk.
+ *  <p><b>This is NOT part of any supported API.
+ *  If you write code that depends on this, you do so at your own risk.
  *  This code and its internal interfaces are subject to change or
  *  deletion without notice.</b>
  */
--- a/langtools/src/share/classes/com/sun/tools/javac/util/Abort.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/langtools/src/share/classes/com/sun/tools/javac/util/Abort.java	Wed Jul 21 09:57:21 2010 -0700
@@ -28,8 +28,8 @@
 /** Throwing an instance of
  *  this class causes (silent) termination of the main compiler method.
  *
- *  <p><b>This is NOT part of any API supported by Sun Microsystems.  If
- *  you write code that depends on this, you do so at your own risk.
+ *  <p><b>This is NOT part of any supported API.
+ *  If you write code that depends on this, you do so at your own risk.
  *  This code and its internal interfaces are subject to change or
  *  deletion without notice.</b>
  */
--- a/langtools/src/share/classes/com/sun/tools/javac/util/AbstractDiagnosticFormatter.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/langtools/src/share/classes/com/sun/tools/javac/util/AbstractDiagnosticFormatter.java	Wed Jul 21 09:57:21 2010 -0700
@@ -57,7 +57,7 @@
  *  <li> Provides the formatting logic for rendering the arguments of a JCDiagnostic object.
  * <ul>
  *
- * <p><b>This is NOT part of any API supported by Sun Microsystems.
+ * <p><b>This is NOT part of any supported API.
  * If you write code that depends on this, you do so at your own risk.
  * This code and its internal interfaces are subject to change or
  * deletion without notice.</b>
--- a/langtools/src/share/classes/com/sun/tools/javac/util/AbstractLog.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/langtools/src/share/classes/com/sun/tools/javac/util/AbstractLog.java	Wed Jul 21 09:57:21 2010 -0700
@@ -37,8 +37,8 @@
  *  A base class for error logs. Reports errors and warnings, and
  *  keeps track of error numbers and positions.
  *
- *  <p><b>This is NOT part of any API supported by Sun Microsystems.  If
- *  you write code that depends on this, you do so at your own risk.
+ *  <p><b>This is NOT part of any supported API.
+ *  If you write code that depends on this, you do so at your own risk.
  *  This code and its internal interfaces are subject to change or
  *  deletion without notice.</b>
  */
--- a/langtools/src/share/classes/com/sun/tools/javac/util/BasicDiagnosticFormatter.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/langtools/src/share/classes/com/sun/tools/javac/util/BasicDiagnosticFormatter.java	Wed Jul 21 09:57:21 2010 -0700
@@ -58,7 +58,7 @@
  * <li>%_: space delimiter, useful for formatting purposes
  * </ul>
  *
- * <p><b>This is NOT part of any API supported by Sun Microsystems.
+ * <p><b>This is NOT part of any supported API.
  * If you write code that depends on this, you do so at your own risk.
  * This code and its internal interfaces are subject to change or
  * deletion without notice.</b>
--- a/langtools/src/share/classes/com/sun/tools/javac/util/Bits.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/langtools/src/share/classes/com/sun/tools/javac/util/Bits.java	Wed Jul 21 09:57:21 2010 -0700
@@ -27,8 +27,8 @@
 
 /** A class for extensible, mutable bit sets.
  *
- *  <p><b>This is NOT part of any API supported by Sun Microsystems.  If
- *  you write code that depends on this, you do so at your own risk.
+ *  <p><b>This is NOT part of any supported API.
+ *  If you write code that depends on this, you do so at your own risk.
  *  This code and its internal interfaces are subject to change or
  *  deletion without notice.</b>
  */
--- a/langtools/src/share/classes/com/sun/tools/javac/util/ByteBuffer.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/langtools/src/share/classes/com/sun/tools/javac/util/ByteBuffer.java	Wed Jul 21 09:57:21 2010 -0700
@@ -31,8 +31,8 @@
  *  appended. There are also methods to append names to byte buffers
  *  and to convert byte buffers to names.
  *
- *  <p><b>This is NOT part of any API supported by Sun Microsystems.  If
- *  you write code that depends on this, you do so at your own risk.
+ *  <p><b>This is NOT part of any supported API.
+ *  If you write code that depends on this, you do so at your own risk.
  *  This code and its internal interfaces are subject to change or
  *  deletion without notice.</b>
  */
--- a/langtools/src/share/classes/com/sun/tools/javac/util/ClientCodeException.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/langtools/src/share/classes/com/sun/tools/javac/util/ClientCodeException.java	Wed Jul 21 09:57:21 2010 -0700
@@ -29,8 +29,8 @@
  * An exception used for propogating exceptions found in client code
  * invoked from javac.
  *
- *  <p><b>This is NOT part of any API supported by Sun Microsystems.  If
- *  you write code that depends on this, you do so at your own risk.
+ *  <p><b>This is NOT part of any supported API.
+ *  If you write code that depends on this, you do so at your own risk.
  *  This code and its internal interfaces are subject to change or
  *  deletion without notice.</b>
  */
--- a/langtools/src/share/classes/com/sun/tools/javac/util/CloseableURLClassLoader.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/langtools/src/share/classes/com/sun/tools/javac/util/CloseableURLClassLoader.java	Wed Jul 21 09:57:21 2010 -0700
@@ -40,8 +40,8 @@
  * fragile. Caveat emptor.
  * @throws Error if the internal data structures are not as expected.
  *
- *  <p><b>This is NOT part of any API supported by Sun Microsystems.  If
- *  you write code that depends on this, you do so at your own risk.
+ *  <p><b>This is NOT part of any supported API.
+ *  If you write code that depends on this, you do so at your own risk.
  *  This code and its internal interfaces are subject to change or
  *  deletion without notice.</b>
  */
--- a/langtools/src/share/classes/com/sun/tools/javac/util/Constants.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/langtools/src/share/classes/com/sun/tools/javac/util/Constants.java	Wed Jul 21 09:57:21 2010 -0700
@@ -32,8 +32,8 @@
 /**
  * Utilities for operating on constant values.
  *
- * <p><b>This is NOT part of any API supported by Sun Microsystems.  If
- * you write code that depends on this, you do so at your own risk.
+ * <p><b>This is NOT part of any supported API.
+ * If you write code that depends on this, you do so at your own risk.
  * This code and its internal interfaces are subject to change or
  * deletion without notice.</b>
  */
--- a/langtools/src/share/classes/com/sun/tools/javac/util/Context.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/langtools/src/share/classes/com/sun/tools/javac/util/Context.java	Wed Jul 21 09:57:21 2010 -0700
@@ -91,8 +91,8 @@
  *     NewPhase.preRegister(context);
  * </pre>
  *
- *  <p><b>This is NOT part of any API supported by Sun Microsystems.  If
- *  you write code that depends on this, you do so at your own risk.
+ *  <p><b>This is NOT part of any supported API.
+ *  If you write code that depends on this, you do so at your own risk.
  *  This code and its internal interfaces are subject to change or
  *  deletion without notice.</b>
  */
--- a/langtools/src/share/classes/com/sun/tools/javac/util/Convert.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/langtools/src/share/classes/com/sun/tools/javac/util/Convert.java	Wed Jul 21 09:57:21 2010 -0700
@@ -28,8 +28,8 @@
 /** Utility class for static conversion methods between numbers
  *  and strings in various formats.
  *
- *  <p><b>This is NOT part of any API supported by Sun Microsystems.  If
- *  you write code that depends on this, you do so at your own risk.
+ *  <p><b>This is NOT part of any supported API.
+ *  If you write code that depends on this, you do so at your own risk.
  *  This code and its internal interfaces are subject to change or
  *  deletion without notice.</b>
  */
--- a/langtools/src/share/classes/com/sun/tools/javac/util/DiagnosticSource.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/langtools/src/share/classes/com/sun/tools/javac/util/DiagnosticSource.java	Wed Jul 21 09:57:21 2010 -0700
@@ -40,8 +40,8 @@
  * A simple abstraction of a source file, as needed for use in a diagnostic message.
  * Provides access to the line and position in a line for any given character offset.
  *
- *  <p><b>This is NOT part of any API supported by Sun Microsystems.  If
- *  you write code that depends on this, you do so at your own risk.
+ *  <p><b>This is NOT part of any supported API.
+ *  If you write code that depends on this, you do so at your own risk.
  *  This code and its internal interfaces are subject to change or
  *  deletion without notice.</b>
  */
--- a/langtools/src/share/classes/com/sun/tools/javac/util/FatalError.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/langtools/src/share/classes/com/sun/tools/javac/util/FatalError.java	Wed Jul 21 09:57:21 2010 -0700
@@ -29,8 +29,8 @@
  *  of the main compiler method.  It is used when some non-recoverable
  *  error has been detected in the compiler environment at runtime.
  *
- *  <p><b>This is NOT part of any API supported by Sun Microsystems.  If
- *  you write code that depends on this, you do so at your own risk.
+ *  <p><b>This is NOT part of any supported API.
+ *  If you write code that depends on this, you do so at your own risk.
  *  This code and its internal interfaces are subject to change or
  *  deletion without notice.</b>
  */
--- a/langtools/src/share/classes/com/sun/tools/javac/util/ForwardingDiagnosticFormatter.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/langtools/src/share/classes/com/sun/tools/javac/util/ForwardingDiagnosticFormatter.java	Wed Jul 21 09:57:21 2010 -0700
@@ -38,7 +38,7 @@
  * A delegated diagnostic formatter delegates all formatting
  * actions to an underlying formatter (aka the delegated formatter).
  *
- * <p><b>This is NOT part of any API supported by Sun Microsystems.
+ * <p><b>This is NOT part of any supported API.
  * If you write code that depends on this, you do so at your own risk.
  * This code and its internal interfaces are subject to change or
  * deletion without notice.</b>
--- a/langtools/src/share/classes/com/sun/tools/javac/util/JCDiagnostic.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/langtools/src/share/classes/com/sun/tools/javac/util/JCDiagnostic.java	Wed Jul 21 09:57:21 2010 -0700
@@ -38,8 +38,8 @@
 
 /** An abstraction of a diagnostic message generated by the compiler.
  *
- *  <p><b>This is NOT part of any API supported by Sun Microsystems.  If
- *  you write code that depends on this, you do so at your own risk.
+ *  <p><b>This is NOT part of any supported API.
+ *  If you write code that depends on this, you do so at your own risk.
  *  This code and its internal interfaces are subject to change or
  *  deletion without notice.</b>
  */
--- a/langtools/src/share/classes/com/sun/tools/javac/util/JavacMessages.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/langtools/src/share/classes/com/sun/tools/javac/util/JavacMessages.java	Wed Jul 21 09:57:21 2010 -0700
@@ -37,8 +37,8 @@
 /**
  *  Support for formatted localized messages.
  *
- *  <p><b>This is NOT part of any API supported by Sun Microsystems.  If
- *  you write code that depends on this, you do so at your own risk.
+ *  <p><b>This is NOT part of any supported API.
+ *  If you write code that depends on this, you do so at your own risk.
  *  This code and its internal interfaces are subject to change or
  *  deletion without notice.</b>
  */
--- a/langtools/src/share/classes/com/sun/tools/javac/util/LayoutCharacters.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/langtools/src/share/classes/com/sun/tools/javac/util/LayoutCharacters.java	Wed Jul 21 09:57:21 2010 -0700
@@ -28,8 +28,8 @@
 /** An interface containing layout character constants used in Java
  *  programs.
  *
- *  <p><b>This is NOT part of any API supported by Sun Microsystems.  If
- *  you write code that depends on this, you do so at your own risk.
+ *  <p><b>This is NOT part of any supported API.
+ *  If you write code that depends on this, you do so at your own risk.
  *  This code and its internal interfaces are subject to change or
  *  deletion without notice.</b>
  */
--- a/langtools/src/share/classes/com/sun/tools/javac/util/List.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/langtools/src/share/classes/com/sun/tools/javac/util/List.java	Wed Jul 21 09:57:21 2010 -0700
@@ -43,8 +43,8 @@
  *  <p>Lists are always trailed by a sentinel element, whose head and tail
  *  are both null.
  *
- *  <p><b>This is NOT part of any API supported by Sun Microsystems.  If
- *  you write code that depends on this, you do so at your own risk.
+ *  <p><b>This is NOT part of any supported API.
+ *  If you write code that depends on this, you do so at your own risk.
  *  This code and its internal interfaces are subject to change or
  *  deletion without notice.</b>
  */
@@ -103,6 +103,7 @@
 
     /** Construct a list consisting of given elements.
      */
+    @SuppressWarnings("varargs")
     public static <A> List<A> of(A x1, A x2, A x3, A... rest) {
         return new List<A>(x1, new List<A>(x2, new List<A>(x3, from(rest))));
     }
--- a/langtools/src/share/classes/com/sun/tools/javac/util/ListBuffer.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/langtools/src/share/classes/com/sun/tools/javac/util/ListBuffer.java	Wed Jul 21 09:57:21 2010 -0700
@@ -33,8 +33,8 @@
 /** A class for constructing lists by appending elements. Modelled after
  *  java.lang.StringBuffer.
  *
- *  <p><b>This is NOT part of any API supported by Sun Microsystems.  If
- *  you write code that depends on this, you do so at your own risk.
+ *  <p><b>This is NOT part of any supported API.
+ *  If you write code that depends on this, you do so at your own risk.
  *  This code and its internal interfaces are subject to change or
  *  deletion without notice.</b>
  */
--- a/langtools/src/share/classes/com/sun/tools/javac/util/Log.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/langtools/src/share/classes/com/sun/tools/javac/util/Log.java	Wed Jul 21 09:57:21 2010 -0700
@@ -41,8 +41,8 @@
 /** A class for error logs. Reports errors and warnings, and
  *  keeps track of error numbers and positions.
  *
- *  <p><b>This is NOT part of any API supported by Sun Microsystems.  If
- *  you write code that depends on this, you do so at your own risk.
+ *  <p><b>This is NOT part of any supported API.
+ *  If you write code that depends on this, you do so at your own risk.
  *  This code and its internal interfaces are subject to change or
  *  deletion without notice.</b>
  */
@@ -125,8 +125,8 @@
         this.promptOnError = options.get("-prompt") != null;
         this.emitWarnings = options.get("-Xlint:none") == null;
         this.suppressNotes = options.get("suppressNotes") != null;
-        this.MaxErrors = getIntOption(options, "-Xmaxerrs", 100);
-        this.MaxWarnings = getIntOption(options, "-Xmaxwarns", 100);
+        this.MaxErrors = getIntOption(options, "-Xmaxerrs", getDefaultMaxErrors());
+        this.MaxWarnings = getIntOption(options, "-Xmaxwarns", getDefaultMaxWarnings());
 
         boolean rawDiagnostics = options.get("rawDiagnostics") != null;
         messages = JavacMessages.instance(context);
@@ -155,6 +155,18 @@
             return defaultValue;
         }
 
+        /** Default value for -Xmaxerrs.
+         */
+        protected int getDefaultMaxErrors() {
+            return 100;
+        }
+
+        /** Default value for -Xmaxwarns.
+         */
+        protected int getDefaultMaxWarnings() {
+            return 100;
+        }
+
     /** The default writer for diagnostics
      */
     static final PrintWriter defaultWriter(Context context) {
--- a/langtools/src/share/classes/com/sun/tools/javac/util/MandatoryWarningHandler.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/langtools/src/share/classes/com/sun/tools/javac/util/MandatoryWarningHandler.java	Wed Jul 21 09:57:21 2010 -0700
@@ -43,8 +43,8 @@
  * made on any API to generate a warning at all. In consequence, this handler only
  * gets to handle those warnings that JLS says must be generated.
  *
- *  <p><b>This is NOT part of any API supported by Sun Microsystems.  If
- *  you write code that depends on this, you do so at your own risk.
+ *  <p><b>This is NOT part of any supported API.
+ *  If you write code that depends on this, you do so at your own risk.
  *  This code and its internal interfaces are subject to change or
  *  deletion without notice.</b>
  */
--- a/langtools/src/share/classes/com/sun/tools/javac/util/Name.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/langtools/src/share/classes/com/sun/tools/javac/util/Name.java	Wed Jul 21 09:57:21 2010 -0700
@@ -29,8 +29,8 @@
  *  Utf8 format. Names are stored in a Name.Table, and are unique within
  *  that table.
  *
- *  <p><b>This is NOT part of any API supported by Sun Microsystems.  If
- *  you write code that depends on this, you do so at your own risk.
+ *  <p><b>This is NOT part of any supported API.
+ *  If you write code that depends on this, you do so at your own risk.
  *  This code and its internal interfaces are subject to change or
  *  deletion without notice.</b>
  */
--- a/langtools/src/share/classes/com/sun/tools/javac/util/Names.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/langtools/src/share/classes/com/sun/tools/javac/util/Names.java	Wed Jul 21 09:57:21 2010 -0700
@@ -29,8 +29,8 @@
  * Access to the compiler's name table.  STandard names are defined,
  * as well as methods to create new names.
  *
- *  <p><b>This is NOT part of any API supported by Sun Microsystems.  If
- *  you write code that depends on this, you do so at your own risk.
+ *  <p><b>This is NOT part of any supported API.
+ *  If you write code that depends on this, you do so at your own risk.
  *  This code and its internal interfaces are subject to change or
  *  deletion without notice.</b>
  */
@@ -103,6 +103,7 @@
     public final Name RuntimeInvisibleTypeAnnotations;
     public final Name RuntimeVisibleParameterAnnotations;
     public final Name RuntimeInvisibleParameterAnnotations;
+    public final Name PolymorphicSignature;
     public final Name Value;
     public final Name EnclosingMethod;
     public final Name desiredAssertionStatus;
@@ -115,7 +116,6 @@
     public final Name value;
     public final Name getMessage;
     public final Name getClass;
-    public final Name invoke;
     public final Name TYPE;
     public final Name TYPE_USE;
     public final Name TYPE_PARAMETER;
@@ -213,6 +213,7 @@
         RuntimeInvisibleTypeAnnotations = fromString("RuntimeInvisibleTypeAnnotations");
         RuntimeVisibleParameterAnnotations = fromString("RuntimeVisibleParameterAnnotations");
         RuntimeInvisibleParameterAnnotations = fromString("RuntimeInvisibleParameterAnnotations");
+        PolymorphicSignature = fromString("PolymorphicSignature");
         Value = fromString("Value");
         EnclosingMethod = fromString("EnclosingMethod");
 
@@ -227,7 +228,6 @@
         value = fromString("value");
         getMessage = fromString("getMessage");
         getClass = fromString("getClass");
-        invoke = fromString("invoke");
 
         TYPE = fromString("TYPE");
         TYPE_USE = fromString("TYPE_USE");
--- a/langtools/src/share/classes/com/sun/tools/javac/util/Options.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/langtools/src/share/classes/com/sun/tools/javac/util/Options.java	Wed Jul 21 09:57:21 2010 -0700
@@ -32,8 +32,8 @@
  *  If an option has an argument, the option name is mapped to the argument.
  *  If a set option has no argument, it is mapped to itself.
  *
- *  <p><b>This is NOT part of any API supported by Sun Microsystems.  If
- *  you write code that depends on this, you do so at your own risk.
+ *  <p><b>This is NOT part of any supported API.
+ *  If you write code that depends on this, you do so at your own risk.
  *  This code and its internal interfaces are subject to change or
  *  deletion without notice.</b>
  */
--- a/langtools/src/share/classes/com/sun/tools/javac/util/Pair.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/langtools/src/share/classes/com/sun/tools/javac/util/Pair.java	Wed Jul 21 09:57:21 2010 -0700
@@ -27,8 +27,8 @@
 
 /** A generic class for pairs.
  *
- *  <p><b>This is NOT part of any API supported by Sun Microsystems.  If
- *  you write code that depends on this, you do so at your own risk.
+ *  <p><b>This is NOT part of any supported API.
+ *  If you write code that depends on this, you do so at your own risk.
  *  This code and its internal interfaces are subject to change or
  *  deletion without notice.</b>
  */
--- a/langtools/src/share/classes/com/sun/tools/javac/util/Position.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/langtools/src/share/classes/com/sun/tools/javac/util/Position.java	Wed Jul 21 09:57:21 2010 -0700
@@ -36,8 +36,8 @@
  *  expansion is optional and no Unicode excape translation is considered.
  *  The first character is at location (1,1).
  *
- *  <p><b>This is NOT part of any API supported by Sun Microsystems.  If
- *  you write code that depends on this, you do so at your own risk.
+ *  <p><b>This is NOT part of any supported API.
+ *  If you write code that depends on this, you do so at your own risk.
  *  This code and its internal interfaces are subject to change or
  *  deletion without notice.</b>
  */
--- a/langtools/src/share/classes/com/sun/tools/javac/util/PropagatedException.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/langtools/src/share/classes/com/sun/tools/javac/util/PropagatedException.java	Wed Jul 21 09:57:21 2010 -0700
@@ -28,7 +28,7 @@
 /**
  * Used to propagate exceptions through to the user.
  *
- * <p><b>This is NOT part of any API supported by Sun Microsystems.
+ * <p><b>This is NOT part of any supported API.
  * If you write code that depends on this, you do so at your own
  * risk.  This code and its internal interfaces are subject to change
  * or deletion without notice.</b></p>
--- a/langtools/src/share/classes/com/sun/tools/javac/util/RawDiagnosticFormatter.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/langtools/src/share/classes/com/sun/tools/javac/util/RawDiagnosticFormatter.java	Wed Jul 21 09:57:21 2010 -0700
@@ -41,7 +41,7 @@
  * or not the source name and position are set. This formatter provides a standardized, localize-independent
  * implementation of a diagnostic formatter; as such, this formatter is best suited for testing purposes.
  *
- * <p><b>This is NOT part of any API supported by Sun Microsystems.
+ * <p><b>This is NOT part of any supported API.
  * If you write code that depends on this, you do so at your own risk.
  * This code and its internal interfaces are subject to change or
  * deletion without notice.</b>
--- a/langtools/src/share/classes/com/sun/tools/javac/util/RichDiagnosticFormatter.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/langtools/src/share/classes/com/sun/tools/javac/util/RichDiagnosticFormatter.java	Wed Jul 21 09:57:21 2010 -0700
@@ -59,7 +59,7 @@
  * to two different type-variables with the same name, their representation is
  * disambiguated by appending an index to the type variable name.
  *
- * <p><b>This is NOT part of any API supported by Sun Microsystems.
+ * <p><b>This is NOT part of any supported API.
  * If you write code that depends on this, you do so at your own risk.
  * This code and its internal interfaces are subject to change or
  * deletion without notice.</b>
--- a/langtools/src/share/classes/com/sun/tools/javac/util/SharedNameTable.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/langtools/src/share/classes/com/sun/tools/javac/util/SharedNameTable.java	Wed Jul 21 09:57:21 2010 -0700
@@ -32,8 +32,8 @@
  * byte array, expanding it as needed. This avoids the overhead incurred
  * by using an array of bytes for each name.
  *
- *  <p><b>This is NOT part of any API supported by Sun Microsystems.  If
- *  you write code that depends on this, you do so at your own risk.
+ *  <p><b>This is NOT part of any supported API.
+ *  If you write code that depends on this, you do so at your own risk.
  *  This code and its internal interfaces are subject to change or
  *  deletion without notice.</b>
  */
--- a/langtools/src/share/classes/com/sun/tools/javac/util/UnsharedNameTable.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/langtools/src/share/classes/com/sun/tools/javac/util/UnsharedNameTable.java	Wed Jul 21 09:57:21 2010 -0700
@@ -32,8 +32,8 @@
  * using weak references. It is recommended for use when a single shared
  * byte array is unsuitable.
  *
- *  <p><b>This is NOT part of any API supported by Sun Microsystems.  If
- *  you write code that depends on this, you do so at your own risk.
+ *  <p><b>This is NOT part of any supported API.
+ *  If you write code that depends on this, you do so at your own risk.
  *  This code and its internal interfaces are subject to change or
  *  deletion without notice.</b>
  */
--- a/langtools/src/share/classes/com/sun/tools/javac/util/Warner.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/langtools/src/share/classes/com/sun/tools/javac/util/Warner.java	Wed Jul 21 09:57:21 2010 -0700
@@ -31,7 +31,7 @@
  * An interface to support optional warnings, needed for support of
  * unchecked conversions and unchecked casts.
  *
- * <p><b>This is NOT part of any API supported by Sun Microsystems.
+ * <p><b>This is NOT part of any supported API.
  * If you write code that depends on this, you do so at your own risk.
  * This code and its internal interfaces are subject to change or
  * deletion without notice.</b>
--- a/langtools/src/share/classes/com/sun/tools/javadoc/DocletInvoker.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/langtools/src/share/classes/com/sun/tools/javadoc/DocletInvoker.java	Wed Jul 21 09:57:21 2010 -0700
@@ -155,10 +155,8 @@
     public boolean start(RootDoc root) {
         Object retVal;
         String methodName = "start";
-        Class<?>[] paramTypes = new Class<?>[1];
-        Object[] params = new Object[1];
-        paramTypes[0] = RootDoc.class;
-        params[0] = root;
+        Class<?>[] paramTypes = { RootDoc.class };
+        Object[] params = { root };
         try {
             retVal = invoke(methodName, null, paramTypes, params);
         } catch (DocletInvokeException exc) {
@@ -181,10 +179,8 @@
     public int optionLength(String option) {
         Object retVal;
         String methodName = "optionLength";
-        Class<?>[] paramTypes = new Class<?>[1];
-        Object[] params = new Object[1];
-        paramTypes[0] = option.getClass();
-        params[0] = option;
+        Class<?>[] paramTypes = { String.class };
+        Object[] params = { option };
         try {
             retVal = invoke(methodName, new Integer(0), paramTypes, params);
         } catch (DocletInvokeException exc) {
@@ -208,12 +204,8 @@
         String options[][] = optlist.toArray(new String[optlist.length()][]);
         String methodName = "validOptions";
         DocErrorReporter reporter = messager;
-        Class<?>[] paramTypes = new Class<?>[2];
-        Object[] params = new Object[2];
-        paramTypes[0] = options.getClass();
-        paramTypes[1] = DocErrorReporter.class;
-        params[0] = options;
-        params[1] = reporter;
+        Class<?>[] paramTypes = { String[][].class, DocErrorReporter.class };
+        Object[] params = { options, reporter };
         try {
             retVal = invoke(methodName, Boolean.TRUE, paramTypes, params);
         } catch (DocletInvokeException exc) {
--- a/langtools/src/share/classes/com/sun/tools/javadoc/Messager.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/langtools/src/share/classes/com/sun/tools/javadoc/Messager.java	Wed Jul 21 09:57:21 2010 -0700
@@ -86,7 +86,7 @@
         private static final long serialVersionUID = 0;
     }
 
-    private final String programName;
+    final String programName;
 
     private ResourceBundle messageRB = null;
 
@@ -121,6 +121,16 @@
         this.programName = programName;
     }
 
+    @Override
+    protected int getDefaultMaxErrors() {
+        return Integer.MAX_VALUE;
+    }
+
+    @Override
+    protected int getDefaultMaxWarnings() {
+        return Integer.MAX_VALUE;
+    }
+
     /**
      * Reset resource bundle, eg. locale has changed.
      */
@@ -231,11 +241,13 @@
      * @param msg message to print
      */
     public void printError(SourcePosition pos, String msg) {
-        String prefix = (pos == null) ? programName : pos.toString();
-        errWriter.println(prefix + ": " + getText("javadoc.error") + " - " + msg);
-        errWriter.flush();
-        prompt();
-        nerrors++;
+        if (nerrors < MaxErrors) {
+            String prefix = (pos == null) ? programName : pos.toString();
+            errWriter.println(prefix + ": " + getText("javadoc.error") + " - " + msg);
+            errWriter.flush();
+            prompt();
+            nerrors++;
+        }
     }
 
     /**
@@ -256,10 +268,12 @@
      * @param msg message to print
      */
     public void printWarning(SourcePosition pos, String msg) {
-        String prefix = (pos == null) ? programName : pos.toString();
-        warnWriter.println(prefix +  ": " + getText("javadoc.warning") +" - " + msg);
-        warnWriter.flush();
-        nwarnings++;
+        if (nwarnings < MaxWarnings) {
+            String prefix = (pos == null) ? programName : pos.toString();
+            warnWriter.println(prefix +  ": " + getText("javadoc.warning") +" - " + msg);
+            warnWriter.flush();
+            nwarnings++;
+        }
     }
 
     /**
--- a/langtools/src/share/classes/com/sun/tools/javadoc/Start.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/langtools/src/share/classes/com/sun/tools/javadoc/Start.java	Wed Jul 21 09:57:21 2010 -0700
@@ -51,8 +51,6 @@
  * @author Neal Gafter (rewrite)
  */
 class Start {
-    /** Context for this invocation. */
-    private final Context context;
 
     private final String defaultDocletClassName;
     private final ClassLoader docletParentClassLoader;
@@ -98,8 +96,8 @@
           PrintWriter noticeWriter,
           String defaultDocletClassName,
           ClassLoader docletParentClassLoader) {
-        context = new Context();
-        messager = new Messager(context, programName, errWriter, warnWriter, noticeWriter);
+        Context tempContext = new Context(); // interim context until option decoding completed
+        messager = new Messager(tempContext, programName, errWriter, warnWriter, noticeWriter);
         this.defaultDocletClassName = defaultDocletClassName;
         this.docletParentClassLoader = docletParentClassLoader;
     }
@@ -110,8 +108,8 @@
 
     Start(String programName, String defaultDocletClassName,
           ClassLoader docletParentClassLoader) {
-        context = new Context();
-        messager = new Messager(context, programName);
+        Context tempContext = new Context(); // interim context until option decoding completed
+        messager = new Messager(tempContext, programName);
         this.defaultDocletClassName = defaultDocletClassName;
         this.docletParentClassLoader = docletParentClassLoader;
     }
@@ -145,6 +143,13 @@
     }
 
     /**
+     * Usage
+     */
+    private void Xusage() {
+        messager.notice("main.Xusage");
+    }
+
+    /**
      * Exit
      */
     private void exit() {
@@ -213,6 +218,15 @@
         setDocletInvoker(argv);
         ListBuffer<String> subPackages = new ListBuffer<String>();
         ListBuffer<String> excludedPackages = new ListBuffer<String>();
+
+        Context context = new Context();
+        // Setup a new Messager, using the same initial parameters as the
+        // existing Messager, except that this one will be able to use any
+        // options that may be set up below.
+        Messager.preRegister(context,
+                messager.programName,
+                messager.errWriter, messager.warnWriter, messager.noticeWriter);
+
         Options compOpts = Options.instance(context);
         boolean docClasses = false;
 
@@ -310,6 +324,15 @@
                     usageError("main.locale_first");
                 oneArg(argv, i++);
                 docLocale = argv[i];
+            } else if (arg.equals("-Xmaxerrs") || arg.equals("-Xmaxwarns")) {
+                oneArg(argv, i++);
+                if (compOpts.get(arg) != null) {
+                    usageError("main.option.already.seen", arg);
+                }
+                compOpts.put(arg, argv[i]);
+            } else if (arg.equals("-X")) {
+                Xusage();
+                exit();
             } else if (arg.startsWith("-XD")) {
                 String s = arg.substring("-XD".length());
                 int eq = s.indexOf('=');
--- a/langtools/src/share/classes/com/sun/tools/javadoc/resources/javadoc.properties	Tue Jul 20 16:09:44 2010 -0700
+++ b/langtools/src/share/classes/com/sun/tools/javadoc/resources/javadoc.properties	Wed Jul 21 09:57:21 2010 -0700
@@ -49,7 +49,13 @@
   -locale <name>            Locale to be used, e.g. en_US or en_US_WIN\n\
   -encoding <name>          Source file encoding name\n\
   -quiet                    Do not display status messages\n\
-  -J<flag>                  Pass <flag> directly to the runtime system\n
+  -J<flag>                  Pass <flag> directly to the runtime system\n\
+  -X                        Print a synopsis of nonstandard options\n
+main.Xusage=\
+  -Xmaxerrs <number>        Set the maximum number of errors to print\n\
+  -Xmaxwarns <number>       Set the maximum number of warnings to print\n\
+\n\
+These options are non-standard and subject to change without notice.
 main.option.already.seen=The {0} option may be specified no more than once.
 main.requires_argument=option {0} requires an argument.
 main.locale_first=option -locale must be first on the command line.
@@ -65,7 +71,7 @@
 main.fatal.error=fatal error
 main.fatal.exception=fatal exception
 main.out.of.memory=java.lang.OutOfMemoryError: Please increase memory.\n\
-For example, on the Sun Classic or HotSpot VMs, add the option -J-Xmx\n\
+For example, on the JDK Classic or HotSpot VMs, add the option -J-Xmx\n\
 such as -J-Xmx32m.
 main.done_in=[done in {0} ms]
 main.doclet_method_must_be_static=In doclet class {0}, method {1} must be static.
--- a/langtools/src/share/classes/com/sun/tools/javadoc/resources/javadoc_zh_CN.properties	Tue Jul 20 16:09:44 2010 -0700
+++ b/langtools/src/share/classes/com/sun/tools/javadoc/resources/javadoc_zh_CN.properties	Wed Jul 21 09:57:21 2010 -0700
@@ -65,7 +65,7 @@
 main.fatal.error=\u81f4\u547d\u9519\u8bef
 main.fatal.exception=\u81f4\u547d\u5f02\u5e38
 main.out.of.memory=java.lang.OutOfMemoryError\uff1a\u8bf7\u589e\u52a0\u5185\u5b58\u3002\n\
-\u4f8b\u5982\uff0c\u5bf9\u4e8e Sun Classic \u6216 HotSpot VM\uff0c\u8bf7\u6dfb\u52a0\u9009\u9879 -J-Xmx\uff0c\n\
+\u4f8b\u5982\uff0c\u5bf9\u4e8e JDK Classic \u6216 HotSpot VM\uff0c\u8bf7\u6dfb\u52a0\u9009\u9879 -J-Xmx\uff0c\n\
 \u5982 -J-Xmx32m\u3002
 main.done_in=[\u5728{0} \u6beb\u79d2\u5185\u5b8c\u6210]
 main.doclet_method_must_be_static=\u5728 doclet \u7c7b {0} \u4e2d\uff0c\u65b9\u6cd5 {1} \u5fc5\u987b\u4e3a\u9759\u6001\u3002
--- a/langtools/src/share/classes/com/sun/tools/javah/Gen.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/langtools/src/share/classes/com/sun/tools/javah/Gen.java	Wed Jul 21 09:57:21 2010 -0700
@@ -60,7 +60,7 @@
  * original writing, this interface is rich enough to support JNI and the
  * old 1.0-style native method interface.
  *
- * <p><b>This is NOT part of any API supported by Sun Microsystems.
+ * <p><b>This is NOT part of any supported API.
  * If you write code that depends on this, you do so at your own
  * risk.  This code and its internal interfaces are subject to change
  * or deletion without notice.</b></p>
--- a/langtools/src/share/classes/com/sun/tools/javah/InternalError.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/langtools/src/share/classes/com/sun/tools/javah/InternalError.java	Wed Jul 21 09:57:21 2010 -0700
@@ -26,8 +26,8 @@
 package com.sun.tools.javah;
 
 /**
- *  <p><b>This is NOT part of any API supported by Sun Microsystems.  If
- *  you write code that depends on this, you do so at your own risk.
+ *  <p><b>This is NOT part of any supported API.
+ *  If you write code that depends on this, you do so at your own risk.
  *  This code and its internal interfaces are subject to change or
  *  deletion without notice.</b>
  */
--- a/langtools/src/share/classes/com/sun/tools/javah/JNI.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/langtools/src/share/classes/com/sun/tools/javah/JNI.java	Wed Jul 21 09:57:21 2010 -0700
@@ -42,7 +42,7 @@
 /**
  * Header file generator for JNI.
  *
- * <p><b>This is NOT part of any API supported by Sun Microsystems.
+ * <p><b>This is NOT part of any supported API.
  * If you write code that depends on this, you do so at your own
  * risk.  This code and its internal interfaces are subject to change
  * or deletion without notice.</b></p>
--- a/langtools/src/share/classes/com/sun/tools/javah/JavahFileManager.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/langtools/src/share/classes/com/sun/tools/javah/JavahFileManager.java	Wed Jul 21 09:57:21 2010 -0700
@@ -36,8 +36,8 @@
 /**
  *  javah's implementation of JavaFileManager.
  *
- *  <p><b>This is NOT part of any API supported by Sun Microsystems.  If
- *  you write code that depends on this, you do so at your own risk.
+ *  <p><b>This is NOT part of any supported API.
+ *  If you write code that depends on this, you do so at your own risk.
  *  This code and its internal interfaces are subject to change or
  *  deletion without notice.</b>
  */
--- a/langtools/src/share/classes/com/sun/tools/javah/JavahTask.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/langtools/src/share/classes/com/sun/tools/javah/JavahTask.java	Wed Jul 21 09:57:21 2010 -0700
@@ -59,7 +59,7 @@
 import javax.lang.model.type.TypeMirror;
 import javax.lang.model.type.TypeVisitor;
 import javax.lang.model.util.ElementFilter;
-import javax.lang.model.util.SimpleTypeVisitor6;
+import javax.lang.model.util.SimpleTypeVisitor7;
 import javax.lang.model.util.Types;
 
 import javax.tools.Diagnostic;
@@ -76,7 +76,7 @@
  * Javah generates support files for native methods.
  * Parse commandline options & Invokes javadoc to execute those commands.
  *
- * <p><b>This is NOT part of any API supported by Sun Microsystems.
+ * <p><b>This is NOT part of any supported API.
  * If you write code that depends on this, you do so at your own
  * risk.  This code and its internal interfaces are subject to change
  * or deletion without notice.</b></p>
@@ -705,7 +705,7 @@
         }
 
         private TypeVisitor<Void,Types> checkMethodParametersVisitor =
-                new SimpleTypeVisitor6<Void,Types>() {
+                new SimpleTypeVisitor7<Void,Types>() {
             @Override
             public Void visitArray(ArrayType t, Types types) {
                 visit(t.getComponentType(), types);
--- a/langtools/src/share/classes/com/sun/tools/javah/JavahTool.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/langtools/src/share/classes/com/sun/tools/javah/JavahTool.java	Wed Jul 21 09:57:21 2010 -0700
@@ -40,7 +40,7 @@
 import javax.tools.StandardJavaFileManager;
 
 /*
- * <p><b>This is NOT part of any API supported by Sun Microsystems.
+ * <p><b>This is NOT part of any supported API.
  * If you write code that depends on this, you do so at your own
  * risk.  This code and its internal interfaces are subject to change
  * or deletion without notice.</b></p>
--- a/langtools/src/share/classes/com/sun/tools/javah/LLNI.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/langtools/src/share/classes/com/sun/tools/javah/LLNI.java	Wed Jul 21 09:57:21 2010 -0700
@@ -45,10 +45,10 @@
 import javax.lang.model.type.TypeMirror;
 import javax.lang.model.type.TypeVisitor;
 import javax.lang.model.util.ElementFilter;
-import javax.lang.model.util.SimpleTypeVisitor6;
+import javax.lang.model.util.SimpleTypeVisitor7;
 
 /*
- * <p><b>This is NOT part of any API supported by Sun Microsystems.
+ * <p><b>This is NOT part of any supported API.
  * If you write code that depends on this, you do so at your own
  * risk.  This code and its internal interfaces are subject to change
  * or deletion without notice.</b></p>
@@ -620,7 +620,7 @@
     }
 
     protected final boolean isLongOrDouble(TypeMirror t) {
-        TypeVisitor<Boolean,Void> v = new SimpleTypeVisitor6<Boolean,Void>() {
+        TypeVisitor<Boolean,Void> v = new SimpleTypeVisitor7<Boolean,Void>() {
             public Boolean defaultAction(TypeMirror t, Void p){
                 return false;
             }
--- a/langtools/src/share/classes/com/sun/tools/javah/Main.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/langtools/src/share/classes/com/sun/tools/javah/Main.java	Wed Jul 21 09:57:21 2010 -0700
@@ -30,8 +30,8 @@
 /**
  *  Main entry point.
  *
- *  <p><b>This is NOT part of any API supported by Sun Microsystems.  If
- *  you write code that depends on this, you do so at your own risk.
+ *  <p><b>This is NOT part of any supported API.
+ *  If you write code that depends on this, you do so at your own risk.
  *  This code and its internal interfaces are subject to change or
  *  deletion without notice.</b>
  */
--- a/langtools/src/share/classes/com/sun/tools/javah/Mangle.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/langtools/src/share/classes/com/sun/tools/javah/Mangle.java	Wed Jul 21 09:57:21 2010 -0700
@@ -37,7 +37,7 @@
  * this more fine grained and distribute the functionality to the
  * generators.
  *
- * <p><b>This is NOT part of any API supported by Sun Microsystems.
+ * <p><b>This is NOT part of any supported API.
  * If you write code that depends on this, you do so at your own
  * risk.  This code and its internal interfaces are subject to change
  * or deletion without notice.</b></p>
--- a/langtools/src/share/classes/com/sun/tools/javah/NativeHeaderTool.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/langtools/src/share/classes/com/sun/tools/javah/NativeHeaderTool.java	Wed Jul 21 09:57:21 2010 -0700
@@ -44,8 +44,8 @@
  * @see JavaFileManager
  * @since 1.7
  *
- *  <p><b>This is NOT part of any API supported by Sun Microsystems.  If
- *  you write code that depends on this, you do so at your own risk.
+ *  <p><b>This is NOT part of any supported API.
+ *  If you write code that depends on this, you do so at your own risk.
  *  This code and its internal interfaces are subject to change or
  *  deletion without notice.</b>
  */
--- a/langtools/src/share/classes/com/sun/tools/javah/TypeSignature.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/langtools/src/share/classes/com/sun/tools/javah/TypeSignature.java	Wed Jul 21 09:57:21 2010 -0700
@@ -38,12 +38,12 @@
 import javax.lang.model.type.TypeVariable;
 import javax.lang.model.type.TypeVisitor;
 import javax.lang.model.util.Elements;
-import javax.lang.model.util.SimpleTypeVisitor6;
+import javax.lang.model.util.SimpleTypeVisitor7;
 
 /**
  * Returns internal type signature.
  *
- * <p><b>This is NOT part of any API supported by Sun Microsystems.
+ * <p><b>This is NOT part of any supported API.
  * If you write code that depends on this, you do so at your own
  * risk.  This code and its internal interfaces are subject to change
  * or deletion without notice.</b></p>
@@ -239,7 +239,7 @@
 
 
     String qualifiedTypeName(TypeMirror type) {
-        TypeVisitor<Name, Void> v = new SimpleTypeVisitor6<Name, Void>() {
+        TypeVisitor<Name, Void> v = new SimpleTypeVisitor7<Name, Void>() {
             @Override
             public Name visitArray(ArrayType t, Void p) {
                 return t.getComponentType().accept(this, p);
--- a/langtools/src/share/classes/com/sun/tools/javah/Util.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/langtools/src/share/classes/com/sun/tools/javah/Util.java	Wed Jul 21 09:57:21 2010 -0700
@@ -44,7 +44,7 @@
  *      bug   -- Bug has occurred in javah
  *      fatal -- We can't even find resources, so bail fast, don't localize
  *
- * <p><b>This is NOT part of any API supported by Sun Microsystems.
+ * <p><b>This is NOT part of any supported API.
  * If you write code that depends on this, you do so at your own
  * risk.  This code and its internal interfaces are subject to change
  * or deletion without notice.</b></p>
--- a/langtools/src/share/classes/com/sun/tools/javap/AnnotationWriter.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/langtools/src/share/classes/com/sun/tools/javap/AnnotationWriter.java	Wed Jul 21 09:57:21 2010 -0700
@@ -40,8 +40,8 @@
 /**
  *  A writer for writing annotations as text.
  *
- *  <p><b>This is NOT part of any API supported by Sun Microsystems.  If
- *  you write code that depends on this, you do so at your own risk.
+ *  <p><b>This is NOT part of any supported API.
+ *  If you write code that depends on this, you do so at your own risk.
  *  This code and its internal interfaces are subject to change or
  *  deletion without notice.</b>
  */
--- a/langtools/src/share/classes/com/sun/tools/javap/AttributeWriter.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/langtools/src/share/classes/com/sun/tools/javap/AttributeWriter.java	Wed Jul 21 09:57:21 2010 -0700
@@ -64,8 +64,8 @@
 /*
  *  A writer for writing Attributes as text.
  *
- *  <p><b>This is NOT part of any API supported by Sun Microsystems.  If
- *  you write code that depends on this, you do so at your own risk.
+ *  <p><b>This is NOT part of any supported API.
+ *  If you write code that depends on this, you do so at your own risk.
  *  This code and its internal interfaces are subject to change or
  *  deletion without notice.</b>
  */
--- a/langtools/src/share/classes/com/sun/tools/javap/BasicWriter.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/langtools/src/share/classes/com/sun/tools/javap/BasicWriter.java	Wed Jul 21 09:57:21 2010 -0700
@@ -35,8 +35,8 @@
  *  A writer similar to a PrintWriter but which does not hide exceptions.
  *  The standard print calls are line-buffered; report calls write messages directly.
  *
- *  <p><b>This is NOT part of any API supported by Sun Microsystems.  If
- *  you write code that depends on this, you do so at your own risk.
+ *  <p><b>This is NOT part of any supported API.
+ *  If you write code that depends on this, you do so at your own risk.
  *  This code and its internal interfaces are subject to change or
  *  deletion without notice.</b>
  */
--- a/langtools/src/share/classes/com/sun/tools/javap/ClassWriter.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/langtools/src/share/classes/com/sun/tools/javap/ClassWriter.java	Wed Jul 21 09:57:21 2010 -0700
@@ -54,8 +54,8 @@
 /*
  *  The main javap class to write the contents of a class file as text.
  *
- *  <p><b>This is NOT part of any API supported by Sun Microsystems.  If
- *  you write code that depends on this, you do so at your own risk.
+ *  <p><b>This is NOT part of any supported API.
+ *  If you write code that depends on this, you do so at your own risk.
  *  This code and its internal interfaces are subject to change or
  *  deletion without notice.</b>
  */
--- a/langtools/src/share/classes/com/sun/tools/javap/CodeWriter.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/langtools/src/share/classes/com/sun/tools/javap/CodeWriter.java	Wed Jul 21 09:57:21 2010 -0700
@@ -40,8 +40,8 @@
 /*
  *  Write the contents of a Code attribute.
  *
- *  <p><b>This is NOT part of any API supported by Sun Microsystems.  If
- *  you write code that depends on this, you do so at your own risk.
+ *  <p><b>This is NOT part of any supported API.
+ *  If you write code that depends on this, you do so at your own risk.
  *  This code and its internal interfaces are subject to change or
  *  deletion without notice.</b>
  */
--- a/langtools/src/share/classes/com/sun/tools/javap/ConstantWriter.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/langtools/src/share/classes/com/sun/tools/javap/ConstantWriter.java	Wed Jul 21 09:57:21 2010 -0700
@@ -34,8 +34,8 @@
 /*
  *  Write a constant pool entry.
  *
- *  <p><b>This is NOT part of any API supported by Sun Microsystems.  If
- *  you write code that depends on this, you do so at your own risk.
+ *  <p><b>This is NOT part of any supported API.
+ *  If you write code that depends on this, you do so at your own risk.
  *  This code and its internal interfaces are subject to change or
  *  deletion without notice.</b>
  */
--- a/langtools/src/share/classes/com/sun/tools/javap/Context.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/langtools/src/share/classes/com/sun/tools/javap/Context.java	Wed Jul 21 09:57:21 2010 -0700
@@ -31,8 +31,8 @@
 /*
  *  Class from which to put/get shared resources.
  *
- *  <p><b>This is NOT part of any API supported by Sun Microsystems.  If
- *  you write code that depends on this, you do so at your own risk.
+ *  <p><b>This is NOT part of any supported API.
+ *  If you write code that depends on this, you do so at your own risk.
  *  This code and its internal interfaces are subject to change or
  *  deletion without notice.</b>
  */
--- a/langtools/src/share/classes/com/sun/tools/javap/DisassemblerTool.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/langtools/src/share/classes/com/sun/tools/javap/DisassemblerTool.java	Wed Jul 21 09:57:21 2010 -0700
@@ -44,8 +44,8 @@
  * @see JavaFileManager
  * @since 1.7
  *
- *  <p><b>This is NOT part of any API supported by Sun Microsystems.  If
- *  you write code that depends on this, you do so at your own risk.
+ *  <p><b>This is NOT part of any supported API.
+ *  If you write code that depends on this, you do so at your own risk.
  *  This code and its internal interfaces are subject to change or
  *  deletion without notice.</b>
  */
--- a/langtools/src/share/classes/com/sun/tools/javap/InstructionDetailWriter.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/langtools/src/share/classes/com/sun/tools/javap/InstructionDetailWriter.java	Wed Jul 21 09:57:21 2010 -0700
@@ -31,8 +31,8 @@
 /*
  *  Write additional details for an instruction.
  *
- *  <p><b>This is NOT part of any API supported by Sun Microsystems.  If
- *  you write code that depends on this, you do so at your own risk.
+ *  <p><b>This is NOT part of any supported API.
+ *  If you write code that depends on this, you do so at your own risk.
  *  This code and its internal interfaces are subject to change or
  *  deletion without notice.</b>
  */
--- a/langtools/src/share/classes/com/sun/tools/javap/InternalError.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/langtools/src/share/classes/com/sun/tools/javap/InternalError.java	Wed Jul 21 09:57:21 2010 -0700
@@ -26,8 +26,8 @@
 package com.sun.tools.javap;
 
 /**
- *  <p><b>This is NOT part of any API supported by Sun Microsystems.  If
- *  you write code that depends on this, you do so at your own risk.
+ *  <p><b>This is NOT part of any supported API.
+ *  If you write code that depends on this, you do so at your own risk.
  *  This code and its internal interfaces are subject to change or
  *  deletion without notice.</b>
  */
--- a/langtools/src/share/classes/com/sun/tools/javap/JavapFileManager.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/langtools/src/share/classes/com/sun/tools/javap/JavapFileManager.java	Wed Jul 21 09:57:21 2010 -0700
@@ -36,8 +36,8 @@
 /**
  *  javap's implementation of JavaFileManager.
  *
- *  <p><b>This is NOT part of any API supported by Sun Microsystems.  If
- *  you write code that depends on this, you do so at your own risk.
+ *  <p><b>This is NOT part of any supported API.
+ *  If you write code that depends on this, you do so at your own risk.
  *  This code and its internal interfaces are subject to change or
  *  deletion without notice.</b>
  */
--- a/langtools/src/share/classes/com/sun/tools/javap/JavapTask.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/langtools/src/share/classes/com/sun/tools/javap/JavapTask.java	Wed Jul 21 09:57:21 2010 -0700
@@ -69,8 +69,8 @@
  *  "Main" class for javap, normally accessed from the command line
  *  via Main, or from JSR199 via DisassemblerTool.
  *
- *  <p><b>This is NOT part of any API supported by Sun Microsystems.  If
- *  you write code that depends on this, you do so at your own risk.
+ *  <p><b>This is NOT part of any supported API.
+ *  If you write code that depends on this, you do so at your own risk.
  *  This code and its internal interfaces are subject to change or
  *  deletion without notice.</b>
  */
--- a/langtools/src/share/classes/com/sun/tools/javap/LocalVariableTableWriter.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/langtools/src/share/classes/com/sun/tools/javap/LocalVariableTableWriter.java	Wed Jul 21 09:57:21 2010 -0700
@@ -42,8 +42,8 @@
 /**
  * Annotate instructions with details about local variables.
  *
- *  <p><b>This is NOT part of any API supported by Sun Microsystems.  If
- *  you write code that depends on this, you do so at your own risk.
+ *  <p><b>This is NOT part of any supported API.
+ *  If you write code that depends on this, you do so at your own risk.
  *  This code and its internal interfaces are subject to change or
  *  deletion without notice.</b>
  */
--- a/langtools/src/share/classes/com/sun/tools/javap/LocalVariableTypeTableWriter.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/langtools/src/share/classes/com/sun/tools/javap/LocalVariableTypeTableWriter.java	Wed Jul 21 09:57:21 2010 -0700
@@ -43,8 +43,8 @@
 /**
  * Annotate instructions with details about local variables.
  *
- *  <p><b>This is NOT part of any API supported by Sun Microsystems.  If
- *  you write code that depends on this, you do so at your own risk.
+ *  <p><b>This is NOT part of any supported API.
+ *  If you write code that depends on this, you do so at your own risk.
  *  This code and its internal interfaces are subject to change or
  *  deletion without notice.</b>
  */
--- a/langtools/src/share/classes/com/sun/tools/javap/Main.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/langtools/src/share/classes/com/sun/tools/javap/Main.java	Wed Jul 21 09:57:21 2010 -0700
@@ -30,8 +30,8 @@
 /**
  *  Main entry point.
  *
- *  <p><b>This is NOT part of any API supported by Sun Microsystems.  If
- *  you write code that depends on this, you do so at your own risk.
+ *  <p><b>This is NOT part of any supported API.
+ *  If you write code that depends on this, you do so at your own risk.
  *  This code and its internal interfaces are subject to change or
  *  deletion without notice.</b>
  */
--- a/langtools/src/share/classes/com/sun/tools/javap/Messages.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/langtools/src/share/classes/com/sun/tools/javap/Messages.java	Wed Jul 21 09:57:21 2010 -0700
@@ -30,8 +30,8 @@
 /**
  *  Access to javap messages.
  *
- *  <p><b>This is NOT part of any API supported by Sun Microsystems.  If
- *  you write code that depends on this, you do so at your own risk.
+ *  <p><b>This is NOT part of any supported API.
+ *  If you write code that depends on this, you do so at your own risk.
  *  This code and its internal interfaces are subject to change or
  *  deletion without notice.</b>
  */
--- a/langtools/src/share/classes/com/sun/tools/javap/Options.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/langtools/src/share/classes/com/sun/tools/javap/Options.java	Wed Jul 21 09:57:21 2010 -0700
@@ -34,8 +34,8 @@
 /*
  *  Provides access to javap's options, set via the command line
  *  or JSR 199 API.
- *  <p><b>This is NOT part of any API supported by Sun Microsystems.  If
- *  you write code that depends on this, you do so at your own risk.
+ *  <p><b>This is NOT part of any supported API.
+ *  If you write code that depends on this, you do so at your own risk.
  *  This code and its internal interfaces are subject to change or
  *  deletion without notice.</b>
  */
--- a/langtools/src/share/classes/com/sun/tools/javap/SourceWriter.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/langtools/src/share/classes/com/sun/tools/javap/SourceWriter.java	Wed Jul 21 09:57:21 2010 -0700
@@ -52,8 +52,8 @@
 /**
  * Annotate instructions with source code.
  *
- *  <p><b>This is NOT part of any API supported by Sun Microsystems.  If
- *  you write code that depends on this, you do so at your own risk.
+ *  <p><b>This is NOT part of any supported API.
+ *  If you write code that depends on this, you do so at your own risk.
  *  This code and its internal interfaces are subject to change or
  *  deletion without notice.</b>
  */
--- a/langtools/src/share/classes/com/sun/tools/javap/StackMapWriter.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/langtools/src/share/classes/com/sun/tools/javap/StackMapWriter.java	Wed Jul 21 09:57:21 2010 -0700
@@ -45,8 +45,8 @@
 /**
  * Annotate instructions with stack map.
  *
- *  <p><b>This is NOT part of any API supported by Sun Microsystems.  If
- *  you write code that depends on this, you do so at your own risk.
+ *  <p><b>This is NOT part of any supported API.
+ *  If you write code that depends on this, you do so at your own risk.
  *  This code and its internal interfaces are subject to change or
  *  deletion without notice.</b>
  */
--- a/langtools/src/share/classes/com/sun/tools/javap/TryBlockWriter.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/langtools/src/share/classes/com/sun/tools/javap/TryBlockWriter.java	Wed Jul 21 09:57:21 2010 -0700
@@ -37,8 +37,8 @@
 /**
  * Annotate instructions with details about try blocks.
  *
- *  <p><b>This is NOT part of any API supported by Sun Microsystems.  If
- *  you write code that depends on this, you do so at your own risk.
+ *  <p><b>This is NOT part of any supported API.
+ *  If you write code that depends on this, you do so at your own risk.
  *  This code and its internal interfaces are subject to change or
  *  deletion without notice.</b>
  */
--- a/langtools/src/share/classes/com/sun/tools/javap/TypeAnnotationWriter.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/langtools/src/share/classes/com/sun/tools/javap/TypeAnnotationWriter.java	Wed Jul 21 09:57:21 2010 -0700
@@ -41,8 +41,8 @@
 /**
  * Annotate instructions with details about type annotations.
  *
- *  <p><b>This is NOT part of any API supported by Sun Microsystems.  If
- *  you write code that depends on this, you do so at your own risk.
+ *  <p><b>This is NOT part of any supported API.
+ *  If you write code that depends on this, you do so at your own risk.
  *  This code and its internal interfaces are subject to change or
  *  deletion without notice.</b>
  */
--- a/langtools/src/share/classes/javax/lang/model/element/ElementKind.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/langtools/src/share/classes/javax/lang/model/element/ElementKind.java	Wed Jul 21 09:57:21 2010 -0700
@@ -88,7 +88,13 @@
      * An implementation-reserved element.  This is not the element
      * you are looking for.
      */
-    OTHER;
+    OTHER,
+
+    /**
+     * A resource variable.
+     * @since 1.7
+     */
+    RESOURCE_VARIABLE;
 
 
     /**
--- a/langtools/src/share/classes/javax/lang/model/element/ElementVisitor.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/langtools/src/share/classes/javax/lang/model/element/ElementVisitor.java	Wed Jul 21 09:57:21 2010 -0700
@@ -62,6 +62,7 @@
  * @author Scott Seligman
  * @author Peter von der Ah&eacute;
  * @see AbstractElementVisitor6
+ * @see AbstractElementVisitor7
  * @since 1.6
  */
 public interface ElementVisitor<R, P> {
--- a/langtools/src/share/classes/javax/lang/model/type/MirroredTypeException.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/langtools/src/share/classes/javax/lang/model/type/MirroredTypeException.java	Wed Jul 21 09:57:21 2010 -0700
@@ -42,7 +42,7 @@
  * @see Element#getAnnotation(Class)
  * @since 1.6
  */
-public class MirroredTypeException extends RuntimeException {
+public class MirroredTypeException extends MirroredTypesException {
 
     private static final long serialVersionUID = 269;
 
@@ -54,7 +54,7 @@
      * @param type  the type being accessed
      */
     public MirroredTypeException(TypeMirror type) {
-        super("Attempt to access Class object for TypeMirror " + type.toString());
+        super("Attempt to access Class object for TypeMirror " + type.toString(), type);
         this.type = type;
     }
 
@@ -76,5 +76,6 @@
         throws IOException, ClassNotFoundException {
         s.defaultReadObject();
         type = null;
+        types = null;
     }
 }
--- a/langtools/src/share/classes/javax/lang/model/type/MirroredTypesException.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/langtools/src/share/classes/javax/lang/model/type/MirroredTypesException.java	Wed Jul 21 09:57:21 2010 -0700
@@ -49,7 +49,17 @@
 
     private static final long serialVersionUID = 269;
 
-    private transient List<? extends TypeMirror> types; // cannot be serialized
+    transient List<? extends TypeMirror> types; // cannot be serialized
+
+    /*
+     * Trusted constructor to be called by MirroredTypeException.
+     */
+    MirroredTypesException(String message, TypeMirror type) {
+        super(message);
+        List<TypeMirror> tmp = (new ArrayList<TypeMirror>());
+        tmp.add(type);
+        types = Collections.unmodifiableList(tmp);
+    }
 
     /**
      * Constructs a new MirroredTypesException for the specified types.
--- a/langtools/src/share/classes/javax/lang/model/util/AbstractAnnotationValueVisitor6.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/langtools/src/share/classes/javax/lang/model/util/AbstractAnnotationValueVisitor6.java	Wed Jul 21 09:57:21 2010 -0700
@@ -62,6 +62,8 @@
  * @author Joseph D. Darcy
  * @author Scott Seligman
  * @author Peter von der Ah&eacute;
+ *
+ * @see AbstractAnnotationValueVisitor7
  * @since 1.6
  */
 @SupportedSourceVersion(RELEASE_6)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/src/share/classes/javax/lang/model/util/AbstractAnnotationValueVisitor7.java	Wed Jul 21 09:57:21 2010 -0700
@@ -0,0 +1,73 @@
+/*
+ * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package javax.lang.model.util;
+
+import java.util.List;
+import javax.lang.model.element.*;
+
+import javax.lang.model.type.TypeMirror;
+import static javax.lang.model.SourceVersion.*;
+import javax.lang.model.SourceVersion;
+import javax.annotation.processing.SupportedSourceVersion;
+
+/**
+ * A skeletal visitor for annotation values with default behavior
+ * appropriate for the {@link SourceVersion#RELEASE_7 RELEASE_7}
+ * source version.
+ *
+ * <p> <b>WARNING:</b> The {@code AnnotationValueVisitor} interface
+ * implemented by this class may have methods added to it in the
+ * future to accommodate new, currently unknown, language structures
+ * added to future versions of the Java&trade; programming language.
+ * Therefore, methods whose names begin with {@code "visit"} may be
+ * added to this class in the future; to avoid incompatibilities,
+ * classes which extend this class should not declare any instance
+ * methods with names beginning with {@code "visit"}.
+ *
+ * <p>When such a new visit method is added, the default
+ * implementation in this class will be to call the {@link
+ * #visitUnknown visitUnknown} method.  A new abstract annotation
+ * value visitor class will also be introduced to correspond to the
+ * new language level; this visitor will have different default
+ * behavior for the visit method in question.  When the new visitor is
+ * introduced, all or portions of this visitor may be deprecated.
+ *
+ * @param <R> the return type of this visitor's methods
+ * @param <P> the type of the additional parameter to this visitor's methods.
+ *
+ * @see AbstractAnnotationValueVisitor6
+ * @since 1.7
+ */
+@SupportedSourceVersion(RELEASE_7)
+public abstract class AbstractAnnotationValueVisitor7<R, P> extends AbstractAnnotationValueVisitor6<R, P> {
+
+    /**
+     * Constructor for concrete subclasses to call.
+     */
+    protected AbstractAnnotationValueVisitor7() {
+        super();
+    }
+}
--- a/langtools/src/share/classes/javax/lang/model/util/AbstractElementVisitor6.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/langtools/src/share/classes/javax/lang/model/util/AbstractElementVisitor6.java	Wed Jul 21 09:57:21 2010 -0700
@@ -65,6 +65,8 @@
  * @author Joseph D. Darcy
  * @author Scott Seligman
  * @author Peter von der Ah&eacute;
+ *
+ * @see AbstractElementVisitor7
  * @since 1.6
  */
 @SupportedSourceVersion(RELEASE_6)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/src/share/classes/javax/lang/model/util/AbstractElementVisitor7.java	Wed Jul 21 09:57:21 2010 -0700
@@ -0,0 +1,75 @@
+/*
+ * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package javax.lang.model.util;
+
+import javax.lang.model.element.*;
+import javax.annotation.processing.SupportedSourceVersion;
+import javax.lang.model.element.*;
+import static javax.lang.model.element.ElementKind.*;
+import static javax.lang.model.SourceVersion.*;
+import javax.lang.model.SourceVersion;
+
+
+/**
+ * A skeletal visitor of program elements with default behavior
+ * appropriate for the {@link SourceVersion#RELEASE_7 RELEASE_7}
+ * source version.
+ *
+ * <p> <b>WARNING:</b> The {@code ElementVisitor} interface
+ * implemented by this class may have methods added to it in the
+ * future to accommodate new, currently unknown, language structures
+ * added to future versions of the Java&trade; programming language.
+ * Therefore, methods whose names begin with {@code "visit"} may be
+ * added to this class in the future; to avoid incompatibilities,
+ * classes which extend this class should not declare any instance
+ * methods with names beginning with {@code "visit"}.
+ *
+ * <p>When such a new visit method is added, the default
+ * implementation in this class will be to call the {@link
+ * #visitUnknown visitUnknown} method.  A new abstract element visitor
+ * class will also be introduced to correspond to the new language
+ * level; this visitor will have different default behavior for the
+ * visit method in question.  When the new visitor is introduced, all
+ * or portions of this visitor may be deprecated.
+ *
+ * @param <R> the return type of this visitor's methods.  Use {@link
+ *            Void} for visitors that do not need to return results.
+ * @param <P> the type of the additional parameter to this visitor's
+ *            methods.  Use {@code Void} for visitors that do not need an
+ *            additional parameter.
+ *
+ * @see AbstractElementVisitor6
+ * @since 1.7
+ */
+@SupportedSourceVersion(RELEASE_7)
+public abstract class AbstractElementVisitor7<R, P> extends AbstractElementVisitor6<R, P> {
+    /**
+     * Constructor for concrete subclasses to call.
+     */
+    protected AbstractElementVisitor7(){
+        super();
+    }
+}
--- a/langtools/src/share/classes/javax/lang/model/util/AbstractTypeVisitor6.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/langtools/src/share/classes/javax/lang/model/util/AbstractTypeVisitor6.java	Wed Jul 21 09:57:21 2010 -0700
@@ -57,6 +57,8 @@
  * @author Joseph D. Darcy
  * @author Scott Seligman
  * @author Peter von der Ah&eacute;
+ *
+ * @see AbstractTypeVisitor7
  * @since 1.6
  */
 public abstract class AbstractTypeVisitor6<R, P> implements TypeVisitor<R, P> {
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/src/share/classes/javax/lang/model/util/AbstractTypeVisitor7.java	Wed Jul 21 09:57:21 2010 -0700
@@ -0,0 +1,67 @@
+/*
+ * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package javax.lang.model.util;
+
+import javax.lang.model.type.*;
+
+/**
+ * A skeletal visitor of types with default behavior appropriate for
+ * the version 7 language level.
+ *
+ * <p> <b>WARNING:</b> The {@code TypeVisitor} interface implemented
+ * by this class may have methods added to it in the future to
+ * accommodate new, currently unknown, language structures added to
+ * future versions of the Java&trade; programming language.
+ * Therefore, methods whose names begin with {@code "visit"} may be
+ * added to this class in the future; to avoid incompatibilities,
+ * classes which extend this class should not declare any instance
+ * methods with names beginning with {@code "visit"}.
+ *
+ * <p>When such a new visit method is added, the default
+ * implementation in this class will be to call the {@link
+ * #visitUnknown visitUnknown} method.  A new abstract type visitor
+ * class will also be introduced to correspond to the new language
+ * level; this visitor will have different default behavior for the
+ * visit method in question.  When the new visitor is introduced, all
+ * or portions of this visitor may be deprecated.
+ *
+ * @param <R> the return type of this visitor's methods.  Use {@link
+ *            Void} for visitors that do not need to return results.
+ * @param <P> the type of the additional parameter to this visitor's
+ *            methods.  Use {@code Void} for visitors that do not need an
+ *            additional parameter.
+ *
+ * @see AbstractTypeVisitor6
+ * @since 1.7
+ */
+public abstract class AbstractTypeVisitor7<R, P> extends AbstractTypeVisitor6<R, P> {
+    /**
+     * Constructor for concrete subclasses to call.
+     */
+    protected AbstractTypeVisitor7() {
+        super();
+    }
+}
--- a/langtools/src/share/classes/javax/lang/model/util/ElementKindVisitor6.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/langtools/src/share/classes/javax/lang/model/util/ElementKindVisitor6.java	Wed Jul 21 09:57:21 2010 -0700
@@ -76,6 +76,8 @@
  * @author Joseph D. Darcy
  * @author Scott Seligman
  * @author Peter von der Ah&eacute;
+ *
+ * @see ElementKindVisitor7
  * @since 1.6
  */
 @SupportedSourceVersion(RELEASE_6)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/src/share/classes/javax/lang/model/util/ElementKindVisitor7.java	Wed Jul 21 09:57:21 2010 -0700
@@ -0,0 +1,97 @@
+/*
+ * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package javax.lang.model.util;
+
+import javax.lang.model.element.*;
+import static javax.lang.model.element.ElementKind.*;
+import javax.annotation.processing.SupportedSourceVersion;
+import static javax.lang.model.SourceVersion.*;
+import javax.lang.model.SourceVersion;
+
+/**
+ * A visitor of program elements based on their {@linkplain
+ * ElementKind kind} with default behavior appropriate for the {@link
+ * SourceVersion#RELEASE_6 RELEASE_6} source version.  For {@linkplain
+ * Element elements} <tt><i>XYZ</i></tt> that may have more than one
+ * kind, the <tt>visit<i>XYZ</i></tt> methods in this class delegate
+ * to the <tt>visit<i>XYZKind</i></tt> method corresponding to the
+ * first argument's kind.  The <tt>visit<i>XYZKind</i></tt> methods
+ * call {@link #defaultAction defaultAction}, passing their arguments
+ * to {@code defaultAction}'s corresponding parameters.
+ *
+ * <p> Methods in this class may be overridden subject to their
+ * general contract.  Note that annotating methods in concrete
+ * subclasses with {@link java.lang.Override @Override} will help
+ * ensure that methods are overridden as intended.
+ *
+ * <p> <b>WARNING:</b> The {@code ElementVisitor} interface
+ * implemented by this class may have methods added to it or the
+ * {@code ElementKind} {@code enum} used in this case may have
+ * constants added to it in the future to accommodate new, currently
+ * unknown, language structures added to future versions of the
+ * Java&trade; programming language.  Therefore, methods whose names
+ * begin with {@code "visit"} may be added to this class in the
+ * future; to avoid incompatibilities, classes which extend this class
+ * should not declare any instance methods with names beginning with
+ * {@code "visit"}.
+ *
+ * <p>When such a new visit method is added, the default
+ * implementation in this class will be to call the {@link
+ * #visitUnknown visitUnknown} method.  A new abstract element kind
+ * visitor class will also be introduced to correspond to the new
+ * language level; this visitor will have different default behavior
+ * for the visit method in question.  When the new visitor is
+ * introduced, all or portions of this visitor may be deprecated.
+ *
+ * @param <R> the return type of this visitor's methods.  Use {@link
+ *            Void} for visitors that do not need to return results.
+ * @param <P> the type of the additional parameter to this visitor's
+ *            methods.  Use {@code Void} for visitors that do not need an
+ *            additional parameter.
+ *
+ * @see ElementKindVisitor6
+ * @since 1.7
+ */
+@SupportedSourceVersion(RELEASE_7)
+public class ElementKindVisitor7<R, P> extends ElementKindVisitor6<R, P> {
+    /**
+     * Constructor for concrete subclasses; uses {@code null} for the
+     * default value.
+     */
+    protected ElementKindVisitor7() {
+        super(null);
+    }
+
+    /**
+     * Constructor for concrete subclasses; uses the argument for the
+     * default value.
+     *
+     * @param defaultValue the value to assign to {@link #DEFAULT_VALUE}
+     */
+    protected ElementKindVisitor7(R defaultValue) {
+        super(defaultValue);
+    }
+}
--- a/langtools/src/share/classes/javax/lang/model/util/ElementScanner6.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/langtools/src/share/classes/javax/lang/model/util/ElementScanner6.java	Wed Jul 21 09:57:21 2010 -0700
@@ -88,6 +88,8 @@
  * @author Joseph D. Darcy
  * @author Scott Seligman
  * @author Peter von der Ah&eacute;
+ *
+ * @see ElementScanner7
  * @since 1.6
  */
 @SupportedSourceVersion(RELEASE_6)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/src/share/classes/javax/lang/model/util/ElementScanner7.java	Wed Jul 21 09:57:21 2010 -0700
@@ -0,0 +1,108 @@
+/*
+ * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package javax.lang.model.util;
+
+import javax.lang.model.element.*;
+import javax.annotation.processing.SupportedSourceVersion;
+import static javax.lang.model.element.ElementKind.*;
+import javax.lang.model.SourceVersion;
+import static javax.lang.model.SourceVersion.*;
+
+
+/**
+ * A scanning visitor of program elements with default behavior
+ * appropriate for the {@link SourceVersion#RELEASE_7 RELEASE_7}
+ * source version.  The <tt>visit<i>XYZ</i></tt> methods in this
+ * class scan their component elements by calling {@code scan} on
+ * their {@linkplain Element#getEnclosedElements enclosed elements},
+ * {@linkplain ExecutableElement#getParameters parameters}, etc., as
+ * indicated in the individual method specifications.  A subclass can
+ * control the order elements are visited by overriding the
+ * <tt>visit<i>XYZ</i></tt> methods.  Note that clients of a scanner
+ * may get the desired behavior be invoking {@code v.scan(e, p)} rather
+ * than {@code v.visit(e, p)} on the root objects of interest.
+ *
+ * <p>When a subclass overrides a <tt>visit<i>XYZ</i></tt> method, the
+ * new method can cause the enclosed elements to be scanned in the
+ * default way by calling <tt>super.visit<i>XYZ</i></tt>.  In this
+ * fashion, the concrete visitor can control the ordering of traversal
+ * over the component elements with respect to the additional
+ * processing; for example, consistently calling
+ * <tt>super.visit<i>XYZ</i></tt> at the start of the overridden
+ * methods will yield a preorder traversal, etc.  If the component
+ * elements should be traversed in some other order, instead of
+ * calling <tt>super.visit<i>XYZ</i></tt>, an overriding visit method
+ * should call {@code scan} with the elements in the desired order.
+ *
+ * <p> Methods in this class may be overridden subject to their
+ * general contract.  Note that annotating methods in concrete
+ * subclasses with {@link java.lang.Override @Override} will help
+ * ensure that methods are overridden as intended.
+ *
+ * <p> <b>WARNING:</b> The {@code ElementVisitor} interface
+ * implemented by this class may have methods added to it in the
+ * future to accommodate new, currently unknown, language structures
+ * added to future versions of the Java&trade; programming language.
+ * Therefore, methods whose names begin with {@code "visit"} may be
+ * added to this class in the future; to avoid incompatibilities,
+ * classes which extend this class should not declare any instance
+ * methods with names beginning with {@code "visit"}.
+ *
+ * <p>When such a new visit method is added, the default
+ * implementation in this class will be to call the {@link
+ * #visitUnknown visitUnknown} method.  A new element scanner visitor
+ * class will also be introduced to correspond to the new language
+ * level; this visitor will have different default behavior for the
+ * visit method in question.  When the new visitor is introduced, all
+ * or portions of this visitor may be deprecated.
+ *
+ * @param <R> the return type of this visitor's methods.  Use {@link
+ *            Void} for visitors that do not need to return results.
+ * @param <P> the type of the additional parameter to this visitor's
+ *            methods.  Use {@code Void} for visitors that do not need an
+ *            additional parameter.
+ *
+ * @see ElementScanner6
+ * @since 1.7
+ */
+@SupportedSourceVersion(RELEASE_7)
+public class ElementScanner7<R, P> extends ElementScanner6<R, P> {
+    /**
+     * Constructor for concrete subclasses; uses {@code null} for the
+     * default value.
+     */
+    protected ElementScanner7(){
+        super(null);
+    }
+
+    /**
+     * Constructor for concrete subclasses; uses the argument for the
+     * default value.
+     */
+    protected ElementScanner7(R defaultValue){
+        super(defaultValue);
+    }
+}
--- a/langtools/src/share/classes/javax/lang/model/util/SimpleAnnotationValueVisitor6.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/langtools/src/share/classes/javax/lang/model/util/SimpleAnnotationValueVisitor6.java	Wed Jul 21 09:57:21 2010 -0700
@@ -69,6 +69,8 @@
  * @author Joseph D. Darcy
  * @author Scott Seligman
  * @author Peter von der Ah&eacute;
+ *
+ * @see SimpleAnnotationValueVisitor7
  * @since 1.6
  */
 @SupportedSourceVersion(RELEASE_6)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/src/share/classes/javax/lang/model/util/SimpleAnnotationValueVisitor7.java	Wed Jul 21 09:57:21 2010 -0700
@@ -0,0 +1,90 @@
+/*
+ * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package javax.lang.model.util;
+
+import java.util.List;
+import javax.lang.model.element.*;
+
+import javax.lang.model.type.TypeMirror;
+import static javax.lang.model.SourceVersion.*;
+import javax.lang.model.SourceVersion;
+import javax.annotation.processing.SupportedSourceVersion;
+
+/**
+ * A simple visitor for annotation values with default behavior
+ * appropriate for the {@link SourceVersion#RELEASE_7 RELEASE_7}
+ * source version.  Visit methods call {@link
+ * #defaultAction} passing their arguments to {@code defaultAction}'s
+ * corresponding parameters.
+ *
+ * <p> Methods in this class may be overridden subject to their
+ * general contract.  Note that annotating methods in concrete
+ * subclasses with {@link java.lang.Override @Override} will help
+ * ensure that methods are overridden as intended.
+ *
+ * <p> <b>WARNING:</b> The {@code AnnotationValueVisitor} interface
+ * implemented by this class may have methods added to it in the
+ * future to accommodate new, currently unknown, language structures
+ * added to future versions of the Java&trade; programming language.
+ * Therefore, methods whose names begin with {@code "visit"} may be
+ * added to this class in the future; to avoid incompatibilities,
+ * classes which extend this class should not declare any instance
+ * methods with names beginning with {@code "visit"}.
+ *
+ * <p>When such a new visit method is added, the default
+ * implementation in this class will be to call the {@link
+ * #visitUnknown visitUnknown} method.  A new simple annotation
+ * value visitor class will also be introduced to correspond to the
+ * new language level; this visitor will have different default
+ * behavior for the visit method in question.  When the new visitor is
+ * introduced, all or portions of this visitor may be deprecated.
+ *
+ * @param <R> the return type of this visitor's methods
+ * @param <P> the type of the additional parameter to this visitor's methods.
+ *
+ * @see SimpleAnnotationValueVisitor6
+ * @since 1.7
+ */
+@SupportedSourceVersion(RELEASE_7)
+public class SimpleAnnotationValueVisitor7<R, P> extends SimpleAnnotationValueVisitor6<R, P> {
+    /**
+     * Constructor for concrete subclasses; uses {@code null} for the
+     * default value.
+     */
+    protected SimpleAnnotationValueVisitor7() {
+        super(null);
+    }
+
+    /**
+     * Constructor for concrete subclasses; uses the argument for the
+     * default value.
+     *
+     * @param defaultValue the value to assign to {@link #DEFAULT_VALUE}
+     */
+    protected SimpleAnnotationValueVisitor7(R defaultValue) {
+        super(defaultValue);
+    }
+}
--- a/langtools/src/share/classes/javax/lang/model/util/SimpleElementVisitor6.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/langtools/src/share/classes/javax/lang/model/util/SimpleElementVisitor6.java	Wed Jul 21 09:57:21 2010 -0700
@@ -71,6 +71,8 @@
  * @author Joseph D. Darcy
  * @author Scott Seligman
  * @author Peter von der Ah&eacute;
+ *
+ * @see SimpleElementVisitor7
  * @since 1.6
  */
 @SupportedSourceVersion(RELEASE_6)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/src/share/classes/javax/lang/model/util/SimpleElementVisitor7.java	Wed Jul 21 09:57:21 2010 -0700
@@ -0,0 +1,92 @@
+/*
+ * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package javax.lang.model.util;
+
+import javax.lang.model.element.*;
+import javax.annotation.processing.SupportedSourceVersion;
+import static javax.lang.model.element.ElementKind.*;
+import javax.lang.model.SourceVersion;
+import static javax.lang.model.SourceVersion.*;
+
+/**
+ * A simple visitor of program elements with default behavior
+ * appropriate for the {@link SourceVersion#RELEASE_7 RELEASE_7}
+ * source version.
+ *
+ * Visit methods corresponding to {@code RELEASE_7} language
+ * constructs call {@link #defaultAction}, passing their arguments to
+ * {@code defaultAction}'s corresponding parameters.
+ *
+ * <p> Methods in this class may be overridden subject to their
+ * general contract.  Note that annotating methods in concrete
+ * subclasses with {@link java.lang.Override @Override} will help
+ * ensure that methods are overridden as intended.
+ *
+ * <p> <b>WARNING:</b> The {@code ElementVisitor} interface
+ * implemented by this class may have methods added to it in the
+ * future to accommodate new, currently unknown, language structures
+ * added to future versions of the Java&trade; programming language.
+ * Therefore, methods whose names begin with {@code "visit"} may be
+ * added to this class in the future; to avoid incompatibilities,
+ * classes which extend this class should not declare any instance
+ * methods with names beginning with {@code "visit"}.
+ *
+ * <p>When such a new visit method is added, the default
+ * implementation in this class will be to call the {@link
+ * #visitUnknown visitUnknown} method.  A new simple element visitor
+ * class will also be introduced to correspond to the new language
+ * level; this visitor will have different default behavior for the
+ * visit method in question.  When the new visitor is introduced, all
+ * or portions of this visitor may be deprecated.
+ *
+ * @param <R> the return type of this visitor's methods.  Use {@code Void}
+ *             for visitors that do not need to return results.
+ * @param <P> the type of the additional parameter to this visitor's methods.  Use {@code Void}
+ *              for visitors that do not need an additional parameter.
+ *
+ * @see SimpleElementVisitor6
+ * @since 1.7
+ */
+@SupportedSourceVersion(RELEASE_7)
+public class SimpleElementVisitor7<R, P> extends SimpleElementVisitor6<R, P> {
+    /**
+     * Constructor for concrete subclasses; uses {@code null} for the
+     * default value.
+     */
+    protected SimpleElementVisitor7(){
+        super(null);
+    }
+
+    /**
+     * Constructor for concrete subclasses; uses the argument for the
+     * default value.
+     *
+     * @param defaultValue the value to assign to {@link #DEFAULT_VALUE}
+     */
+    protected SimpleElementVisitor7(R defaultValue){
+        super(defaultValue);
+    }
+}
--- a/langtools/src/share/classes/javax/lang/model/util/SimpleTypeVisitor6.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/langtools/src/share/classes/javax/lang/model/util/SimpleTypeVisitor6.java	Wed Jul 21 09:57:21 2010 -0700
@@ -70,6 +70,8 @@
  * @author Joseph D. Darcy
  * @author Scott Seligman
  * @author Peter von der Ah&eacute;
+ *
+ * @see SimpleTypeVisitor7
  * @since 1.6
  */
 @SupportedSourceVersion(RELEASE_6)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/src/share/classes/javax/lang/model/util/SimpleTypeVisitor7.java	Wed Jul 21 09:57:21 2010 -0700
@@ -0,0 +1,91 @@
+/*
+ * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package javax.lang.model.util;
+
+import javax.lang.model.type.*;
+import javax.annotation.processing.SupportedSourceVersion;
+import javax.lang.model.SourceVersion;
+import static javax.lang.model.SourceVersion.*;
+
+/**
+ * A simple visitor of types with default behavior appropriate for the
+ * {@link SourceVersion#RELEASE_7 RELEASE_7} source version.
+ *
+ * Visit methods corresponding to {@code RELEASE_7} language
+ * constructs call {@link #defaultAction}, passing their arguments to
+ * {@code defaultAction}'s corresponding parameters.
+ *
+ * <p> Methods in this class may be overridden subject to their
+ * general contract.  Note that annotating methods in concrete
+ * subclasses with {@link java.lang.Override @Override} will help
+ * ensure that methods are overridden as intended.
+ *
+ * <p> <b>WARNING:</b> The {@code TypeVisitor} interface implemented
+ * by this class may have methods added to it in the future to
+ * accommodate new, currently unknown, language structures added to
+ * future versions of the Java&trade; programming language.
+ * Therefore, methods whose names begin with {@code "visit"} may be
+ * added to this class in the future; to avoid incompatibilities,
+ * classes which extend this class should not declare any instance
+ * methods with names beginning with {@code "visit"}.
+ *
+ * <p>When such a new visit method is added, the default
+ * implementation in this class will be to call the {@link
+ * #visitUnknown visitUnknown} method.  A new simple type visitor
+ * class will also be introduced to correspond to the new language
+ * level; this visitor will have different default behavior for the
+ * visit method in question.  When the new visitor is introduced, all
+ * or portions of this visitor may be deprecated.
+ *
+ * @param <R> the return type of this visitor's methods.  Use {@link
+ *            Void} for visitors that do not need to return results.
+ * @param <P> the type of the additional parameter to this visitor's
+ *            methods.  Use {@code Void} for visitors that do not need an
+ *            additional parameter.
+ *
+ * @see SimpleTypeVisitor6
+ * @since 1.7
+ */
+@SupportedSourceVersion(RELEASE_7)
+public class SimpleTypeVisitor7<R, P> extends SimpleTypeVisitor6<R, P> {
+    /**
+     * Constructor for concrete subclasses; uses {@code null} for the
+     * default value.
+     */
+    protected SimpleTypeVisitor7(){
+        super(null);
+    }
+
+    /**
+     * Constructor for concrete subclasses; uses the argument for the
+     * default value.
+     *
+     * @param defaultValue the value to assign to {@link #DEFAULT_VALUE}
+     */
+    protected SimpleTypeVisitor7(R defaultValue){
+        super(defaultValue);
+    }
+}
--- a/langtools/src/share/classes/javax/lang/model/util/TypeKindVisitor6.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/langtools/src/share/classes/javax/lang/model/util/TypeKindVisitor6.java	Wed Jul 21 09:57:21 2010 -0700
@@ -74,6 +74,8 @@
  * @author Joseph D. Darcy
  * @author Scott Seligman
  * @author Peter von der Ah&eacute;
+ *
+ * @see TypeKindVisitor7
  * @since 1.6
  */
 @SupportedSourceVersion(RELEASE_6)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/src/share/classes/javax/lang/model/util/TypeKindVisitor7.java	Wed Jul 21 09:57:21 2010 -0700
@@ -0,0 +1,95 @@
+/*
+ * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package javax.lang.model.util;
+
+import javax.lang.model.type.*;
+import javax.annotation.processing.SupportedSourceVersion;
+import static javax.lang.model.element.ElementKind.*;
+import static javax.lang.model.SourceVersion.*;
+import javax.lang.model.SourceVersion;
+
+/**
+ * A visitor of types based on their {@linkplain TypeKind kind} with
+ * default behavior appropriate for the {@link SourceVersion#RELEASE_7
+ * RELEASE_7} source version.  For {@linkplain
+ * TypeMirror types} <tt><i>XYZ</i></tt> that may have more than one
+ * kind, the <tt>visit<i>XYZ</i></tt> methods in this class delegate
+ * to the <tt>visit<i>XYZKind</i></tt> method corresponding to the
+ * first argument's kind.  The <tt>visit<i>XYZKind</i></tt> methods
+ * call {@link #defaultAction defaultAction}, passing their arguments
+ * to {@code defaultAction}'s corresponding parameters.
+ *
+ * <p> Methods in this class may be overridden subject to their
+ * general contract.  Note that annotating methods in concrete
+ * subclasses with {@link java.lang.Override @Override} will help
+ * ensure that methods are overridden as intended.
+ *
+ * <p> <b>WARNING:</b> The {@code TypeVisitor} interface implemented
+ * by this class may have methods added to it in the future to
+ * accommodate new, currently unknown, language structures added to
+ * future versions of the Java&trade; programming language.
+ * Therefore, methods whose names begin with {@code "visit"} may be
+ * added to this class in the future; to avoid incompatibilities,
+ * classes which extend this class should not declare any instance
+ * methods with names beginning with {@code "visit"}.
+ *
+ * <p>When such a new visit method is added, the default
+ * implementation in this class will be to call the {@link
+ * #visitUnknown visitUnknown} method.  A new type kind visitor class
+ * will also be introduced to correspond to the new language level;
+ * this visitor will have different default behavior for the visit
+ * method in question.  When the new visitor is introduced, all or
+ * portions of this visitor may be deprecated.
+ *
+ * @param <R> the return type of this visitor's methods.  Use {@link
+ *            Void} for visitors that do not need to return results.
+ * @param <P> the type of the additional parameter to this visitor's
+ *            methods.  Use {@code Void} for visitors that do not need an
+ *            additional parameter.
+ *
+ * @see TypeKindVisitor6
+ * @since 1.7
+ */
+@SupportedSourceVersion(RELEASE_7)
+public class TypeKindVisitor7<R, P> extends TypeKindVisitor6<R, P> {
+    /**
+     * Constructor for concrete subclasses to call; uses {@code null}
+     * for the default value.
+     */
+    protected TypeKindVisitor7() {
+        super(null);
+    }
+
+    /**
+     * Constructor for concrete subclasses to call; uses the argument
+     * for the default value.
+     *
+     * @param defaultValue the value to assign to {@link #DEFAULT_VALUE}
+     */
+    protected TypeKindVisitor7(R defaultValue) {
+        super(defaultValue);
+    }
+}
--- a/langtools/src/share/classes/javax/tools/JavaFileManager.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/langtools/src/share/classes/javax/tools/JavaFileManager.java	Wed Jul 21 09:57:21 2010 -0700
@@ -256,7 +256,7 @@
      *
      * <p>Optionally, this file manager might consider the sibling as
      * a hint for where to place the output.  The exact semantics of
-     * this hint is unspecified.  Sun's compiler, javac, for
+     * this hint is unspecified.  The JDK compiler, javac, for
      * example, will place class files in the same directories as
      * originating source files unless a class file output directory
      * is provided.  To facilitate this behavior, javac might provide
@@ -338,7 +338,7 @@
      *
      * <p>Optionally, this file manager might consider the sibling as
      * a hint for where to place the output.  The exact semantics of
-     * this hint is unspecified.  Sun's compiler, javac, for
+     * this hint is unspecified.  The JDK compiler, javac, for
      * example, will place class files in the same directories as
      * originating source files unless a class file output directory
      * is provided.  To facilitate this behavior, javac might provide
--- a/langtools/src/share/sample/javac/processing/src/CheckNamesProcessor.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/langtools/src/share/sample/javac/processing/src/CheckNamesProcessor.java	Wed Jul 21 09:57:21 2010 -0700
@@ -138,7 +138,7 @@
     public SourceVersion getSupportedSourceVersion() {
         /*
          * Return latest source version instead of a fixed version
-         * like RELEASE_6.  To return a fixed version, this class
+         * like RELEASE_7.  To return a fixed version, this class
          * could be annotated with a SupportedSourceVersion
          * annotation.
          *
@@ -190,7 +190,7 @@
         /**
          * Visitor to implement name checks.
          */
-        private class NameCheckScanner extends ElementScanner6<Void, Void> {
+        private class NameCheckScanner extends ElementScanner7<Void, Void> {
             // The visitor could be enhanced to return true/false if
             // there were warnings reported or a count of the number
             // of warnings.  This could be facilitated by using
@@ -312,7 +312,7 @@
             @Override
             public Void visitUnknown(Element e, Void p) {
                 // This method will be called if a kind of element
-                // added after JDK 6 is visited.  Since as of this
+                // added after JDK 7 is visited.  Since as of this
                 // writing the conventions for such constructs aren't
                 // known, issue a warning.
                 messager.printMessage(WARNING,
--- a/langtools/test/Makefile	Tue Jul 20 16:09:44 2010 -0700
+++ b/langtools/test/Makefile	Wed Jul 21 09:57:21 2010 -0700
@@ -50,6 +50,7 @@
       endif
     endif
   endif
+  EXE_SUFFIX=.exe
 endif
 
 # Root of this test area (important to use full paths in some places)
@@ -105,12 +106,13 @@
 # PRODUCT_HOME is a JPRT variable pointing to a directory containing the output from 
 # make/Makefile
 # For langtools, this is a directory containing build and dist
-# For a control build, this is build/$(PRODUCT)-$(ARCH)/j2sdk-image
+# For a control build, this is build/$(PRODUCT)-$(ARCH)/XYZ-image 
+#	(i.e, j2sdk-image or jdk-module-image)
 ifdef PRODUCT_HOME
   ifeq ($(shell [ -r $(PRODUCT_HOME)/dist/lib/classes.jar ]; echo $$?),0)
     TESTBOOTCLASSPATH = $(PRODUCT_HOME)/dist/lib/classes.jar
   endif
-  ifeq ($(shell [ -r $(PRODUCT_HOME)/lib/tools.jar ]; echo $$?),0)
+  ifeq ($(shell [ -r $(PRODUCT_HOME)/bin/javac$(EXE_SUFFIX) ]; echo $$?),0)
     TESTJAVA = $(PRODUCT_HOME)
   endif
 endif
@@ -150,6 +152,16 @@
 ###    -jtoptions:-Ejck.env.runtime.testCompile.groupMode.groupSize=$(JCK_GROUP_SIZE)
 endif
 
+# Timeouts -- by default, increase test timeouts when running on JPRT
+ifdef JPRT_JOB_ID
+  ifndef JTREG_TIMEOUT_FACTOR
+    JTREG_TIMEOUT_FACTOR = 3
+  endif
+endif
+ifdef JTREG_TIMEOUT_FACTOR
+  JTREG_OPTIONS += -timeoutFactor:$(JTREG_TIMEOUT_FACTOR)
+endif
+
 # Assertions: some tests show failures when assertions are enabled.
 # Since javac is typically loaded via the bootclassloader (either via TESTJAVA
 # or TESTBOOTCLASSPATH), you may need -esa to enable assertions in javac.
--- a/langtools/test/tools/apt/mirror/declaration/pkg1/pkg2/package.html	Tue Jul 20 16:09:44 2010 -0700
+++ b/langtools/test/tools/apt/mirror/declaration/pkg1/pkg2/package.html	Wed Jul 21 09:57:21 2010 -0700
@@ -24,7 +24,6 @@
 Please 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>
--- a/langtools/test/tools/javac/6402516/CheckLocalElements.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/langtools/test/tools/javac/6402516/CheckLocalElements.java	Wed Jul 21 09:57:21 2010 -0700
@@ -95,7 +95,7 @@
         return encl == null ? "" : encl.accept(qualNameVisitor, null);
     }
 
-    private ElementVisitor<String,Void> qualNameVisitor = new SimpleElementVisitor6<String,Void>() {
+    private ElementVisitor<String,Void> qualNameVisitor = new SimpleElementVisitor7<String,Void>() {
         protected String defaultAction(Element e, Void ignore) {
             return "";
         }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/6917288/GraphicalInstaller.java	Wed Jul 21 09:57:21 2010 -0700
@@ -0,0 +1,55 @@
+/*
+ * 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.
+ */
+
+/**
+ * Complex example for the "access constructor tags" issue.
+ * This test causes Lower to evaluate all classes defined in installNext
+ * before they are lowered, thus preventing the use of Lower.classdefs
+ * as a way of determining whether a class has been translated or not.
+ */
+class GraphicalInstaller  {
+    private BackgroundInstaller backgroundInstaller;
+
+    private void installNext() {
+        final Integer x = 0;
+        class X {
+          Object o = new Object() { int y = x; };
+        };
+        new X();
+        if (false) {
+            new Runnable(){
+                public void run() {
+                }
+            };
+        }
+    }
+
+    private void installSuiteCommon() {
+        backgroundInstaller = new BackgroundInstaller();
+    }
+
+    private static class BackgroundInstaller {
+        private BackgroundInstaller() {
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/6917288/GraphicalInstallerTest.java	Wed Jul 21 09:57:21 2010 -0700
@@ -0,0 +1,106 @@
+/*
+ * 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 6917288
+ * @summary Unnamed nested class is not generated
+ */
+
+import java.io.*;
+import java.util.*;
+
+public class GraphicalInstallerTest {
+    public static void main(String... args) throws Exception {
+        new GraphicalInstallerTest().run();
+    }
+
+    void run() throws Exception {
+        File testSrc = new File(System.getProperty("test.src"));
+        File classes = new File("classes");
+        classes.mkdirs();
+        List<String> opts = Arrays.asList("-d", classes.getPath());
+        int rc = compile(opts, new File(testSrc, "GraphicalInstaller.java"));
+        if (rc != 0) {
+            error("compilation failed: rc=" + rc);
+            return;
+        }
+
+        check(classes,
+            "GraphicalInstaller$1.class",
+            "GraphicalInstaller$1X$1.class",
+            "GraphicalInstaller$1X.class",
+            "GraphicalInstaller$BackgroundInstaller.class",
+            "GraphicalInstaller.class");
+
+        if (errors > 0)
+            throw new Exception(errors + " errors occurred");
+    }
+
+    /**
+     *  Compile files with given options.
+     *  Display any output from compiler, and return javac return code.
+     */
+    int compile(List<String> opts, File... files) {
+        List<String> args = new ArrayList<String>();
+        args.addAll(opts);
+        for (File f: files)
+            args.add(f.getPath());
+        StringWriter sw = new StringWriter();
+        PrintWriter pw = new PrintWriter(sw);
+        int rc = com.sun.tools.javac.Main.compile(args.toArray(new String[args.size()]), pw);
+        pw.close();
+        String out = sw.toString();
+        if (out.length() > 0)
+            System.err.println(out);
+        return rc;
+    }
+
+    /**
+     *  Check that a directory contains the expected files.
+     */
+    void check(File dir, String... paths) {
+        Set<String> found = new TreeSet<String>(Arrays.asList(dir.list()));
+        Set<String> expect = new TreeSet<String>(Arrays.asList(paths));
+        if (found.equals(expect))
+            return;
+        for (String f: found) {
+            if (!expect.contains(f))
+                error("Unexpected file found: " + f);
+        }
+        for (String e: expect) {
+            if (!found.contains(e))
+                error("Expected file not found: " + e);
+        }
+    }
+
+    /**
+     *  Record an error message.
+     */
+    void error(String msg) {
+        System.err.println(msg);
+        errors++;
+    }
+
+    int errors;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/6917288/T6917288.java	Wed Jul 21 09:57:21 2010 -0700
@@ -0,0 +1,158 @@
+/*
+ * 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 6917288
+ * @summary Unnamed nested class is not generated
+ */
+
+import java.io.*;
+import java.util.*;
+
+public class T6917288 {
+    // refers to kind of reference to an anon inner class that may be generated
+    enum Kind { NONE, FALSE, TRUE, ALWAYS };
+
+    public static void main(String... args) throws Exception {
+        new T6917288().run();
+    }
+
+    void run() throws Exception {
+        for (Kind k: Kind.values()) {
+            test(k);
+        }
+
+        if (errors > 0)
+            throw new Exception(errors + " errors occurred");
+    }
+
+    /**
+     *  Run a test case for Kind k.
+     */
+    void test(Kind k) throws Exception {
+        System.err.println("Test " + (++count) + ": " + k);
+        File testDir = new File("test" + count);
+        File srcDir = new File(testDir, "src");
+        srcDir.mkdirs();
+        File classesDir = new File(testDir, "classes");
+        classesDir.mkdirs();
+
+        List<String> opts = new ArrayList<String>();
+        opts.add("-d");
+        opts.add(classesDir.getPath());
+
+        File f = writeFile(srcDir, k);
+        int rc = compile(opts, f);
+        if (rc != 0) {
+            error("compilation failed: rc=" + rc);
+            return;
+        }
+
+        check(classesDir, "Test.class", "Test$Inner.class", "Test$1.class");
+    }
+
+    /**
+     *  Compile files with given options.
+     *  Display any output from compiler, and return javac return code.
+     */
+    int compile(List<String> opts, File... files) {
+        List<String> args = new ArrayList<String>();
+        args.addAll(opts);
+        for (File f: files)
+            args.add(f.getPath());
+        StringWriter sw = new StringWriter();
+        PrintWriter pw = new PrintWriter(sw);
+        int rc = com.sun.tools.javac.Main.compile(args.toArray(new String[args.size()]), pw);
+        pw.close();
+        String out = sw.toString();
+        if (out.length() > 0)
+            System.err.println(out);
+        return rc;
+    }
+
+    /**
+     *  Check that a directory contains the expected files.
+     */
+    void check(File dir, String... paths) {
+        Set<String> found = new TreeSet<String>(Arrays.asList(dir.list()));
+        Set<String> expect = new TreeSet<String>(Arrays.asList(paths));
+        if (found.equals(expect))
+            return;
+        for (String f: found) {
+            if (!expect.contains(f))
+                error("Unexpected file found: " + f);
+        }
+        for (String e: expect) {
+            if (!found.contains(e))
+                error("Expected file not found: " + e);
+        }
+    }
+
+    /**
+     *  Write source file for test case k.
+     */
+    File writeFile(File dir, Kind k) throws Exception {
+        StringBuilder sb = new StringBuilder();
+        sb.append("public class Test {\n");
+        sb.append("    private Inner inner;\n");
+
+        // generate different cases of an anon inner class
+        if (k != Kind.NONE) {
+            sb.append("    private void m() {\n");
+            sb.append("        ");
+            switch (k) {
+                case FALSE: case TRUE:
+                    sb.append("if (" + k.toString().toLowerCase() + ") ");
+            }
+            sb.append("new Runnable() { public void run() { } };\n");
+            sb.append("    }\n");
+        }
+
+        sb.append("    private void init() {\n");
+        sb.append("        inner = new Inner();\n");
+        sb.append("    }\n");
+        sb.append("\n");
+        sb.append("    private static class Inner {\n");
+        sb.append("        private Inner() {\n");
+        sb.append("        }\n");
+        sb.append("    }\n");
+        sb.append("}\n");
+
+        File f = new File(dir, "Test.java");
+        FileWriter w = new FileWriter(f);
+        w.write(sb.toString());
+        w.close();
+        return f;
+    }
+
+    /**
+     *  Record an error message.
+     */
+    void error(String msg) {
+        System.err.println(msg);
+        errors++;
+    }
+
+    int count;
+    int errors;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/6948381/T6948381.java	Wed Jul 21 09:57:21 2010 -0700
@@ -0,0 +1,29 @@
+/*
+ * 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 6948381
+ * @summary javac Null Pointer Exception in Types.makeCompoundType
+ * @compile npe/A.java npe/B.java
+ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/6948381/npe/A.java	Wed Jul 21 09:57:21 2010 -0700
@@ -0,0 +1,28 @@
+/*
+ * 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.
+ */
+
+package npe;
+
+import npe.B.*;
+
+public interface A {}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/6948381/npe/B.java	Wed Jul 21 09:57:21 2010 -0700
@@ -0,0 +1,26 @@
+/*
+ * 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.
+ */
+
+package npe;
+
+public interface B<T extends A & java.io.Serializable> {}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/T6956638.java	Wed Jul 21 09:57:21 2010 -0700
@@ -0,0 +1,156 @@
+/*
+ * 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.
+ */
+
+import java.io.BufferedWriter;
+import java.io.File;
+import java.io.FileWriter;
+import java.io.IOException;
+import java.io.StringWriter;
+import java.util.Arrays;
+import java.util.Iterator;
+import java.util.List;
+
+import javax.lang.model.element.Element;
+import javax.tools.DiagnosticCollector;
+import javax.tools.JavaCompiler;
+import javax.tools.JavaFileObject;
+import javax.tools.StandardJavaFileManager;
+import javax.tools.ToolProvider;
+
+import com.sun.source.tree.CompilationUnitTree;
+import com.sun.source.util.JavacTask;
+
+/**
+ * @test
+ * @bug 6956638
+ * @summary JavacTask.generate does not generate all required files
+ */
+public class T6956638 {
+    public static void main(String[] args) throws Exception {
+        new T6956638().run();
+    }
+
+    void run() throws Exception {
+        File srcDir = new File("src");
+
+        File[] files = {
+            writeFile(new File(srcDir, "T1.java"),
+                "public class T1 extends T2 {}\n"),
+            writeFile(new File(srcDir, "T2.java"),
+                "public class T2 extends T3 {}\n"),
+            writeFile(new File(srcDir, "T3.java"),
+                "public class T3 { public static final int C = 1; }\n"),
+            writeFile(new File(srcDir, "Test.java"),
+                "public class Test { public static final int D = T1.C; }\n")
+        };
+
+        for (File f1: files) {
+            for (File f2: files) {
+                if (f2 == f1) continue;
+                for (File f3: files) {
+                    if (f3 == f2 || f3 == f1) continue;
+                    for (File f4: files) {
+                        if (f4 == f3 || f4 == f2 || f4 == f1) continue;
+                        try {
+                            test(f1, f2, f3, f4);
+                        } catch (Exception e) {
+                            error(e);
+                        }
+                    }
+                }
+            }
+        }
+
+        if (errors > 0)
+            throw new Exception(errors + " tests failed");
+    }
+
+    void test(File... sourceFiles) throws Exception {
+        System.err.println("Test " + (++count) + ": " + Arrays.asList(sourceFiles));
+
+        File classesDir = new File("classes" + count);
+        classesDir.mkdirs();
+
+        StringWriter compilerOutputStream = new StringWriter();
+
+        List<String> compileOptions = Arrays.asList("-d", classesDir.getPath());
+        JavaCompiler compiler = ToolProvider.getSystemJavaCompiler();
+        DiagnosticCollector<JavaFileObject> diagnosticCollector = new DiagnosticCollector<JavaFileObject>();
+        StandardJavaFileManager fileManager = compiler.getStandardFileManager(diagnosticCollector, null, null);
+        Iterable<? extends JavaFileObject> sourceFileObjects = fileManager.getJavaFileObjects(sourceFiles);
+        System.err.println("1- javac given java source JavaFileObjects " + sourceFileObjects);
+        JavaCompiler.CompilationTask task = compiler.getTask(compilerOutputStream, fileManager, null, compileOptions, null, sourceFileObjects);
+        JavacTask javacTask = (JavacTask) task;
+
+        Iterable<? extends CompilationUnitTree> parsedTrees = javacTask.parse();
+        Iterable<? extends Element> analyzedTrees = javacTask.analyze();
+        Iterable<? extends JavaFileObject> generatedFiles = javacTask.generate();
+
+        System.err.println("2- parsed:" + size(parsedTrees) + " analysed:" + size(analyzedTrees) + " generated:" + size(generatedFiles));
+
+        System.err.print("3-");
+        for (JavaFileObject f : generatedFiles)
+            System.err.print(" " + f);
+        System.err.println("");
+
+        System.err.print("5-");
+        for (File f : classesDir.listFiles())
+            System.err.print(" " + f);
+        System.err.println("");
+
+        System.err.println("----");
+        System.err.println(compilerOutputStream.toString());
+
+        if (size(generatedFiles) != size(parsedTrees)) {
+            throw new Exception("wrong number of files generated: " + size(generatedFiles)
+                    + " expected: " + size(parsedTrees));
+        }
+    }
+
+    private void error(Throwable t) {
+        t.printStackTrace();
+        errors++;
+    }
+
+    int count;
+    int errors;
+
+    private static <E> int size(Iterable<E> x) {
+        int n = 0;
+        for (Iterator<E> iter = x.iterator(); iter.hasNext(); ++n)
+            iter.next();
+        return n;
+    }
+
+    private static File writeFile(File f, String str) throws IOException {
+        f.getParentFile().mkdirs();
+        BufferedWriter fout = new BufferedWriter(new FileWriter(f));
+        try {
+            fout.write(str);
+            fout.flush();
+        } finally {
+            fout.close();
+        }
+        return f;
+    }
+}
--- a/langtools/test/tools/javac/api/TestOperators.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/langtools/test/tools/javac/api/TestOperators.java	Wed Jul 21 09:57:21 2010 -0700
@@ -299,7 +299,7 @@
         final Trees trees = Trees.instance(processingEnv);
         final Messager log = processingEnv.getMessager();
         final Elements elements = processingEnv.getElementUtils();
-        class Scan extends ElementScanner6<Void,Void> {
+        class Scan extends ElementScanner7<Void,Void> {
             @Override
             public Void visitExecutable(ExecutableElement e, Void p) {
                 Object debug = e; // info for exception handler
--- a/langtools/test/tools/javac/api/evalexpr/ByteArrayClassLoader.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/langtools/test/tools/javac/api/evalexpr/ByteArrayClassLoader.java	Wed Jul 21 09:57:21 2010 -0700
@@ -28,7 +28,7 @@
 /**
  * A class loader which loads classes from byte arrays.
  *
- * <p><b>This is NOT part of any API supported by Sun Microsystems.
+ * <p><b>This is NOT part of any supported API.
  * If you write code that depends on this, you do so at your own
  * risk.  This code and its internal interfaces are subject to change
  * or deletion without notice.</b></p>
--- a/langtools/test/tools/javac/api/evalexpr/CompileFromString.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/langtools/test/tools/javac/api/evalexpr/CompileFromString.java	Wed Jul 21 09:57:21 2010 -0700
@@ -32,7 +32,7 @@
 /**
  * JSR 199 Demo application: compile from a String.
  *
- * <p><b>This is NOT part of any API supported by Sun Microsystems.
+ * <p><b>This is NOT part of any supported API.
  * If you write code that depends on this, you do so at your own
  * risk.  This code and its internal interfaces are subject to change
  * or deletion without notice.</b></p>
--- a/langtools/test/tools/javac/api/evalexpr/MemoryFileManager.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/langtools/test/tools/javac/api/evalexpr/MemoryFileManager.java	Wed Jul 21 09:57:21 2010 -0700
@@ -43,7 +43,7 @@
  * This file manager delegates to another file manager
  * to lookup classes on boot class path.
  *
- * <p><b>This is NOT part of any API supported by Sun Microsystems.
+ * <p><b>This is NOT part of any supported API.
  * If you write code that depends on this, you do so at your own
  * risk.  This code and its internal interfaces are subject to change
  * or deletion without notice.</b></p>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/diags/CheckResourceKeys.java	Wed Jul 21 09:57:21 2010 -0700
@@ -0,0 +1,362 @@
+/*
+ * 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 6964768 6964461 6964469 6964487 6964460 6964481
+ * @summary need test program to validate javac resource bundles
+ */
+
+import java.io.*;
+import java.util.*;
+import javax.tools.*;
+import com.sun.tools.classfile.*;
+
+/**
+ * Compare string constants in javac classes against keys in javac resource bundles.
+ */
+public class CheckResourceKeys {
+    /**
+     * Main program.
+     * Options:
+     * -finddeadkeys
+     *      look for keys in resource bundles that are no longer required
+     * -findmissingkeys
+     *      look for keys in resource bundles that are missing
+     *
+     * @throws Exception if invoked by jtreg and errors occur
+     */
+    public static void main(String... args) throws Exception {
+        CheckResourceKeys c = new CheckResourceKeys();
+        if (c.run(args))
+            return;
+
+        if (is_jtreg())
+            throw new Exception(c.errors + " errors occurred");
+        else
+            System.exit(1);
+    }
+
+    static boolean is_jtreg() {
+        return (System.getProperty("test.src") != null);
+    }
+
+    /**
+     * Main entry point.
+     */
+    boolean run(String... args) throws Exception {
+        boolean findDeadKeys = false;
+        boolean findMissingKeys = false;
+
+        if (args.length == 0) {
+            if (is_jtreg()) {
+                findDeadKeys = true;
+                findMissingKeys = true;
+            } else {
+                System.err.println("Usage: java CheckResourceKeys <options>");
+                System.err.println("where options include");
+                System.err.println("  -finddeadkeys      find keys in resource bundles which are no longer required");
+                System.err.println("  -findmissingkeys   find keys in resource bundles that are required but missing");
+                return true;
+            }
+        } else {
+            for (String arg: args) {
+                if (arg.equalsIgnoreCase("-finddeadkeys"))
+                    findDeadKeys = true;
+                else if (arg.equalsIgnoreCase("-findmissingkeys"))
+                    findMissingKeys = true;
+                else
+                    error("bad option: " + arg);
+            }
+        }
+
+        if (errors > 0)
+            return false;
+
+        Set<String> codeStrings = getCodeStrings();
+        Set<String> resourceKeys = getResourceKeys();
+
+        if (findDeadKeys)
+            findDeadKeys(codeStrings, resourceKeys);
+
+        if (findMissingKeys)
+            findMissingKeys(codeStrings, resourceKeys);
+
+        return (errors == 0);
+    }
+
+    /**
+     * Find keys in resource bundles which are probably no longer required.
+     * A key is probably required if there is a string fragment in the code
+     * that is part of the resource key, or if the key is well-known
+     * according to various pragmatic rules.
+     */
+    void findDeadKeys(Set<String> codeStrings, Set<String> resourceKeys) {
+        String[] prefixes = {
+            "compiler.err.", "compiler.warn.", "compiler.note.", "compiler.misc.",
+            "javac."
+        };
+        for (String rk: resourceKeys) {
+            // some keys are used directly, without a prefix.
+            if (codeStrings.contains(rk))
+                continue;
+
+            // remove standard prefix
+            String s = null;
+            for (int i = 0; i < prefixes.length && s == null; i++) {
+                if (rk.startsWith(prefixes[i])) {
+                    s = rk.substring(prefixes[i].length());
+                }
+            }
+            if (s == null) {
+                error("Resource key does not start with a standard prefix: " + rk);
+                continue;
+            }
+
+            if (codeStrings.contains(s))
+                continue;
+
+            // keys ending in .1 are often synthesized
+            if (s.endsWith(".1") && codeStrings.contains(s.substring(0, s.length() - 2)))
+                continue;
+
+            // verbose keys are generated by ClassReader.printVerbose
+            if (s.startsWith("verbose.") && codeStrings.contains(s.substring(8)))
+                continue;
+
+            // mandatory warning messages are synthesized with no characteristic substring
+            if (isMandatoryWarningString(s))
+                continue;
+
+            // check known (valid) exceptions
+            if (knownRequired.contains(rk))
+                continue;
+
+            // check known suspects
+            if (needToInvestigate.contains(rk))
+                continue;
+
+            error("Resource key not found in code: " + rk);
+        }
+    }
+
+    /**
+     * The keys for mandatory warning messages are all synthesized and do not
+     * have a significant recognizable substring to look for.
+     */
+    private boolean isMandatoryWarningString(String s) {
+        String[] bases = { "deprecated", "unchecked", "varargs", "sunapi" };
+        String[] tails = { ".filename", ".filename.additional", ".plural", ".plural.additional", ".recompile" };
+        for (String b: bases) {
+            if (s.startsWith(b)) {
+                String tail = s.substring(b.length());
+                for (String t: tails) {
+                    if (tail.equals(t))
+                        return true;
+                }
+            }
+        }
+        return false;
+    }
+
+    Set<String> knownRequired = new TreeSet<String>(Arrays.asList(
+        // See Resolve.getErrorKey
+        "compiler.err.cant.resolve.args",
+        "compiler.err.cant.resolve.args.params",
+        "compiler.err.cant.resolve.location.args",
+        "compiler.err.cant.resolve.location.args.params",
+        // JavaCompiler, reports #errors and #warnings
+        "compiler.misc.count.error",
+        "compiler.misc.count.error.plural",
+        "compiler.misc.count.warn",
+        "compiler.misc.count.warn.plural",
+        // Used for LintCategory
+        "compiler.warn.lintOption",
+        // Other
+        "compiler.misc.base.membership"                                 // (sic)
+        ));
+
+
+    Set<String> needToInvestigate = new TreeSet<String>(Arrays.asList(
+        "compiler.err.cant.read.file",                      // UNUSED
+        "compiler.err.illegal.self.ref",                    // UNUSED
+        "compiler.err.io.exception",                        // UNUSED
+        "compiler.err.limit.pool.in.class",                 // UNUSED
+        "compiler.err.name.reserved.for.internal.use",      // UNUSED
+        "compiler.err.no.match.entry",                      // UNUSED
+        "compiler.err.not.within.bounds.explain",           // UNUSED
+        "compiler.err.signature.doesnt.match.intf",         // UNUSED
+        "compiler.err.signature.doesnt.match.supertype",    // UNUSED
+        "compiler.err.type.var.more.than.once",             // UNUSED
+        "compiler.err.type.var.more.than.once.in.result",   // UNUSED
+        "compiler.misc.ccf.found.later.version",            // UNUSED
+        "compiler.misc.non.denotable.type",                 // UNUSED
+        "compiler.misc.unnamed.package",                    // should be required, CR 6964147
+        "compiler.misc.verbose.retro",                      // UNUSED
+        "compiler.misc.verbose.retro.with",                 // UNUSED
+        "compiler.misc.verbose.retro.with.list",            // UNUSED
+        "compiler.warn.proc.type.already.exists",           // TODO in JavacFiler
+        "javac.err.invalid.arg",                            // UNUSED ??
+        "javac.opt.arg.class",                              // UNUSED ??
+        "javac.opt.arg.pathname",                           // UNUSED ??
+        "javac.opt.moreinfo",                               // option commented out
+        "javac.opt.nogj",                                   // UNUSED
+        "javac.opt.printflat",                              // option commented out
+        "javac.opt.printsearch",                            // option commented out
+        "javac.opt.prompt",                                 // option commented out
+        "javac.opt.retrofit",                               // UNUSED
+        "javac.opt.s",                                      // option commented out
+        "javac.opt.scramble",                               // option commented out
+        "javac.opt.scrambleall"                             // option commented out
+        ));
+
+    /**
+     * For all strings in the code that look like they might be fragments of
+     * a resource key, verify that a key exists.
+     */
+    void findMissingKeys(Set<String> codeStrings, Set<String> resourceKeys) {
+        for (String cs: codeStrings) {
+            if (cs.matches("[A-Za-z][^.]*\\..*")) {
+                // ignore filenames (i.e. in SourceFile attribute
+                if (cs.matches(".*\\.java"))
+                    continue;
+                // ignore package and class names
+                if (cs.matches("(com|java|javax|sun)\\.[A-Za-z.]+"))
+                    continue;
+                // explicit known exceptions
+                if (noResourceRequired.contains(cs))
+                    continue;
+                // look for matching resource
+                if (hasMatch(resourceKeys, cs))
+                    continue;
+                error("no match for \"" + cs + "\"");
+            }
+        }
+    }
+    // where
+    private Set<String> noResourceRequired = new HashSet<String>(Arrays.asList(
+            // system properties
+            "application.home", // in Paths.java
+            "env.class.path",
+            "line.separator",
+            "user.dir",
+            // file names
+            "ct.sym",
+            "rt.jar",
+            "tools.jar",
+            // -XD option names
+            "process.packages",
+            "ignore.symbol.file",
+            // prefix/embedded strings
+            "compiler.",
+            "compiler.misc.",
+            "count.",
+            "illegal.",
+            "javac.",
+            "verbose."
+    ));
+
+    /**
+     * Look for a resource that ends in this string fragment.
+     */
+    boolean hasMatch(Set<String> resourceKeys, String s) {
+        for (String rk: resourceKeys) {
+            if (rk.endsWith(s))
+                return true;
+        }
+        return false;
+    }
+
+    /**
+     * Get the set of strings from (most of) the javac classfiles.
+     */
+    Set<String> getCodeStrings() throws IOException {
+        Set<String> results = new TreeSet<String>();
+        JavaCompiler c = ToolProvider.getSystemJavaCompiler();
+        JavaFileManager fm = c.getStandardFileManager(null, null, null);
+        String[] pkgs = {
+            "javax.annotation.processing",
+            "javax.lang.model",
+            "javax.tools",
+            "com.sun.source",
+            "com.sun.tools.javac"
+        };
+        for (String pkg: pkgs) {
+            for (JavaFileObject fo: fm.list(StandardLocation.PLATFORM_CLASS_PATH,
+                    pkg, EnumSet.of(JavaFileObject.Kind.CLASS), true)) {
+                String name = fo.getName();
+                // ignore resource files, and files which are not really part of javac
+                if (name.contains("resources")
+                        || name.contains("Launcher.class")
+                        || name.contains("CreateSymbols.class"))
+                    continue;
+                scan(fo, results);
+            }
+        }
+        return results;
+    }
+
+    /**
+     * Get the set of strings from a class file.
+     * Only strings that look like they might be a resource key are returned.
+     */
+    void scan(JavaFileObject fo, Set<String> results) throws IOException {
+        InputStream in = fo.openInputStream();
+        try {
+            ClassFile cf = ClassFile.read(in);
+            for (ConstantPool.CPInfo cpinfo: cf.constant_pool.entries()) {
+                if (cpinfo.getTag() == ConstantPool.CONSTANT_Utf8) {
+                    String v = ((ConstantPool.CONSTANT_Utf8_info) cpinfo).value;
+                    if (v.matches("[A-Za-z0-9-_.]+"))
+                        results.add(v);
+                }
+            }
+        } catch (ConstantPoolException ignore) {
+        } finally {
+            in.close();
+        }
+    }
+
+    /**
+     * Get the set of keys from the javac resource bundles.
+     */
+    Set<String> getResourceKeys() {
+        Set<String> results = new TreeSet<String>();
+        for (String name : new String[]{"javac", "compiler"}) {
+            ResourceBundle b =
+                    ResourceBundle.getBundle("com.sun.tools.javac.resources." + name);
+            results.addAll(b.keySet());
+        }
+        return results;
+    }
+
+    /**
+     * Report an error.
+     */
+    void error(String msg) {
+        System.err.println("Error: " + msg);
+        errors++;
+    }
+
+    int errors;
+}
--- a/langtools/test/tools/javac/enum/6424358/T6424358.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/langtools/test/tools/javac/enum/6424358/T6424358.java	Wed Jul 21 09:57:21 2010 -0700
@@ -48,7 +48,7 @@
         final Messager log = processingEnv.getMessager();
         final Elements elements = processingEnv.getElementUtils();
         final TypeElement testMe = elements.getTypeElement("TestMe");
-        class Scan extends ElementScanner6<Void,Void> {
+        class Scan extends ElementScanner7<Void,Void> {
             @Override
             public Void visitExecutable(ExecutableElement e, Void p) {
                 System.err.println("Looking at " + e);
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/generics/6946618/T6946618a.java	Wed Jul 21 09:57:21 2010 -0700
@@ -0,0 +1,21 @@
+/*
+ * @test /nodynamiccopyright/
+ * @bug     6946618
+ * @summary sqe test fails: javac/generics/NewOnTypeParm  in pit jdk7 b91 in all platforms.
+ * @author  mcimadamore
+ * @compile/fail/ref=T6946618a.out -XDrawDiagnostics T6946618a.java
+ */
+
+class T6946618a {
+    static class C<T> {
+      T makeT() {
+        return new T(); //error
+      }
+    }
+
+    static class D<S> {
+      C<S> makeC() {
+        return new C<S>(); //ok
+      }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/generics/6946618/T6946618a.out	Wed Jul 21 09:57:21 2010 -0700
@@ -0,0 +1,2 @@
+T6946618a.java:12:20: compiler.err.type.found.req: (compiler.misc.type.parameter: T), (compiler.misc.type.req.class)
+1 error
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/generics/6946618/T6946618b.java	Wed Jul 21 09:57:21 2010 -0700
@@ -0,0 +1,21 @@
+/*
+ * @test /nodynamiccopyright/
+ * @bug     6946618
+ * @summary sqe test fails: javac/generics/NewOnTypeParm  in pit jdk7 b91 in all platforms.
+ * @author  mcimadamore
+ * @compile/fail/ref=T6946618b.out -XDrawDiagnostics T6946618b.java
+ */
+
+class T6946618b {
+    static class C<T> {
+      T makeT() {
+        return new T<>(); //error
+      }
+    }
+
+    static class D<S> {
+      C<S> makeC() {
+        return new C<>(); //ok
+      }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/generics/6946618/T6946618b.out	Wed Jul 21 09:57:21 2010 -0700
@@ -0,0 +1,2 @@
+T6946618b.java:12:20: compiler.err.type.found.req: (compiler.misc.type.parameter: T), (compiler.misc.type.req.class)
+1 error
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/generics/6946618/T6946618c.java	Wed Jul 21 09:57:21 2010 -0700
@@ -0,0 +1,17 @@
+/*
+ * @test /nodynamiccopyright/
+ * @bug     6946618 6968497
+ * @summary sqe test fails: javac/generics/NewOnTypeParm  in pit jdk7 b91 in all platforms.
+ * @author  mcimadamore
+ * @compile/fail/ref=T6946618c.out -XDrawDiagnostics T6946618c.java
+ */
+
+class T6946618c {
+    static class C<T> { }
+
+    void test() {
+        C<?> c1 = new C<? extends String>();
+        C<?> c2 = new C<? super String>();
+        C<?> c3 = new C<?>();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/generics/6946618/T6946618c.out	Wed Jul 21 09:57:21 2010 -0700
@@ -0,0 +1,4 @@
+T6946618c.java:13:24: compiler.err.type.found.req: ? extends java.lang.String, (compiler.misc.type.req.exact)
+T6946618c.java:14:24: compiler.err.type.found.req: ? super java.lang.String, (compiler.misc.type.req.exact)
+T6946618c.java:15:24: compiler.err.type.found.req: ?, (compiler.misc.type.req.exact)
+3 errors
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/generics/diamond/T6951833.java	Wed Jul 21 09:57:21 2010 -0700
@@ -0,0 +1,36 @@
+/*
+ * 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 6951833
+ *
+ * @summary  latest diamond implementation generates spurious raw type warnings
+ * @author mcimadamore
+ * @compile -Xlint:rawtypes -Werror T6951833.java
+ *
+ */
+
+class T6951833<X> {
+   T6951833<String> bug = new T6951833<>();
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/generics/typevars/T6880344.java	Wed Jul 21 09:57:21 2010 -0700
@@ -0,0 +1,40 @@
+/*
+ * 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     6880344
+ * @summary Recursive type parameters do not compile
+ * @author  mcimadamore
+ * @compile T6880344.java
+ */
+
+class T6880344 {
+    static class A<X1 extends G<X1>> {
+        public A<N<X1>> xyz;
+    }
+
+    static class N<X2 extends G<X2>> implements G<N<X2>> { }
+
+    interface G<X3 extends G<X3>> { }
+}
--- a/langtools/test/tools/javac/literals/BadUnderscoreLiterals.6.out	Tue Jul 20 16:09:44 2010 -0700
+++ b/langtools/test/tools/javac/literals/BadUnderscoreLiterals.6.out	Wed Jul 21 09:57:21 2010 -0700
@@ -1,4 +1,4 @@
-BadUnderscoreLiterals.java:14:17: compiler.err.unsupported.underscore: 1.6
+BadUnderscoreLiterals.java:14:17: compiler.err.unsupported.underscore.lit: 1.6
 BadUnderscoreLiterals.java:18:15: compiler.err.illegal.underscore
 BadUnderscoreLiterals.java:22:19: compiler.err.illegal.underscore
 BadUnderscoreLiterals.java:25:14: compiler.err.unsupported.binary.lit: 1.6
--- a/langtools/test/tools/javac/meth/InvokeDyn.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/langtools/test/tools/javac/meth/InvokeDyn.java	Wed Jul 21 09:57:21 2010 -0700
@@ -47,7 +47,7 @@
 import java.dyn.InvokeDynamic;
 
 public class InvokeDyn {
-    void test() {
+    void test() throws Throwable {
         Object x = "hello";
         InvokeDynamic.greet(x, "world", 123);
         InvokeDynamic.greet(x, "mundus", 456);
--- a/langtools/test/tools/javac/meth/InvokeMH.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/langtools/test/tools/javac/meth/InvokeMH.java	Wed Jul 21 09:57:21 2010 -0700
@@ -48,28 +48,56 @@
     void test(MethodHandle mh_SiO,
               MethodHandle mh_vS,
               MethodHandle mh_vi,
-              MethodHandle mh_vv) {
+              MethodHandle mh_vv) throws Throwable {
         Object o; String s; int i;  // for return type testing
 
         // next five must have sig = (String,int)Object
-        mh_SiO.invoke("world", 123);
-        mh_SiO.invoke("mundus", 456);
+        mh_SiO.invokeExact("world", 123);
+        mh_SiO.invokeExact("mundus", 456);
         Object k = "kosmos";
-        mh_SiO.invoke((String)k, 789);
-        o = mh_SiO.invoke((String)null, 000);
-        o = mh_SiO.<Object>invoke("arda", -123);
+        mh_SiO.invokeExact((String)k, 789);
+        o = mh_SiO.invokeExact((String)null, 000);
+        o = mh_SiO.<Object>invokeExact("arda", -123);
 
         // sig = ()String
-        s = mh_vS.<String>invoke();
+        s = mh_vS.<String>invokeExact();
 
         // sig = ()int
-        i = mh_vi.<int>invoke();
-        o = mh_vi.<int>invoke();
-        //s = mh_vi.<int>invoke(); //BAD
-        mh_vi.<int>invoke();
+        i = mh_vi.<int>invokeExact();
+        o = mh_vi.<int>invokeExact();
+        //s = mh_vi.<int>invokeExact(); //BAD
+        mh_vi.<int>invokeExact();
 
         // sig = ()void
-        //o = mh_vv.<void>invoke(); //BAD
-        mh_vv.<void>invoke();
+        //o = mh_vv.<void>invokeExact(); //BAD
+        mh_vv.<void>invokeExact();
+    }
+
+    void testGen(MethodHandle mh_SiO,
+                 MethodHandle mh_vS,
+                 MethodHandle mh_vi,
+                 MethodHandle mh_vv) throws Throwable {
+        Object o; String s; int i;  // for return type testing
+
+        // next five must have sig = (*,*)*
+        mh_SiO.invokeGeneric((Object)"world", (Object)123);
+        mh_SiO.<void>invokeGeneric((Object)"mundus", (Object)456);
+        Object k = "kosmos";
+        mh_SiO.invokeGeneric(k, 789);
+        o = mh_SiO.invokeGeneric(null, 000);
+        o = mh_SiO.<Object>invokeGeneric("arda", -123);
+
+        // sig = ()String
+        o = mh_vS.invokeGeneric();
+
+        // sig = ()int
+        i = mh_vi.<int>invokeGeneric();
+        o = mh_vi.invokeGeneric();
+        //s = mh_vi.<int>invokeGeneric(); //BAD
+        mh_vi.<void>invokeGeneric();
+
+        // sig = ()void
+        //o = mh_vv.<void>invokeGeneric(); //BAD
+        o = mh_vv.invokeGeneric();
     }
 }
--- a/langtools/test/tools/javac/processing/model/6194785/T6194785.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/langtools/test/tools/javac/processing/model/6194785/T6194785.java	Wed Jul 21 09:57:21 2010 -0700
@@ -43,7 +43,7 @@
     {
         final Messager log = processingEnv.getMessager();
         final Elements elements = processingEnv.getElementUtils();
-        class Scan extends ElementScanner6<Void,Void> {
+        class Scan extends ElementScanner7<Void,Void> {
             @Override
             public Void visitExecutable(ExecutableElement e, Void ignored) {
                 for (VariableElement p : e.getParameters())
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/processing/model/type/MirroredTypeEx/Plurality.java	Wed Jul 21 09:57:21 2010 -0700
@@ -0,0 +1,192 @@
+/*
+ * 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     6519115
+ * @summary Verify MirroredTypeException vs MirroredTypesException is thrown
+ * @compile Plurality.java
+ * @compile -processor Plurality -proc:only Plurality.java
+ * @author  Joseph D. Darcy
+ */
+import java.lang.annotation.*;
+import java.math.BigDecimal;
+import java.util.*;
+import javax.annotation.processing.*;
+import javax.lang.model.*;
+import javax.lang.model.element.*;
+import javax.lang.model.type.*;
+import javax.lang.model.util.*;
+
+@SupportedAnnotationTypes("*")
+@P0
+@P1
+@P2
+@S1
+public class Plurality extends AbstractProcessor {
+    private boolean executed = false;
+
+    Elements elements;
+    Types types;
+
+    @Override
+    public void init(ProcessingEnvironment penv) {
+        super.init(penv);
+        elements = penv.getElementUtils();
+        types =  penv.getTypeUtils();
+    }
+
+
+    public boolean process(Set<? extends TypeElement> annotations,
+                           RoundEnvironment roundEnv) {
+        if (!roundEnv.processingOver()) {
+            executed = true;
+            // Processing just this type
+            Element e = elements.getTypeElement("Plurality");
+            Class[] classes = null;
+
+            P0 p0 = e.getAnnotation(P0.class);
+            try {
+                classes = p0.value();
+            } catch (MirroredTypesException mtse) {
+                if (mtse instanceof MirroredTypeException) {
+                    throw new RuntimeException("Wrong exception type!");
+                }
+
+                List<? extends TypeMirror> types = mtse.getTypeMirrors();
+                if (types.size() != 0)
+                    throw new RuntimeException("List size != 0: " +
+                                               types);
+            }
+
+            P1 p1 = e.getAnnotation(P1.class);
+            try {
+                classes = p1.value();
+            } catch (MirroredTypesException mtse) {
+                if (mtse instanceof MirroredTypeException) {
+                    throw new RuntimeException("Wrong exception type!");
+                }
+
+                List<? extends TypeMirror> types = mtse.getTypeMirrors();
+                if (types.size() != 1)
+                    throw new RuntimeException("List size != 1: " +
+                                               types);
+                checkTypeListMatchesClasses(types,
+                                            this.getClass().getAnnotation(P1.class).value());
+            }
+
+
+            P2 p2 = e.getAnnotation(P2.class);
+            try {
+                classes = p2.value();
+            } catch(MirroredTypesException mtse) {
+                if (mtse instanceof MirroredTypeException) {
+                    throw new RuntimeException("Wrong exception type!");
+                }
+
+                List<? extends TypeMirror> types = mtse.getTypeMirrors();
+                if (types.size() != 2)
+                    throw new RuntimeException("List size != 2: " +
+                                               types);
+                checkTypeListMatchesClasses(types,
+                                            this.getClass().getAnnotation(P2.class).value());
+            }
+
+            Class<?> clazz = null;
+            S1 s1 = e.getAnnotation(S1.class);
+            try {
+                clazz = s1.value();
+            } catch(MirroredTypesException mtse) {
+                List<? extends TypeMirror> types = mtse.getTypeMirrors();
+                if (types.size() != 1)
+                    throw new RuntimeException("List size != 1: " +
+                                               types);
+                Class<?>[] clazzes = new Class<?>[1];
+                clazzes[0] = this.getClass().getAnnotation(S1.class).value();
+                checkTypeListMatchesClasses(types,
+                                            clazzes);
+            }
+
+            try {
+                clazz = s1.value();
+            } catch(MirroredTypeException mte) {
+                TypeMirror type = mte.getTypeMirror();
+                if (type == null) {
+                    throw new RuntimeException("Expected null");
+                }
+                List<TypeMirror> types = new ArrayList<>();
+                types.add(type);
+                Class<?>[] clazzes = new Class<?>[1];
+                clazzes[0] = this.getClass().getAnnotation(S1.class).value();
+                checkTypeListMatchesClasses(types, clazzes);
+            }
+        } else {
+            if (!executed) {
+                throw new RuntimeException("Didn't seem to do anything!");
+            }
+        }
+        return true;
+    }
+
+    private static void checkTypeListMatchesClasses(List<? extends TypeMirror> types,
+                                               Class<?>[] classes) {
+        if (types.size() != classes.length)
+            throw new RuntimeException("Size mismatch:\n\t" + types +
+                                       "\n\t" + Arrays.toString(classes));
+        int i = -1;
+        for(Class<?> clazz : classes) {
+            i++;
+            String canonicalName = clazz.getCanonicalName();
+            String toStringName = types.get(i).toString();
+            if (!canonicalName.equals(toStringName))
+                throw new RuntimeException("Mismatched names: " +
+                                           canonicalName + "\t" +
+                                           toStringName);
+        }
+    }
+
+    @Override
+    public SourceVersion getSupportedSourceVersion() {
+        return SourceVersion.latest();
+    }
+}
+
+@Retention(RetentionPolicy.RUNTIME)
+@interface P0 {
+    Class[] value() default {};
+}
+
+@Retention(RetentionPolicy.RUNTIME)
+@interface P1 {
+    Class[] value() default {Integer.class};
+}
+
+@Retention(RetentionPolicy.RUNTIME)
+@interface P2 {
+    Class[] value() default {String.class, Number.class};
+}
+
+@Retention(RetentionPolicy.RUNTIME)
+@interface S1 {
+    Class value() default BigDecimal.class;
+}
--- a/langtools/test/tools/javac/processing/model/type/NoTypes.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/langtools/test/tools/javac/processing/model/type/NoTypes.java	Wed Jul 21 09:57:21 2010 -0700
@@ -89,7 +89,7 @@
         verifyKind(NONE, types.getNoType(NONE));
 
         // The return type of a constructor or void method is VOID.
-        class Scanner extends ElementScanner6<Void, Void> {
+        class Scanner extends ElementScanner7<Void, Void> {
             @Override
             public Void visitExecutable(ExecutableElement e, Void p) {
                 verifyKind(VOID, e.getReturnType());
@@ -104,10 +104,10 @@
 
     /**
      * Verify that a NoType instance is of a particular kind,
-     * and that TypeKindVisitor6 properly dispatches on it.
+     * and that TypeKindVisitor7 properly dispatches on it.
      */
     private void verifyKind(TypeKind kind, TypeMirror type) {
-        class Vis extends TypeKindVisitor6<TypeKind, Void> {
+        class Vis extends TypeKindVisitor7<TypeKind, Void> {
             @Override
             public TypeKind visitNoTypeAsVoid(NoType t, Void p) {
                 return VOID;
--- a/langtools/test/tools/javac/processing/model/util/deprecation/TestDeprecation.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/langtools/test/tools/javac/processing/model/util/deprecation/TestDeprecation.java	Wed Jul 21 09:57:21 2010 -0700
@@ -67,7 +67,7 @@
         return true;
     }
 
-    private class DeprecationChecker extends ElementScanner6<Boolean,Void> {
+    private class DeprecationChecker extends ElementScanner7<Boolean,Void> {
         private Elements elementUtils;
         private boolean failure;
         DeprecationChecker() {
--- a/langtools/test/tools/javac/varargs/6730476/T6730476a.java	Tue Jul 20 16:09:44 2010 -0700
+++ b/langtools/test/tools/javac/varargs/6730476/T6730476a.java	Wed Jul 21 09:57:21 2010 -0700
@@ -27,7 +27,7 @@
  *
  * @summary invalid "unchecked generic array" warning
  * @author mcimadamore
- * @compile T6730476a.java -Xlint -Werror
+ * @compile T6730476a.java -Xlint:unchecked -Werror
  *
  */
 
--- a/langtools/test/tools/javac/varargs/6806876/T6806876.out	Tue Jul 20 16:09:44 2010 -0700
+++ b/langtools/test/tools/javac/varargs/6806876/T6806876.out	Wed Jul 21 09:57:21 2010 -0700
@@ -1,4 +1,6 @@
 T6806876.java:11:32: compiler.warn.unchecked.generic.array.creation: java.lang.Number&java.lang.Comparable<? extends java.lang.Number&java.lang.Comparable<?>>[]
 - compiler.err.warnings.and.werror
+- compiler.note.varargs.filename: T6806876.java
+- compiler.note.varargs.recompile
 1 error
 1 warning
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/varargs/warning/Warn4.java	Wed Jul 21 09:57:21 2010 -0700
@@ -0,0 +1,259 @@
+/*
+ * 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     6945418
+ * @summary Project Coin: Simplified Varargs Method Invocation
+ * @author  mcimadamore
+ * @run main Warn4
+ */
+import com.sun.source.util.JavacTask;
+import java.net.URI;
+import java.util.Arrays;
+import java.util.Set;
+import java.util.HashSet;
+import javax.tools.Diagnostic;
+import javax.tools.JavaCompiler;
+import javax.tools.JavaFileObject;
+import javax.tools.SimpleJavaFileObject;
+import javax.tools.ToolProvider;
+
+public class Warn4 {
+
+    final static Warning[] error = null;
+    final static Warning[] none = new Warning[] {};
+    final static Warning[] vararg = new Warning[] { Warning.VARARGS };
+    final static Warning[] unchecked = new Warning[] { Warning.UNCHECKED };
+    final static Warning[] both = new Warning[] { Warning.VARARGS, Warning.UNCHECKED };
+
+    enum Warning {
+        UNCHECKED("unchecked"),
+        VARARGS("varargs");
+
+        String category;
+
+        Warning(String category) {
+            this.category = category;
+        }
+
+        boolean isEnabled(XlintOption xlint, SuppressLevel suppressLevel) {
+            return Arrays.asList(xlint.enabledWarnings).contains(this);
+        }
+
+        boolean isSuppressed(SuppressLevel suppressLevel) {
+            return Arrays.asList(suppressLevel.suppressedWarnings).contains(VARARGS);
+        }
+    }
+
+    enum XlintOption {
+        NONE(),
+        UNCHECKED(Warning.UNCHECKED),
+        VARARGS(Warning.VARARGS),
+        ALL(Warning.UNCHECKED, Warning.VARARGS);
+
+        Warning[] enabledWarnings;
+
+        XlintOption(Warning... enabledWarnings) {
+            this.enabledWarnings = enabledWarnings;
+        }
+
+        String getXlintOption() {
+            StringBuilder buf = new StringBuilder();
+            String sep = "";
+            for (Warning w : enabledWarnings) {
+                buf.append(sep);
+                buf.append(w.category);
+                sep=",";
+            }
+            return "-Xlint:" +
+                    (this == NONE ? "none" : buf.toString());
+        }
+    }
+
+    enum SuppressLevel {
+        NONE(),
+        UNCHECKED(Warning.UNCHECKED),
+        VARARGS(Warning.VARARGS),
+        ALL(Warning.UNCHECKED, Warning.VARARGS);
+
+        Warning[] suppressedWarnings;
+
+        SuppressLevel(Warning... suppressedWarnings) {
+            this.suppressedWarnings = suppressedWarnings;
+        }
+
+        String getSuppressAnnotation() {
+            StringBuilder buf = new StringBuilder();
+            String sep = "";
+            for (Warning w : suppressedWarnings) {
+                buf.append(sep);
+                buf.append("\"");
+                buf.append(w.category);
+                buf.append("\"");
+                sep=",";
+            }
+            return this == NONE ? "" :
+                "@SuppressWarnings({" + buf.toString() + "})";
+        }
+    }
+
+    enum Signature {
+
+        EXTENDS_TVAR("<Z> void #name(List<? extends Z>#arity arg) { #body }",
+            new Warning[][] {both, both, both, both, error, both, both, both, error}),
+        SUPER_TVAR("<Z> void #name(List<? super Z>#arity arg) { #body }",
+            new Warning[][] {error, both, error, both, error, error, both, both, error}),
+        UNBOUND("void #name(List<?>#arity arg) { #body }",
+            new Warning[][] {none, none, none, none, none, none, none, none, error}),
+        INVARIANT_TVAR("<Z> void #name(List<Z>#arity arg) { #body }",
+            new Warning[][] {both, both, both, both, error, both, both, both, error}),
+        TVAR("<Z> void #name(Z#arity arg) { #body }",
+            new Warning[][] {both, both, both, both, both, both, both, both, vararg}),
+        EXTENDS("void #name(List<? extends String>#arity arg) { #body }",
+            new Warning[][] {error, error, error, error, error, both, error, both, error}),
+        SUPER("void #name(List<? super String>#arity arg) { #body }",
+            new Warning[][] {error, error, error, error, error, error, both, both, error}),
+        INVARIANT("void #name(List<String>#arity arg) { #body }",
+            new Warning[][] {error, error, error, error, error, error, error, both, error}),
+        UNPARAMETERIZED("void #name(String#arity arg) { #body }",
+            new Warning[][] {error, error, error, error, error, error, error, error, none});
+
+        String template;
+        Warning[][] warnings;
+
+        Signature(String template, Warning[][] warnings) {
+            this.template = template;
+            this.warnings = warnings;
+        }
+
+        boolean isApplicableTo(Signature other) {
+            return warnings[other.ordinal()] != null;
+        }
+
+        boolean giveUnchecked(Signature other) {
+            return warnings[other.ordinal()] == unchecked ||
+                    warnings[other.ordinal()] == both;
+        }
+
+        boolean giveVarargs(Signature other) {
+            return warnings[other.ordinal()] == vararg ||
+                    warnings[other.ordinal()] == both;
+        }
+    }
+
+    public static void main(String... args) throws Exception {
+        for (XlintOption xlint : XlintOption.values()) {
+            for (SuppressLevel suppressLevel : SuppressLevel.values()) {
+                for (Signature vararg_meth : Signature.values()) {
+                    for (Signature client_meth : Signature.values()) {
+                        if (vararg_meth.isApplicableTo(client_meth)) {
+                            test(xlint,
+                                    suppressLevel,
+                                    vararg_meth,
+                                    client_meth);
+                        }
+                    }
+                }
+            }
+        }
+    }
+
+    static void test(XlintOption xlint, SuppressLevel suppressLevel,
+            Signature vararg_meth, Signature client_meth) throws Exception {
+        final JavaCompiler tool = ToolProvider.getSystemJavaCompiler();
+        JavaSource source = new JavaSource(suppressLevel, vararg_meth, client_meth);
+        DiagnosticChecker dc = new DiagnosticChecker();
+        JavacTask ct = (JavacTask)tool.getTask(null, null, dc,
+                Arrays.asList(xlint.getXlintOption()), null, Arrays.asList(source));
+        ct.generate(); //to get mandatory notes
+        check(dc.warnings,
+                dc.notes,
+                new boolean[] {vararg_meth.giveUnchecked(client_meth),
+                               vararg_meth.giveVarargs(client_meth)},
+                source, xlint, suppressLevel);
+    }
+
+    static void check(Set<Warning> warnings, Set<Warning> notes, boolean[] warnArr, JavaSource source, XlintOption xlint, SuppressLevel suppressLevel) {
+        boolean badOutput = false;
+        for (Warning wkind : Warning.values()) {
+            badOutput |= (warnArr[wkind.ordinal()] && !wkind.isSuppressed(suppressLevel)) !=
+                    (wkind.isEnabled(xlint, suppressLevel) ?
+                        warnings.contains(wkind) :
+                        notes.contains(wkind));
+        }
+        if (badOutput) {
+            throw new Error("invalid diagnostics for source:\n" +
+                    source.getCharContent(true) +
+                    "\nOptions: " + xlint.getXlintOption() +
+                    "\nExpected unchecked warning: " + warnArr[0] +
+                    "\nExpected unsafe vararg warning: " + warnArr[1] +
+                    "\nWarnings: " + warnings +
+                    "\nNotes: " + notes);
+        }
+    }
+
+    static class JavaSource extends SimpleJavaFileObject {
+
+        String source;
+
+        public JavaSource(SuppressLevel suppressLevel, Signature vararg_meth, Signature client_meth) {
+            super(URI.create("myfo:/Test.java"), JavaFileObject.Kind.SOURCE);
+            String meth1 = vararg_meth.template.replace("#arity", "...");
+            meth1 = meth1.replace("#name", "m");
+            meth1 = meth1.replace("#body", "");
+            meth1 = suppressLevel.getSuppressAnnotation() + meth1;
+            String meth2 = client_meth.template.replace("#arity", "");
+            meth2 = meth2.replace("#name", "test");
+            meth2 = meth2.replace("#body", "m(arg);");
+            source = "import java.util.List;\n" +
+               "class Test {\n" + meth1 +
+               "\n" + meth2 + "\n}\n";
+        }
+
+        @Override
+        public CharSequence getCharContent(boolean ignoreEncodingErrors) {
+            return source;
+        }
+    }
+
+    static class DiagnosticChecker implements javax.tools.DiagnosticListener<JavaFileObject> {
+
+        Set<Warning> warnings = new HashSet<>();
+        Set<Warning> notes = new HashSet<>();
+
+        public void report(Diagnostic<? extends JavaFileObject> diagnostic) {
+            if (diagnostic.getKind() == Diagnostic.Kind.MANDATORY_WARNING ||
+                    diagnostic.getKind() == Diagnostic.Kind.WARNING) {
+                warnings.add(diagnostic.getCode().contains("varargs") ?
+                    Warning.VARARGS :
+                    Warning.UNCHECKED);
+            }
+            else if (diagnostic.getKind() == Diagnostic.Kind.NOTE) {
+                notes.add(diagnostic.getCode().contains("varargs") ?
+                    Warning.VARARGS :
+                    Warning.UNCHECKED);
+            }
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javadoc/6958836/Test.java	Wed Jul 21 09:57:21 2010 -0700
@@ -0,0 +1,120 @@
+/*
+ * 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 6958836
+ * @summary javadoc should support -Xmaxerrs and -Xmaxwarns
+ */
+
+import java.io.*;
+import java.util.*;
+
+public class Test {
+    public static void main(String... args) throws Exception {
+        new Test().run();
+    }
+
+    void run() throws Exception {
+        javadoc("errs",  list(),                   10,  0);
+        javadoc("errs",  list("-Xmaxerrs",   "0"), 10,  0);
+        javadoc("errs",  list("-Xmaxerrs",   "2"),  2,  0);
+        javadoc("errs",  list("-Xmaxerrs",   "4"),  4,  0);
+        javadoc("errs",  list("-Xmaxerrs",  "20"), 10,  0);
+
+        javadoc("warns", list(),                    0, 10);
+        javadoc("warns", list("-Xmaxwarns",  "0"),  0, 10);
+        javadoc("warns", list("-Xmaxwarns",  "2"),  0,  2);
+        javadoc("warns", list("-Xmaxwarns",  "4"),  0,  4);
+        javadoc("warns", list("-Xmaxwarns", "20"),  0, 10);
+
+        if (errors > 0)
+            throw new Exception(errors + " errors occurred.");
+    }
+
+    void javadoc(String pkg, List<String> testOpts,
+                int expectErrs, int expectWarns) {
+        System.err.println("Test " + (++count) + ": " + pkg + " " + testOpts);
+        File testOutDir = new File("test" + count);
+
+        List<String> opts = new ArrayList<String>();
+        // Force en_US locale in lieu of something like -XDrawDiagnostics.
+        // For some reason, this must be the first option when used.
+        opts.addAll(list("-locale", "en_US"));
+        opts.addAll(list("-classpath", System.getProperty("test.src")));
+        opts.addAll(list("-d", testOutDir.getPath()));
+        opts.addAll(testOpts);
+        opts.add(pkg);
+
+        StringWriter errSW = new StringWriter();
+        PrintWriter errPW = new PrintWriter(errSW);
+        StringWriter warnSW = new StringWriter();
+        PrintWriter warnPW = new PrintWriter(warnSW);
+        StringWriter noteSW = new StringWriter();
+        PrintWriter notePW = new PrintWriter(noteSW);
+
+        int rc = com.sun.tools.javadoc.Main.execute("javadoc",
+                              errPW, warnPW, notePW,
+                              "com.sun.tools.doclets.standard.Standard",
+                              getClass().getClassLoader(),
+                              opts.toArray(new String[opts.size()]));
+        System.err.println("rc: " + rc);
+
+        errPW.close();
+        String errOut = errSW.toString();
+        System.err.println("Errors:\n" + errOut);
+        warnPW.close();
+        String warnOut = warnSW.toString();
+        System.err.println("Warnings:\n" + warnOut);
+        notePW.close();
+        String noteOut = noteSW.toString();
+        System.err.println("Notes:\n" + noteOut);
+
+        check(errOut, "Errors.java", expectErrs);
+        check(warnOut, " warning ", expectWarns); // requires -locale en_US
+    }
+
+    void check(String text, String expectText, int expectCount) {
+        int foundCount = 0;
+        for (String line: text.split("[\r\n]+")) {
+            if (line.contains(expectText))
+                foundCount++;
+        }
+        if (foundCount != expectCount) {
+            error("incorrect number of matches found: " + foundCount
+                  + ", expected: " + expectCount);
+        }
+    }
+
+    private List<String> list(String... args) {
+        return Arrays.asList(args);
+    }
+
+    void error(String msg) {
+        System.err.println(msg);
+        errors++;
+    }
+
+    int count;
+    int errors;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javadoc/6958836/errs/Errors.java	Wed Jul 21 09:57:21 2010 -0700
@@ -0,0 +1,38 @@
+/*
+ * 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.
+ */
+
+package errs;
+
+// class with 10 errors
+class Errors {
+    X m0() { }
+    X m1() { }
+    X m2() { }
+    X m3() { }
+    X m4() { }
+    X m5() { }
+    X m6() { }
+    X m7() { }
+    X m8() { }
+    X m9() { }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javadoc/6958836/warns/Warnings.java	Wed Jul 21 09:57:21 2010 -0700
@@ -0,0 +1,57 @@
+/*
+ * 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.
+ */
+
+package warns;
+
+// class with 10 warnings
+public class Warnings {
+    /** @param x */
+    public void m0() { }
+
+    /** @param x */
+    public void m1() { }
+
+    /** @param x */
+    public void m2() { }
+
+    /** @param x */
+    public void m3() { }
+
+    /** @param x */
+    public void m4() { }
+
+    /** @param x */
+    public void m5() { }
+
+    /** @param x */
+    public void m6() { }
+
+    /** @param x */
+    public void m7() { }
+
+    /** @param x */
+    public void m8() { }
+
+    /** @param x */
+    public void m9() { }
+}
--- a/make/Defs-internal.gmk	Tue Jul 20 16:09:44 2010 -0700
+++ b/make/Defs-internal.gmk	Wed Jul 21 09:57:21 2010 -0700
@@ -52,7 +52,6 @@
 endif
 
 # Define absolute paths to TOPDIRs
-ABS_CONTROL_TOPDIR:=$(call OptFullPath,"$(CONTROL_TOPDIR)")
 ABS_LANGTOOLS_TOPDIR:=$(call OptFullPath,"$(LANGTOOLS_TOPDIR)")
 ABS_CORBA_TOPDIR:=$(call OptFullPath,"$(CORBA_TOPDIR)")
 ABS_JAXP_TOPDIR:=$(call OptFullPath,"$(JAXP_TOPDIR)")
--- a/make/jprt.gmk	Tue Jul 20 16:09:44 2010 -0700
+++ b/make/jprt.gmk	Wed Jul 21 09:57:21 2010 -0700
@@ -45,11 +45,11 @@
 endif
 
 jprt_build_fastdebug: fastdebug_build
-	( $(CD) $(OUTPUTDIR)-fastdebug/j2sdk-image && \
+	( $(CD) $(OUTPUTDIR)/../$(PLATFORM)-$(ARCH)-fastdebug/j2sdk-image && \
 	  $(ZIPEXE) -q -r $(JPRT_ARCHIVE_BUNDLE) . )
 
 jprt_build_debug: debug_build
-	( $(CD) $(OUTPUTDIR)-debug/j2sdk-image && \
+	( $(CD) $(OUTPUTDIR)/../$(PLATFORM)-$(ARCH)-debug/j2sdk-image && \
 	  $(ZIPEXE) -q -r $(JPRT_ARCHIVE_BUNDLE) . )
 
 ################################################################
--- a/make/sanity-rules.gmk	Tue Jul 20 16:09:44 2010 -0700
+++ b/make/sanity-rules.gmk	Wed Jul 21 09:57:21 2010 -0700
@@ -281,7 +281,6 @@
 	@$(ECHO) "Build Directory Structure:" >> $(MESSAGE_FILE)
 	@$(ECHO) "   CWD = `$(PWD)`" >> $(MESSAGE_FILE)
 	@$(ECHO) "   TOPDIR = $(TOPDIR)"  >> $(MESSAGE_FILE)
-	@$(ECHO) "   CONTROL_TOPDIR = $(CONTROL_TOPDIR)"  >> $(MESSAGE_FILE)
 ifeq ($(LANGTOOLS_SRC_AVAILABLE), true)
 	@$(ECHO) "   LANGTOOLS_TOPDIR = $(LANGTOOLS_TOPDIR)"  >> $(MESSAGE_FILE)
 endif
--- a/test/Makefile	Tue Jul 20 16:09:44 2010 -0700
+++ b/test/Makefile	Wed Jul 21 09:57:21 2010 -0700
@@ -54,30 +54,33 @@
 
 # Test target list for jdk repository
 JDK_TEST_LIST = \
-	jdk_awt \
-	jdk_beans jdk_beans1 jdk_beans2 jdk_beans3  \
+	jdk_beans1 jdk_beans2 jdk_beans3  \
 	jdk_io  \
 	jdk_lang  \
-	jdk_management jdk_management1 jdk_management2  \
+	jdk_management1 jdk_management2  \
 	jdk_math  \
 	jdk_misc  \
 	jdk_net  \
-	jdk_nio jdk_nio1 jdk_nio2 jdk_nio3  \
+	jdk_nio1 jdk_nio2 jdk_nio3  \
+	jdk_security1 jdk_security2 jdk_security3  \
+	jdk_text  \
+	jdk_tools1 jdk_tools2  \
+	jdk_util
+
+# These tests need a DISPLAY and can create window interaction complications
+JDK_TEST_LIST2 = \
+	jdk_awt \
 	jdk_rmi \
-	jdk_security jdk_security1 jdk_security2 jdk_security3  \
-	jdk_swing \
-	jdk_text  \
-	jdk_tools jdk_tools1 jdk_tools2  \
-	jdk_util
+	jdk_swing
 
 # Default test target (everything)
 all: $(JDK_TEST_LIST) $(LANGTOOLS_TEST_LIST)
 
 # Test targets
 $(LANGTOOLS_TEST_LIST):
-	@$(call SUBDIR_TEST, $(LANGTOOLS_DIR), $(subst langtools_,,$@))
+	@$(NO_STOPPING)$(call SUBDIR_TEST, $(LANGTOOLS_DIR), $(subst langtools_,,$@))
 $(JDK_TEST_LIST):
-	@$(call SUBDIR_TEST, $(JDK_DIR), $@)
+	@$(NO_STOPPING)$(call SUBDIR_TEST, $(JDK_DIR), $@)
 
 clean: