Merge
diff --git a/.hgtags-top-repo b/.hgtags-top-repo
index 6681557..7dc9b1b 100644
--- a/.hgtags-top-repo
+++ b/.hgtags-top-repo
@@ -41,3 +41,4 @@
 269c1ec4435dfb7b452ae6e3bdde005d55c5c830 jdk7-b64
 e01380cd1de4ce048b87d059d238e5ab5e341947 jdk7-b65
 6bad5e3fe50337d95b1416d744780d65bc570da6 jdk7-b66
+c4523c6f82048f420bf0d57c4cd47976753b7d2c jdk7-b67
diff --git a/corba/.hgtags b/corba/.hgtags
index 55f6338..3e17536 100644
--- a/corba/.hgtags
+++ b/corba/.hgtags
@@ -41,3 +41,4 @@
 047dd27fddb607f8135296b3754131f6e13cb8c7 jdk7-b64
 97fd9b42f5c2d342b90d18f0a2b57e4117e39415 jdk7-b65
 a821e059a961bcb02830280d51f6dd030425c066 jdk7-b66
+a12ea7c7b497b4ba7830550095ef633bd6f43971 jdk7-b67
diff --git a/corba/make/Makefile b/corba/make/Makefile
index 0ca13f6..d986cc3 100644
--- a/corba/make/Makefile
+++ b/corba/make/Makefile
@@ -110,7 +110,7 @@
 ifdef TARGET_CLASS_VERSION
     TARGET_LEVEL = $(TARGET_CLASS_VERSION)
 else
-    TARGET_LEVEL = 6
+    TARGET_LEVEL = 7
 endif
 
 ifndef TARGET_JAVA
diff --git a/corba/make/common/shared/Defs-java.gmk b/corba/make/common/shared/Defs-java.gmk
index 44764bd..591dd1d 100644
--- a/corba/make/common/shared/Defs-java.gmk
+++ b/corba/make/common/shared/Defs-java.gmk
@@ -107,12 +107,12 @@
 NO_PROPRIETARY_API_WARNINGS = -XDignore.symbol.file=true
 JAVACFLAGS  += $(NO_PROPRIETARY_API_WARNINGS)
 
-# Add the source level (currently all source is 1.5, should this be 1.6?)
-LANGUAGE_VERSION = -source 1.5
+# Add the source level
+LANGUAGE_VERSION = -source 7
 JAVACFLAGS  += $(LANGUAGE_VERSION)
 
-# Add the class version we want (currently this is 5, should it be 6 or even 7?)
-TARGET_CLASS_VERSION = 5
+# Add the class version we want
+TARGET_CLASS_VERSION = 7
 CLASS_VERSION = -target $(TARGET_CLASS_VERSION)
 JAVACFLAGS  += $(CLASS_VERSION)
 JAVACFLAGS  += -encoding ascii
diff --git a/hotspot/.hgtags b/hotspot/.hgtags
index e805fe0..ad4c8f2 100644
--- a/hotspot/.hgtags
+++ b/hotspot/.hgtags
@@ -41,3 +41,4 @@
 ba36394eb84b949b31212bdb32a518a8f92bab5b jdk7-b64
 ba313800759b678979434d6da8ed3bf49eb8bea4 jdk7-b65
 57c71ad0341b8b64ed20f81151eb7f06324f8894 jdk7-b66
+18f526145aea355a9320b724373386fc2170f183 jdk7-b67
diff --git a/jaxp/.hgtags b/jaxp/.hgtags
index 9b72496..f196582 100644
--- a/jaxp/.hgtags
+++ b/jaxp/.hgtags
@@ -41,3 +41,4 @@
 a10eec7a1edf536f39b5828d8623054dbc62c2b7 jdk7-b64
 008c662e0ee9a91aebb75e46b97de979083d5c1c jdk7-b65
 22f9d5d5b5fe0f47048f41e6c6e54fee5edad0ec jdk7-b66
+a033af8d824a408d3ac602205ecdefc128749e1e jdk7-b67
diff --git a/jaxp/make/build.properties b/jaxp/make/build.properties
index 6689159..b47b032 100644
--- a/jaxp/make/build.properties
+++ b/jaxp/make/build.properties
@@ -30,8 +30,8 @@
 # one of the standard user build.properties files (see build.xml)
 
 # options for the <javac> tasks used to compile the tools
-javac.source = 5
-javac.target = 5
+javac.source = 7
+javac.target = 7
 javac.debug = true
 javac.no.jdk.warnings = -XDignore.symbol.file=true
 # set the following to -version to verify the versions of javac being used
diff --git a/jaxws/.hgtags b/jaxws/.hgtags
index a5dc8fe..36dc0d6 100644
--- a/jaxws/.hgtags
+++ b/jaxws/.hgtags
@@ -41,3 +41,4 @@
 aaa25dfd3de68c6f1a1d3ef8c45fd99f76bca6dd jdk7-b64
 aa22a1be5866a6608ba17a7a443945559409ae0f jdk7-b65
 fa8712c099edd5c9a6b3ed9729353738004d388f jdk7-b66
+faa13cd4d6cdcfb155da5ed23b0da6e0ed0f9ea8 jdk7-b67
diff --git a/jaxws/make/build.properties b/jaxws/make/build.properties
index 6689159..b47b032 100644
--- a/jaxws/make/build.properties
+++ b/jaxws/make/build.properties
@@ -30,8 +30,8 @@
 # one of the standard user build.properties files (see build.xml)
 
 # options for the <javac> tasks used to compile the tools
-javac.source = 5
-javac.target = 5
+javac.source = 7
+javac.target = 7
 javac.debug = true
 javac.no.jdk.warnings = -XDignore.symbol.file=true
 # set the following to -version to verify the versions of javac being used
diff --git a/jdk/.hgtags b/jdk/.hgtags
index b19d229..73634a1 100644
--- a/jdk/.hgtags
+++ b/jdk/.hgtags
@@ -41,3 +41,4 @@
 a50217eb3ee10b9f9547e0708e5c9625405083ef jdk7-b64
 382a27aa78d3236fa123c60577797a887fe93e09 jdk7-b65
 bd31b30a5b21f20e42965b1633f18a5c7946d398 jdk7-b66
+a952aafd5181af953b0ef3010dbd2fcc28460e8a jdk7-b67
diff --git a/jdk/make/com/sun/crypto/provider/Makefile b/jdk/make/com/sun/crypto/provider/Makefile
index f8134de..8cf809d 100644
--- a/jdk/make/com/sun/crypto/provider/Makefile
+++ b/jdk/make/com/sun/crypto/provider/Makefile
@@ -1,5 +1,5 @@
 #
-# Copyright 2007-2008 Sun Microsystems, Inc.  All Rights Reserved.
+# Copyright 2007-2009 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
@@ -45,54 +45,49 @@
 # For OpenJDK, the jar files built here are installed directly into the
 # OpenJDK.
 #
-# For JDK, the binaries use pre-built/pre-signed/pre-obfuscated binary
-# files stored in the closed workspace that are not shipped in the
-# OpenJDK workspaces.  We still build the JDK files here to verify the
-# files compile, and in preparation for possible signing and
-# obfuscation.  Developers working on JCE in JDK must sign the JCE files
-# before testing: obfuscation is optional during development.  The JCE
-# signing key is kept separate from the JDK workspace to prevent its
-# disclosure.  The obfuscation tool has not been licensed for general
-# usage.
-#
+# For JDK, the binaries use pre-built/pre-signed binary files stored in
+# the closed workspace that are not shipped in the OpenJDK workspaces.
+# We still build the JDK files here to verify the files compile, and in
+# preparation for possible signing.  Developers working on JCE in JDK
+# must sign the JCE files before testing.  The JCE signing key is kept
+# separate from the JDK workspace to prevent its disclosure.
+# 
 # SPECIAL NOTE TO JCE/JDK developers:  The source files must eventually
-# be built, obfuscated, signed, and then the resulting jar files MUST BE
-# CHECKED INTO THE CLOSED PART OF THE WORKSPACE*.  This separate step
-# *MUST NOT BE FORGOTTEN*, otherwise a bug fixed in the source code will
-# not be reflected in the shipped binaries.  The "release" target should be
+# be built and signed, and the resulting jar files MUST BE CHECKED INTO
+# THE CLOSED PART OF THE WORKSPACE*.  This separate step *MUST NOT BE
+# FORGOTTEN*, otherwise a bug fixed in the source code will not be
+# reflected in the shipped binaries.  The "release" target should be
 # used to generate the required files.
 #
 # There are a number of targets to help both JDK/OpenJDK developers.
 #
 # Main Targets (JDK/OPENJDK):
 #
-#     all/clobber/clean		The usual.
-#				    If OpenJDK, installs sunjce_provider.jar.
-#				    If JDK, installs prebuilt
-#				    sunjce_provider.jar.
+#     all/clobber/clean        The usual.
+#                                  If OpenJDK, installs sunjce_provider.jar.
+#                                  If JDK, installs prebuilt
+#                                      sunjce_provider.jar.
 #
-#     jar			Builds/installs sunjce_provider.jar
-#				    If OpenJDK, does not sign.
-#				    If JDK, tries to sign.
+#     jar                      Builds/installs sunjce_provider.jar
+#                                  If OpenJDK, does not sign.
+#                                  If JDK, tries to sign.
 #
 # Other lesser-used Targets (JDK/OPENJDK):
 #
-#     build-jar			Builds sunjce_provider.jar
-#				    (does not sign/install)
+#     build-jar                Builds sunjce_provider.jar
+#                                  (does not sign/install)
 #
-#     install-jar		Alias for "jar" above.
+#     install-jar              Alias for "jar" above.
 #
 # Other targets (JDK only):
 #
-#     sign			Alias for sign-jar
-#	  sign-jar		Builds/signs sunjce_provider.jar (no install)
+#     sign                     Alias for sign-jar
+#         sign-jar             Builds/signs sunjce_provider.jar (no install)
 #
-#     obfus			Builds/obfuscates/signs sunjce_provider.jar
+#     release                  Builds all targets in preparation
+#                              for workspace integration.
 #
-#     release			Builds all targets in preparation
-#				for workspace integration.
-#
-#     install-prebuilt		Installs the pre-built jar files
+#     install-prebuilt         Installs the pre-built jar files
 #
 # This makefile was written to support parallel target execution.
 #
@@ -103,7 +98,7 @@
 
 #
 # The following is for when we need to do postprocessing
-# (signing/obfuscation) against a read-only build.  If the OUTPUTDIR
+# (signing) against a read-only build.  If the OUTPUTDIR
 # isn't writable, the build currently crashes out.
 #
 ifndef OPENJDK
@@ -158,8 +153,8 @@
 #
 # We use a variety of subdirectories in the $(TEMPDIR) depending on what
 # part of the build we're doing.  Both OPENJDK/JDK builds are initially
-# done in the unsigned area.  When files are signed or obfuscated in JDK,
-# they will be placed in the appropriate areas.
+# done in the unsigned area.  When files are signed in JDK, they will be
+# placed in the appropriate areas.
 #
 UNSIGNED_DIR = $(TEMPDIR)/unsigned
 
@@ -223,61 +218,15 @@
 endif
 	$(call sign-file, $(UNSIGNED_DIR)/sunjce_provider.jar)
 
-# =====================================================
-# Obfuscate/sign/install the JDK build.  Not needed for OpenJDK.
-#
-
-OBFUS_DIR = $(JCE_BUILD_DIR)/obfus/sunjce
-
-CLOSED_DIR = $(BUILDDIR)/closed/com/sun/crypto/provider
-
-obfus: $(OBFUS_DIR)/sunjce_provider.jar
-	$(release-warning)
-
-ifndef ALT_JCE_BUILD_DIR
-$(OBFUS_DIR)/sunjce_provider.jar: build-jar $(JCE_MANIFEST_FILE) \
-	    $(OBFUS_DIR)/sunjce.dox
-else
-$(OBFUS_DIR)/sunjce_provider.jar: $(JCE_MANIFEST_FILE) $(OBFUS_DIR)/sunjce.dox
-	@if [ ! -d $(CLASSDESTDIR) ] ; then \
-	    $(ECHO) "Couldn't find $(CLASSDESTDIR)"; \
-	    exit 1; \
-	fi
-endif
-	@$(ECHO) ">>>Obfuscating SunJCE Provider..."
-	$(presign)
-	$(preobfus)
-	$(prep-target)
-	$(CD) $(OBFUS_DIR); \
-	$(OBFUSCATOR) -fv sunjce.dox
-	@$(CD) $(OBFUS_DIR); $(java-vm-cleanup)
-	$(BOOT_JAR_CMD) cmf $(JCE_MANIFEST_FILE) $@ \
-	    -C $(OBFUS_DIR)/build com \
-	    $(BOOT_JAR_JFLAGS)
-	$(sign-target)
-	@$(java-vm-cleanup)
-
-$(OBFUS_DIR)/sunjce.dox: $(CLOSED_DIR)/obfus/sunjce.dox
-	@$(ECHO) ">>>Creating sunjce.dox"
-	$(prep-target)
-	$(SED) "s:@@TEMPDIR@@:$(ABS_TEMPDIR):" $< > $@
-
-#
-# The current obfuscator has a limitation in that it currently only
-# supports up to v49 class file format.  Force v49 classfiles in our
-# builds for now.
-#
-TARGET_CLASS_VERSION = 5
-
 
 # =====================================================
-# Create the Release Engineering files.  Obfuscated builds, etc.
+# Create the Release Engineering files.  Signed builds, etc.
 #
 
-release: $(OBFUS_DIR)/sunjce_provider.jar
+release: $(SIGNED_DIR)/sunjce_provider.jar
 	$(RM) $(JCE_BUILD_DIR)/release/sunjce_provider.jar
 	$(MKDIR) -p $(JCE_BUILD_DIR)/release
-	$(CP) $(OBFUS_DIR)/sunjce_provider.jar $(JCE_BUILD_DIR)/release
+	$(CP) $(SIGNED_DIR)/sunjce_provider.jar $(JCE_BUILD_DIR)/release
 	$(release-warning)
 
 endif # OPENJDK
@@ -319,5 +268,5 @@
 
 .PHONY: build-jar jar install-jar
 ifndef OPENJDK
-.PHONY: sign sign-jar obfus release install-prebuilt
+.PHONY: sign sign-jar release install-prebuilt
 endif
diff --git a/jdk/make/common/shared/Defs-control.gmk b/jdk/make/common/shared/Defs-control.gmk
index 9c62bf6..565cbba 100644
--- a/jdk/make/common/shared/Defs-control.gmk
+++ b/jdk/make/common/shared/Defs-control.gmk
@@ -92,9 +92,9 @@
 dummy := $(shell $(MKDIR) -p $(TEMP_DIR))
 
 # The language version we want for this jdk build
-SOURCE_LANGUAGE_VERSION=5
+SOURCE_LANGUAGE_VERSION=7
 # The class version we want for this jdk build
-TARGET_CLASS_VERSION=5
+TARGET_CLASS_VERSION=7
 
 # The MESSAGE, WARNING and ERROR files are used to store sanity check and 
 # source check messages, warnings and errors. 
diff --git a/jdk/make/common/shared/Defs-java.gmk b/jdk/make/common/shared/Defs-java.gmk
index 16db68b..9d918af 100644
--- a/jdk/make/common/shared/Defs-java.gmk
+++ b/jdk/make/common/shared/Defs-java.gmk
@@ -122,13 +122,13 @@
   JAVACFLAGS  += -Werror
 endif
 
-# Add the source level (currently all source is 1.5, should this be 1.6?)
-SOURCE_LANGUAGE_VERSION = 5
+# Add the source level
+SOURCE_LANGUAGE_VERSION = 7
 LANGUAGE_VERSION = -source $(SOURCE_LANGUAGE_VERSION)
 JAVACFLAGS  += $(LANGUAGE_VERSION)
 
-# Add the class version we want (currently this is 5, should it be 6 or even 7?)
-TARGET_CLASS_VERSION = 5
+# Add the class version we want
+TARGET_CLASS_VERSION = 7
 CLASS_VERSION = -target $(TARGET_CLASS_VERSION)
 JAVACFLAGS  += $(CLASS_VERSION)
 JAVACFLAGS  += -encoding ascii
diff --git a/jdk/make/java/dyn/Makefile b/jdk/make/java/dyn/Makefile
index 00cc225..5ae0b50 100644
--- a/jdk/make/java/dyn/Makefile
+++ b/jdk/make/java/dyn/Makefile
@@ -33,8 +33,8 @@
 
 # The sources built here use new language syntax to generate
 # method handle calls.  Let's be sure we are using that format.
-#LANGUAGE_VERSION = -source 7
-#CLASS_VERSION = -target 7
+LANGUAGE_VERSION = -source 7
+CLASS_VERSION = -target 7
 
 # Actually, it will be less disruptive to compile with the same
 # -target option as the rest of the system, and just turn on
diff --git a/jdk/make/javax/crypto/Defs-jce.gmk b/jdk/make/javax/crypto/Defs-jce.gmk
index 46fe111..0b75bce 100644
--- a/jdk/make/javax/crypto/Defs-jce.gmk
+++ b/jdk/make/javax/crypto/Defs-jce.gmk
@@ -1,5 +1,5 @@
 #
-# Copyright 2007-2008 Sun Microsystems, Inc.  All Rights Reserved.
+# Copyright 2007-2009 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
@@ -61,7 +61,7 @@
 SIGNING_ALIAS      = jce_rsa
 
 #
-# Defines for signing/obfuscating the various jar files.
+# Defines for signing the various jar files.
 #
 
 define presign
@@ -100,19 +100,4 @@
 	$(sign-target)
 endef
 
-#
-# Location for the Obfuscation product.  JDK currently has
-# the requirement that we obfuscate our JCE jars.
-#
-OBFUSCATOR = /security/tools/bin/obfus
-OBFUS_DIR = $(TEMPDIR)/obfus
-
-define preobfus
-    @if [ ! -f $(OBFUSCATOR) ]; then \
-	$(ECHO) "\n$(OBFUSCATOR): Obfuscator *NOT* available..." \
-	    $(README-MAKEFILE_WARNING); \
-	exit 2; \
-    fi
-endef
-
 endif  # !OPENJDK
diff --git a/jdk/make/javax/crypto/Makefile b/jdk/make/javax/crypto/Makefile
index 216ff6e..fe07ed5 100644
--- a/jdk/make/javax/crypto/Makefile
+++ b/jdk/make/javax/crypto/Makefile
@@ -1,5 +1,5 @@
 #
-# Copyright 2007-2008 Sun Microsystems, Inc.  All Rights Reserved.
+# Copyright 2007-2009 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
@@ -44,64 +44,65 @@
 # For OpenJDK, the jar files built here are installed directly into the
 # OpenJDK.
 #
-# For JDK, the binaries use pre-built/pre-signed/pre-obfuscated binary
-# files stored in the closed workspace that are not shipped in the
-# OpenJDK workspaces.  We still build the JDK files here to verify the
-# files compile, and in preparation for possible signing and
-# obfuscation.  Developers working on JCE in JDK must sign the JCE files
-# before testing: obfuscation is optional during development.  The JCE
-# signing key is kept separate from the JDK workspace to prevent its
-# disclosure.  The obfuscation tool has not been licensed for general
-# usage.
+# For JDK, the binaries use pre-built/pre-signed binary files stored in
+# the closed workspace that are not shipped in the OpenJDK workspaces.
+# We still build the JDK files here to verify the files compile, and in
+# preparation for possible signing.  Developers working on JCE in JDK
+# must sign the JCE files before testing.  The JCE signing key is kept
+# separate from the JDK workspace to prevent its disclosure.
 #
 # SPECIAL NOTE TO JCE/JDK developers:  The source files must eventually
-# be built, obfuscated, signed, and the resulting jar files *MUST BE
-# CHECKED INTO THE CLOSED PART OF THE WORKSPACE*.  This separate step
-# *MUST NOT BE FORGOTTEN*, otherwise a bug fixed in the source code will
-# not be reflected in the shipped binaries.  The "release" target should
-# be used to generate the required files.
+# be built and signed, and the resulting jar files *MUST BE CHECKED INTO
+# THE CLOSED PART OF THE WORKSPACE*.  This separate step *MUST NOT BE
+# FORGOTTEN*, otherwise a bug fixed in the source code will not be
+# reflected in the shipped binaries.  The "release" target should be
+# used to generate the required files.
 #
 # There are a number of targets to help both JDK/OpenJDK developers.
 #
 # Main Targets (JDK/OPENJDK):
 #
-#     all/clobber/clean		The usual.
-#				    If OpenJDK, installs
-#					jce.jar/limited policy files.
-#				    If JDK, installs prebuilt
-#					jce.jar/limited policy files.
+#     all/clobber/clean        The usual.
+#                                  If OpenJDK: builds/installs the
+#                                      jce.jar/limited policy files.
+#                                  If JDK: builds but does not install.
+#                                     During full tops-down builds,
+#                                     prebuilt/presigned jce.jar &
+#                                     limited policy files are copied
+#                                     in by make/java/redist/Makefile.
+#                                     If you are working in this directory
+#                                     and want to install the prebuilts,
+#                                     use the "install-prebuilt" target.
 #
-#     jar			Builds/installs jce.jar
-#				    If OpenJDK, does not sign
-#				    If JDK, tries to sign
+#     jar                      Builds/installs jce.jar
+#                                  If OpenJDK, does not sign
+#                                  If JDK, tries to sign
 #
 # Other lesser-used Targets (JDK/OPENJDK):
 #
-#     build-jar			Builds jce.jar (does not sign/install)
+#     build-jar                Builds jce.jar (does not sign/install)
 #
-#     build-policy		Builds policy files (does not sign/install)
+#     build-policy             Builds policy files (does not sign/install)
 #
-#     install-jar		Alias for "jar" above
+#     install-jar              Alias for "jar" above
 #
-#     install-limited		Builds/installs limited policy files
-#				    If OpenJDK, does not sign
-#				    If JDK, tries to sign
-#     install-unlimited		Builds/nstalls unlimited policy files
-#				    If OpenJDK, does not sign
-#				    If JDK, tries to sign
+#     install-limited          Builds/installs limited policy files
+#                                  If OpenJDK, does not sign
+#                                  If JDK, tries to sign
+#     install-unlimited        Builds/nstalls unlimited policy files
+#                                  If OpenJDK, does not sign
+#                                  If JDK, tries to sign
 #
 # Other targets (JDK only):
 #
-#     sign			Alias for sign-jar and sign-policy
-#	  sign-jar		Builds/signs jce.jar file (no install)
-#	  sign-policy		Builds/signs policy files (no install)
+#     sign                     Alias for sign-jar and sign-policy
+#          sign-jar            Builds/signs jce.jar file (no install)
+#          sign-policy         Builds/signs policy files (no install)
 #
-#     obfus			Builds/obfuscates/signs jce.jar
+#     release                  Builds all targets in preparation
+#                              for workspace integration.
 #
-#     release			Builds all targets in preparation
-#				for workspace integration.
-#
-#     install-prebuilt		Installs the pre-built jar files
+#     install-prebuilt         Installs the pre-built jar files
 #
 # This makefile was written to support parallel target execution.
 #
@@ -112,7 +113,7 @@
 
 #
 # The following is for when we need to do postprocessing
-# (signing/obfuscation) against a read-only build.  If the OUTPUTDIR
+# (signing) against a read-only build.  If the OUTPUTDIR
 # isn't writable, the build currently crashes out.
 #
 ifndef OPENJDK
@@ -169,8 +170,8 @@
 #
 # We use a variety of subdirectories in the $(TEMPDIR) depending on what
 # part of the build we're doing.  Both OPENJDK/JDK builds are initially
-# done in the unsigned area.  When files are signed or obfuscated in JDK,
-# they will be placed in the appropriate areas.
+# done in the unsigned area.  When files are signed in JDK, they will be
+# placed in the appropriate areas.
 #
 UNSIGNED_DIR = $(TEMPDIR)/unsigned
 
@@ -178,7 +179,7 @@
 
 
 # =====================================================
-# Build the unsigned jce.jar file.  Signing/obfuscation comes later.
+# Build the unsigned jce.jar file.  Signing comes later.
 #
 
 JAR_DESTFILE = $(LIBDIR)/jce.jar
@@ -363,68 +364,13 @@
 
 
 # =====================================================
-# Obfuscate/sign/install the JDK build.  Not needed for OpenJDK.
-#
-
-OBFUS_DIR = $(JCE_BUILD_DIR)/obfus/jce
-
-CLOSED_DIR = $(BUILDDIR)/closed/javax/crypto
-
-obfus: $(OBFUS_DIR)/jce.jar
-	$(release-warning)
-
-ifndef ALT_JCE_BUILD_DIR
-$(OBFUS_DIR)/jce.jar: build-jar $(JCE_MANIFEST_FILE) $(OBFUS_DIR)/framework.dox
-else
-#
-# We have to remove the build dependency, otherwise, we'll try to rebuild it
-# which we can't do on a read-only filesystem.
-#
-$(OBFUS_DIR)/jce.jar: $(JCE_MANIFEST_FILE) $(OBFUS_DIR)/framework.dox
-	@if [ ! -d $(CLASSDESTDIR) ] ; then \
-	    $(ECHO) "Couldn't find $(CLASSDESTDIR)"; \
-	    exit 1; \
-	fi
-endif
-	@$(ECHO) ">>>Obfuscating JCE framework..."
-	$(presign)
-	$(preobfus)
-	$(prep-target)
-	$(CD) $(OBFUS_DIR); \
-	$(OBFUSCATOR) -fv framework.dox
-	@$(CD) $(OBFUS_DIR); $(java-vm-cleanup)
-	@#
-	@# The sun.security.internal classes are currently not obfuscated
-	@# due to an obfus problem. Manually copy them to the build directory
-	@# so that they are included in the jce.jar file.
-	@#
-	$(CP) -r $(CLASSDESTDIR)/sun $(OBFUS_DIR)/build
-	$(BOOT_JAR_CMD) cmf $(JCE_MANIFEST_FILE) $@	\
-	    -C $(OBFUS_DIR)/build javax			\
-	    -C $(OBFUS_DIR)/build sun			\
-	    $(BOOT_JAR_JFLAGS)
-	$(sign-target)
-	@$(java-vm-cleanup)
-
-$(OBFUS_DIR)/framework.dox: $(CLOSED_DIR)/obfus/framework.dox
-	@$(ECHO) ">>>Creating framework.dox"
-	$(prep-target)
-	$(SED) "s:@@TEMPDIR@@:$(ABS_TEMPDIR):" $< > $@
-
-#
-# The current obfuscator has a limitation in that it currently only
-# supports up to v49 class file format.  Force v49 classfiles in our
-# builds for now.
-#
-TARGET_CLASS_VERSION = 5
-
-
-# =====================================================
-# Create the Release Engineering files.  Obfuscated builds,
+# Create the Release Engineering files.  Signed builds,
 # unlimited policy file distribution, etc.
 #
 
-release: $(OBFUS_DIR)/jce.jar sign-policy $(CLOSED_DIR)/doc/COPYRIGHT.html \
+CLOSED_DIR = $(BUILDDIR)/closed/javax/crypto
+
+release: $(SIGNED_DIR)/jce.jar sign-policy $(CLOSED_DIR)/doc/COPYRIGHT.html \
          $(CLOSED_DIR)/doc/README.txt
 	$(RM) -r \
 	    $(JCE_BUILD_DIR)/release/UnlimitedJCEPolicy              \
@@ -433,7 +379,7 @@
 	    $(JCE_BUILD_DIR)/release/local_policy.jar                \
 	    $(JCE_BUILD_DIR)/release/UnlimitedJCEPolicy.zip
 	$(MKDIR) -p $(JCE_BUILD_DIR)/release/UnlimitedJCEPolicy
-	$(CP) $(OBFUS_DIR)/jce.jar $(JCE_BUILD_DIR)/release
+	$(CP) $(SIGNED_DIR)/jce.jar $(JCE_BUILD_DIR)/release
 	$(CP) \
 	    $(SIGNED_POLICY_BUILDDIR)/limited/US_export_policy.jar   \
 	    $(SIGNED_POLICY_BUILDDIR)/limited/local_policy.jar       \
@@ -529,5 +475,5 @@
 .PHONY: build-jar jar build-policy unlimited limited install-jar \
 	install-limited install-unlimited
 ifndef OPENJDK
-.PHONY: sign sign-jar sign-policy obfus release install-prebuilt
+.PHONY: sign sign-jar sign-policy release install-prebuilt
 endif
diff --git a/jdk/make/sun/security/mscapi/Makefile b/jdk/make/sun/security/mscapi/Makefile
index 08d6609..c16d130 100644
--- a/jdk/make/sun/security/mscapi/Makefile
+++ b/jdk/make/sun/security/mscapi/Makefile
@@ -1,5 +1,5 @@
 #
-# Copyright 2005-2008 Sun Microsystems, Inc.  All Rights Reserved.
+# Copyright 2005-2009 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
@@ -59,31 +59,31 @@
 #
 # Main Targets (JDK/OPENJDK):
 #
-#     all/clobber/clean		The usual, plus the native libraries.
-#				    If OpenJDK, installs sunmscapi.jar.
-#				    If JDK, installs prebuilt
-#				    sunmscapi.jar.
+#     all/clobber/clean        The usual, plus the native libraries.
+#                                  If OpenJDK, installs sunmscapi.jar.
+#                                  If JDK, installs prebuilt
+#                                      sunmscapi.jar.
 #
-#     jar			Builds/installs sunmscapi.jar
-#				    If OpenJDK, does not sign.
-#				    If JDK, tries to sign.
+#     jar                      Builds/installs sunmscapi.jar
+#                                  If OpenJDK, does not sign.
+#                                  If JDK, tries to sign.
 #
 # Other lesser-used Targets (JDK/OPENJDK):
 #
-#     build-jar			Builds sunmscapi.jar
-#				    (does not sign/install)
+#     build-jar                Builds sunmscapi.jar
+#                                  (does not sign/install)
 #
-#     install-jar		Alias for "jar" above.
+#     install-jar              Alias for "jar" above.
 #
 # Other targets (JDK only):
 #
-#     sign			Alias for sign-jar
-#	  sign-jar		Builds/signs sunmscapi.jar (no install)
+#     sign                     Alias for sign-jar
+#          sign-jar            Builds/signs sunmscapi.jar (no install)
 #
-#     release			Builds all targets in preparation
-#				for workspace integration.
+#     release                  Builds all targets in preparation
+#                              for workspace integration.
 #
-#     install-prebuilt		Installs the pre-built jar files
+#     install-prebuilt         Installs the pre-built jar files
 #
 # This makefile was written to support parallel target execution.
 #
diff --git a/jdk/make/sun/security/pkcs11/Makefile b/jdk/make/sun/security/pkcs11/Makefile
index f20910b..9a4a408 100644
--- a/jdk/make/sun/security/pkcs11/Makefile
+++ b/jdk/make/sun/security/pkcs11/Makefile
@@ -1,5 +1,5 @@
 #
-# Copyright 2003-2008 Sun Microsystems, Inc.  All Rights Reserved.
+# Copyright 2003-2009 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
@@ -59,31 +59,31 @@
 #
 # Main Targets (JDK/OPENJDK):
 #
-#     all/clobber/clean		The usual, plus the native libraries.
-#				    If OpenJDK, installs sunpkcs11.jar.
-#				    If JDK, installs prebuilt
-#				    sunpkcs11.jar.
+#     all/clobber/clean        The usual, plus the native libraries.
+#                                  If OpenJDK, installs sunpkcs11.jar.
+#                                  If JDK, installs prebuilt
+#                                      sunpkcs11.jar.
 #
-#     jar			Builds/installs sunpkcs11.jar
-#				    If OpenJDK, does not sign.
-#				    If JDK, tries to sign.
+#     jar                      Builds/installs sunpkcs11.jar
+#                                  If OpenJDK, does not sign.
+#                                  If JDK, tries to sign.
 #
 # Other lesser-used Targets (JDK/OPENJDK):
 #
-#     build-jar			Builds sunpkcs11.jar
-#				    (does not sign/install)
+#     build-jar                Builds sunpkcs11.jar
+#                                  (does not sign/install)
 #
-#     install-jar		Alias for "jar" above.
+#     install-jar              Alias for "jar" above.
 #
 # Other targets (JDK only):
 #
-#     sign			Alias for sign-jar
-#	  sign-jar		Builds/signs sunpkcs11.jar (no install)
+#     sign                     Alias for sign-jar
+#          sign-jar            Builds/signs sunpkcs11.jar (no install)
 #
-#     release			Builds all targets in preparation
-#				for workspace integration.
+#     release                  Builds all targets in preparation
+#                              for workspace integration.
 #
-#     install-prebuilt		Installs the pre-built jar files
+#     install-prebuilt         Installs the pre-built jar files
 #
 # This makefile was written to support parallel target execution.
 #
diff --git a/jdk/src/share/classes/com/sun/crypto/provider/AESCipher.java b/jdk/src/share/classes/com/sun/crypto/provider/AESCipher.java
index 1809f6d..1d58e21 100644
--- a/jdk/src/share/classes/com/sun/crypto/provider/AESCipher.java
+++ b/jdk/src/share/classes/com/sun/crypto/provider/AESCipher.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2002-2007 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2002-2009 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
@@ -56,12 +56,8 @@
     /**
      * Creates an instance of AES cipher with default ECB mode and
      * PKCS5Padding.
-     *
-     * @exception SecurityException if this constructor fails to verify
-     * its own integrity
      */
     public AESCipher() {
-        SunJCE.ensureIntegrity(getClass());
         core = new CipherCore(new AESCrypt(), AESConstants.AES_BLOCK_SIZE);
     }
 
diff --git a/jdk/src/share/classes/com/sun/crypto/provider/AESKeyGenerator.java b/jdk/src/share/classes/com/sun/crypto/provider/AESKeyGenerator.java
index d6a715d..83cf322 100644
--- a/jdk/src/share/classes/com/sun/crypto/provider/AESKeyGenerator.java
+++ b/jdk/src/share/classes/com/sun/crypto/provider/AESKeyGenerator.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2002-2007 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2002-2009 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
@@ -48,16 +48,9 @@
     private int keySize = 16; // default keysize (in number of bytes)
 
     /**
-     * Verify the SunJCE provider in the constructor.
-     *
-     * @exception SecurityException if fails to verify
-     * its own integrity
+     * Empty constructor.
      */
     public AESKeyGenerator() {
-        if (!SunJCE.verifySelfIntegrity(this.getClass())) {
-            throw new SecurityException("The SunJCE provider may have " +
-                                        "been tampered.");
-        }
     }
 
     /**
diff --git a/jdk/src/share/classes/com/sun/crypto/provider/AESWrapCipher.java b/jdk/src/share/classes/com/sun/crypto/provider/AESWrapCipher.java
index 5bdcb13..501e2b6 100644
--- a/jdk/src/share/classes/com/sun/crypto/provider/AESWrapCipher.java
+++ b/jdk/src/share/classes/com/sun/crypto/provider/AESWrapCipher.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2004-2007 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2004-2009 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
@@ -65,12 +65,8 @@
     /**
      * Creates an instance of AES KeyWrap cipher with default
      * mode, i.e. "ECB" and padding scheme, i.e. "NoPadding".
-     *
-     * @exception SecurityException if this constructor fails to verify
-     * its own integrity
      */
     public AESWrapCipher() {
-        SunJCE.ensureIntegrity(getClass());
         cipher = new AESCrypt();
     }
 
diff --git a/jdk/src/share/classes/com/sun/crypto/provider/ARCFOURCipher.java b/jdk/src/share/classes/com/sun/crypto/provider/ARCFOURCipher.java
index 5876a45..62affa3 100644
--- a/jdk/src/share/classes/com/sun/crypto/provider/ARCFOURCipher.java
+++ b/jdk/src/share/classes/com/sun/crypto/provider/ARCFOURCipher.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2003-2007 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2003-2009 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
@@ -62,7 +62,6 @@
 
     // called by the JCE framework
     public ARCFOURCipher() {
-        SunJCE.ensureIntegrity(getClass());
         S = new int[256];
     }
 
diff --git a/jdk/src/share/classes/com/sun/crypto/provider/BlowfishCipher.java b/jdk/src/share/classes/com/sun/crypto/provider/BlowfishCipher.java
index 2b5f0fb..14d049f 100644
--- a/jdk/src/share/classes/com/sun/crypto/provider/BlowfishCipher.java
+++ b/jdk/src/share/classes/com/sun/crypto/provider/BlowfishCipher.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 1998-2007 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 1998-2009 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
@@ -60,12 +60,8 @@
     /**
      * Creates an instance of Blowfish cipher with default ECB mode and
      * PKCS5Padding.
-     *
-     * @exception SecurityException if this constructor fails to verify
-     * its own integrity
      */
     public BlowfishCipher() {
-        SunJCE.ensureIntegrity(getClass());
         core = new CipherCore(new BlowfishCrypt(),
                               BlowfishConstants.BLOWFISH_BLOCK_SIZE);
     }
diff --git a/jdk/src/share/classes/com/sun/crypto/provider/BlowfishKeyGenerator.java b/jdk/src/share/classes/com/sun/crypto/provider/BlowfishKeyGenerator.java
index 2d8fb85..96a2c71 100644
--- a/jdk/src/share/classes/com/sun/crypto/provider/BlowfishKeyGenerator.java
+++ b/jdk/src/share/classes/com/sun/crypto/provider/BlowfishKeyGenerator.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 1998-2007 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 1998-2009 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
@@ -46,16 +46,9 @@
     private int keysize = 16; // default keysize (in number of bytes)
 
     /**
-     * Verify the SunJCE provider in the constructor.
-     *
-     * @exception SecurityException if fails to verify
-     * its own integrity
+     * Empty constructor
      */
     public BlowfishKeyGenerator() {
-        if (!SunJCE.verifySelfIntegrity(this.getClass())) {
-            throw new SecurityException("The SunJCE provider may have " +
-                                        "been tampered.");
-        }
     }
 
     /**
diff --git a/jdk/src/share/classes/com/sun/crypto/provider/DESCipher.java b/jdk/src/share/classes/com/sun/crypto/provider/DESCipher.java
index 07ddf31..30f36f3 100644
--- a/jdk/src/share/classes/com/sun/crypto/provider/DESCipher.java
+++ b/jdk/src/share/classes/com/sun/crypto/provider/DESCipher.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 1997-2007 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 1997-2009 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
@@ -56,12 +56,8 @@
     /**
      * Creates an instance of DES cipher with default ECB mode and
      * PKCS5Padding.
-     *
-     * @exception SecurityException if this constructor fails to verify
-     * its own integrity
      */
     public DESCipher() {
-        SunJCE.ensureIntegrity(getClass());
         core = new CipherCore(new DESCrypt(), DESConstants.DES_BLOCK_SIZE);
     }
 
diff --git a/jdk/src/share/classes/com/sun/crypto/provider/DESKeyFactory.java b/jdk/src/share/classes/com/sun/crypto/provider/DESKeyFactory.java
index 3ffa89d..968d6f7 100644
--- a/jdk/src/share/classes/com/sun/crypto/provider/DESKeyFactory.java
+++ b/jdk/src/share/classes/com/sun/crypto/provider/DESKeyFactory.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 1997-2007 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 1997-2009 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
@@ -42,17 +42,11 @@
 public final class DESKeyFactory extends SecretKeyFactorySpi {
 
     /**
-     * Verify the SunJCE provider in the constructor.
-     *
-     * @exception SecurityException if fails to verify
-     * its own integrity
+     * Empty constructor
      */
     public DESKeyFactory() {
-        if (!SunJCE.verifySelfIntegrity(this.getClass())) {
-            throw new SecurityException("The SunJCE provider may have " +
-                                        "been tampered.");
-        }
     }
+
     /**
      * Generates a <code>SecretKey</code> object from the provided key
      * specification (key material).
diff --git a/jdk/src/share/classes/com/sun/crypto/provider/DESKeyGenerator.java b/jdk/src/share/classes/com/sun/crypto/provider/DESKeyGenerator.java
index 2a7ac8e..cd028d4 100644
--- a/jdk/src/share/classes/com/sun/crypto/provider/DESKeyGenerator.java
+++ b/jdk/src/share/classes/com/sun/crypto/provider/DESKeyGenerator.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 1997-2007 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 1997-2009 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
@@ -46,16 +46,9 @@
     private SecureRandom random = null;
 
     /**
-     * Verify the SunJCE provider in the constructor.
-     *
-     * @exception SecurityException if fails to verify
-     * its own integrity
+     * Empty constructor
      */
     public DESKeyGenerator() {
-        if (!SunJCE.verifySelfIntegrity(this.getClass())) {
-            throw new SecurityException("The SunJCE provider may have " +
-                                        "been tampered.");
-        }
     }
 
     /**
diff --git a/jdk/src/share/classes/com/sun/crypto/provider/DESedeCipher.java b/jdk/src/share/classes/com/sun/crypto/provider/DESedeCipher.java
index 1514f44..394a784 100644
--- a/jdk/src/share/classes/com/sun/crypto/provider/DESedeCipher.java
+++ b/jdk/src/share/classes/com/sun/crypto/provider/DESedeCipher.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 1997-2007 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 1997-2009 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
@@ -53,12 +53,8 @@
     /**
      * Creates an instance of DESede cipher with default ECB mode and
      * PKCS5Padding.
-     *
-     * @exception SecurityException if this constructor fails to verify
-     * its own integrity
      */
     public DESedeCipher() {
-        SunJCE.ensureIntegrity(getClass());
         core = new CipherCore(new DESedeCrypt(), DESConstants.DES_BLOCK_SIZE);
     }
 
diff --git a/jdk/src/share/classes/com/sun/crypto/provider/DESedeKeyFactory.java b/jdk/src/share/classes/com/sun/crypto/provider/DESedeKeyFactory.java
index 831ca8c..fcd619b 100644
--- a/jdk/src/share/classes/com/sun/crypto/provider/DESedeKeyFactory.java
+++ b/jdk/src/share/classes/com/sun/crypto/provider/DESedeKeyFactory.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 1997-2007 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 1997-2009 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
@@ -42,16 +42,9 @@
 public final class DESedeKeyFactory extends SecretKeyFactorySpi {
 
     /**
-     * Verify the SunJCE provider in the constructor.
-     *
-     * @exception SecurityException if fails to verify
-     * its own integrity
+     * Empty constructor
      */
     public DESedeKeyFactory() {
-        if (!SunJCE.verifySelfIntegrity(this.getClass())) {
-            throw new SecurityException("The SunJCE provider may have been " +
-                                        "tampered.");
-        }
     }
 
     /**
diff --git a/jdk/src/share/classes/com/sun/crypto/provider/DESedeKeyGenerator.java b/jdk/src/share/classes/com/sun/crypto/provider/DESedeKeyGenerator.java
index 439c8fa..333375e 100644
--- a/jdk/src/share/classes/com/sun/crypto/provider/DESedeKeyGenerator.java
+++ b/jdk/src/share/classes/com/sun/crypto/provider/DESedeKeyGenerator.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 1997-2007 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 1997-2009 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
@@ -47,16 +47,9 @@
     private int keysize = 168;
 
     /**
-     * Verify the SunJCE provider in the constructor.
-     *
-     * @exception SecurityException if fails to verify
-     * its own integrity
+     * Empty constructor
      */
     public DESedeKeyGenerator() {
-        if (!SunJCE.verifySelfIntegrity(this.getClass())) {
-            throw new SecurityException("The SunJCE provider may have been " +
-                                        "tampered.");
-        }
     }
 
     /**
diff --git a/jdk/src/share/classes/com/sun/crypto/provider/DESedeWrapCipher.java b/jdk/src/share/classes/com/sun/crypto/provider/DESedeWrapCipher.java
index 48cbb1e..c3a36d1 100644
--- a/jdk/src/share/classes/com/sun/crypto/provider/DESedeWrapCipher.java
+++ b/jdk/src/share/classes/com/sun/crypto/provider/DESedeWrapCipher.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2004-2007 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2004-2009 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
@@ -74,12 +74,8 @@
     /**
      * Creates an instance of CMS DESede KeyWrap cipher with default
      * mode, i.e. "CBC" and padding scheme, i.e. "NoPadding".
-     *
-     * @exception SecurityException if this constructor fails to verify
-     * its own integrity.
      */
     public DESedeWrapCipher() {
-        SunJCE.ensureIntegrity(getClass());
         cipher = new CipherBlockChaining(new DESedeCrypt());
     }
 
diff --git a/jdk/src/share/classes/com/sun/crypto/provider/DHKeyAgreement.java b/jdk/src/share/classes/com/sun/crypto/provider/DHKeyAgreement.java
index 30bec72..e2a3cf0 100644
--- a/jdk/src/share/classes/com/sun/crypto/provider/DHKeyAgreement.java
+++ b/jdk/src/share/classes/com/sun/crypto/provider/DHKeyAgreement.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 1997-2007 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 1997-2009 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
@@ -58,16 +58,9 @@
     private BigInteger y = BigInteger.ZERO;
 
     /**
-     * Verify the SunJCE provider in the constructor.
-     *
-     * @exception SecurityException if fails to verify
-     * its own integrity
+     * Empty constructor
      */
     public DHKeyAgreement() {
-        if (!SunJCE.verifySelfIntegrity(this.getClass())) {
-            throw new SecurityException("The SunJCE provider may have been " +
-                                        "tampered.");
-        }
     }
 
     /**
diff --git a/jdk/src/share/classes/com/sun/crypto/provider/DHKeyFactory.java b/jdk/src/share/classes/com/sun/crypto/provider/DHKeyFactory.java
index e7c5f53..01a449c 100644
--- a/jdk/src/share/classes/com/sun/crypto/provider/DHKeyFactory.java
+++ b/jdk/src/share/classes/com/sun/crypto/provider/DHKeyFactory.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 1997-2007 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 1997-2009 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
@@ -49,16 +49,9 @@
 public final class DHKeyFactory extends KeyFactorySpi {
 
     /**
-     * Verify the SunJCE provider in the constructor.
-     *
-     * @exception SecurityException if fails to verify
-     * its own integrity
+     * Empty constructor
      */
     public DHKeyFactory() {
-        if (!SunJCE.verifySelfIntegrity(this.getClass())) {
-            throw new SecurityException("The SunJCE provider may have " +
-                                        "been tampered.");
-        }
     }
 
     /**
diff --git a/jdk/src/share/classes/com/sun/crypto/provider/HmacCore.java b/jdk/src/share/classes/com/sun/crypto/provider/HmacCore.java
index 9950d11..87d9e04 100644
--- a/jdk/src/share/classes/com/sun/crypto/provider/HmacCore.java
+++ b/jdk/src/share/classes/com/sun/crypto/provider/HmacCore.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2002-2007 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2002-2009 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
@@ -241,7 +241,6 @@
     public static final class HmacSHA256 extends MacSpi implements Cloneable {
         private final HmacCore core;
         public HmacSHA256() throws NoSuchAlgorithmException {
-            SunJCE.ensureIntegrity(getClass());
             core = new HmacCore("SHA-256", 64);
         }
         private HmacSHA256(HmacSHA256 base) throws CloneNotSupportedException {
@@ -278,7 +277,6 @@
     public static final class HmacSHA384 extends MacSpi implements Cloneable {
         private final HmacCore core;
         public HmacSHA384() throws NoSuchAlgorithmException {
-            SunJCE.ensureIntegrity(getClass());
             core = new HmacCore("SHA-384", 128);
         }
         private HmacSHA384(HmacSHA384 base) throws CloneNotSupportedException {
@@ -315,7 +313,6 @@
     public static final class HmacSHA512 extends MacSpi implements Cloneable {
         private final HmacCore core;
         public HmacSHA512() throws NoSuchAlgorithmException {
-            SunJCE.ensureIntegrity(getClass());
             core = new HmacCore("SHA-512", 128);
         }
         private HmacSHA512(HmacSHA512 base) throws CloneNotSupportedException {
diff --git a/jdk/src/share/classes/com/sun/crypto/provider/HmacMD5.java b/jdk/src/share/classes/com/sun/crypto/provider/HmacMD5.java
index 26e7638..ce3793c 100644
--- a/jdk/src/share/classes/com/sun/crypto/provider/HmacMD5.java
+++ b/jdk/src/share/classes/com/sun/crypto/provider/HmacMD5.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 1998-2007 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 1998-2009 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
@@ -44,16 +44,8 @@
 
     /**
      * Standard constructor, creates a new HmacMD5 instance.
-     * Verify the SunJCE provider in the constructor.
-     *
-     * @exception SecurityException if fails to verify
-     * its own integrity
      */
     public HmacMD5() throws NoSuchAlgorithmException {
-        if (!SunJCE.verifySelfIntegrity(this.getClass())) {
-            throw new SecurityException("The SunJCE provider may have " +
-                                        "been tampered.");
-        }
         hmac = new HmacCore(MessageDigest.getInstance("MD5"),
                             MD5_BLOCK_LENGTH);
     }
diff --git a/jdk/src/share/classes/com/sun/crypto/provider/HmacMD5KeyGenerator.java b/jdk/src/share/classes/com/sun/crypto/provider/HmacMD5KeyGenerator.java
index c1b6526..1f73f32 100644
--- a/jdk/src/share/classes/com/sun/crypto/provider/HmacMD5KeyGenerator.java
+++ b/jdk/src/share/classes/com/sun/crypto/provider/HmacMD5KeyGenerator.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 1999-2007 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 1999-2009 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
@@ -46,16 +46,9 @@
     private int keysize = 64; // default keysize (in number of bytes)
 
     /**
-     * Verify the SunJCE provider in the constructor.
-     *
-     * @exception SecurityException if fails to verify
-     * its own integrity
+     * Empty constructor
      */
     public HmacMD5KeyGenerator() {
-        if (!SunJCE.verifySelfIntegrity(this.getClass())) {
-            throw new SecurityException("The SunJCE provider may have " +
-                                        "been tampered.");
-        }
     }
 
     /**
diff --git a/jdk/src/share/classes/com/sun/crypto/provider/HmacPKCS12PBESHA1.java b/jdk/src/share/classes/com/sun/crypto/provider/HmacPKCS12PBESHA1.java
index 150477c..4508c24 100644
--- a/jdk/src/share/classes/com/sun/crypto/provider/HmacPKCS12PBESHA1.java
+++ b/jdk/src/share/classes/com/sun/crypto/provider/HmacPKCS12PBESHA1.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2003-2007 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2003-2009 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
@@ -48,13 +48,8 @@
 
     /**
      * Standard constructor, creates a new HmacSHA1 instance.
-     * Verify the SunJCE provider in the constructor.
-     *
-     * @exception SecurityException if fails to verify
-     * its own integrity
      */
     public HmacPKCS12PBESHA1() throws NoSuchAlgorithmException {
-        SunJCE.ensureIntegrity(this.getClass());
         this.hmac = new HmacCore(MessageDigest.getInstance("SHA1"),
                                  SHA1_BLOCK_LENGTH);
     }
diff --git a/jdk/src/share/classes/com/sun/crypto/provider/HmacSHA1.java b/jdk/src/share/classes/com/sun/crypto/provider/HmacSHA1.java
index 1421e85..0b4bea2 100644
--- a/jdk/src/share/classes/com/sun/crypto/provider/HmacSHA1.java
+++ b/jdk/src/share/classes/com/sun/crypto/provider/HmacSHA1.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 1998-2007 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 1998-2009 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
@@ -44,16 +44,8 @@
 
     /**
      * Standard constructor, creates a new HmacSHA1 instance.
-     * Verify the SunJCE provider in the constructor.
-     *
-     * @exception SecurityException if fails to verify
-     * its own integrity
      */
     public HmacSHA1() throws NoSuchAlgorithmException {
-        if (!SunJCE.verifySelfIntegrity(this.getClass())) {
-            throw new SecurityException("The SunJCE provider may have " +
-                                        "been tampered.");
-        }
         this.hmac = new HmacCore(MessageDigest.getInstance("SHA1"),
                                  SHA1_BLOCK_LENGTH);
     }
diff --git a/jdk/src/share/classes/com/sun/crypto/provider/HmacSHA1KeyGenerator.java b/jdk/src/share/classes/com/sun/crypto/provider/HmacSHA1KeyGenerator.java
index 561e4f1..2bf2142 100644
--- a/jdk/src/share/classes/com/sun/crypto/provider/HmacSHA1KeyGenerator.java
+++ b/jdk/src/share/classes/com/sun/crypto/provider/HmacSHA1KeyGenerator.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 1999-2007 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 1999-2009 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
@@ -46,16 +46,9 @@
     private int keysize = 64; // default keysize (in number of bytes)
 
     /**
-     * Verify the SunJCE provider in the constructor.
-     *
-     * @exception SecurityException if fails to verify
-     * its own integrity
+     * Empty constructor
      */
     public HmacSHA1KeyGenerator() {
-        if (!SunJCE.verifySelfIntegrity(this.getClass())) {
-            throw new SecurityException("The SunJCE provider may have " +
-                                        "been tampered.");
-        }
     }
 
     /**
diff --git a/jdk/src/share/classes/com/sun/crypto/provider/JarVerifier.java b/jdk/src/share/classes/com/sun/crypto/provider/JarVerifier.java
deleted file mode 100644
index ea5f856..0000000
--- a/jdk/src/share/classes/com/sun/crypto/provider/JarVerifier.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
- * Copyright 2007 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 com.sun.crypto.provider;
-
-// NOTE: this class is duplicated amongst SunJCE, SunPKCS11, and SunMSCAPI.
-// All files should be kept in sync.
-
-import java.io.*;
-import java.util.*;
-import java.util.jar.*;
-import java.net.URL;
-import java.net.JarURLConnection;
-import java.net.MalformedURLException;
-
-import java.security.*;
-import java.security.cert.*;
-import java.security.cert.Certificate;
-
-/**
- * This class verifies JAR files (and any supporting JAR files), and
- * determines whether they may be used in this implementation.
- *
- * The JCE in OpenJDK has an open cryptographic interface, meaning it
- * does not restrict which providers can be used.  Compliance with
- * United States export controls and with local law governing the
- * import/export of products incorporating the JCE in the OpenJDK is
- * the responsibility of the licensee.
- *
- * @since 1.7
- */
-final class JarVerifier {
-
-    private static final boolean debug = false;
-
-    /**
-     * Verify the JAR file is signed by an entity which has a certificate
-     * issued by a trusted CA.
-     *
-     * Note: this is a temporary method and will change soon to use the
-     * exception chaining mechanism, which can provide more details
-     * as to why the verification failed.
-     *
-     * @param c the class to be verified.
-     * @return true if verification is successful.
-     */
-    static boolean verify(final Class c) {
-        return true;
-    }
-}
diff --git a/jdk/src/share/classes/com/sun/crypto/provider/KeyGeneratorCore.java b/jdk/src/share/classes/com/sun/crypto/provider/KeyGeneratorCore.java
index 242db61..6864dad 100644
--- a/jdk/src/share/classes/com/sun/crypto/provider/KeyGeneratorCore.java
+++ b/jdk/src/share/classes/com/sun/crypto/provider/KeyGeneratorCore.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2003-2007 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2003-2009 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
@@ -109,7 +109,6 @@
     public static final class HmacSHA256KG extends KeyGeneratorSpi {
         private final KeyGeneratorCore core;
         public HmacSHA256KG() {
-            SunJCE.ensureIntegrity(getClass());
             core = new KeyGeneratorCore("HmacSHA256", 256);
         }
         protected void engineInit(SecureRandom random) {
@@ -131,7 +130,6 @@
     public static final class HmacSHA384KG extends KeyGeneratorSpi {
         private final KeyGeneratorCore core;
         public HmacSHA384KG() {
-            SunJCE.ensureIntegrity(getClass());
             core = new KeyGeneratorCore("HmacSHA384", 384);
         }
         protected void engineInit(SecureRandom random) {
@@ -153,7 +151,6 @@
     public static final class HmacSHA512KG extends KeyGeneratorSpi {
         private final KeyGeneratorCore core;
         public HmacSHA512KG() {
-            SunJCE.ensureIntegrity(getClass());
             core = new KeyGeneratorCore("HmacSHA512", 512);
         }
         protected void engineInit(SecureRandom random) {
@@ -175,7 +172,6 @@
     public static final class RC2KeyGenerator extends KeyGeneratorSpi {
         private final KeyGeneratorCore core;
         public RC2KeyGenerator() {
-            SunJCE.ensureIntegrity(getClass());
             core = new KeyGeneratorCore("RC2", 128);
         }
         protected void engineInit(SecureRandom random) {
@@ -201,7 +197,6 @@
     public static final class ARCFOURKeyGenerator extends KeyGeneratorSpi {
         private final KeyGeneratorCore core;
         public ARCFOURKeyGenerator() {
-            SunJCE.ensureIntegrity(getClass());
             core = new KeyGeneratorCore("ARCFOUR", 128);
         }
         protected void engineInit(SecureRandom random) {
diff --git a/jdk/src/share/classes/com/sun/crypto/provider/PBEKeyFactory.java b/jdk/src/share/classes/com/sun/crypto/provider/PBEKeyFactory.java
index 23478f8..f86dad5 100644
--- a/jdk/src/share/classes/com/sun/crypto/provider/PBEKeyFactory.java
+++ b/jdk/src/share/classes/com/sun/crypto/provider/PBEKeyFactory.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 1997-2007 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 1997-2009 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
@@ -49,16 +49,9 @@
     private static HashSet<String> validTypes;
 
     /**
-     * Verify the SunJCE provider in the constructor.
-     *
-     * @exception SecurityException if fails to verify
-     * its own integrity
+     * Simple constructor
      */
     private PBEKeyFactory(String keytype) {
-        if (!SunJCE.verifySelfIntegrity(this.getClass())) {
-            throw new SecurityException("The SunJCE provider may have " +
-                                        "been tampered.");
-        }
         type = keytype;
     }
 
diff --git a/jdk/src/share/classes/com/sun/crypto/provider/PBEWithMD5AndDESCipher.java b/jdk/src/share/classes/com/sun/crypto/provider/PBEWithMD5AndDESCipher.java
index 1bf6d6f..8eec23d 100644
--- a/jdk/src/share/classes/com/sun/crypto/provider/PBEWithMD5AndDESCipher.java
+++ b/jdk/src/share/classes/com/sun/crypto/provider/PBEWithMD5AndDESCipher.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 1997-2007 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 1997-2009 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
@@ -55,16 +55,9 @@
      * unavailable
      * @exception NoSuchPaddingException if the required padding mechanism
      * (PKCS5Padding) is unavailable
-     *
-     * @exception SecurityException if this constructor fails to verify
-     * its own integrity
      */
     public PBEWithMD5AndDESCipher()
         throws NoSuchAlgorithmException, NoSuchPaddingException {
-        if (!SunJCE.verifySelfIntegrity(this.getClass())) {
-            throw new SecurityException("The SunJCE provider may have " +
-                                        "been tampered.");
-        }
         core = new PBECipherCore("DES");
     }
 
diff --git a/jdk/src/share/classes/com/sun/crypto/provider/PBEWithMD5AndTripleDESCipher.java b/jdk/src/share/classes/com/sun/crypto/provider/PBEWithMD5AndTripleDESCipher.java
index 7af04b6..c121bd1 100644
--- a/jdk/src/share/classes/com/sun/crypto/provider/PBEWithMD5AndTripleDESCipher.java
+++ b/jdk/src/share/classes/com/sun/crypto/provider/PBEWithMD5AndTripleDESCipher.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 1998-2007 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 1998-2009 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
@@ -61,23 +61,14 @@
      * Creates an instance of this cipher, and initializes its mode (CBC) and
      * padding (PKCS5).
      *
-     * Verify the SunJCE provider in the constructor.
-     *
      * @exception NoSuchAlgorithmException if the required cipher mode (CBC) is
      * unavailable
      * @exception NoSuchPaddingException if the required padding mechanism
      * (PKCS5Padding) is unavailable
-     * @exception SecurityException if fails to verify
-     * its own integrity
      */
     public PBEWithMD5AndTripleDESCipher()
         throws NoSuchAlgorithmException, NoSuchPaddingException
     {
-        if (!SunJCE.verifySelfIntegrity(this.getClass())) {
-            throw new SecurityException("The SunJCE provider may have " +
-                                        "been tampered.");
-        }
-
         // set the encapsulated cipher to do triple DES
         core = new PBECipherCore("DESede");
     }
diff --git a/jdk/src/share/classes/com/sun/crypto/provider/PBKDF2HmacSHA1Factory.java b/jdk/src/share/classes/com/sun/crypto/provider/PBKDF2HmacSHA1Factory.java
index 9ba5303..205e38c 100644
--- a/jdk/src/share/classes/com/sun/crypto/provider/PBKDF2HmacSHA1Factory.java
+++ b/jdk/src/share/classes/com/sun/crypto/provider/PBKDF2HmacSHA1Factory.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2005-2007 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2009 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
@@ -45,16 +45,9 @@
 public final class PBKDF2HmacSHA1Factory extends SecretKeyFactorySpi {
 
     /**
-     * Verify the SunJCE provider in the constructor.
-     *
-     * @exception SecurityException if fails to verify
-     * its own integrity
+     * Empty constructor
      */
     public PBKDF2HmacSHA1Factory() {
-        if (!SunJCE.verifySelfIntegrity(this.getClass())) {
-            throw new SecurityException("The SunJCE provider may have " +
-                                        "been tampered.");
-        }
     }
 
     /**
diff --git a/jdk/src/share/classes/com/sun/crypto/provider/PKCS12PBECipherCore.java b/jdk/src/share/classes/com/sun/crypto/provider/PKCS12PBECipherCore.java
index 277a7b3..ba7e7fe 100644
--- a/jdk/src/share/classes/com/sun/crypto/provider/PKCS12PBECipherCore.java
+++ b/jdk/src/share/classes/com/sun/crypto/provider/PKCS12PBECipherCore.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2003-2007 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2003-2009 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
@@ -370,7 +370,6 @@
     public static final class PBEWithSHA1AndDESede extends CipherSpi {
         private final PKCS12PBECipherCore core;
         public PBEWithSHA1AndDESede() throws NoSuchAlgorithmException {
-            SunJCE.ensureIntegrity(this.getClass());
             core = new PKCS12PBECipherCore("DESede", 24);
         }
         protected byte[] engineDoFinal(byte[] in, int inOff, int inLen)
@@ -446,7 +445,6 @@
     public static final class PBEWithSHA1AndRC2_40 extends CipherSpi {
         private final PKCS12PBECipherCore core;
         public PBEWithSHA1AndRC2_40() throws NoSuchAlgorithmException {
-            SunJCE.ensureIntegrity(this.getClass());
             core = new PKCS12PBECipherCore("RC2", 5);
         }
         protected byte[] engineDoFinal(byte[] in, int inOff, int inLen)
diff --git a/jdk/src/share/classes/com/sun/crypto/provider/RC2Cipher.java b/jdk/src/share/classes/com/sun/crypto/provider/RC2Cipher.java
index c96d07f..d119a06 100644
--- a/jdk/src/share/classes/com/sun/crypto/provider/RC2Cipher.java
+++ b/jdk/src/share/classes/com/sun/crypto/provider/RC2Cipher.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2003-2007 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2003-2009 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
@@ -45,7 +45,6 @@
     private final RC2Crypt embeddedCipher;
 
     public RC2Cipher() {
-        SunJCE.ensureIntegrity(getClass());
         embeddedCipher = new RC2Crypt();
         core = new CipherCore(embeddedCipher, 8);
     }
diff --git a/jdk/src/share/classes/com/sun/crypto/provider/RSACipher.java b/jdk/src/share/classes/com/sun/crypto/provider/RSACipher.java
index e5c6c01..9f5179e 100644
--- a/jdk/src/share/classes/com/sun/crypto/provider/RSACipher.java
+++ b/jdk/src/share/classes/com/sun/crypto/provider/RSACipher.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2003-2007 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2003-2009 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
@@ -111,7 +111,6 @@
     private String oaepHashAlgorithm = "SHA-1";
 
     public RSACipher() {
-        SunJCE.ensureIntegrity(getClass());
         paddingType = PAD_PKCS1;
     }
 
diff --git a/jdk/src/share/classes/com/sun/crypto/provider/SslMacCore.java b/jdk/src/share/classes/com/sun/crypto/provider/SslMacCore.java
index 7756e73..8046a22 100644
--- a/jdk/src/share/classes/com/sun/crypto/provider/SslMacCore.java
+++ b/jdk/src/share/classes/com/sun/crypto/provider/SslMacCore.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2005-2007 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2009 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
@@ -226,9 +226,6 @@
 
         static final byte[] md5Pad1 = genPad((byte)0x36, 48);
         static final byte[] md5Pad2 = genPad((byte)0x5c, 48);
-        static {
-            SunJCE.ensureIntegrity(SslMacMD5.class);
-        }
     }
 
     // nested static class for the SslMacMD5 implementation
@@ -262,9 +259,6 @@
 
         static final byte[] shaPad1 = genPad((byte)0x36, 40);
         static final byte[] shaPad2 = genPad((byte)0x5c, 40);
-        static {
-            SunJCE.ensureIntegrity(SslMacSHA1.class);
-        }
     }
 
 }
diff --git a/jdk/src/share/classes/com/sun/crypto/provider/SunJCE.java b/jdk/src/share/classes/com/sun/crypto/provider/SunJCE.java
index 13691b0..af46b03 100644
--- a/jdk/src/share/classes/com/sun/crypto/provider/SunJCE.java
+++ b/jdk/src/share/classes/com/sun/crypto/provider/SunJCE.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 1997-2007 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 1997-2009 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
@@ -93,10 +93,6 @@
 
     static final SecureRandom RANDOM = new SecureRandom();
 
-    // After the SunJCE passed self-integrity checking,
-    // verifiedSelfIntegrity will be set to true.
-    private static boolean verifiedSelfIntegrity = false;
-
     public SunJCE() {
         /* We are the "SunJCE" provider */
         super("SunJCE", 1.7d, info);
@@ -441,21 +437,4 @@
             }
         });
     }
-
-    // set to true once self verification is complete
-    private static volatile boolean integrityVerified;
-
-    static void ensureIntegrity(Class c) {
-        if (verifySelfIntegrity(c) == false) {
-            throw new SecurityException("The SunJCE provider may have " +
-                                        "been tampered.");
-        }
-    }
-
-    static final boolean verifySelfIntegrity(Class c) {
-        if (verifiedSelfIntegrity) {
-            return true;
-        }
-        return (integrityVerified = JarVerifier.verify(c));
-    }
 }
diff --git a/jdk/src/share/classes/com/sun/crypto/provider/TlsKeyMaterialGenerator.java b/jdk/src/share/classes/com/sun/crypto/provider/TlsKeyMaterialGenerator.java
index 260fdd8..8f27f74 100644
--- a/jdk/src/share/classes/com/sun/crypto/provider/TlsKeyMaterialGenerator.java
+++ b/jdk/src/share/classes/com/sun/crypto/provider/TlsKeyMaterialGenerator.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2005-2007 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2009 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
@@ -52,7 +52,6 @@
     private int protocolVersion;
 
     public TlsKeyMaterialGenerator() {
-        SunJCE.ensureIntegrity(getClass());
     }
 
     protected void engineInit(SecureRandom random) {
diff --git a/jdk/src/share/classes/com/sun/crypto/provider/TlsMasterSecretGenerator.java b/jdk/src/share/classes/com/sun/crypto/provider/TlsMasterSecretGenerator.java
index ad47dda..d56c3b9 100644
--- a/jdk/src/share/classes/com/sun/crypto/provider/TlsMasterSecretGenerator.java
+++ b/jdk/src/share/classes/com/sun/crypto/provider/TlsMasterSecretGenerator.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2005-2007 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2009 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
@@ -51,7 +51,6 @@
     private int protocolVersion;
 
     public TlsMasterSecretGenerator() {
-        SunJCE.ensureIntegrity(getClass());
     }
 
     protected void engineInit(SecureRandom random) {
diff --git a/jdk/src/share/classes/com/sun/crypto/provider/TlsPrfGenerator.java b/jdk/src/share/classes/com/sun/crypto/provider/TlsPrfGenerator.java
index 5306a72..f2c885f 100644
--- a/jdk/src/share/classes/com/sun/crypto/provider/TlsPrfGenerator.java
+++ b/jdk/src/share/classes/com/sun/crypto/provider/TlsPrfGenerator.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2005-2007 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2009 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
@@ -109,7 +109,6 @@
     private TlsPrfParameterSpec spec;
 
     public TlsPrfGenerator() {
-        SunJCE.ensureIntegrity(getClass());
     }
 
     protected void engineInit(SecureRandom random) {
diff --git a/jdk/src/share/classes/com/sun/crypto/provider/TlsRsaPremasterSecretGenerator.java b/jdk/src/share/classes/com/sun/crypto/provider/TlsRsaPremasterSecretGenerator.java
index 6986dec..742d3e1 100644
--- a/jdk/src/share/classes/com/sun/crypto/provider/TlsRsaPremasterSecretGenerator.java
+++ b/jdk/src/share/classes/com/sun/crypto/provider/TlsRsaPremasterSecretGenerator.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2005-2007 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2009 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
@@ -48,7 +48,6 @@
     private SecureRandom random;
 
     public TlsRsaPremasterSecretGenerator() {
-        SunJCE.ensureIntegrity(getClass());
     }
 
     protected void engineInit(SecureRandom random) {
diff --git a/jdk/src/share/classes/com/sun/jndi/ldap/Filter.java b/jdk/src/share/classes/com/sun/jndi/ldap/Filter.java
index 6a00219..17f5eb2 100644
--- a/jdk/src/share/classes/com/sun/jndi/ldap/Filter.java
+++ b/jdk/src/share/classes/com/sun/jndi/ldap/Filter.java
@@ -93,9 +93,7 @@
 
         int filtOffset[] = new int[1];
 
-        for (filtOffset[0] = filterStart;
-             filtOffset[0] < filterEnd;
-             filtOffset[0]++) {
+        for (filtOffset[0] = filterStart; filtOffset[0] < filterEnd;) {
             switch (filter[filtOffset[0]]) {
             case '(':
                 filtOffset[0]++;
@@ -104,18 +102,21 @@
                 case '&':
                     encodeComplexFilter(ber, filter,
                         LDAP_FILTER_AND, filtOffset, filterEnd);
+                    // filtOffset[0] has pointed to char after right paren
                     parens--;
                     break;
 
                 case '|':
                     encodeComplexFilter(ber, filter,
                         LDAP_FILTER_OR, filtOffset, filterEnd);
+                    // filtOffset[0] has pointed to char after right paren
                     parens--;
                     break;
 
                 case '!':
                     encodeComplexFilter(ber, filter,
                         LDAP_FILTER_NOT, filtOffset, filterEnd);
+                    // filtOffset[0] has pointed to char after right paren
                     parens--;
                     break;
 
@@ -143,8 +144,8 @@
 
                     encodeSimpleFilter(ber, filter, filtOffset[0], nextOffset);
 
-                    // points to right parens; for loop will increment beyond parens
-                    filtOffset[0] = nextOffset;
+                    // points to the char after right paren.
+                    filtOffset[0] = nextOffset + 1;
 
                     parens--;
                     break;
@@ -170,9 +171,14 @@
                 filtOffset[0] = filterEnd; // force break from outer
                 break;
             }
+
+            if (parens < 0) {
+                throw new InvalidSearchFilterException(
+                                                "Unbalanced parenthesis");
+            }
         }
 
-        if (parens > 0) {
+        if (parens != 0) {
             throw new InvalidSearchFilterException("Unbalanced parenthesis");
         }
 
diff --git a/jdk/src/share/classes/java/lang/Character.java b/jdk/src/share/classes/java/lang/Character.java
index 9b9c938..f20f8e3 100644
--- a/jdk/src/share/classes/java/lang/Character.java
+++ b/jdk/src/share/classes/java/lang/Character.java
@@ -2784,8 +2784,13 @@
      * @since  1.5
      */
     public static int toCodePoint(char high, char low) {
-        return ((high - MIN_HIGH_SURROGATE) << 10)
-            + (low - MIN_LOW_SURROGATE) + MIN_SUPPLEMENTARY_CODE_POINT;
+        // Optimized form of:
+        // return ((high - MIN_HIGH_SURROGATE) << 10)
+        //         + (low - MIN_LOW_SURROGATE)
+        //         + MIN_SUPPLEMENTARY_CODE_POINT;
+        return ((high << 10) + low) + (MIN_SUPPLEMENTARY_CODE_POINT
+                                       - (MIN_HIGH_SURROGATE << 10)
+                                       - MIN_LOW_SURROGATE);
     }
 
     /**
@@ -3071,9 +3076,10 @@
     }
 
     static void toSurrogates(int codePoint, char[] dst, int index) {
-        int offset = codePoint - MIN_SUPPLEMENTARY_CODE_POINT;
-        dst[index+1] = (char)((offset & 0x3ff) + MIN_LOW_SURROGATE);
-        dst[index] = (char)((offset >>> 10) + MIN_HIGH_SURROGATE);
+        // 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)));
     }
 
     /**
diff --git a/jdk/src/share/classes/java/lang/ClassNotFoundException.java b/jdk/src/share/classes/java/lang/ClassNotFoundException.java
index 8da8445..af3af42 100644
--- a/jdk/src/share/classes/java/lang/ClassNotFoundException.java
+++ b/jdk/src/share/classes/java/lang/ClassNotFoundException.java
@@ -50,7 +50,7 @@
  * @see     java.lang.ClassLoader#loadClass(java.lang.String, boolean)
  * @since   JDK1.0
  */
-public class ClassNotFoundException extends Exception {
+public class ClassNotFoundException extends ReflectiveOperationException {
     /**
      * use serialVersionUID from JDK 1.1.X for interoperability
      */
diff --git a/jdk/src/share/classes/java/lang/Double.java b/jdk/src/share/classes/java/lang/Double.java
index 9866d5d..8efb241 100644
--- a/jdk/src/share/classes/java/lang/Double.java
+++ b/jdk/src/share/classes/java/lang/Double.java
@@ -529,6 +529,7 @@
      * @param  s   the string to be parsed.
      * @return the {@code double} value represented by the string
      *         argument.
+     * @throws NullPointerException  if the string is null
      * @throws NumberFormatException if the string does not contain
      *         a parsable {@code double}.
      * @see    java.lang.Double#valueOf(String)
diff --git a/jdk/src/share/classes/java/lang/Float.java b/jdk/src/share/classes/java/lang/Float.java
index 1c89a45..eb13301 100644
--- a/jdk/src/share/classes/java/lang/Float.java
+++ b/jdk/src/share/classes/java/lang/Float.java
@@ -438,12 +438,13 @@
      * represented by the specified {@code String}, as performed
      * by the {@code valueOf} method of class {@code Float}.
      *
-     * @param      s   the string to be parsed.
+     * @param  s the string to be parsed.
      * @return the {@code float} value represented by the string
      *         argument.
-     * @throws  NumberFormatException  if the string does not contain a
+     * @throws NullPointerException  if the string is null
+     * @throws NumberFormatException if the string does not contain a
      *               parsable {@code float}.
-     * @see        java.lang.Float#valueOf(String)
+     * @see    java.lang.Float#valueOf(String)
      * @since 1.2
      */
     public static float parseFloat(String s) throws NumberFormatException {
diff --git a/jdk/src/share/classes/java/lang/IllegalAccessException.java b/jdk/src/share/classes/java/lang/IllegalAccessException.java
index 19b51b9..2dc6099 100644
--- a/jdk/src/share/classes/java/lang/IllegalAccessException.java
+++ b/jdk/src/share/classes/java/lang/IllegalAccessException.java
@@ -56,7 +56,7 @@
  * @see     java.lang.reflect.Constructor#newInstance(Object[])
  * @since   JDK1.0
  */
-public class IllegalAccessException extends Exception {
+public class IllegalAccessException extends ReflectiveOperationException {
     private static final long serialVersionUID = 6616958222490762034L;
 
     /**
diff --git a/jdk/src/share/classes/java/lang/InstantiationException.java b/jdk/src/share/classes/java/lang/InstantiationException.java
index ace382a..fac4839 100644
--- a/jdk/src/share/classes/java/lang/InstantiationException.java
+++ b/jdk/src/share/classes/java/lang/InstantiationException.java
@@ -43,7 +43,7 @@
  * @since   JDK1.0
  */
 public
-class InstantiationException extends Exception {
+class InstantiationException extends ReflectiveOperationException {
     private static final long serialVersionUID = -8441929162975509110L;
 
     /**
diff --git a/jdk/src/share/classes/java/lang/NoSuchFieldException.java b/jdk/src/share/classes/java/lang/NoSuchFieldException.java
index b44fb17..ce3adf2 100644
--- a/jdk/src/share/classes/java/lang/NoSuchFieldException.java
+++ b/jdk/src/share/classes/java/lang/NoSuchFieldException.java
@@ -31,7 +31,7 @@
  * @author  unascribed
  * @since   JDK1.1
  */
-public class NoSuchFieldException extends Exception {
+public class NoSuchFieldException extends ReflectiveOperationException {
     private static final long serialVersionUID = -6143714805279938260L;
 
     /**
diff --git a/jdk/src/share/classes/java/lang/NoSuchMethodException.java b/jdk/src/share/classes/java/lang/NoSuchMethodException.java
index 720fbfc..dc8954b 100644
--- a/jdk/src/share/classes/java/lang/NoSuchMethodException.java
+++ b/jdk/src/share/classes/java/lang/NoSuchMethodException.java
@@ -32,7 +32,7 @@
  * @since      JDK1.0
  */
 public
-class NoSuchMethodException extends Exception {
+class NoSuchMethodException extends ReflectiveOperationException {
     private static final long serialVersionUID = 5034388446362600923L;
 
     /**
diff --git a/jdk/src/share/classes/java/lang/ReflectiveOperationException.java b/jdk/src/share/classes/java/lang/ReflectiveOperationException.java
new file mode 100644
index 0000000..d06613c
--- /dev/null
+++ b/jdk/src/share/classes/java/lang/ReflectiveOperationException.java
@@ -0,0 +1,91 @@
+/*
+ * Copyright 2009 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;
+
+/**
+ * Common superclass of exceptions thrown by reflective operations in
+ * core reflection.
+ *
+ * @see LinkageError
+ * @since 1.7
+ */
+public class ReflectiveOperationException extends Exception {
+    static final long serialVersionUID = 123456789L;
+
+    /**
+     * Constructs a new exception with {@code null} as its detail
+     * message.  The cause is not initialized, and may subsequently be
+     * initialized by a call to {@link #initCause}.
+     */
+    public ReflectiveOperationException() {
+        super();
+    }
+
+    /**
+     * Constructs a new exception with the specified detail message.
+     * The cause is not initialized, and may subsequently be
+     * initialized by a call to {@link #initCause}.
+     *
+     * @param   message   the detail message. The detail message is saved for
+     *          later retrieval by the {@link #getMessage()} method.
+     */
+    public ReflectiveOperationException(String message) {
+        super(message);
+    }
+
+    /**
+     * Constructs a new exception with the specified detail message
+     * and cause.
+     *
+     * <p>Note that the detail message associated with
+     * {@code cause} is <em>not</em> automatically incorporated in
+     * this exception's detail message.
+     *
+     * @param  message the detail message (which is saved for later retrieval
+     *         by the {@link #getMessage()} method).
+     * @param  cause the cause (which is saved for later retrieval by the
+     *         {@link #getCause()} method).  (A {@code null} value is
+     *         permitted, and indicates that the cause is nonexistent or
+     *         unknown.)
+     */
+    public ReflectiveOperationException(String message, Throwable cause) {
+        super(message, cause);
+    }
+
+    /**
+     * Constructs a new exception with the specified cause and a detail
+     * message of {@code (cause==null ? null : cause.toString())} (which
+     * typically contains the class and detail message of {@code cause}).
+     *
+     * @param  cause the cause (which is saved for later retrieval by the
+     *         {@link #getCause()} method).  (A {@code null} value is
+     *         permitted, and indicates that the cause is nonexistent or
+     *         unknown.)
+     */
+    public ReflectiveOperationException(Throwable cause) {
+        super(cause);
+    }
+}
diff --git a/jdk/src/share/classes/java/lang/reflect/InvocationTargetException.java b/jdk/src/share/classes/java/lang/reflect/InvocationTargetException.java
index 28f3b20..048d04c 100644
--- a/jdk/src/share/classes/java/lang/reflect/InvocationTargetException.java
+++ b/jdk/src/share/classes/java/lang/reflect/InvocationTargetException.java
@@ -39,7 +39,7 @@
  * @see Method
  * @see Constructor
  */
-public class InvocationTargetException extends Exception {
+public class InvocationTargetException extends ReflectiveOperationException {
     /**
      * Use serialVersionUID from JDK 1.1.X for interoperability
      */
diff --git a/jdk/src/share/classes/java/security/cert/CertPathHelperImpl.java b/jdk/src/share/classes/java/security/cert/CertPathHelperImpl.java
index a999828..b279392 100644
--- a/jdk/src/share/classes/java/security/cert/CertPathHelperImpl.java
+++ b/jdk/src/share/classes/java/security/cert/CertPathHelperImpl.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2002-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2002-2009 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
@@ -46,7 +46,7 @@
     /**
      * Initialize the helper framework. This method must be called from
      * the static initializer of each class that is the target of one of
-     * the methods in this class. This ensures that the helper if initialized
+     * the methods in this class. This ensures that the helper is initialized
      * prior to a tunneled call from the Sun provider.
      */
     synchronized static void initialize() {
@@ -59,4 +59,8 @@
             Set<GeneralNameInterface> names) {
         sel.setPathToNamesInternal(names);
     }
+
+    protected void implSetDateAndTime(X509CRLSelector sel, Date date, long skew) {
+        sel.setDateAndTime(date, skew);
+    }
 }
diff --git a/jdk/src/share/classes/java/security/cert/X509CRLSelector.java b/jdk/src/share/classes/java/security/cert/X509CRLSelector.java
index b602aee..1fc750d 100644
--- a/jdk/src/share/classes/java/security/cert/X509CRLSelector.java
+++ b/jdk/src/share/classes/java/security/cert/X509CRLSelector.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2000-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2000-2009 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
@@ -72,6 +72,10 @@
  */
 public class X509CRLSelector implements CRLSelector {
 
+    static {
+        CertPathHelperImpl.initialize();
+    }
+
     private static final Debug debug = Debug.getInstance("certpath");
     private HashSet<Object> issuerNames;
     private HashSet<X500Principal> issuerX500Principals;
@@ -79,6 +83,7 @@
     private BigInteger maxCRL;
     private Date dateAndTime;
     private X509Certificate certChecking;
+    private long skew = 0;
 
     /**
      * Creates an <code>X509CRLSelector</code>. Initially, no criteria are set
@@ -417,7 +422,18 @@
         if (dateAndTime == null)
             this.dateAndTime = null;
         else
-            this.dateAndTime = (Date) dateAndTime.clone();
+            this.dateAndTime = new Date(dateAndTime.getTime());
+        this.skew = 0;
+    }
+
+    /**
+     * Sets the dateAndTime criterion and allows for the specified clock skew
+     * (in milliseconds) when checking against the validity period of the CRL.
+     */
+    void setDateAndTime(Date dateAndTime, long skew) {
+        this.dateAndTime =
+            (dateAndTime == null ? null : new Date(dateAndTime.getTime()));
+        this.skew = skew;
     }
 
     /**
@@ -657,8 +673,14 @@
                 }
                 return false;
             }
-            if (crlThisUpdate.after(dateAndTime)
-                  || nextUpdate.before(dateAndTime)) {
+            Date nowPlusSkew = dateAndTime;
+            Date nowMinusSkew = dateAndTime;
+            if (skew > 0) {
+                nowPlusSkew = new Date(dateAndTime.getTime() + skew);
+                nowMinusSkew = new Date(dateAndTime.getTime() - skew);
+            }
+            if (nowMinusSkew.after(nextUpdate)
+                || nowPlusSkew.before(crlThisUpdate)) {
                 if (debug != null) {
                     debug.println("X509CRLSelector.match: update out of range");
                 }
diff --git a/jdk/src/share/classes/java/util/logging/LogManager.java b/jdk/src/share/classes/java/util/logging/LogManager.java
index fc8f080..e641256 100644
--- a/jdk/src/share/classes/java/util/logging/LogManager.java
+++ b/jdk/src/share/classes/java/util/logging/LogManager.java
@@ -338,7 +338,7 @@
     // already been created with the given name it is returned.
     // Otherwise a new logger instance is created and registered
     // in the LogManager global namespace.
-    synchronized Logger demandLogger(String name) {
+    Logger demandLogger(String name) {
         Logger result = getLogger(name);
         if (result == null) {
             result = new Logger(name, null);
diff --git a/jdk/src/share/classes/javax/crypto/JarVerifier.java b/jdk/src/share/classes/javax/crypto/JarVerifier.java
index 3767610..03f8083 100644
--- a/jdk/src/share/classes/javax/crypto/JarVerifier.java
+++ b/jdk/src/share/classes/javax/crypto/JarVerifier.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2007 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2007-2009 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
@@ -28,9 +28,7 @@
 import java.io.*;
 import java.net.*;
 import java.security.*;
-import java.util.*;
 import java.util.jar.*;
-import javax.crypto.CryptoPolicyParser.ParsingException;
 
 /**
  * This class verifies JAR files (and any supporting JAR files), and
@@ -135,17 +133,6 @@
     }
 
     /**
-     * Verify that the provided JarEntry was indeed signed by the
-     * framework signing certificate.
-     *
-     * @param je the URL of the jar entry to be checked.
-     * @throws Exception if the jar entry was not signed by
-     *          the proper certificate
-     */
-    static void verifyFrameworkSigned(URL je) throws Exception {
-    }
-
-    /**
      * Verify that the provided certs include the
      * framework signing certificate.
      *
diff --git a/jdk/src/share/classes/javax/crypto/JceSecurity.java b/jdk/src/share/classes/javax/crypto/JceSecurity.java
index 11b124a..b204f38 100644
--- a/jdk/src/share/classes/javax/crypto/JceSecurity.java
+++ b/jdk/src/share/classes/javax/crypto/JceSecurity.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 1997-2007 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 1997-2009 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
@@ -25,7 +25,6 @@
 
 package javax.crypto;
 
-import java.lang.ref.*;
 import java.util.*;
 import java.util.jar.*;
 import java.io.*;
@@ -256,11 +255,6 @@
                                 ("Cannot locate policy or framework files!");
         }
 
-        // Enforce the signer restraint, i.e. signer of JCE framework
-        // jar should also be the signer of the two jurisdiction policy
-        // jar files.
-        JarVerifier.verifyFrameworkSigned(jceCipherURL);
-
         // Read jurisdiction policies.
         CryptoPermissions defaultExport = new CryptoPermissions();
         CryptoPermissions exemptExport = new CryptoPermissions();
diff --git a/jdk/src/share/classes/javax/swing/JFileChooser.java b/jdk/src/share/classes/javax/swing/JFileChooser.java
index 82c85fe..8ba9c7c 100644
--- a/jdk/src/share/classes/javax/swing/JFileChooser.java
+++ b/jdk/src/share/classes/javax/swing/JFileChooser.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 1997-2008 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 1997-2009 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
@@ -739,6 +739,11 @@
 
         dialog.show();
         firePropertyChange("JFileChooserDialogIsClosingProperty", dialog, null);
+
+        // Remove all components from dialog. The MetalFileChooserUI.installUI() method (and other LAFs)
+        // registers AWT listener for dialogs and produces memory leaks. It happens when
+        // installUI invoked after the showDialog method.
+        dialog.getContentPane().removeAll();
         dialog.dispose();
         dialog = null;
         return returnValue;
diff --git a/jdk/src/share/classes/javax/swing/JInternalFrame.java b/jdk/src/share/classes/javax/swing/JInternalFrame.java
index 837ffe4..3079a26 100644
--- a/jdk/src/share/classes/javax/swing/JInternalFrame.java
+++ b/jdk/src/share/classes/javax/swing/JInternalFrame.java
@@ -26,13 +26,10 @@
 package javax.swing;
 
 import java.awt.*;
-import java.awt.event.*;
 
 import java.beans.PropertyVetoException;
 import java.beans.PropertyChangeEvent;
-import java.util.EventListener;
 
-import javax.swing.border.Border;
 import javax.swing.event.InternalFrameEvent;
 import javax.swing.event.InternalFrameListener;
 import javax.swing.plaf.*;
@@ -40,7 +37,6 @@
 import javax.accessibility.*;
 
 import java.io.ObjectOutputStream;
-import java.io.ObjectInputStream;
 import java.io.IOException;
 import java.lang.StringBuilder;
 import java.beans.PropertyChangeListener;
@@ -1459,19 +1455,22 @@
             SwingUtilities2.compositeRequestFocus(getDesktopIcon());
         }
         else {
-            // FocusPropertyChangeListener will eventually update
-            // lastFocusOwner. As focus requests are asynchronous
-            // lastFocusOwner may be accessed before it has been correctly
-            // updated. To avoid any problems, lastFocusOwner is immediately
-            // set, assuming the request will succeed.
-            lastFocusOwner = getMostRecentFocusOwner();
-            if (lastFocusOwner == null) {
-                // Make sure focus is restored somewhere, so that
-                // we don't leave a focused component in another frame while
-                // this frame is selected.
-                lastFocusOwner = getContentPane();
+            Component component = KeyboardFocusManager.getCurrentKeyboardFocusManager().getPermanentFocusOwner();
+            if ((component == null) || !SwingUtilities.isDescendingFrom(component, this)) {
+                // FocusPropertyChangeListener will eventually update
+                // lastFocusOwner. As focus requests are asynchronous
+                // lastFocusOwner may be accessed before it has been correctly
+                // updated. To avoid any problems, lastFocusOwner is immediately
+                // set, assuming the request will succeed.
+                setLastFocusOwner(getMostRecentFocusOwner());
+                if (lastFocusOwner == null) {
+                    // Make sure focus is restored somewhere, so that
+                    // we don't leave a focused component in another frame while
+                    // this frame is selected.
+                    setLastFocusOwner(getContentPane());
+                }
+                lastFocusOwner.requestFocus();
             }
-            lastFocusOwner.requestFocus();
         }
     }
 
diff --git a/jdk/src/share/classes/javax/swing/plaf/basic/BasicDesktopIconUI.java b/jdk/src/share/classes/javax/swing/plaf/basic/BasicDesktopIconUI.java
index 5ebb628..888b95a 100644
--- a/jdk/src/share/classes/javax/swing/plaf/basic/BasicDesktopIconUI.java
+++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicDesktopIconUI.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 1997-2008 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 1997-2009 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
@@ -32,9 +32,6 @@
 import javax.swing.border.*;
 import javax.swing.plaf.*;
 import java.beans.*;
-import java.util.EventListener;
-import java.io.Serializable;
-
 
 /**
  * Basic L&F for a minimized window on a desktop.
@@ -47,7 +44,6 @@
 
     protected JInternalFrame.JDesktopIcon desktopIcon;
     protected JInternalFrame frame;
-    private DesktopIconMover desktopIconMover;
 
     /**
      * The title pane component used in the desktop icon.
@@ -128,21 +124,12 @@
         mouseInputListener = createMouseInputListener();
         desktopIcon.addMouseMotionListener(mouseInputListener);
         desktopIcon.addMouseListener(mouseInputListener);
-         getDesktopIconMover().installListeners();
     }
 
     protected void uninstallListeners() {
         desktopIcon.removeMouseMotionListener(mouseInputListener);
         desktopIcon.removeMouseListener(mouseInputListener);
         mouseInputListener = null;
-         getDesktopIconMover().uninstallListeners();
-    }
-
-    private DesktopIconMover getDesktopIconMover() {
-        if (desktopIconMover == null) {
-            desktopIconMover = new DesktopIconMover(desktopIcon);
-        }
-        return desktopIconMover;
     }
 
     protected void installDefaults() {
diff --git a/jdk/src/share/classes/javax/swing/plaf/basic/BasicDirectoryModel.java b/jdk/src/share/classes/javax/swing/plaf/basic/BasicDirectoryModel.java
index 74f24b6..1e5d80f 100644
--- a/jdk/src/share/classes/javax/swing/plaf/basic/BasicDirectoryModel.java
+++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicDirectoryModel.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 1998-2008 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 1998-2009 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
@@ -232,6 +232,10 @@
         public void run0() {
             FileSystemView fileSystem = filechooser.getFileSystemView();
 
+            if (isInterrupted()) {
+                return;
+            }
+
             File[] list = fileSystem.getFiles(currentDirectory, filechooser.isFileHidingEnabled());
 
             if (isInterrupted()) {
@@ -268,8 +272,8 @@
 
             // To avoid loads of synchronizations with Invoker and improve performance we
             // execute the whole block on the COM thread
-            DoChangeContents doChangeContents = ShellFolder.getInvoker().invoke(new Callable<DoChangeContents>() {
-                public DoChangeContents call() throws Exception {
+            DoChangeContents doChangeContents = ShellFolder.invoke(new Callable<DoChangeContents>() {
+                public DoChangeContents call() {
                     int newSize = newFileCache.size();
                     int oldSize = fileCache.size();
 
diff --git a/jdk/src/share/classes/javax/swing/plaf/basic/BasicInternalFrameUI.java b/jdk/src/share/classes/javax/swing/plaf/basic/BasicInternalFrameUI.java
index 3839305..551ab00 100644
--- a/jdk/src/share/classes/javax/swing/plaf/basic/BasicInternalFrameUI.java
+++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicInternalFrameUI.java
@@ -27,16 +27,10 @@
 
 import java.awt.*;
 import java.awt.event.*;
-import java.awt.peer.LightweightPeer;
-
 import javax.swing.*;
-import javax.swing.border.*;
 import javax.swing.plaf.*;
 import javax.swing.event.*;
-
 import java.beans.*;
-import java.io.Serializable;
-
 import sun.swing.DefaultLookup;
 import sun.swing.UIAction;
 
@@ -55,6 +49,7 @@
     protected MouseInputAdapter          borderListener;
     protected PropertyChangeListener     propertyChangeListener;
     protected LayoutManager              internalFrameLayout;
+    protected ComponentListener          componentListener;
     protected MouseInputListener         glassPaneDispatcher;
     private InternalFrameListener        internalFrameListener;
 
@@ -66,9 +61,9 @@
     protected BasicInternalFrameTitlePane titlePane; // access needs this
 
     private static DesktopManager sharedDesktopManager;
+    private boolean componentListenerAdded = false;
 
     private Rectangle parentBounds;
-    private DesktopIconMover desktopIconMover;
 
     private boolean dragging = false;
     private boolean resizing = false;
@@ -209,17 +204,14 @@
             frame.getGlassPane().addMouseListener(glassPaneDispatcher);
             frame.getGlassPane().addMouseMotionListener(glassPaneDispatcher);
         }
+        componentListener =  createComponentListener();
         if (frame.getParent() != null) {
           parentBounds = frame.getParent().getBounds();
         }
-        getDesktopIconMover().installListeners();
-    }
-
-    private DesktopIconMover getDesktopIconMover() {
-        if (desktopIconMover == null) {
-            desktopIconMover = new DesktopIconMover(frame);
+        if ((frame.getParent() != null) && !componentListenerAdded) {
+            frame.getParent().addComponentListener(componentListener);
+            componentListenerAdded = true;
         }
-        return desktopIconMover;
     }
 
     // Provide a FocusListener to listen for a WINDOW_LOST_FOCUS event,
@@ -290,7 +282,11 @@
      * @since 1.3
      */
     protected void uninstallListeners() {
-      getDesktopIconMover().uninstallListeners();
+        if ((frame.getParent() != null) && componentListenerAdded) {
+            frame.getParent().removeComponentListener(componentListener);
+            componentListenerAdded = false;
+        }
+        componentListener = null;
       if (glassPaneDispatcher != null) {
           frame.getGlassPane().removeMouseListener(glassPaneDispatcher);
           frame.getGlassPane().removeMouseMotionListener(glassPaneDispatcher);
@@ -1228,6 +1224,15 @@
                 }
             }
 
+            // Relocate the icon base on the new parent bounds.
+            if (icon != null) {
+                Rectangle iconBounds = icon.getBounds();
+                int y = iconBounds.y +
+                        (parentNewBounds.height - parentBounds.height);
+                icon.setBounds(iconBounds.x, y,
+                        iconBounds.width, iconBounds.height);
+            }
+
             // Update the new parent bounds for next resize.
             if (!parentBounds.equals(parentNewBounds)) {
                 parentBounds = parentNewBounds;
@@ -1399,6 +1404,9 @@
                     // Cancel a resize in progress if the internal frame
                     // gets a setClosed(true) or dispose().
                     cancelResize();
+                    if ((frame.getParent() != null) && componentListenerAdded) {
+                        frame.getParent().removeComponentListener(componentListener);
+                    }
                     closeFrame(f);
                 }
             } else if (JInternalFrame.IS_MAXIMUM_PROPERTY == prop) {
@@ -1431,6 +1439,10 @@
                 } else {
                     parentBounds = null;
                 }
+                if ((frame.getParent() != null) && !componentListenerAdded) {
+                    f.getParent().addComponentListener(componentListener);
+                    componentListenerAdded = true;
+                }
             } else if (JInternalFrame.TITLE_PROPERTY == prop ||
                     prop == "closable" || prop == "iconable" ||
                     prop == "maximizable") {
diff --git a/jdk/src/share/classes/javax/swing/plaf/basic/BasicScrollPaneUI.java b/jdk/src/share/classes/javax/swing/plaf/basic/BasicScrollPaneUI.java
index af5eaa5..ec33129 100644
--- a/jdk/src/share/classes/javax/swing/plaf/basic/BasicScrollPaneUI.java
+++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicScrollPaneUI.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 1997-2005 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 1997-2009 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
@@ -37,17 +37,12 @@
 import java.beans.PropertyChangeEvent;
 
 import java.awt.Component;
-import java.awt.Container;
-import java.awt.LayoutManager;
 import java.awt.Rectangle;
 import java.awt.Dimension;
 import java.awt.Point;
 import java.awt.Insets;
 import java.awt.Graphics;
 import java.awt.event.*;
-import java.io.Serializable;
-import java.awt.Toolkit;
-import java.awt.ComponentOrientation;
 
 /**
  * A default L&F implementation of ScrollPaneUI.
@@ -63,6 +58,7 @@
     protected ChangeListener viewportChangeListener;
     protected PropertyChangeListener spPropertyChangeListener;
     private MouseWheelListener mouseScrollListener;
+    private int oldExtent = Integer.MIN_VALUE;
 
     /**
      * PropertyChangeListener installed on the vertical scrollbar.
@@ -327,9 +323,13 @@
                             * leave it until someone claims.
                             */
                             value = Math.max(0, Math.min(max - extent, max - extent - viewPosition.x));
+                            if (oldExtent > extent) {
+                                value -= oldExtent - extent;
+                            }
                         }
                     }
                 }
+                oldExtent = extent;
                 hsb.setValues(value, extent, 0, max);
             }
 
@@ -1020,7 +1020,7 @@
 
             if (viewport != null) {
                 if (e.getSource() == viewport) {
-                    viewportStateChanged(e);
+                    syncScrollPaneWithViewport();
                 }
                 else {
                     JScrollBar hsb = scrollpane.getHorizontalScrollBar();
@@ -1077,11 +1077,6 @@
             viewport.setViewPosition(p);
         }
 
-        private void viewportStateChanged(ChangeEvent e) {
-            syncScrollPaneWithViewport();
-        }
-
-
         //
         // PropertyChangeListener: This is installed on both the JScrollPane
         // and the horizontal/vertical scrollbars.
diff --git a/jdk/src/share/classes/javax/swing/plaf/basic/DesktopIconMover.java b/jdk/src/share/classes/javax/swing/plaf/basic/DesktopIconMover.java
deleted file mode 100644
index deff4f2..0000000
--- a/jdk/src/share/classes/javax/swing/plaf/basic/DesktopIconMover.java
+++ /dev/null
@@ -1,168 +0,0 @@
-/*
- * Copyright 1997-2008 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 javax.swing.plaf.basic;
-
-import javax.swing.*;
-import java.awt.*;
-import java.awt.event.*;
-import java.beans.*;
-
-/**
- * DesktopIconMover is intended to move desktop icon
- * when parent window is resized.
- */
-class DesktopIconMover implements ComponentListener, PropertyChangeListener {
-    private Component parent;
-    private JInternalFrame frame; // if not null, DesktopIconMover(frame)
-                                  // constructor was used
-    private JInternalFrame.JDesktopIcon icon;
-    private Rectangle parentBounds;
-    private boolean componentListenerAdded = false;
-
-    public DesktopIconMover(JInternalFrame frame) {
-        if (frame == null) {
-            throw new NullPointerException("Frame cannot be null");
-        }
-        this.frame = frame;
-        this.icon = frame.getDesktopIcon();
-        if (icon == null) {
-            throw new NullPointerException(
-                    "frame.getDesktopIcon() cannot be null");
-        }
-        this.parent = frame.getParent();
-        if (this.parent != null) {
-            parentBounds = this.parent.getBounds();
-        }
-    }
-
-    public DesktopIconMover(JInternalFrame.JDesktopIcon icon) {
-        if (icon == null) {
-            throw new NullPointerException("Icon cannot be null");
-        }
-        this.icon = icon;
-        this.parent = icon.getParent();
-        if (this.parent != null) {
-            parentBounds = this.parent.getBounds();
-        }
-    }
-
-    public void installListeners() {
-        if (frame != null) {
-            frame.addPropertyChangeListener(this);
-        } else {
-            icon.addPropertyChangeListener(this);
-        }
-        addComponentListener();
-    }
-
-    public void uninstallListeners() {
-        if (frame != null) {
-            frame.removePropertyChangeListener(this);
-        } else {
-            icon.removePropertyChangeListener(this);
-        }
-        removeComponentListener();
-    }
-
-    public void propertyChange(PropertyChangeEvent evt) {
-        String propName = evt.getPropertyName();
-        if ("ancestor".equals(propName)) {
-            Component newAncestor = (Component) evt.getNewValue();
-
-            // Remove component listener if parent is changing
-            Component probablyNewParent = getCurrentParent();
-            if ((probablyNewParent != null) &&
-                    (!probablyNewParent.equals(parent))) {
-                removeComponentListener();
-                parent = probablyNewParent;
-            }
-
-            if (newAncestor == null) {
-                removeComponentListener();
-            } else {
-                addComponentListener();
-            }
-
-            // Update parentBounds
-            if (parent != null) {
-                parentBounds = parent.getBounds();
-            } else {
-                parentBounds = null;
-            }
-        } else if (JInternalFrame.IS_CLOSED_PROPERTY.equals(propName)) {
-            removeComponentListener();
-        }
-    }
-
-    private void addComponentListener() {
-        if (!componentListenerAdded && (parent != null)) {
-            parent.addComponentListener(this);
-            componentListenerAdded = true;
-        }
-    }
-
-    private void removeComponentListener() {
-        if ((parent != null) && componentListenerAdded) {
-            parent.removeComponentListener(this);
-            componentListenerAdded = false;
-        }
-    }
-
-    private Component getCurrentParent() {
-        if (frame != null) {
-            return frame.getParent();
-        } else {
-            return icon.getParent();
-        }
-    }
-
-    public void componentResized(ComponentEvent e) {
-        if ((parent == null) || (parentBounds == null)) {
-            return;
-        }
-
-        Rectangle parentNewBounds = parent.getBounds();
-        if ((parentNewBounds == null) || parentNewBounds.equals(parentBounds)) {
-            return;
-        }
-
-        // Move desktop icon only in up-down direction
-        int newIconY = icon.getLocation().y +
-                (parentNewBounds.height - parentBounds.height);
-        icon.setLocation(icon.getLocation().x, newIconY);
-
-        parentBounds = parentNewBounds;
-    }
-
-    public void componentMoved(ComponentEvent e) {
-    }
-
-    public void componentShown(ComponentEvent e) {
-    }
-
-    public void componentHidden(ComponentEvent e) {
-    }
-}
diff --git a/jdk/src/share/classes/javax/swing/plaf/nimbus/AbstractRegionPainter.java b/jdk/src/share/classes/javax/swing/plaf/nimbus/AbstractRegionPainter.java
index bf29e15..f5762f0 100644
--- a/jdk/src/share/classes/javax/swing/plaf/nimbus/AbstractRegionPainter.java
+++ b/jdk/src/share/classes/javax/swing/plaf/nimbus/AbstractRegionPainter.java
@@ -227,10 +227,10 @@
      *
      * @param x an encoded x value (0...1, or 1...2, or 2...3)
      * @return the decoded x value
+     * @throws IllegalArgumentException
+     *      if {@code x < 0} or {@code x > 3}
      */
     protected final float decodeX(float x) {
-        if (ctx.canvasSize == null) return x;
-
         if (x >= 0 && x <= 1) {
             return x * leftWidth;
         } else if (x > 1 && x < 2) {
@@ -238,7 +238,7 @@
         } else if (x >= 2 && x <= 3) {
             return ((x-2) * rightWidth) + leftWidth + centerWidth;
         } else {
-            throw new AssertionError("Invalid x");
+            throw new IllegalArgumentException("Invalid x");
         }
     }
 
@@ -248,10 +248,10 @@
      *
      * @param y an encoded y value (0...1, or 1...2, or 2...3)
      * @return the decoded y value
+     * @throws IllegalArgumentException
+     *      if {@code y < 0} or {@code y > 3}
      */
     protected final float decodeY(float y) {
-        if (ctx.canvasSize == null) return y;
-
         if (y >= 0 && y <= 1) {
             return y * topHeight;
         } else if (y > 1 && y < 2) {
@@ -259,7 +259,7 @@
         } else if (y >= 2 && y <= 3) {
             return ((y-2) * bottomHeight) + topHeight + centerHeight;
         } else {
-            throw new AssertionError("Invalid y");
+            throw new IllegalArgumentException("Invalid y");
         }
     }
 
@@ -271,10 +271,10 @@
      * @param x an encoded x value of the bezier control point (0...1, or 1...2, or 2...3)
      * @param dx the offset distance to the anchor from the control point x
      * @return the decoded x location of the control point
+     * @throws IllegalArgumentException
+     *      if {@code x < 0} or {@code x > 3}
      */
     protected final float decodeAnchorX(float x, float dx) {
-        if (ctx.canvasSize == null) return x + dx;
-
         if (x >= 0 && x <= 1) {
             return decodeX(x) + (dx * leftScale);
         } else if (x > 1 && x < 2) {
@@ -282,7 +282,7 @@
         } else if (x >= 2 && x <= 3) {
             return decodeX(x) + (dx * rightScale);
         } else {
-            throw new AssertionError("Invalid x");
+            throw new IllegalArgumentException("Invalid x");
         }
     }
 
@@ -294,10 +294,10 @@
      * @param y an encoded y value of the bezier control point (0...1, or 1...2, or 2...3)
      * @param dy the offset distance to the anchor from the control point y
      * @return the decoded y position of the control point
+     * @throws IllegalArgumentException
+     *      if {@code y < 0} or {@code y > 3}
      */
     protected final float decodeAnchorY(float y, float dy) {
-        if (ctx.canvasSize == null) return y + dy;
-
         if (y >= 0 && y <= 1) {
             return decodeY(y) + (dy * topScale);
         } else if (y > 1 && y < 2) {
@@ -305,7 +305,7 @@
         } else if (y >= 2 && y <= 3) {
             return decodeY(y) + (dy * bottomScale);
         } else {
-            throw new AssertionError("Invalid y");
+            throw new IllegalArgumentException("Invalid y");
         }
     }
 
@@ -363,6 +363,15 @@
      * @param midpoints
      * @param colors
      * @return a valid LinearGradientPaint. This method never returns null.
+     * @throws NullPointerException
+     *      if {@code midpoints} array is null,
+     *      or {@code colors} array is null,
+     * @throws IllegalArgumentException
+     *      if start and end points are the same points,
+     *      or {@code midpoints.length != colors.length},
+     *      or {@code colors} is less than 2 in size,
+     *      or a {@code midpoints} value is less than 0.0 or greater than 1.0,
+     *      or the {@code midpoints} are not provided in strictly increasing order
      */
     protected final LinearGradientPaint decodeGradient(float x1, float y1, float x2, float y2, float[] midpoints, Color[] colors) {
         if (x1 == x2 && y1 == y2) {
@@ -384,6 +393,15 @@
      * @param midpoints
      * @param colors
      * @return a valid RadialGradientPaint. This method never returns null.
+     * @throws NullPointerException
+     *      if {@code midpoints} array is null,
+     *      or {@code colors} array is null
+     * @throws IllegalArgumentException
+     *      if {@code r} is non-positive,
+     *      or {@code midpoints.length != colors.length},
+     *      or {@code colors} is less than 2 in size,
+     *      or a {@code midpoints} value is less than 0.0 or greater than 1.0,
+     *      or the {@code midpoints} are not provided in strictly increasing order
      */
     protected final RadialGradientPaint decodeRadialGradient(float x, float y, float r, float[] midpoints, Color[] colors) {
         if (r == 0f) {
@@ -537,10 +555,10 @@
             this.maxVerticalScaleFactor = maxV;
 
             if (canvasSize != null) {
-                a = insets.left;
-                b = canvasSize.width - insets.right;
-                c = insets.top;
-                d = canvasSize.height - insets.bottom;
+                a = stretchingInsets.left;
+                b = canvasSize.width - stretchingInsets.right;
+                c = stretchingInsets.top;
+                d = canvasSize.height - stretchingInsets.bottom;
                 this.canvasSize = canvasSize;
                 this.inverted = inverted;
                 if (inverted) {
diff --git a/jdk/src/share/classes/javax/swing/plaf/nimbus/NimbusIcon.java b/jdk/src/share/classes/javax/swing/plaf/nimbus/NimbusIcon.java
index 921ca0e..f96a03c 100644
--- a/jdk/src/share/classes/javax/swing/plaf/nimbus/NimbusIcon.java
+++ b/jdk/src/share/classes/javax/swing/plaf/nimbus/NimbusIcon.java
@@ -84,6 +84,8 @@
                         translatex = 1;
                     }
                 }
+            } else if (c instanceof JMenu) {
+                flip = ! c.getComponentOrientation().isLeftToRight();
             }
             if (g instanceof Graphics2D){
                 Graphics2D gfx = (Graphics2D)g;
diff --git a/jdk/src/share/classes/javax/swing/text/GlyphView.java b/jdk/src/share/classes/javax/swing/text/GlyphView.java
index 364fd69..087e920 100644
--- a/jdk/src/share/classes/javax/swing/text/GlyphView.java
+++ b/jdk/src/share/classes/javax/swing/text/GlyphView.java
@@ -719,8 +719,9 @@
             checkPainter();
             int p0 = getStartOffset();
             int p1 = painter.getBoundedPosition(this, p0, pos, len);
-            return ((p1 > p0) && (getBreakSpot(p0, p1) != BreakIterator.DONE)) ?
-                    View.ExcellentBreakWeight : View.BadBreakWeight;
+            return p1 == p0 ? View.BadBreakWeight :
+                   getBreakSpot(p0, p1) != BreakIterator.DONE ?
+                            View.ExcellentBreakWeight : View.GoodBreakWeight;
         }
         return super.getBreakWeight(axis, pos, len);
     }
diff --git a/jdk/src/share/classes/javax/swing/text/ParagraphView.java b/jdk/src/share/classes/javax/swing/text/ParagraphView.java
index c7f6bb0..2b5f782 100644
--- a/jdk/src/share/classes/javax/swing/text/ParagraphView.java
+++ b/jdk/src/share/classes/javax/swing/text/ParagraphView.java
@@ -175,23 +175,6 @@
     }
 
     /**
-     * Adjusts the given row if possible to fit within the
-     * layout span.  By default this will try to find the
-     * highest break weight possible nearest the end of
-     * the row.  If a forced break is encountered, the
-     * break will be positioned there.
-     * <p>
-     * This is meant for internal usage, and should not be used directly.
-     *
-     * @param r the row to adjust to the current layout
-     *          span
-     * @param desiredSpan the current layout span >= 0
-     * @param x the location r starts at
-     */
-    protected void adjustRow(Row r, int desiredSpan, int x) {
-    }
-
-    /**
      * Returns the next visual position for the cursor, in
      * either the east or west direction.
      * Overridden from <code>CompositeView</code>.
diff --git a/jdk/src/share/classes/sun/awt/shell/ShellFolder.java b/jdk/src/share/classes/sun/awt/shell/ShellFolder.java
index d38fd98..cf3c789 100644
--- a/jdk/src/share/classes/sun/awt/shell/ShellFolder.java
+++ b/jdk/src/share/classes/sun/awt/shell/ShellFolder.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2000-2008 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2000-2009 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
@@ -289,8 +289,8 @@
 
         // To avoid loads of synchronizations with Invoker and improve performance we
         // synchronize the whole code of the sort method once
-        getInvoker().invoke(new Callable<Void>() {
-            public Void call() throws Exception {
+        invoke(new Callable<Void>() {
+            public Void call() {
                 // Check that we can use the ShellFolder.sortChildren() method:
                 //   1. All files have the same non-null parent
                 //   2. All files is ShellFolders
@@ -330,8 +330,8 @@
     public void sortChildren(final List<? extends File> files) {
         // To avoid loads of synchronizations with Invoker and improve performance we
         // synchronize the whole code of the sort method once
-        getInvoker().invoke(new Callable<Void>() {
-            public Void call() throws Exception {
+        invoke(new Callable<Void>() {
+            public Void call() {
                 Collections.sort(files, FILE_COMPARATOR);
 
                 return null;
@@ -502,17 +502,61 @@
     }
 
     /**
+     * Invokes the {@code task} which doesn't throw checked exceptions
+     * from its {@code call} method. If invokation is interrupted then Thread.currentThread().isInterrupted() will
+     * be set and result will be {@code null}
+     */
+    public static <T> T invoke(Callable<T> task) {
+        try {
+            return invoke(task, RuntimeException.class);
+        } catch (InterruptedException e) {
+            return null;
+        }
+    }
+
+    /**
+     * Invokes the {@code task} which throws checked exceptions from its {@code call} method.
+     * If invokation is interrupted then Thread.currentThread().isInterrupted() will
+     * be set and InterruptedException will be thrown as well.
+     */
+    public static <T, E extends Throwable> T invoke(Callable<T> task, Class<E> exceptionClass)
+            throws InterruptedException, E {
+        try {
+            return getInvoker().invoke(task);
+        } catch (Exception e) {
+            if (e instanceof RuntimeException) {
+                // Rethrow unchecked exceptions
+                throw (RuntimeException) e;
+            }
+
+            if (e instanceof InterruptedException) {
+                // Set isInterrupted flag for current thread
+                Thread.currentThread().interrupt();
+
+                // Rethrow InterruptedException
+                throw (InterruptedException) e;
+            }
+
+            if (exceptionClass.isInstance(e)) {
+                throw exceptionClass.cast(e);
+            }
+
+            throw new RuntimeException("Unexpected error", e);
+        }
+    }
+
+    /**
      * Interface allowing to invoke tasks in different environments on different platforms.
      */
     public static interface Invoker {
         /**
-         * Invokes a callable task. If the {@code task} throws a checked exception,
-         * it will be wrapped into a {@link RuntimeException}
+         * Invokes a callable task.
          *
          * @param task a task to invoke
+         * @throws Exception {@code InterruptedException} or an exception that was thrown from the {@code task}
          * @return the result of {@code task}'s invokation
          */
-        <T> T invoke(Callable<T> task);
+        <T> T invoke(Callable<T> task) throws Exception;
     }
 
     /**
diff --git a/jdk/src/share/classes/sun/awt/shell/ShellFolderManager.java b/jdk/src/share/classes/sun/awt/shell/ShellFolderManager.java
index dc8901f..fe00063 100644
--- a/jdk/src/share/classes/sun/awt/shell/ShellFolderManager.java
+++ b/jdk/src/share/classes/sun/awt/shell/ShellFolderManager.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2000-2008 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2000-2009 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
@@ -108,12 +108,8 @@
     }
 
     private static class DirectInvoker implements ShellFolder.Invoker {
-        public <T> T invoke(Callable<T> task) {
-            try {
-                return task.call();
-            } catch (Exception e) {
-                throw new RuntimeException(e);
-            }
+        public <T> T invoke(Callable<T> task) throws Exception {
+            return task.call();
         }
     }
 }
diff --git a/jdk/src/share/classes/sun/nio/cs/Surrogate.java b/jdk/src/share/classes/sun/nio/cs/Surrogate.java
index 369af3a..9e036c8 100644
--- a/jdk/src/share/classes/sun/nio/cs/Surrogate.java
+++ b/jdk/src/share/classes/sun/nio/cs/Surrogate.java
@@ -30,7 +30,6 @@
 import java.nio.charset.MalformedInputException;
 import java.nio.charset.UnmappableCharacterException;
 
-
 /**
  * Utility class for dealing with surrogates.
  *
@@ -41,19 +40,15 @@
 
     private Surrogate() { }
 
-    // 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;
-
-    // Range of UCS-4 values that need surrogates in UTF-16
-    //
-    public static final int UCS4_MIN = 0x10000;
-    public static final int UCS4_MAX = (1 << 20) + UCS4_MIN - 1;
+    // TODO: Deprecate/remove the following redundant definitions
+    public static final char MIN_HIGH = Character.MIN_HIGH_SURROGATE;
+    public static final char MAX_HIGH = Character.MAX_HIGH_SURROGATE;
+    public static final char MIN_LOW  = Character.MIN_LOW_SURROGATE;
+    public static final char MAX_LOW  = Character.MAX_LOW_SURROGATE;
+    public static final char MIN      = Character.MIN_SURROGATE;
+    public static final char MAX      = Character.MAX_SURROGATE;
+    public static final int UCS4_MIN  = Character.MIN_SUPPLEMENTARY_CODE_POINT;
+    public static final int UCS4_MAX  = Character.MAX_CODE_POINT;
 
     /**
      * Tells whether or not the given UTF-16 value is a high surrogate.
@@ -77,35 +72,45 @@
     }
 
     /**
+     * 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 isBMP(int uc) {
+        return (int) (char) uc == uc;
+    }
+
+    /**
      * Tells whether or not the given UCS-4 character must be represented as a
      * surrogate pair in UTF-16.
      */
     public static boolean neededFor(int uc) {
-        return (uc >= UCS4_MIN) && (uc <= UCS4_MAX);
+        return Character.isSupplementaryCodePoint(uc);
     }
 
     /**
      * Returns the high UTF-16 surrogate for the given UCS-4 character.
      */
     public static char high(int uc) {
-        assert neededFor(uc);
-        return (char)(0xd800 | (((uc - UCS4_MIN) >> 10) & 0x3ff));
+        assert Character.isSupplementaryCodePoint(uc);
+        return (char)((uc >> 10)
+                      + (Character.MIN_HIGH_SURROGATE
+                         - (Character.MIN_SUPPLEMENTARY_CODE_POINT >> 10)));
     }
 
     /**
      * Returns the low UTF-16 surrogate for the given UCS-4 character.
      */
     public static char low(int uc) {
-        assert neededFor(uc);
-        return (char)(0xdc00 | ((uc - UCS4_MIN) & 0x3ff));
+        assert Character.isSupplementaryCodePoint(uc);
+        return (char)((uc & 0x3ff) + Character.MIN_LOW_SURROGATE);
     }
 
     /**
      * Converts the given surrogate pair into a 32-bit UCS-4 character.
      */
     public static int toUCS4(char c, char d) {
-        assert isHigh(c) && isLow(d);
-        return (((c & 0x3ff) << 10) | (d & 0x3ff)) + 0x10000;
+        assert Character.isHighSurrogate(c) && Character.isLowSurrogate(d);
+        return Character.toCodePoint(c, d);
     }
 
     /**
@@ -178,14 +183,14 @@
          *           object
          */
         public int parse(char c, CharBuffer in) {
-            if (Surrogate.isHigh(c)) {
+            if (Character.isHighSurrogate(c)) {
                 if (!in.hasRemaining()) {
                     error = CoderResult.UNDERFLOW;
                     return -1;
                 }
                 char d = in.get();
-                if (Surrogate.isLow(d)) {
-                    character = toUCS4(c, d);
+                if (Character.isLowSurrogate(d)) {
+                    character = Character.toCodePoint(c, d);
                     isPair = true;
                     error = null;
                     return character;
@@ -193,7 +198,7 @@
                 error = CoderResult.malformedForLength(1);
                 return -1;
             }
-            if (Surrogate.isLow(c)) {
+            if (Character.isLowSurrogate(c)) {
                 error = CoderResult.malformedForLength(1);
                 return -1;
             }
@@ -220,14 +225,14 @@
          */
         public int parse(char c, char[] ia, int ip, int il) {
             assert (ia[ip] == c);
-            if (Surrogate.isHigh(c)) {
+            if (Character.isHighSurrogate(c)) {
                 if (il - ip < 2) {
                     error = CoderResult.UNDERFLOW;
                     return -1;
                 }
                 char d = ia[ip + 1];
-                if (Surrogate.isLow(d)) {
-                    character = toUCS4(c, d);
+                if (Character.isLowSurrogate(d)) {
+                    character = Character.toCodePoint(c, d);
                     isPair = true;
                     error = null;
                     return character;
@@ -235,7 +240,7 @@
                 error = CoderResult.malformedForLength(1);
                 return -1;
             }
-            if (Surrogate.isLow(c)) {
+            if (Character.isLowSurrogate(c)) {
                 error = CoderResult.malformedForLength(1);
                 return -1;
             }
@@ -282,7 +287,7 @@
          *           error() will return a descriptive result object
          */
         public int generate(int uc, int len, CharBuffer dst) {
-            if (uc <= 0xffff) {
+            if (Surrogate.isBMP(uc)) {
                 if (Surrogate.is(uc)) {
                     error = CoderResult.malformedForLength(len);
                     return -1;
@@ -294,12 +299,7 @@
                 dst.put((char)uc);
                 error = null;
                 return 1;
-            }
-            if (uc < Surrogate.UCS4_MIN) {
-                error = CoderResult.malformedForLength(len);
-                return -1;
-            }
-            if (uc <= Surrogate.UCS4_MAX) {
+            } else if (Character.isSupplementaryCodePoint(uc)) {
                 if (dst.remaining() < 2) {
                     error = CoderResult.OVERFLOW;
                     return -1;
@@ -308,9 +308,10 @@
                 dst.put(Surrogate.low(uc));
                 error = null;
                 return 2;
+            } else {
+                error = CoderResult.unmappableForLength(len);
+                return -1;
             }
-            error = CoderResult.unmappableForLength(len);
-            return -1;
         }
 
         /**
@@ -330,7 +331,7 @@
          *           error() will return a descriptive result object
          */
         public int generate(int uc, int len, char[] da, int dp, int dl) {
-            if (uc <= 0xffff) {
+            if (Surrogate.isBMP(uc)) {
                 if (Surrogate.is(uc)) {
                     error = CoderResult.malformedForLength(len);
                     return -1;
@@ -342,12 +343,7 @@
                 da[dp] = (char)uc;
                 error = null;
                 return 1;
-            }
-            if (uc < Surrogate.UCS4_MIN) {
-                error = CoderResult.malformedForLength(len);
-                return -1;
-            }
-            if (uc <= Surrogate.UCS4_MAX) {
+            } else if (Character.isSupplementaryCodePoint(uc)) {
                 if (dl - dp < 2) {
                     error = CoderResult.OVERFLOW;
                     return -1;
@@ -356,11 +352,11 @@
                 da[dp + 1] = Surrogate.low(uc);
                 error = null;
                 return 2;
+            } else {
+                error = CoderResult.unmappableForLength(len);
+                return -1;
             }
-            error = CoderResult.unmappableForLength(len);
-            return -1;
         }
-
     }
 
 }
diff --git a/jdk/src/share/classes/sun/security/krb5/Config.java b/jdk/src/share/classes/sun/security/krb5/Config.java
index 8adcba8..283e0d2 100644
--- a/jdk/src/share/classes/sun/security/krb5/Config.java
+++ b/jdk/src/share/classes/sun/security/krb5/Config.java
@@ -70,7 +70,12 @@
     private static final int BASE16_1 = 16;
     private static final int BASE16_2 = 16 * 16;
     private static final int BASE16_3 = 16 * 16 * 16;
-    private String defaultRealm;   // default kdc realm.
+
+    /**
+     * Specified by system properties. Must be both null or non-null.
+     */
+    private final String defaultRealm;
+    private final String defaultKDC;
 
     // used for native interface
     private static native String getWindowsDirectory(boolean isSystem);
@@ -81,9 +86,8 @@
      * singleton) is returned.
      *
      * @exception KrbException if error occurs when constructing a Config
-     * instance. Possible causes would be configuration file not
-     * found, either of java.security.krb5.realm or java.security.krb5.kdc
-     * not specified, error reading configuration file.
+     * instance. Possible causes would be either of java.security.krb5.realm or
+     * java.security.krb5.kdc not specified, error reading configuration file.
      */
     public static synchronized Config getInstance() throws KrbException {
         if (singleton == null) {
@@ -98,9 +102,8 @@
      * the java.security.krb5.* system properties again.
      *
      * @exception KrbException if error occurs when constructing a Config
-     * instance. Possible causes would be configuration file not
-     * found, either of java.security.krb5.realm or java.security.krb5.kdc
-     * not specified, error reading configuration file.
+     * instance. Possible causes would be either of java.security.krb5.realm or
+     * java.security.krb5.kdc not specified, error reading configuration file.
      */
 
     public static synchronized void refresh() throws KrbException {
@@ -114,56 +117,37 @@
      */
     private Config() throws KrbException {
         /*
-         * If these two system properties are being specified by the user,
-         * we ignore configuration file. If either one system property is
-         * specified, we throw exception. If neither of them are specified,
-         * we load the information from configuration file.
+         * If either one system property is specified, we throw exception.
          */
-        String kdchost =
+        String tmp =
             java.security.AccessController.doPrivileged(
                 new sun.security.action.GetPropertyAction
                     ("java.security.krb5.kdc"));
+        if (tmp != null) {
+            // The user can specify a list of kdc hosts separated by ":"
+            defaultKDC = tmp.replace(':', ' ');
+        } else {
+            defaultKDC = null;
+        }
         defaultRealm =
             java.security.AccessController.doPrivileged(
                 new sun.security.action.GetPropertyAction
                     ("java.security.krb5.realm"));
-        if ((kdchost == null && defaultRealm != null) ||
-            (defaultRealm == null && kdchost != null)) {
+        if ((defaultKDC == null && defaultRealm != null) ||
+            (defaultRealm == null && defaultKDC != null)) {
             throw new KrbException
                 ("System property java.security.krb5.kdc and " +
                  "java.security.krb5.realm both must be set or " +
                  "neither must be set.");
         }
 
-        // Read the Kerberos configuration file
+        // Always read the Kerberos configuration file
         try {
             Vector<String> configFile;
             configFile = loadConfigFile();
             stanzaTable = parseStanzaTable(configFile);
         } catch (IOException ioe) {
-            // No krb5.conf, no problem. We'll use DNS etc.
-        }
-
-        if (kdchost != null) {
-            /*
-             * If configuration information is only specified by
-             * properties java.security.krb5.kdc and
-             * java.security.krb5.realm, we put both in the hashtable
-             * under [libdefaults].
-             */
-            if (stanzaTable == null) {
-                stanzaTable = new Hashtable<String,Object> ();
-            }
-            Hashtable<String,String> kdcs =
-                    (Hashtable<String,String>)stanzaTable.get("libdefaults");
-            if (kdcs == null) {
-                kdcs = new Hashtable<String,String> ();
-                stanzaTable.put("libdefaults", kdcs);
-            }
-            kdcs.put("default_realm", defaultRealm);
-            // The user can specify a list of kdc hosts separated by ":"
-            kdchost = kdchost.replace(':', ' ');
-            kdcs.put("kdc", kdchost);
+            // No krb5.conf, no problem. We'll use DNS or system property etc.
         }
     }
 
@@ -295,19 +279,6 @@
         String result = null;
         Hashtable subTable;
 
-        /*
-         * In the situation when kdc is specified by
-         * java.security.krb5.kdc, we get the kdc from [libdefaults] in
-         * hashtable.
-         */
-        if (name.equalsIgnoreCase("kdc") &&
-            (section.equalsIgnoreCase(getDefault("default_realm", "libdefaults"))) &&
-            (java.security.AccessController.doPrivileged(
-                new sun.security.action.
-                GetPropertyAction("java.security.krb5.kdc")) != null)) {
-            result = getDefault("kdc", "libdefaults");
-            return result;
-        }
         if (stanzaTable != null) {
             for (Enumeration e = stanzaTable.keys(); e.hasMoreElements(); ) {
                 stanzaName = (String)e.nextElement();
@@ -1035,13 +1006,13 @@
     /**
      * Resets the default kdc realm.
      * We do not need to synchronize these methods since assignments are atomic
+     *
+     * This method was useless. Kept here in case some class still calls it.
      */
     public void resetDefaultRealm(String realm) {
-        defaultRealm = realm;
         if (DEBUG) {
-            System.out.println(">>> Config reset default kdc " + defaultRealm);
+            System.out.println(">>> Config try resetting default kdc " + realm);
         }
-
     }
 
     /**
@@ -1098,6 +1069,9 @@
      * @return the default realm, always non null
      */
     public String getDefaultRealm() throws KrbException {
+        if (defaultRealm != null) {
+            return defaultRealm;
+        }
         Exception cause = null;
         String realm = getDefault("default_realm", "libdefaults");
         if ((realm == null) && useDNS_Realm()) {
@@ -1142,6 +1116,9 @@
         if (realm == null) {
             realm = getDefaultRealm();
         }
+        if (realm.equalsIgnoreCase(defaultRealm)) {
+            return defaultKDC;
+        }
         Exception cause = null;
         String kdcs = getDefault("kdc", realm);
         if ((kdcs == null) && useDNS_KDC()) {
@@ -1171,6 +1148,9 @@
             });
         }
         if (kdcs == null) {
+            if (defaultKDC != null) {
+                return defaultKDC;
+            }
             KrbException ke = new KrbException("Cannot locate KDC");
             if (cause != null) {
                 ke.initCause(cause);
diff --git a/jdk/src/share/classes/sun/security/krb5/KrbApReq.java b/jdk/src/share/classes/sun/security/krb5/KrbApReq.java
index d274b1e..4ed98c5 100644
--- a/jdk/src/share/classes/sun/security/krb5/KrbApReq.java
+++ b/jdk/src/share/classes/sun/security/krb5/KrbApReq.java
@@ -294,8 +294,6 @@
         apReqMessg.ticket.sname.setRealm(apReqMessg.ticket.realm);
         enc_ticketPart.cname.setRealm(enc_ticketPart.crealm);
 
-        Config.getInstance().resetDefaultRealm(apReqMessg.ticket.realm.toString());
-
         if (!authenticator.cname.equals(enc_ticketPart.cname))
             throw new KrbApErrException(Krb5.KRB_AP_ERR_BADMATCH);
 
diff --git a/jdk/src/share/classes/sun/security/krb5/internal/ktab/KeyTab.java b/jdk/src/share/classes/sun/security/krb5/internal/ktab/KeyTab.java
index 4fd7b3b..d7c5484 100644
--- a/jdk/src/share/classes/sun/security/krb5/internal/ktab/KeyTab.java
+++ b/jdk/src/share/classes/sun/security/krb5/internal/ktab/KeyTab.java
@@ -1,5 +1,5 @@
 /*
- * Portions Copyright 2000-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Portions Copyright 2000-2009 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
@@ -403,11 +403,11 @@
     /**
      * Retrieves the key table entry with the specified service name.
      * @param service the service which may have an entry in the key table.
+     * @param keyType the etype to match, returns the 1st one if -1 provided
      * @return -1 if the entry is not found, else return the entry index
      * in the list.
      */
     private int retrieveEntry(PrincipalName service, int keyType) {
-        int found = -1;
         KeyTabEntry e;
         if (entries != null) {
             for (int i = 0; i < entries.size(); i++) {
@@ -418,7 +418,7 @@
                 }
             }
         }
-        return found;
+        return -1;
     }
 
     /**
@@ -476,12 +476,29 @@
     /**
      * Removes an entry from the key table.
      * @param service the service <code>PrincipalName</code>.
+     * @param etype the etype to match, first one if -1 provided
+     * @return 1 if removed successfully, 0 otherwise
      */
-    public void deleteEntry(PrincipalName service) {
-        int result = retrieveEntry(service, -1);
+    public int deleteEntry(PrincipalName service, int etype) {
+        int result = retrieveEntry(service, etype);
         if (result != -1) {
             entries.removeElementAt(result);
+            return 1;
         }
+        return 0;
+    }
+
+    /**
+     * Removes an entry from the key table.
+     * @param service the service <code>PrincipalName</code>.
+     * @return number of entries removed
+     */
+    public int deleteEntry(PrincipalName service) {
+        int count = 0;
+        while (deleteEntry(service, -1) > 0) {
+            count++;
+        }
+        return count;
     }
 
     /**
diff --git a/jdk/src/share/classes/sun/security/pkcs11/JarVerifier.java b/jdk/src/share/classes/sun/security/pkcs11/JarVerifier.java
deleted file mode 100644
index 092c572..0000000
--- a/jdk/src/share/classes/sun/security/pkcs11/JarVerifier.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
- * Copyright 2007 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.security.pkcs11;
-
-// NOTE: this class is duplicated amongst SunJCE, SunPKCS11, and SunMSCAPI.
-// All files should be kept in sync.
-
-import java.io.*;
-import java.util.*;
-import java.util.jar.*;
-import java.net.URL;
-import java.net.JarURLConnection;
-import java.net.MalformedURLException;
-
-import java.security.*;
-import java.security.cert.*;
-import java.security.cert.Certificate;
-
-/**
- * This class verifies JAR files (and any supporting JAR files), and
- * determines whether they may be used in this implementation.
- *
- * The JCE in OpenJDK has an open cryptographic interface, meaning it
- * does not restrict which providers can be used.  Compliance with
- * United States export controls and with local law governing the
- * import/export of products incorporating the JCE in the OpenJDK is
- * the responsibility of the licensee.
- *
- * @since 1.7
- */
-final class JarVerifier {
-
-    private static final boolean debug = false;
-
-    /**
-     * Verify the JAR file is signed by an entity which has a certificate
-     * issued by a trusted CA.
-     *
-     * Note: this is a temporary method and will change soon to use the
-     * exception chaining mechanism, which can provide more details
-     * as to why the verification failed.
-     *
-     * @param c the class to be verified.
-     * @return true if verification is successful.
-     */
-    static boolean verify(final Class c) {
-        return true;
-    }
-}
diff --git a/jdk/src/share/classes/sun/security/pkcs11/SunPKCS11.java b/jdk/src/share/classes/sun/security/pkcs11/SunPKCS11.java
index 6d0e045..674092e 100644
--- a/jdk/src/share/classes/sun/security/pkcs11/SunPKCS11.java
+++ b/jdk/src/share/classes/sun/security/pkcs11/SunPKCS11.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2003-2008 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2003-2009 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
@@ -390,24 +390,6 @@
         return sb.toString();
     }
 
-    // set to true once self verification is complete
-    private static volatile boolean integrityVerified;
-
-    static void verifySelfIntegrity(Class c) {
-        if (integrityVerified) {
-            return;
-        }
-        doVerifySelfIntegrity(c);
-    }
-
-    private static synchronized void doVerifySelfIntegrity(Class c) {
-        integrityVerified = JarVerifier.verify(c);
-        if (integrityVerified == false) {
-            throw new ProviderException
-                ("The SunPKCS11 provider may have been tampered with.");
-        }
-    }
-
     public boolean equals(Object obj) {
         return this == obj;
     }
@@ -923,7 +905,6 @@
             if (type == MD) {
                 return new P11Digest(token, algorithm, mechanism);
             } else if (type == CIP) {
-                verifySelfIntegrity(getClass());
                 if (algorithm.startsWith("RSA")) {
                     return new P11RSACipher(token, algorithm, mechanism);
                 } else {
@@ -932,12 +913,10 @@
             } else if (type == SIG) {
                 return new P11Signature(token, algorithm, mechanism);
             } else if (type == MAC) {
-                verifySelfIntegrity(getClass());
                 return new P11Mac(token, algorithm, mechanism);
             } else if (type == KPG) {
                 return new P11KeyPairGenerator(token, algorithm, mechanism);
             } else if (type == KA) {
-                verifySelfIntegrity(getClass());
                 if (algorithm.equals("ECDH")) {
                     return new P11ECDHKeyAgreement(token, algorithm, mechanism);
                 } else {
@@ -946,11 +925,8 @@
             } else if (type == KF) {
                 return token.getKeyFactory(algorithm);
             } else if (type == SKF) {
-                verifySelfIntegrity(getClass());
                 return new P11SecretKeyFactory(token, algorithm);
             } else if (type == KG) {
-                verifySelfIntegrity(getClass());
-
                 // reference equality
                 if (algorithm == "SunTlsRsaPremasterSecret") {
                     return new P11TlsRsaPremasterSecretGenerator(
diff --git a/jdk/src/share/classes/sun/security/provider/certpath/CertPathHelper.java b/jdk/src/share/classes/sun/security/provider/certpath/CertPathHelper.java
index 38c5130..b45b207 100644
--- a/jdk/src/share/classes/sun/security/provider/certpath/CertPathHelper.java
+++ b/jdk/src/share/classes/sun/security/provider/certpath/CertPathHelper.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2002-2006 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2002-2009 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
@@ -25,9 +25,11 @@
 
 package sun.security.provider.certpath;
 
+import java.util.Date;
 import java.util.Set;
 
 import java.security.cert.X509CertSelector;
+import java.security.cert.X509CRLSelector;
 
 import sun.security.x509.GeneralNameInterface;
 
@@ -55,8 +57,14 @@
     protected abstract void implSetPathToNames(X509CertSelector sel,
             Set<GeneralNameInterface> names);
 
+    protected abstract void implSetDateAndTime(X509CRLSelector sel, Date date, long skew);
+
     static void setPathToNames(X509CertSelector sel,
             Set<GeneralNameInterface> names) {
         instance.implSetPathToNames(sel, names);
     }
+
+    static void setDateAndTime(X509CRLSelector sel, Date date, long skew) {
+        instance.implSetDateAndTime(sel, date, skew);
+    }
 }
diff --git a/jdk/src/share/classes/sun/security/provider/certpath/CrlRevocationChecker.java b/jdk/src/share/classes/sun/security/provider/certpath/CrlRevocationChecker.java
index 63ee343..b462dd5 100644
--- a/jdk/src/share/classes/sun/security/provider/certpath/CrlRevocationChecker.java
+++ b/jdk/src/share/classes/sun/security/provider/certpath/CrlRevocationChecker.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2000-2008 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2000-2009 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
@@ -81,6 +81,10 @@
     private static final boolean[] ALL_REASONS =
         {true, true, true, true, true, true, true, true, true};
 
+    // Maximum clock skew in milliseconds (15 minutes) allowed when checking
+    // validity of CRLs
+    private static final long MAX_CLOCK_SKEW = 900000;
+
     /**
      * Creates a <code>CrlRevocationChecker</code>.
      *
@@ -281,7 +285,7 @@
         try {
             X509CRLSelector sel = new X509CRLSelector();
             sel.setCertificateChecking(currCert);
-            sel.setDateAndTime(mCurrentTime);
+            CertPathHelper.setDateAndTime(sel, mCurrentTime, MAX_CLOCK_SKEW);
 
             for (CertStore mStore : mStores) {
                 for (java.security.cert.CRL crl : mStore.getCRLs(sel)) {
diff --git a/jdk/src/share/classes/sun/security/provider/certpath/OCSPResponse.java b/jdk/src/share/classes/sun/security/provider/certpath/OCSPResponse.java
index 62cd428..cdadc45 100644
--- a/jdk/src/share/classes/sun/security/provider/certpath/OCSPResponse.java
+++ b/jdk/src/share/classes/sun/security/provider/certpath/OCSPResponse.java
@@ -149,9 +149,9 @@
 
     private SingleResponse singleResponse;
 
-    // Maximum clock skew in milliseconds (10 minutes) allowed when checking
+    // Maximum clock skew in milliseconds (15 minutes) allowed when checking
     // validity of OCSP responses
-    private static final long MAX_CLOCK_SKEW = 600000;
+    private static final long MAX_CLOCK_SKEW = 900000;
 
     // an array of all of the CRLReasons (used in SingleResponse)
     private static CRLReason[] values = CRLReason.values();
diff --git a/jdk/src/share/classes/sun/security/tools/JarSigner.java b/jdk/src/share/classes/sun/security/tools/JarSigner.java
index e7ca8bc..76a9c40 100644
--- a/jdk/src/share/classes/sun/security/tools/JarSigner.java
+++ b/jdk/src/share/classes/sun/security/tools/JarSigner.java
@@ -136,7 +136,7 @@
     char[] keypass; // private key password
     String sigfile; // name of .SF file
     String sigalg; // name of signature algorithm
-    String digestalg = "SHA1"; // name of digest algorithm
+    String digestalg = "SHA-256"; // name of digest algorithm
     String signedjar; // output filename
     String tsaUrl; // location of the Timestamping Authority
     String tsaAlias; // alias for the Timestamping Authority's certificate
@@ -2205,7 +2205,7 @@
                 if (keyAlgorithm.equalsIgnoreCase("DSA"))
                     digestAlgorithm = "SHA1";
                 else if (keyAlgorithm.equalsIgnoreCase("RSA"))
-                    digestAlgorithm = "SHA1";
+                    digestAlgorithm = "SHA256";
                 else {
                     throw new RuntimeException("private key is not a DSA or "
                                                + "RSA key");
diff --git a/jdk/src/share/classes/sun/security/tools/KeyTool.java b/jdk/src/share/classes/sun/security/tools/KeyTool.java
index 9b4b16f..892e8644 100644
--- a/jdk/src/share/classes/sun/security/tools/KeyTool.java
+++ b/jdk/src/share/classes/sun/security/tools/KeyTool.java
@@ -1052,7 +1052,7 @@
         X509CertImpl signerCertImpl = new X509CertImpl(encoded);
         X509CertInfo signerCertInfo = (X509CertInfo)signerCertImpl.get(
                 X509CertImpl.NAME + "." + X509CertImpl.INFO);
-        X500Name owner = (X500Name)signerCertInfo.get(X509CertInfo.SUBJECT + "." +
+        X500Name issuer = (X500Name)signerCertInfo.get(X509CertInfo.SUBJECT + "." +
                                            CertificateSubjectName.DN_NAME);
 
         Date firstDate = getStartDate(startDate);
@@ -1068,7 +1068,7 @@
         Signature signature = Signature.getInstance(sigAlgName);
         signature.initSign(privateKey);
 
-        X500Signer signer = new X500Signer(signature, owner);
+        X500Signer signer = new X500Signer(signature, issuer);
 
         X509CertInfo info = new X509CertInfo();
         info.set(X509CertInfo.VALIDITY, interval);
@@ -1102,7 +1102,8 @@
         PKCS10 req = new PKCS10(rawReq);
 
         info.set(X509CertInfo.KEY, new CertificateX509Key(req.getSubjectPublicKeyInfo()));
-        info.set(X509CertInfo.SUBJECT, new CertificateSubjectName(req.getSubjectName()));
+        info.set(X509CertInfo.SUBJECT, new CertificateSubjectName(
+                dname==null?req.getSubjectName():new X500Name(dname)));
         CertificateExtensions reqex = null;
         Iterator<PKCS10Attribute> attrs = req.getAttributes().getAttributes().iterator();
         while (attrs.hasNext()) {
@@ -1160,8 +1161,9 @@
 
         Signature signature = Signature.getInstance(sigAlgName);
         signature.initSign(privKey);
-        X500Name subject =
-            new X500Name(((X509Certificate)cert).getSubjectDN().toString());
+        X500Name subject = dname == null?
+                new X500Name(((X509Certificate)cert).getSubjectDN().toString()):
+                new X500Name(dname);
         X500Signer signer = new X500Signer(signature, subject);
 
         // Sign the request and base-64 encode it
@@ -1316,7 +1318,7 @@
         if ("DSA".equalsIgnoreCase(keyAlgName)) {
             return "SHA1WithDSA";
         } else if ("RSA".equalsIgnoreCase(keyAlgName)) {
-            return "SHA1WithRSA";
+            return "SHA256WithRSA";
         } else if ("EC".equalsIgnoreCase(keyAlgName)) {
             return "SHA1withECDSA";
         } else {
@@ -1334,6 +1336,8 @@
         if (keysize == -1) {
             if ("EC".equalsIgnoreCase(keyAlgName)) {
                 keysize = 256;
+            } else if ("RSA".equalsIgnoreCase(keyAlgName)) {
+                keysize = 2048;
             } else {
                 keysize = 1024;
             }
@@ -2497,6 +2501,7 @@
                         cert.getNotAfter().toString(),
                         getCertFingerPrint("MD5", cert),
                         getCertFingerPrint("SHA1", cert),
+                        getCertFingerPrint("SHA-256", cert),
                         cert.getSigAlgName(),
                         cert.getVersion()
                         };
@@ -3428,7 +3433,7 @@
 
                 int colonpos = name.indexOf(':');
                 if (colonpos >= 0) {
-                    if (name.substring(colonpos+1).equalsIgnoreCase("critical")) {
+                    if (oneOf(name.substring(colonpos+1), "critical") == 0) {
                         isCritical = true;
                     }
                     name = name.substring(0, colonpos);
@@ -3689,6 +3694,8 @@
         System.err.println(rb.getString
                 ("\t     [-alias <alias>] [-sigalg <sigalg>]"));
         System.err.println(rb.getString
+                ("\t     [-dname <dname>]"));
+        System.err.println(rb.getString
                 ("\t     [-file <csr_file>] [-keypass <keypass>]"));
         System.err.println(rb.getString
                 ("\t     [-keystore <keystore>] [-storepass <storepass>]"));
@@ -3771,6 +3778,8 @@
         System.err.println(rb.getString
                 ("\t     [-alias <alias>]"));
         System.err.println(rb.getString
+                ("\t     [-dname <dname>]"));
+        System.err.println(rb.getString
                 ("\t     [-sigalg <sigalg>]"));
         System.err.println(rb.getString
                 ("\t     [-startdate <startdate>]"));
diff --git a/jdk/src/share/classes/sun/security/util/Resources.java b/jdk/src/share/classes/sun/security/util/Resources.java
index c8c5e38..9b3931b6 100644
--- a/jdk/src/share/classes/sun/security/util/Resources.java
+++ b/jdk/src/share/classes/sun/security/util/Resources.java
@@ -215,7 +215,7 @@
         {"\t(RETURN if same as for <otherAlias>)",
                 "\t(RETURN if same as for <{0}>)"},
         {"*PATTERN* printX509Cert",
-                "Owner: {0}\nIssuer: {1}\nSerial number: {2}\nValid from: {3} until: {4}\nCertificate fingerprints:\n\t MD5:  {5}\n\t SHA1: {6}\n\t Signature algorithm name: {7}\n\t Version: {8}"},
+                "Owner: {0}\nIssuer: {1}\nSerial number: {2}\nValid from: {3} until: {4}\nCertificate fingerprints:\n\t MD5:  {5}\n\t SHA1: {6}\n\t SHA256: {7}\n\t Signature algorithm name: {8}\n\t Version: {9}"},
         {"What is your first and last name?",
                 "What is your first and last name?"},
         {"What is the name of your organizational unit?",
@@ -301,6 +301,7 @@
                 "-certreq     [-v] [-protected]"},
         {"\t     [-alias <alias>] [-sigalg <sigalg>]",
                 "\t     [-alias <alias>] [-sigalg <sigalg>]"},
+        {"\t     [-dname <dname>]", "\t     [-dname <dname>]"},
         {"\t     [-file <csr_file>] [-keypass <keypass>]",
                 "\t     [-file <csr_file>] [-keypass <keypass>]"},
         {"\t     [-keystore <keystore>] [-storepass <storepass>]",
diff --git a/jdk/src/share/classes/sun/swing/FilePane.java b/jdk/src/share/classes/sun/swing/FilePane.java
index eae3d5a..4aa8052 100644
--- a/jdk/src/share/classes/sun/swing/FilePane.java
+++ b/jdk/src/share/classes/sun/swing/FilePane.java
@@ -1,6 +1,5 @@
-
 /*
- * Copyright 2003-2008 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2003-2009 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
@@ -905,8 +904,8 @@
 
         @Override
         public void sort() {
-            ShellFolder.getInvoker().invoke(new Callable<Void>() {
-                public Void call() throws Exception {
+            ShellFolder.invoke(new Callable<Void>() {
+                public Void call() {
                     DetailsTableRowSorter.super.sort();
                     return null;
                 }
diff --git a/jdk/src/share/classes/sun/swing/MenuItemLayoutHelper.java b/jdk/src/share/classes/sun/swing/MenuItemLayoutHelper.java
index 109d0c4..1f0281e 100644
--- a/jdk/src/share/classes/sun/swing/MenuItemLayoutHelper.java
+++ b/jdk/src/share/classes/sun/swing/MenuItemLayoutHelper.java
@@ -718,10 +718,10 @@
     }
 
     private void alignRect(Rectangle rect, int alignment, int origWidth) {
-        if (alignment != SwingUtilities.LEFT) {
+        if (alignment == SwingConstants.RIGHT) {
             rect.x = rect.x + rect.width - origWidth;
-            rect.width = origWidth;
         }
+        rect.width = origWidth;
     }
 
     protected void layoutIconAndTextInLabelRect(LayoutResult lr) {
diff --git a/jdk/src/share/native/sun/security/pkcs11/wrapper/p11_general.c b/jdk/src/share/native/sun/security/pkcs11/wrapper/p11_general.c
index e6cbe2b6..8e80a59 100644
--- a/jdk/src/share/native/sun/security/pkcs11/wrapper/p11_general.c
+++ b/jdk/src/share/native/sun/security/pkcs11/wrapper/p11_general.c
@@ -337,7 +337,7 @@
     CK_ULONG ckTokenNumber;
     CK_SLOT_ID_PTR ckpSlotList;
     CK_BBOOL ckTokenPresent;
-    jlongArray jSlotList;
+    jlongArray jSlotList = NULL;
     CK_RV rv;
 
     CK_FUNCTION_LIST_PTR ckpFunctions = getFunctionList(env, obj);
@@ -637,7 +637,7 @@
     CK_SLOT_ID ckSlotID;
     CK_ULONG ckMechanismNumber;
     CK_MECHANISM_TYPE_PTR ckpMechanismList;
-    jlongArray jMechanismList;
+    jlongArray jMechanismList = NULL;
     CK_RV rv;
 
     CK_FUNCTION_LIST_PTR ckpFunctions = getFunctionList(env, obj);
diff --git a/jdk/src/share/native/sun/security/pkcs11/wrapper/p11_keymgmt.c b/jdk/src/share/native/sun/security/pkcs11/wrapper/p11_keymgmt.c
index aab0491..501ead9 100644
--- a/jdk/src/share/native/sun/security/pkcs11/wrapper/p11_keymgmt.c
+++ b/jdk/src/share/native/sun/security/pkcs11/wrapper/p11_keymgmt.c
@@ -73,9 +73,8 @@
     CK_MECHANISM ckMechanism;
     CK_ATTRIBUTE_PTR ckpAttributes = NULL_PTR;
     CK_ULONG ckAttributesLength;
-    CK_OBJECT_HANDLE ckKeyHandle;
+    CK_OBJECT_HANDLE ckKeyHandle = 0;
     jlong jKeyHandle = 0L;
-    CK_ULONG i;
     CK_RV rv;
 
     CK_FUNCTION_LIST_PTR ckpFunctions = getFunctionList(env, obj);
@@ -151,8 +150,7 @@
     CK_OBJECT_HANDLE_PTR ckpPublicKeyHandle;  /* pointer to Public Key */
     CK_OBJECT_HANDLE_PTR ckpPrivateKeyHandle; /* pointer to Private Key */
     CK_OBJECT_HANDLE_PTR ckpKeyHandles;     /* pointer to array with Public and Private Key */
-    jlongArray jKeyHandles;
-    CK_ULONG i;
+    jlongArray jKeyHandles = NULL;
     CK_RV rv;
 
     CK_FUNCTION_LIST_PTR ckpFunctions = getFunctionList(env, obj);
@@ -299,9 +297,8 @@
     CK_ULONG ckWrappedKeyLength;
     CK_ATTRIBUTE_PTR ckpAttributes = NULL_PTR;
     CK_ULONG ckAttributesLength;
-    CK_OBJECT_HANDLE ckKeyHandle;
+    CK_OBJECT_HANDLE ckKeyHandle = 0;
     jlong jKeyHandle = 0L;
-    CK_ULONG i;
     CK_RV rv;
 
     CK_FUNCTION_LIST_PTR ckpFunctions = getFunctionList(env, obj);
@@ -478,8 +475,7 @@
     CK_ATTRIBUTE_PTR ckpAttributes = NULL_PTR;
     CK_ULONG ckAttributesLength;
     CK_OBJECT_HANDLE ckKeyHandle = 0;
-    jlong jKeyHandle;
-    CK_ULONG i;
+    jlong jKeyHandle = 0L;
     CK_RV rv;
     CK_OBJECT_HANDLE_PTR phKey = &ckKeyHandle;
 
diff --git a/jdk/src/share/native/sun/security/pkcs11/wrapper/p11_objmgmt.c b/jdk/src/share/native/sun/security/pkcs11/wrapper/p11_objmgmt.c
index a72f20d..307f2ee 100644
--- a/jdk/src/share/native/sun/security/pkcs11/wrapper/p11_objmgmt.c
+++ b/jdk/src/share/native/sun/security/pkcs11/wrapper/p11_objmgmt.c
@@ -72,8 +72,7 @@
     CK_OBJECT_HANDLE ckObjectHandle;
     CK_ATTRIBUTE_PTR ckpAttributes = NULL_PTR;
     CK_ULONG ckAttributesLength;
-    jlong jObjectHandle;
-    CK_ULONG i;
+    jlong jObjectHandle = 0L;
     CK_RV rv;
 
     CK_FUNCTION_LIST_PTR ckpFunctions = getFunctionList(env, obj);
@@ -114,8 +113,7 @@
     CK_OBJECT_HANDLE ckNewObjectHandle;
     CK_ATTRIBUTE_PTR ckpAttributes = NULL_PTR;
     CK_ULONG ckAttributesLength;
-    jlong jNewObjectHandle;
-    CK_ULONG i;
+    jlong jNewObjectHandle = 0L;
     CK_RV rv;
 
     CK_FUNCTION_LIST_PTR ckpFunctions = getFunctionList(env, obj);
@@ -180,7 +178,7 @@
     CK_SESSION_HANDLE ckSessionHandle;
     CK_OBJECT_HANDLE ckObjectHandle;
     CK_ULONG ckObjectSize;
-    jlong jObjectSize;
+    jlong jObjectSize = 0L;
     CK_RV rv;
 
     CK_FUNCTION_LIST_PTR ckpFunctions = getFunctionList(env, obj);
@@ -217,7 +215,7 @@
     CK_ATTRIBUTE_PTR ckpAttributes = NULL_PTR;
     CK_ULONG ckAttributesLength;
     CK_ULONG ckBufferLength;
-    CK_ULONG i, j;
+    CK_ULONG i;
     jobject jAttribute;
     CK_RV rv;
 
@@ -307,7 +305,6 @@
     CK_OBJECT_HANDLE ckObjectHandle;
     CK_ATTRIBUTE_PTR ckpAttributes = NULL_PTR;
     CK_ULONG ckAttributesLength;
-    CK_ULONG i;
     CK_RV rv;
 
     CK_FUNCTION_LIST_PTR ckpFunctions = getFunctionList(env, obj);
@@ -342,7 +339,6 @@
     CK_SESSION_HANDLE ckSessionHandle;
     CK_ATTRIBUTE_PTR ckpAttributes = NULL_PTR;
     CK_ULONG ckAttributesLength;
-    CK_ULONG i;
     CK_RV rv;
 
     CK_FUNCTION_LIST_PTR ckpFunctions = getFunctionList(env, obj);
@@ -385,7 +381,7 @@
     CK_ULONG ckMaxObjectLength;
     CK_OBJECT_HANDLE_PTR ckpObjectHandleArray;
     CK_ULONG ckActualObjectCount;
-    jlongArray jObjectHandleArray;
+    jlongArray jObjectHandleArray = NULL;
 
     CK_FUNCTION_LIST_PTR ckpFunctions = getFunctionList(env, obj);
     if (ckpFunctions == NULL) { return NULL; }
diff --git a/jdk/src/share/native/sun/security/pkcs11/wrapper/p11_sign.c b/jdk/src/share/native/sun/security/pkcs11/wrapper/p11_sign.c
index e55755d..6c60fdd 100644
--- a/jdk/src/share/native/sun/security/pkcs11/wrapper/p11_sign.c
+++ b/jdk/src/share/native/sun/security/pkcs11/wrapper/p11_sign.c
@@ -110,7 +110,7 @@
     CK_BYTE_PTR ckpSignature;
     CK_ULONG ckDataLength;
     CK_ULONG ckSignatureLength = 0;
-    jbyteArray jSignature;
+    jbyteArray jSignature = NULL;
     CK_RV rv;
 
     CK_FUNCTION_LIST_PTR ckpFunctions = getFunctionList(env, obj);
diff --git a/jdk/src/share/native/sun/security/pkcs11/wrapper/p11_util.c b/jdk/src/share/native/sun/security/pkcs11/wrapper/p11_util.c
index d4c12a0..98ec9c3 100644
--- a/jdk/src/share/native/sun/security/pkcs11/wrapper/p11_util.c
+++ b/jdk/src/share/native/sun/security/pkcs11/wrapper/p11_util.c
@@ -194,16 +194,14 @@
     jclass jPKCS11ExceptionClass;
     jmethodID jConstructor;
     jthrowable jPKCS11Exception;
-    jlong jErrorCode;
+    jlong jErrorCode = 0L;
 
-    if (returnValue == CKR_OK) {
-        return 0L ;
-    } else {
+    if (returnValue != CKR_OK) {
+        jErrorCode = ckULongToJLong(returnValue);
         jPKCS11ExceptionClass = (*env)->FindClass(env, CLASS_PKCS11EXCEPTION);
         if (jPKCS11ExceptionClass != NULL) {
             jConstructor = (*env)->GetMethodID(env, jPKCS11ExceptionClass, "<init>", "(J)V");
             if (jConstructor != NULL) {
-                jErrorCode = ckULongToJLong(returnValue);
                 jPKCS11Exception = (jthrowable) (*env)->NewObject(env, jPKCS11ExceptionClass, jConstructor, jErrorCode);
                 if (jPKCS11Exception != NULL) {
                     (*env)->Throw(env, jPKCS11Exception);
@@ -211,8 +209,8 @@
             }
         }
         (*env)->DeleteLocalRef(env, jPKCS11ExceptionClass);
-        return jErrorCode ;
     }
+    return jErrorCode ;
 }
 
 /*
diff --git a/jdk/src/share/native/sun/security/pkcs11/wrapper/pkcs11wrapper.h b/jdk/src/share/native/sun/security/pkcs11/wrapper/pkcs11wrapper.h
index 9dd90c3..78a73f1 100644
--- a/jdk/src/share/native/sun/security/pkcs11/wrapper/pkcs11wrapper.h
+++ b/jdk/src/share/native/sun/security/pkcs11/wrapper/pkcs11wrapper.h
@@ -300,7 +300,7 @@
 
 /* funktions to convert a CK-type array and the array length to a Java array */
 
-jcharArray ckByteArrayToJByteArray(JNIEnv *env, const CK_BYTE_PTR ckpArray, CK_ULONG ckLength);
+jbyteArray ckByteArrayToJByteArray(JNIEnv *env, const CK_BYTE_PTR ckpArray, CK_ULONG ckLength);
 jlongArray ckULongArrayToJLongArray(JNIEnv *env, const CK_ULONG_PTR ckpArray, CK_ULONG ckLength);
 jcharArray ckCharArrayToJCharArray(JNIEnv *env, const CK_CHAR_PTR ckpArray, CK_ULONG length);
 jcharArray ckUTF8CharArrayToJCharArray(JNIEnv *env, const CK_UTF8CHAR_PTR ckpArray, CK_ULONG ckLength);
diff --git a/jdk/src/solaris/classes/sun/awt/X11/XRobotPeer.java b/jdk/src/solaris/classes/sun/awt/X11/XRobotPeer.java
index 663c0ed..82e2263 100644
--- a/jdk/src/solaris/classes/sun/awt/X11/XRobotPeer.java
+++ b/jdk/src/solaris/classes/sun/awt/X11/XRobotPeer.java
@@ -27,6 +27,7 @@
 import java.awt.*;
 import java.awt.peer.*;
 import sun.awt.X11GraphicsConfig;
+import sun.awt.SunToolkit;
 
 class XRobotPeer implements RobotPeer {
     private X11GraphicsConfig   xgc = null;
@@ -38,7 +39,8 @@
 
     XRobotPeer(GraphicsConfiguration gc) {
         this.xgc = (X11GraphicsConfig)gc;
-        setup();
+        SunToolkit tk = (SunToolkit)Toolkit.getDefaultToolkit();
+        setup(tk.getNumberOfButtons());
     }
 
     public void dispose() {
@@ -81,7 +83,7 @@
         return pixelArray;
     }
 
-    private static native synchronized void setup();
+    private static native synchronized void setup(int numberOfButtons);
 
     private static native synchronized void mouseMoveImpl(X11GraphicsConfig xgc, int x, int y);
     private static native synchronized void mousePressImpl(int buttons);
diff --git a/jdk/src/solaris/classes/sun/nio/ch/SctpChannelImpl.java b/jdk/src/solaris/classes/sun/nio/ch/SctpChannelImpl.java
index 366ccc5..d784257 100644
--- a/jdk/src/solaris/classes/sun/nio/ch/SctpChannelImpl.java
+++ b/jdk/src/solaris/classes/sun/nio/ch/SctpChannelImpl.java
@@ -127,8 +127,6 @@
 
     /* -- End of fields protected by stateLock -- */
 
-    private SctpResultContainer commUpResultContainer;  /* null */
-
     /**
      * Constructor for normal connecting sockets
      */
@@ -761,12 +759,6 @@
                     if (!ensureReceiveOpen())
                         return null;
 
-                    if (commUpResultContainer != null) {
-                        resultContainer = commUpResultContainer;
-                        commUpResultContainer = null;
-                        continue;
-                    }
-
                     int n = 0;
                     try {
                         begin();
@@ -778,7 +770,7 @@
                         }
 
                         do {
-                            n = receive(fdVal, buffer, resultContainer);
+                            n = receive(fdVal, buffer, resultContainer, fromConnect);
                         } while ((n == IOStatus.INTERRUPTED) && isOpen());
                     } finally {
                         receiverCleanup();
@@ -809,9 +801,9 @@
 
                     if (fromConnect)  {
                         /* If we reach here, then it was connect that invoked
-                         * receive an received the COMM_UP. Save it and allow
-                         * the user handler to process it upon next receive. */
-                        commUpResultContainer = resultContainer;
+                         * receive and received the COMM_UP. We have already
+                         * handled the COMM_UP with the internal notification
+                         * handler. Simply return. */
                         return null;
                     }
                 }  /* receiveLock */
@@ -827,20 +819,21 @@
 
     private int receive(int fd,
                         ByteBuffer dst,
-                        SctpResultContainer resultContainer)
+                        SctpResultContainer resultContainer,
+                        boolean peek)
             throws IOException {
         int pos = dst.position();
         int lim = dst.limit();
         assert (pos <= lim);
         int rem = (pos <= lim ? lim - pos : 0);
         if (dst instanceof DirectBuffer && rem > 0)
-            return receiveIntoNativeBuffer(fd, resultContainer, dst, rem, pos);
+            return receiveIntoNativeBuffer(fd, resultContainer, dst, rem, pos, peek);
 
         /* Substitute a native buffer */
         int newSize = Math.max(rem, 1);
         ByteBuffer bb = Util.getTemporaryDirectBuffer(newSize);
         try {
-            int n = receiveIntoNativeBuffer(fd, resultContainer, bb, newSize, 0);
+            int n = receiveIntoNativeBuffer(fd, resultContainer, bb, newSize, 0, peek);
             bb.flip();
             if (n > 0 && rem > 0)
                 dst.put(bb);
@@ -854,10 +847,11 @@
                                         SctpResultContainer resultContainer,
                                         ByteBuffer bb,
                                         int rem,
-                                        int pos)
+                                        int pos,
+                                        boolean peek)
         throws IOException
     {
-        int n = receive0(fd, resultContainer, ((DirectBuffer)bb).address() + pos, rem);
+        int n = receive0(fd, resultContainer, ((DirectBuffer)bb).address() + pos, rem, peek);
 
         if (n > 0)
             bb.position(pos + n);
@@ -1089,7 +1083,7 @@
     private static native void initIDs();
 
     static native int receive0(int fd, SctpResultContainer resultContainer,
-            long address, int length) throws IOException;
+            long address, int length, boolean peek) throws IOException;
 
     static native int send0(int fd, long address, int length,
             SocketAddress target, int assocId, int streamNumber,
diff --git a/jdk/src/solaris/classes/sun/nio/ch/SctpMultiChannelImpl.java b/jdk/src/solaris/classes/sun/nio/ch/SctpMultiChannelImpl.java
index 555ce0e..b8457fd 100644
--- a/jdk/src/solaris/classes/sun/nio/ch/SctpMultiChannelImpl.java
+++ b/jdk/src/solaris/classes/sun/nio/ch/SctpMultiChannelImpl.java
@@ -31,6 +31,8 @@
 import java.io.FileDescriptor;
 import java.io.IOException;
 import java.util.Collections;
+import java.util.Map.Entry;
+import java.util.Iterator;
 import java.util.Set;
 import java.util.HashSet;
 import java.util.HashMap;
@@ -702,7 +704,7 @@
             int assocId = association.associationID();
             Set<SocketAddress> addresses = null;
 
-            try {
+             try {
                 addresses = SctpNet.getRemoteAddresses(fdVal, assocId);
             } catch (IOException unused) {
                 /* OK, determining connected addresses may not be possible
@@ -723,9 +725,11 @@
                 /* We cannot determine the connected addresses */
                 Set<java.util.Map.Entry<SocketAddress, Association>> addrAssocs =
                         addressMap.entrySet();
-                for (java.util.Map.Entry<SocketAddress, Association> entry : addrAssocs) {
+                Iterator<Entry<SocketAddress, Association>> iterator = addrAssocs.iterator();
+                while (iterator.hasNext()) {
+                    Entry<SocketAddress, Association> entry = iterator.next();
                     if (entry.getValue().equals(association)) {
-                        addressMap.remove(entry.getKey());
+                        iterator.remove();
                     }
                 }
             }
@@ -957,7 +961,7 @@
                                 int length)
             throws IOException{
         return SctpChannelImpl.receive0(fd, resultContainer, address,
-                length);
+                length, false /*peek */);
     }
 
     private static int send0(int fd,
diff --git a/jdk/src/solaris/native/sun/awt/awt_Robot.c b/jdk/src/solaris/native/sun/awt/awt_Robot.c
index 18aa155..dbeebfe 100644
--- a/jdk/src/solaris/native/sun/awt/awt_Robot.c
+++ b/jdk/src/solaris/native/sun/awt/awt_Robot.c
@@ -51,9 +51,8 @@
 
 extern struct X11GraphicsConfigIDs x11GraphicsConfigIDs;
 
-extern int32_t getNumButtons();
-
 static jint * masks;
+static jint num_buttons;
 
 static int32_t isXTestAvailable() {
     int32_t major_opcode, first_event, first_error;
@@ -164,34 +163,34 @@
 
 /*********************************************************************************************/
 
+// this should be called from XRobotPeer constructor
 JNIEXPORT void JNICALL
-Java_sun_awt_X11_XRobotPeer_setup (JNIEnv * env, jclass cls) {
+Java_sun_awt_X11_XRobotPeer_setup (JNIEnv * env, jclass cls, jint numberOfButtons) {
     int32_t xtestAvailable;
 
-// this should be called from XRobotPeer constructor
+    DTRACE_PRINTLN("RobotPeer: setup()");
+
+    num_buttons = numberOfButtons;
+
     jclass inputEventClazz = (*env)->FindClass(env, "java/awt/event/InputEvent");
     jmethodID getButtonDownMasksID = (*env)->GetStaticMethodID(env, inputEventClazz, "getButtonDownMasks", "()[I");
     jintArray obj = (jintArray)(*env)->CallStaticObjectMethod(env, inputEventClazz, getButtonDownMasksID);
-    jsize len = (*env)->GetArrayLength(env, obj);
     jint * tmp = (*env)->GetIntArrayElements(env, obj, JNI_FALSE);
 
-    masks  = (jint *)malloc(sizeof(jint)*len);
+    masks  = (jint *)malloc(sizeof(jint) * num_buttons);
     if (masks == (jint *) NULL) {
         JNU_ThrowOutOfMemoryError((JNIEnv *)JNU_GetEnv(jvm, JNI_VERSION_1_2), NULL);
         goto finally;
     }
 
     int i;
-    for (i = 0; i < len; i++) {
+    for (i = 0; i < num_buttons; i++) {
         masks[i] = tmp[i];
     }
     (*env)->ReleaseIntArrayElements(env, obj, tmp, 0);
     (*env)->DeleteLocalRef(env, obj);
 
-    DTRACE_PRINTLN("RobotPeer: setup()");
-
     AWT_LOCK();
-
     xtestAvailable = isXTestAvailable();
     DTRACE_PRINTLN1("RobotPeer: XTest available = %d", xtestAvailable);
     if (!xtestAvailable) {
@@ -338,8 +337,6 @@
 {
     AWT_LOCK();
 
-    int32_t num_buttons = getNumButtons(); //from XToolkit.c
-
     DTRACE_PRINTLN1("RobotPeer: mouseAction(%i)", buttonMask);
     DTRACE_PRINTLN1("RobotPeer: mouseAction, press = %d", isMousePress);
 
diff --git a/jdk/src/solaris/native/sun/nio/ch/SctpChannelImpl.c b/jdk/src/solaris/native/sun/nio/ch/SctpChannelImpl.c
index 7bb312a..0cc1b6b 100644
--- a/jdk/src/solaris/native/sun/nio/ch/SctpChannelImpl.c
+++ b/jdk/src/solaris/native/sun/nio/ch/SctpChannelImpl.c
@@ -417,11 +417,11 @@
 /*
  * Class:     sun_nio_ch_SctpChannelImpl
  * Method:    receive0
- * Signature: (ILsun/nio/ch/SctpResultContainer;JI)I
+ * Signature: (ILsun/nio/ch/SctpResultContainer;JIZ)I
  */
 JNIEXPORT jint JNICALL Java_sun_nio_ch_SctpChannelImpl_receive0
   (JNIEnv *env, jclass klass, jint fd, jobject resultContainerObj,
-   jlong address, jint length) {
+   jlong address, jint length, jboolean peek) {
     SOCKADDR sa;
     int sa_len = sizeof(sa);
     ssize_t rv = 0;
@@ -429,6 +429,7 @@
     struct iovec iov[1];
     struct msghdr msg[1];
     char cbuf[CMSG_SPACE(sizeof (struct sctp_sndrcvinfo))];
+    int flags = peek == JNI_TRUE ? MSG_PEEK : 0;
 
     /* Set up the msghdr structure for receiving */
     memset(msg, 0, sizeof (*msg));
@@ -443,7 +444,7 @@
     msg->msg_flags = 0;
 
     do {
-        if ((rv = recvmsg(fd, msg, 0)) < 0) {
+        if ((rv = recvmsg(fd, msg, flags)) < 0) {
             if (errno == EWOULDBLOCK) {
                 return IOS_UNAVAILABLE;
             } else if (errno == EINTR) {
@@ -473,7 +474,7 @@
                 memcpy(buf, addr, rv);
                 iov->iov_base = buf + rv;
                 iov->iov_len = NOTIFICATION_BUFFER_SIZE - rv;
-                if ((rv = recvmsg(fd, msg, 0)) < 0) {
+                if ((rv = recvmsg(fd, msg, flags)) < 0) {
                     handleSocketError(env, errno);
                     return 0;
                 }
diff --git a/jdk/src/solaris/native/sun/nio/fs/UnixNativeDispatcher.c b/jdk/src/solaris/native/sun/nio/fs/UnixNativeDispatcher.c
index 6f55bbe..a39f10d 100644
--- a/jdk/src/solaris/native/sun/nio/fs/UnixNativeDispatcher.c
+++ b/jdk/src/solaris/native/sun/nio/fs/UnixNativeDispatcher.c
@@ -85,19 +85,21 @@
 static jfieldID entry_dev;
 
 /**
- * System calls that may not be available at build time.
+ * System calls that may not be available at run time.
  */
 typedef int openat64_func(int, const char *, int, ...);
 typedef int fstatat64_func(int, const char *, struct stat64 *, int);
 typedef int unlinkat_func(int, const char*, int);
 typedef int renameat_func(int, const char*, int, const char*);
 typedef int futimesat_func(int, const char *, const struct timeval *);
+typedef DIR* fdopendir_func(int);
 
 static openat64_func* my_openat64_func = NULL;
 static fstatat64_func* my_fstatat64_func = NULL;
 static unlinkat_func* my_unlinkat_func = NULL;
 static renameat_func* my_renameat_func = NULL;
 static futimesat_func* my_futimesat_func = NULL;
+static fdopendir_func* my_fdopendir_func = NULL;
 
 /**
  * fstatat missing from glibc on Linux. Temporary workaround
@@ -183,7 +185,7 @@
     entry_options = (*env)->GetFieldID(env, clazz, "opts", "[B");
     entry_dev = (*env)->GetFieldID(env, clazz, "dev", "J");
 
-    /* system calls that might not be available at build time */
+    /* system calls that might not be available at run time */
 
 #if defined(__solaris__) && defined(_LP64)
     /* Solaris 64-bit does not have openat64/fstatat64 */
@@ -196,6 +198,7 @@
     my_unlinkat_func = (unlinkat_func*) dlsym(RTLD_DEFAULT, "unlinkat");
     my_renameat_func = (renameat_func*) dlsym(RTLD_DEFAULT, "renameat");
     my_futimesat_func = (futimesat_func*) dlsym(RTLD_DEFAULT, "futimesat");
+    my_fdopendir_func = (fdopendir_func*) dlsym(RTLD_DEFAULT, "fdopendir");
 
 #if defined(FSTATAT64_SYSCALL_AVAILABLE)
     /* fstatat64 missing from glibc */
@@ -205,7 +208,7 @@
 
     if (my_openat64_func != NULL &&  my_fstatat64_func != NULL &&
         my_unlinkat_func != NULL && my_renameat_func != NULL &&
-        my_futimesat_func != NULL)
+        my_futimesat_func != NULL && my_fdopendir_func != NULL)
     {
         flags |= sun_nio_fs_UnixNativeDispatcher_HAS_AT_SYSCALLS;
     }
@@ -565,8 +568,13 @@
 Java_sun_nio_fs_UnixNativeDispatcher_fdopendir(JNIEnv* env, jclass this, int dfd) {
     DIR* dir;
 
+    if (my_fdopendir_func == NULL) {
+        JNU_ThrowInternalError(env, "should not reach here");
+        return (jlong)-1;
+    }
+
     /* EINTR not listed as a possible error */
-    dir = fdopendir((int)dfd);
+    dir = (*my_fdopendir_func)((int)dfd);
     if (dir == NULL) {
         throwUnixException(env, errno);
     }
diff --git a/jdk/src/windows/classes/sun/awt/shell/Win32ShellFolder2.java b/jdk/src/windows/classes/sun/awt/shell/Win32ShellFolder2.java
index 716b562..1b81007 100644
--- a/jdk/src/windows/classes/sun/awt/shell/Win32ShellFolder2.java
+++ b/jdk/src/windows/classes/sun/awt/shell/Win32ShellFolder2.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2003-2008 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2003-2009 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
@@ -29,7 +29,6 @@
 import java.awt.Toolkit;
 import java.awt.image.BufferedImage;
 import java.io.File;
-import java.io.FileNotFoundException;
 import java.io.IOException;
 import java.util.*;
 import java.util.concurrent.*;
@@ -185,8 +184,8 @@
         boolean disposed;
         public void dispose() {
             if (disposed) return;
-            ShellFolder.getInvoker().invoke(new Callable<Void>() {
-                public Void call() throws Exception {
+            invoke(new Callable<Void>() {
+                public Void call() {
                     if (relativePIDL != 0) {
                         releasePIDL(relativePIDL);
                     }
@@ -224,7 +223,7 @@
      */
     private boolean isPersonal;
 
-    private static String composePathForCsidl(int csidl) throws IOException {
+    private static String composePathForCsidl(int csidl) throws IOException, InterruptedException {
         String path = getFileSystemPath(csidl);
         return path == null
                 ? ("ShellFolder: 0x" + Integer.toHexString(csidl))
@@ -235,12 +234,13 @@
      * Create a system special shell folder, such as the
      * desktop or Network Neighborhood.
      */
-    Win32ShellFolder2(final int csidl) throws IOException {
+    Win32ShellFolder2(final int csidl) throws IOException, InterruptedException {
         // Desktop is parent of DRIVES and NETWORK, not necessarily
         // other special shell folders.
         super(null, composePathForCsidl(csidl));
-        ShellFolder.getInvoker().invoke(new Callable<Void>() {
-            public Void call() throws Exception {
+
+        invoke(new Callable<Void>() {
+            public Void call() throws InterruptedException {
                 if (csidl == DESKTOP) {
                     initDesktop();
                 } else {
@@ -276,7 +276,7 @@
                 }
                 return null;
             }
-        });
+        }, InterruptedException.class);
 
         sun.java2d.Disposer.addRecord(this, disposer);
     }
@@ -296,13 +296,13 @@
     /**
      * Creates a shell folder with a parent and relative PIDL
      */
-    Win32ShellFolder2(final Win32ShellFolder2 parent, final long relativePIDL) {
+    Win32ShellFolder2(final Win32ShellFolder2 parent, final long relativePIDL) throws InterruptedException {
         super(parent,
-            ShellFolder.getInvoker().invoke(new Callable<String>() {
-                public String call() throws Exception {
+            invoke(new Callable<String>() {
+                public String call() {
                     return getFileSystemPath(parent.getIShellFolder(), relativePIDL);
                 }
-            })
+            }, RuntimeException.class)
         );
         this.disposer.relativePIDL = relativePIDL;
         getAbsolutePath();
@@ -335,8 +335,8 @@
      * drive (normally "C:\").
      */
     protected Object writeReplace() throws java.io.ObjectStreamException {
-        return ShellFolder.getInvoker().invoke(new Callable<File>() {
-            public File call() throws Exception {
+        return invoke(new Callable<File>() {
+            public File call() {
                 if (isFileSystem()) {
                     return new File(getPath());
                 } else {
@@ -398,11 +398,11 @@
     /**
      * Accessor for IShellFolder
      */
-    public long getIShellFolder() {
+    private long getIShellFolder() {
         if (disposer.pIShellFolder == 0) {
-            disposer.pIShellFolder =
-                ShellFolder.getInvoker().invoke(new Callable<Long>() {
-                    public Long call() throws Exception {
+            try {
+                disposer.pIShellFolder = invoke(new Callable<Long>() {
+                    public Long call() {
                         assert(isDirectory());
                         assert(parent != null);
                         long parentIShellFolder = getParentIShellFolder();
@@ -421,7 +421,10 @@
                         }
                         return pIShellFolder;
                     }
-                });
+                }, RuntimeException.class);
+            } catch (InterruptedException e) {
+                // Ignore error
+            }
         }
         return disposer.pIShellFolder;
     }
@@ -505,18 +508,23 @@
         }
 
         if (parent == rhs.parent || parent.equals(rhs.parent)) {
-            return pidlsEqual(getParentIShellFolder(), disposer.relativePIDL, rhs.disposer.relativePIDL);
+            try {
+                return pidlsEqual(getParentIShellFolder(), disposer.relativePIDL, rhs.disposer.relativePIDL);
+            } catch (InterruptedException e) {
+                return false;
+            }
         }
 
         return false;
     }
 
-    private static boolean pidlsEqual(final long pIShellFolder, final long pidl1, final long pidl2) {
-        return ShellFolder.getInvoker().invoke(new Callable<Boolean>() {
-            public Boolean call() throws Exception {
-                return (compareIDs(pIShellFolder, pidl1, pidl2) == 0);
+    private static boolean pidlsEqual(final long pIShellFolder, final long pidl1, final long pidl2)
+            throws InterruptedException {
+        return invoke(new Callable<Boolean>() {
+            public Boolean call() {
+                return compareIDs(pIShellFolder, pidl1, pidl2) == 0;
             }
-        });
+        }, RuntimeException.class);
     }
 
     // NOTE: this method uses COM and must be called on the 'COM thread'. See ComInvoker for the details
@@ -539,14 +547,16 @@
      * Return whether the given attribute flag is set for this object
      */
     public boolean hasAttribute(final int attribute) {
-        return ShellFolder.getInvoker().invoke(new Callable<Boolean>() {
-            public Boolean call() throws Exception {
+        Boolean result = invoke(new Callable<Boolean>() {
+            public Boolean call() {
                 // Caching at this point doesn't seem to be cost efficient
                 return (getAttributes0(getParentIShellFolder(),
                     getRelativePIDL(), attribute)
                     & attribute) != 0;
             }
         });
+
+        return result != null && result;
     }
 
     /**
@@ -561,32 +571,29 @@
     private static native int getAttributes0(long pParentIShellFolder, long pIDL, int attrsMask);
 
     // Return the path to the underlying file system object
+    // Should be called from the COM thread
     private static String getFileSystemPath(final long parentIShellFolder, final long relativePIDL) {
-        return ShellFolder.getInvoker().invoke(new Callable<String>() {
-            public String call() throws Exception {
-                int linkedFolder = ATTRIB_LINK | ATTRIB_FOLDER;
-                if (parentIShellFolder == Win32ShellFolderManager2.getNetwork().getIShellFolder() &&
-                        getAttributes0(parentIShellFolder, relativePIDL, linkedFolder) == linkedFolder) {
+        int linkedFolder = ATTRIB_LINK | ATTRIB_FOLDER;
+        if (parentIShellFolder == Win32ShellFolderManager2.getNetwork().getIShellFolder() &&
+                getAttributes0(parentIShellFolder, relativePIDL, linkedFolder) == linkedFolder) {
 
-                    String s =
-                            getFileSystemPath(Win32ShellFolderManager2.getDesktop().getIShellFolder(),
-                                    getLinkLocation(parentIShellFolder, relativePIDL, false));
-                    if (s != null && s.startsWith("\\\\")) {
-                        return s;
-                    }
-                }
-                return getDisplayNameOf(parentIShellFolder, relativePIDL, SHGDN_FORPARSING);
+            String s =
+                    getFileSystemPath(Win32ShellFolderManager2.getDesktop().getIShellFolder(),
+                            getLinkLocation(parentIShellFolder, relativePIDL, false));
+            if (s != null && s.startsWith("\\\\")) {
+                return s;
             }
-        });
+        }
+        return getDisplayNameOf(parentIShellFolder, relativePIDL, SHGDN_FORPARSING);
     }
 
     // Needs to be accessible to Win32ShellFolderManager2
-    static String getFileSystemPath(final int csidl) throws IOException {
-        return ShellFolder.getInvoker().invoke(new Callable<String>() {
-            public String call() throws Exception {
+    static String getFileSystemPath(final int csidl) throws IOException, InterruptedException {
+        return invoke(new Callable<String>() {
+            public String call() throws IOException {
                 return getFileSystemPath0(csidl);
             }
-        });
+        }, IOException.class);
     }
 
     // NOTE: this method uses COM and must be called on the 'COM thread'. See ComInvoker for the details
@@ -630,13 +637,14 @@
      */
     // Returns an IEnumIDList interface for an IShellFolder.  The value
     // returned must be released using releaseEnumObjects().
-    private long getEnumObjects(long pIShellFolder, final boolean includeHiddenFiles) {
-        final boolean isDesktop = (disposer.pIShellFolder == getDesktopIShellFolder());
-        return ShellFolder.getInvoker().invoke(new Callable<Long>() {
-            public Long call() throws Exception {
+    private long getEnumObjects(final boolean includeHiddenFiles) throws InterruptedException {
+        return invoke(new Callable<Long>() {
+            public Long call() {
+                boolean isDesktop = disposer.pIShellFolder == getDesktopIShellFolder();
+
                 return getEnumObjects(disposer.pIShellFolder, isDesktop, includeHiddenFiles);
             }
-        });
+        }, RuntimeException.class);
     }
 
     // Returns an IEnumIDList interface for an IShellFolder.  The value
@@ -670,58 +678,62 @@
             security.checkRead(getPath());
         }
 
-        return ShellFolder.getInvoker().invoke(new Callable<File[]>() {
-            public File[] call() throws Exception {
-                if (!isDirectory()) {
-                    return null;
-                }
-                // Links to directories are not directories and cannot be parents.
-                // This does not apply to folders in My Network Places (NetHood)
-                // because they are both links and real directories!
-                if (isLink() && !hasAttribute(ATTRIB_FOLDER)) {
-                    return new File[0];
-                }
+        try {
+            return invoke(new Callable<File[]>() {
+                public File[] call() throws InterruptedException {
+                    if (!isDirectory()) {
+                        return null;
+                    }
+                    // Links to directories are not directories and cannot be parents.
+                    // This does not apply to folders in My Network Places (NetHood)
+                    // because they are both links and real directories!
+                    if (isLink() && !hasAttribute(ATTRIB_FOLDER)) {
+                        return new File[0];
+                    }
 
-                Win32ShellFolder2 desktop = Win32ShellFolderManager2.getDesktop();
-                Win32ShellFolder2 personal = Win32ShellFolderManager2.getPersonal();
+                    Win32ShellFolder2 desktop = Win32ShellFolderManager2.getDesktop();
+                    Win32ShellFolder2 personal = Win32ShellFolderManager2.getPersonal();
 
-                // If we are a directory, we have a parent and (at least) a
-                // relative PIDL. We must first ensure we are bound to the
-                // parent so we have an IShellFolder to query.
-                long pIShellFolder = getIShellFolder();
-                // Now we can enumerate the objects in this folder.
-                ArrayList<Win32ShellFolder2> list = new ArrayList<Win32ShellFolder2>();
-                long pEnumObjects = getEnumObjects(pIShellFolder, includeHiddenFiles);
-                if (pEnumObjects != 0) {
-                    long childPIDL;
-                    int testedAttrs = ATTRIB_FILESYSTEM | ATTRIB_FILESYSANCESTOR;
-                    do {
-                        childPIDL = getNextChild(pEnumObjects);
-                        boolean releasePIDL = true;
-                        if (childPIDL != 0 &&
-                                (getAttributes0(pIShellFolder, childPIDL, testedAttrs) & testedAttrs) != 0) {
-                            Win32ShellFolder2 childFolder;
-                            if (Win32ShellFolder2.this.equals(desktop)
-                                    && personal != null
-                                    && pidlsEqual(pIShellFolder, childPIDL, personal.disposer.relativePIDL)) {
-                                childFolder = personal;
-                            } else {
-                                childFolder = new Win32ShellFolder2(Win32ShellFolder2.this, childPIDL);
-                                releasePIDL = false;
+                    // If we are a directory, we have a parent and (at least) a
+                    // relative PIDL. We must first ensure we are bound to the
+                    // parent so we have an IShellFolder to query.
+                    long pIShellFolder = getIShellFolder();
+                    // Now we can enumerate the objects in this folder.
+                    ArrayList<Win32ShellFolder2> list = new ArrayList<Win32ShellFolder2>();
+                    long pEnumObjects = getEnumObjects(includeHiddenFiles);
+                    if (pEnumObjects != 0) {
+                        long childPIDL;
+                        int testedAttrs = ATTRIB_FILESYSTEM | ATTRIB_FILESYSANCESTOR;
+                        do {
+                            childPIDL = getNextChild(pEnumObjects);
+                            boolean releasePIDL = true;
+                            if (childPIDL != 0 &&
+                                    (getAttributes0(pIShellFolder, childPIDL, testedAttrs) & testedAttrs) != 0) {
+                                Win32ShellFolder2 childFolder;
+                                if (Win32ShellFolder2.this.equals(desktop)
+                                        && personal != null
+                                        && pidlsEqual(pIShellFolder, childPIDL, personal.disposer.relativePIDL)) {
+                                    childFolder = personal;
+                                } else {
+                                    childFolder = new Win32ShellFolder2(Win32ShellFolder2.this, childPIDL);
+                                    releasePIDL = false;
+                                }
+                                list.add(childFolder);
                             }
-                            list.add(childFolder);
-                        }
-                        if (releasePIDL) {
-                            releasePIDL(childPIDL);
-                        }
-                    } while (childPIDL != 0 && !Thread.currentThread().isInterrupted());
-                    releaseEnumObjects(pEnumObjects);
+                            if (releasePIDL) {
+                                releasePIDL(childPIDL);
+                            }
+                        } while (childPIDL != 0 && !Thread.currentThread().isInterrupted());
+                        releaseEnumObjects(pEnumObjects);
+                    }
+                    return Thread.currentThread().isInterrupted()
+                        ? new File[0]
+                        : list.toArray(new ShellFolder[list.size()]);
                 }
-                return Thread.currentThread().isInterrupted()
-                    ? new File[0]
-                    : list.toArray(new ShellFolder[list.size()]);
-            }
-        });
+            }, InterruptedException.class);
+        } catch (InterruptedException e) {
+            return new File[0];
+        }
     }
 
 
@@ -730,13 +742,13 @@
      *
      * @return The child shellfolder, or null if not found.
      */
-    Win32ShellFolder2 getChildByPath(final String filePath) {
-        return ShellFolder.getInvoker().invoke(new Callable<Win32ShellFolder2>() {
-            public Win32ShellFolder2 call() throws Exception {
+    Win32ShellFolder2 getChildByPath(final String filePath) throws InterruptedException {
+        return invoke(new Callable<Win32ShellFolder2>() {
+            public Win32ShellFolder2 call() throws InterruptedException {
                 long pIShellFolder = getIShellFolder();
-                long pEnumObjects = getEnumObjects(pIShellFolder, true);
+                long pEnumObjects = getEnumObjects(true);
                 Win32ShellFolder2 child = null;
-                long childPIDL = 0;
+                long childPIDL;
 
                 while ((childPIDL = getNextChild(pEnumObjects)) != 0) {
                     if (getAttributes0(pIShellFolder, childPIDL, ATTRIB_FILESYSTEM) != 0) {
@@ -753,7 +765,7 @@
                 releaseEnumObjects(pEnumObjects);
                 return child;
             }
-        });
+        }, InterruptedException.class);
     }
 
     private Boolean cachedIsLink;
@@ -791,8 +803,8 @@
     }
 
     private ShellFolder getLinkLocation(final boolean resolve) {
-        return ShellFolder.getInvoker().invoke(new Callable<ShellFolder>() {
-            public ShellFolder call() throws Exception {
+        return invoke(new Callable<ShellFolder>() {
+            public ShellFolder call() {
                 if (!isLink()) {
                     return null;
                 }
@@ -805,6 +817,8 @@
                         location =
                                 Win32ShellFolderManager2.createShellFolderFromRelativePIDL(getDesktop(),
                                         linkLocationPIDL);
+                    } catch (InterruptedException e) {
+                        // Return null
                     } catch (InternalError e) {
                         // Could be a link to a non-bindable object, such as a network connection
                         // TODO: getIShellFolder() should throw FileNotFoundException instead
@@ -816,19 +830,12 @@
     }
 
     // Parse a display name into a PIDL relative to the current IShellFolder.
-    long parseDisplayName(final String name) throws FileNotFoundException {
-        try {
-            return ShellFolder.getInvoker().invoke(new Callable<Long>() {
-                public Long call() throws Exception {
-                    return parseDisplayName0(getIShellFolder(), name);
-                }
-            });
-        } catch (RuntimeException e) {
-            if (e.getCause() instanceof IOException) {
-                throw new FileNotFoundException("Could not find file " + name);
+    long parseDisplayName(final String name) throws IOException, InterruptedException {
+        return invoke(new Callable<Long>() {
+            public Long call() throws IOException {
+                return parseDisplayName0(getIShellFolder(), name);
             }
-            throw e;
-        }
+        }, IOException.class);
     }
 
     // NOTE: this method uses COM and must be called on the 'COM thread'. See ComInvoker for the details
@@ -846,8 +853,8 @@
     public String getDisplayName() {
         if (displayName == null) {
             displayName =
-                ShellFolder.getInvoker().invoke(new Callable<String>() {
-                    public String call() throws Exception {
+                invoke(new Callable<String>() {
+                    public String call() {
                         return getDisplayNameOf(getParentIShellFolder(),
                                 getRelativePIDL(), SHGDN_NORMAL);
                     }
@@ -867,8 +874,8 @@
         if (folderType == null) {
             final long absolutePIDL = getAbsolutePIDL();
             folderType =
-                ShellFolder.getInvoker().invoke(new Callable<String>() {
-                    public String call() throws Exception {
+                invoke(new Callable<String>() {
+                    public String call() {
                         return getFolderType(absolutePIDL);
                     }
                 });
@@ -926,15 +933,12 @@
 
     public static native int[] getFileChooserBitmapBits();
 
+    // Should be called from the COM thread
     private long getIShellIcon() {
         if (pIShellIcon == -1L) {
-            pIShellIcon =
-                ShellFolder.getInvoker().invoke(new Callable<Long>() {
-                    public Long call() throws Exception {
-                        return getIShellIcon(getIShellFolder());
-                    }
-                });
+            pIShellIcon = getIShellIcon(getIShellFolder());
         }
+
         return pIShellIcon;
     }
 
@@ -988,8 +992,8 @@
         Image icon = getLargeIcon ? largeIcon : smallIcon;
         if (icon == null) {
             icon =
-                ShellFolder.getInvoker().invoke(new Callable<Image>() {
-                    public Image call() throws Exception {
+                invoke(new Callable<Image>() {
+                    public Image call() {
                         Image newIcon = null;
                         if (isFileSystem()) {
                             long parentIShellIcon = (parent != null)
@@ -1113,8 +1117,8 @@
     private static final int LVCFMT_CENTER = 2;
 
     public ShellFolderColumnInfo[] getFolderColumns() {
-        return ShellFolder.getInvoker().invoke(new Callable<ShellFolderColumnInfo[]>() {
-            public ShellFolderColumnInfo[] call() throws Exception {
+        return invoke(new Callable<ShellFolderColumnInfo[]>() {
+            public ShellFolderColumnInfo[] call() {
                 ShellFolderColumnInfo[] columns = doGetColumnInfo(getIShellFolder());
 
                 if (columns != null) {
@@ -1143,8 +1147,8 @@
     }
 
     public Object getFolderColumnValue(final int column) {
-        return ShellFolder.getInvoker().invoke(new Callable<Object>() {
-            public Object call() throws Exception {
+        return invoke(new Callable<Object>() {
+            public Object call() {
                 return doGetColumnValue(getParentIShellFolder(), getRelativePIDL(), column);
             }
         });
@@ -1163,8 +1167,8 @@
     public void sortChildren(final List<? extends File> files) {
         // To avoid loads of synchronizations with Invoker and improve performance we
         // synchronize the whole code of the sort method once
-        getInvoker().invoke(new Callable<Void>() {
-            public Void call() throws Exception {
+        invoke(new Callable<Void>() {
+            public Void call() {
                 Collections.sort(files, new ColumnComparator(getIShellFolder(), 0));
 
                 return null;
@@ -1184,19 +1188,21 @@
 
         // compares 2 objects within this folder by the specified column
         public int compare(final File o, final File o1) {
-            return ShellFolder.getInvoker().invoke(new Callable<Integer>() {
-                public Integer call() throws Exception {
+            Integer result = invoke(new Callable<Integer>() {
+                public Integer call() {
                     if (o instanceof Win32ShellFolder2
-                            && o1 instanceof Win32ShellFolder2) {
+                        && o1 instanceof Win32ShellFolder2) {
                         // delegates comparison to native method
                         return compareIDsByColumn(parentIShellFolder,
-                                ((Win32ShellFolder2) o).getRelativePIDL(),
-                                ((Win32ShellFolder2) o1).getRelativePIDL(),
-                                columnIdx);
+                            ((Win32ShellFolder2) o).getRelativePIDL(),
+                            ((Win32ShellFolder2) o1).getRelativePIDL(),
+                            columnIdx);
                     }
                     return 0;
                 }
             });
+
+            return result == null ? 0 : result;
         }
     }
 }
diff --git a/jdk/src/windows/classes/sun/awt/shell/Win32ShellFolderManager2.java b/jdk/src/windows/classes/sun/awt/shell/Win32ShellFolderManager2.java
index 1586846..4471a3e 100644
--- a/jdk/src/windows/classes/sun/awt/shell/Win32ShellFolderManager2.java
+++ b/jdk/src/windows/classes/sun/awt/shell/Win32ShellFolderManager2.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2003-2008 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2003-2009 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
@@ -58,10 +58,15 @@
     }
 
     public ShellFolder createShellFolder(File file) throws FileNotFoundException {
-        return createShellFolder(getDesktop(), file);
+        try {
+            return createShellFolder(getDesktop(), file);
+        } catch (InterruptedException e) {
+            throw new FileNotFoundException("Execution was interrupted");
+        }
     }
 
-    static Win32ShellFolder2 createShellFolder(Win32ShellFolder2 parent, File file) throws FileNotFoundException {
+    static Win32ShellFolder2 createShellFolder(Win32ShellFolder2 parent, File file)
+            throws FileNotFoundException, InterruptedException {
         long pIDL;
         try {
             pIDL = parent.parseDisplayName(file.getCanonicalPath());
@@ -77,7 +82,8 @@
         return folder;
     }
 
-    static Win32ShellFolder2 createShellFolderFromRelativePIDL(Win32ShellFolder2 parent, long pIDL) {
+    static Win32ShellFolder2 createShellFolderFromRelativePIDL(Win32ShellFolder2 parent, long pIDL)
+            throws InterruptedException {
         // Walk down this relative pIDL, creating new nodes for each of the entries
         while (pIDL != 0) {
             long curPIDL = Win32ShellFolder2.copyFirstPIDLEntry(pIDL);
@@ -108,7 +114,9 @@
             try {
                 desktop = new Win32ShellFolder2(DESKTOP);
             } catch (IOException e) {
-                desktop = null;
+                // Ignore error
+            } catch (InterruptedException e) {
+                // Ignore error
             }
         }
         return desktop;
@@ -119,7 +127,9 @@
             try {
                 drives = new Win32ShellFolder2(DRIVES);
             } catch (IOException e) {
-                drives = null;
+                // Ignore error
+            } catch (InterruptedException e) {
+                // Ignore error
             }
         }
         return drives;
@@ -132,8 +142,10 @@
                 if (path != null) {
                     recent = createShellFolder(getDesktop(), new File(path));
                 }
+            } catch (InterruptedException e) {
+                // Ignore error
             } catch (IOException e) {
-                recent = null;
+                // Ignore error
             }
         }
         return recent;
@@ -144,7 +156,9 @@
             try {
                 network = new Win32ShellFolder2(NETWORK);
             } catch (IOException e) {
-                network = null;
+                // Ignore error
+            } catch (InterruptedException e) {
+                // Ignore error
             }
         }
         return network;
@@ -164,8 +178,10 @@
                         personal.setIsPersonal();
                     }
                 }
+            } catch (InterruptedException e) {
+                // Ignore error
             } catch (IOException e) {
-                personal = null;
+                // Ignore error
             }
         }
         return personal;
@@ -267,6 +283,9 @@
                     }
                 } catch (IOException e) {
                     // Skip this value
+                } catch (InterruptedException e) {
+                    // Return empty result
+                    return new File[0];
                 }
             } while (value != null);
 
@@ -476,33 +495,39 @@
             return comThread;
         }
 
-        public <T> T invoke(Callable<T> task) {
-            try {
-                if (Thread.currentThread() == comThread) {
-                    // if it's already called from the COM
-                    // thread, we don't need to delegate the task
-                    return task.call();
-                } else {
-                    while (true) {
-                        Future<T> future = submit(task);
+        public <T> T invoke(Callable<T> task) throws Exception {
+            if (Thread.currentThread() == comThread) {
+                // if it's already called from the COM
+                // thread, we don't need to delegate the task
+                return task.call();
+            } else {
+                Future<T> future;
 
-                        try {
-                            return future.get();
-                        } catch (InterruptedException e) {
-                            // Repeat the attempt
-                            future.cancel(true);
-                        }
+                try {
+                    future = submit(task);
+                } catch (RejectedExecutionException e) {
+                    throw new InterruptedException(e.getMessage());
+                }
+
+                try {
+                    return future.get();
+                } catch (InterruptedException e) {
+                    future.cancel(true);
+
+                    throw e;
+                } catch (ExecutionException e) {
+                    Throwable cause = e.getCause();
+
+                    if (cause instanceof Exception) {
+                        throw (Exception) cause;
                     }
+
+                    if (cause instanceof Error) {
+                        throw (Error) cause;
+                    }
+
+                    throw new RuntimeException("Unexpected error", cause);
                 }
-            } catch (Exception e) {
-                Throwable cause = (e instanceof ExecutionException) ? e.getCause() : e;
-                if (cause instanceof RuntimeException) {
-                    throw (RuntimeException) cause;
-                }
-                if (cause instanceof Error) {
-                    throw (Error) cause;
-                }
-                throw new RuntimeException(cause);
             }
         }
     }
diff --git a/jdk/src/windows/classes/sun/nio/fs/WindowsPath.java b/jdk/src/windows/classes/sun/nio/fs/WindowsPath.java
index 029431f..dcfc50e 100644
--- a/jdk/src/windows/classes/sun/nio/fs/WindowsPath.java
+++ b/jdk/src/windows/classes/sun/nio/fs/WindowsPath.java
@@ -1177,14 +1177,20 @@
 
         /*
          * Windows treates symbolic links to directories differently than it
-         * does to other file types. For that reason we check if the exists and
-         * is a directory.
+         * does to other file types. For that reason we need to check if the
+         * target is a directory (or a directory junction).
          */
+        WindowsPath resolvedTarget;
+        if (target.type == WindowsPathType.RELATIVE) {
+            WindowsPath parent = getParent();
+            resolvedTarget = (parent == null) ? target : parent.resolve(target);
+        } else {
+            resolvedTarget = resolve(target);
+        }
         int flags = 0;
-        WindowsPath resolvedTarget =
-            WindowsPath.createFromNormalizedPath(getFileSystem(), resolve(target).path);
         try {
-            if (WindowsFileAttributes.get(resolvedTarget, true).isDirectory())
+            WindowsFileAttributes wattrs = WindowsFileAttributes.get(resolvedTarget, false);
+            if (wattrs.isDirectory() || wattrs.isDirectoryLink())
                 flags |= SYMBOLIC_LINK_FLAG_DIRECTORY;
         } catch (WindowsException x) {
             // unable to access target so assume target is not a directory
diff --git a/jdk/src/windows/classes/sun/security/krb5/internal/tools/Klist.java b/jdk/src/windows/classes/sun/security/krb5/internal/tools/Klist.java
index c4724fb..5cb919b 100644
--- a/jdk/src/windows/classes/sun/security/krb5/internal/tools/Klist.java
+++ b/jdk/src/windows/classes/sun/security/krb5/internal/tools/Klist.java
@@ -1,4 +1,5 @@
 /*
+ * Portions Copyright 2003-2009 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
diff --git a/jdk/src/windows/classes/sun/security/krb5/internal/tools/Ktab.java b/jdk/src/windows/classes/sun/security/krb5/internal/tools/Ktab.java
index b773189..30be1b5 100644
--- a/jdk/src/windows/classes/sun/security/krb5/internal/tools/Ktab.java
+++ b/jdk/src/windows/classes/sun/security/krb5/internal/tools/Ktab.java
@@ -1,4 +1,5 @@
 /*
+ * Portions Copyright 2003-2009 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
@@ -30,16 +31,15 @@
 package sun.security.krb5.internal.tools;
 
 import sun.security.krb5.*;
-import sun.security.krb5.internal.*;
 import sun.security.krb5.internal.ktab.*;
-import sun.security.krb5.KrbCryptoException;
-import java.lang.RuntimeException;
 import java.io.IOException;
 import java.io.BufferedReader;
 import java.io.InputStreamReader;
-import java.io.FileOutputStream;
 import java.io.File;
+import java.text.DateFormat;
 import java.util.Arrays;
+import java.util.Date;
+import sun.security.krb5.internal.crypto.EType;
 /**
  * This class can execute as a command-line tool to help the user manage
  * entires in the key table.
@@ -55,6 +55,9 @@
     char action;
     String name;   // name and directory of key table
     String principal;
+    boolean showEType;
+    boolean showTime;
+    int etype = -1;
     char[] password = null;
 
     /**
@@ -62,13 +65,14 @@
      * <br>Usage: ktab <options>
      * <br>available options to Ktab:
      * <ul>
-     * <li><b>-l</b>  list the keytab name and entries
+     * <li><b>-l [-e] [-t]</b>  list the keytab name and entries, -e show
+     * encryption etypes, -t show timestamps.
      * <li><b>-a</b>  &lt;<i>principal name</i>&gt;
      * (&lt;<i>password</i>&gt;)  add an entry to the keytab.
      * The entry is added only to the keytab. No changes are made to the
      * Kerberos database.
-     * <li><b>-d</b>  &lt;<i>principal name</i>&gt;
-     * delete an entry from the keytab
+     * <li><b>-d</b>  &lt;<i>principal name</i>&gt; [&lt;<i>etype</i>&gt;]
+     * delete an entry from the keytab.
      * The entry is deleted only from the keytab. No changes are made to the
      * Kerberos database.
      * <li><b>-k</b>  &lt;<i>keytab name</i> &gt;
@@ -182,6 +186,11 @@
                 i++;
                 if ((i < args.length) && (!args[i].startsWith("-"))) {
                     principal = args[i];
+                    int j = i + 1;
+                    if ((j < args.length) && (!args[j].startsWith("-"))) {
+                        etype = Integer.parseInt(args[j]);
+                        i = j;
+                    }
                 } else {
                     System.out.println("Please specify the principal" +
                                        "name of the entry you want to " +
@@ -207,6 +216,12 @@
                     System.exit(-1);
                 }
                 break;
+            case 'e':
+                showEType = true;
+                break;
+            case 't':
+                showTime = true;
+                break;
             default:
                 printHelp();
                 System.exit(-1);
@@ -271,25 +286,54 @@
      * Lists key table name and entries in it.
      */
     void listKt() {
-        int version;
-        String principal;
-        // System.out.println("Keytab name: " + admin.getKeyTabName());
-        System.out.println("Keytab name: " + table.tabName());
-        // KeyTabEntry[] entries = admin.getEntries();
+        System.out.println("Keytab name: " + KeyTab.tabName());
         KeyTabEntry[] entries = table.getEntries();
         if ((entries != null) && (entries.length > 0)) {
-            System.out.println("KVNO    Principal");
+            String[][] output = new String[entries.length+1][showTime?3:2];
+            int column = 0;
+            output[0][column++] = "KVNO";
+            if (showTime) output[0][column++] = "Timestamp";
+            output[0][column++] = "Principal";
             for (int i = 0; i < entries.length; i++) {
-                version = entries[i].getKey().getKeyVersionNumber().intValue();
-                principal = entries[i].getService().toString();
-                if (i == 0) {
-                    StringBuffer separator = new StringBuffer();
-                    for (int j = 0; j < 9 + principal.length(); j++) {
-                        separator.append("-");
-                    }
-                    System.out.println(separator.toString());
+                column = 0;
+                output[i+1][column++] = entries[i].getKey().
+                        getKeyVersionNumber().toString();
+                if (showTime) output[i+1][column++] =
+                        DateFormat.getDateTimeInstance(
+                        DateFormat.SHORT, DateFormat.SHORT).format(
+                        new Date(entries[i].getTimeStamp().getTime()));
+                String princ = entries[i].getService().toString();
+                if (showEType) {
+                    int e = entries[i].getKey().getEType();
+                    output[i+1][column++] = princ + " (" + e + ":" +
+                            EType.toString(e) + ")";
+                } else {
+                    output[i+1][column++] = princ;
                 }
-                System.out.println("  " + version + "     " + principal);
+            }
+            int[] width = new int[column];
+            for (int j=0; j<column; j++) {
+                for (int i=0; i <= entries.length; i++) {
+                    if (output[i][j].length() > width[j]) {
+                        width[j] = output[i][j].length();
+                    }
+                }
+                if (j != 0) width[j] = -width[j];
+            }
+            for (int j=0; j<column; j++) {
+                System.out.printf("%" + width[j] + "s ", output[0][j]);
+            }
+            System.out.println();
+            for (int j=0; j<column; j++) {
+                for (int k=0; k<Math.abs(width[j]); k++) System.out.print("-");
+                System.out.print(" ");
+            }
+            System.out.println();
+            for (int i=0; i<entries.length; i++) {
+                for (int j=0; j<column; j++) {
+                    System.out.printf("%" + width[j] + "s ", output[i+1][j]);
+                }
+                System.out.println();
             }
         } else {
             System.out.println("0 entry.");
@@ -309,9 +353,10 @@
             String answer;
             BufferedReader cis =
                 new BufferedReader(new InputStreamReader(System.in));
-            System.out.print("Are you sure you want to "+
+            System.out.print("Are you sure you want to"+
                              " delete service key for " + pname.toString() +
-                             " in " + table.tabName() + "?(Y/N) :");
+                             " (" + (etype==-1?"all etypes":("etype = "+etype)) +
+                             ") in " + table.tabName() + "?(Y/N): ");
 
             System.out.flush();
             answer = cis.readLine();
@@ -333,19 +378,26 @@
             e.printStackTrace();
             System.exit(-1);
         }
-        // admin.deleteEntry(pname);
-        table.deleteEntry(pname);
 
-        try {
-            table.save();
-        } catch (IOException e) {
-            System.err.println("Error occurs while saving the keytab." +
+        int count;
+        if (etype == -1) count = table.deleteEntry(pname);
+        else count = table.deleteEntry(pname, etype);
+
+        if (count == 0) {
+            System.err.println("No matched entry in the keytab. " +
                                "Deletion fails.");
-            e.printStackTrace();
             System.exit(-1);
+        } else {
+            try {
+                table.save();
+            } catch (IOException e) {
+                System.err.println("Error occurs while saving the keytab. " +
+                                   "Deletion fails.");
+                e.printStackTrace();
+                System.exit(-1);
+            }
+            System.out.println("Done!");
         }
-        System.out.println("Done!");
-
     }
 
     /**
@@ -355,12 +407,12 @@
         System.out.println("\nUsage: ktab " +
                            "<options>");
         System.out.println("available options to Ktab:");
-        System.out.println("-l\t\t\t\tlist the keytab name and entries");
+        System.out.println("-l [-e] [-t]\t\t\tlist the keytab name and entries,\n\t\t\t\t-e with etype, -t with timestamp");
         System.out.println("-a <principal name> (<password>)add an entry " +
                            "to the keytab");
-        System.out.println("-d <principal name>\t\tdelete an entry from "+
-                           "the keytab");
+        System.out.println("-d <principal name> [<etype>]\tdelete an "+
+                           "entry from the keytab");
         System.out.println("-k <keytab name>\t\tspecify keytab name and "+
-                           " path with prefix FILE:");
+                           "path with prefix FILE:");
     }
 }
diff --git a/jdk/src/windows/classes/sun/security/mscapi/JarVerifier.java b/jdk/src/windows/classes/sun/security/mscapi/JarVerifier.java
deleted file mode 100644
index 1fcd6c9..0000000
--- a/jdk/src/windows/classes/sun/security/mscapi/JarVerifier.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright 2007 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.security.mscapi;
-
-// NOTE: this class is duplicated amongst SunJCE, SunPKCS11, and SunMSCAPI.
-// All files should be kept in sync.
-
-import java.io.*;
-import java.util.*;
-import java.util.jar.*;
-import java.net.URL;
-import java.net.JarURLConnection;
-import java.net.MalformedURLException;
-
-import java.security.*;
-import java.security.cert.*;
-import java.security.cert.Certificate;
-
-/**
- * This class verifies JAR files (and any supporting JAR files), and
- * determines whether they may be used in this implementation.
- *
- * The JCE in OpenJDK has an open cryptographic interface, meaning it
- * does not restrict which providers can be used.  Compliance with
- * United States export controls and with local law governing the
- * import/export of products incorporating the JCE in the OpenJDK is
- * the responsibility of the licensee.
- *
- * @since 1.7
- */
-final class JarVerifier {
-
-    private static final boolean debug = false;
-
-    /**
-     * Verify the JAR file is signed by an entity which has a certificate
-     * issued by a trusted CA.
-     *
-     * Note: this is a temporary method and will change soon to use the
-     * exception chaining mechanism, which can provide more details
-     * as to why the verification failed.
-     *
-     * @param c the class to be verified.
-     * @return true if verification is successful.
-     */
-    static boolean verify(final Class c) {
-        return true;
-    }
-}
diff --git a/jdk/src/windows/classes/sun/security/mscapi/RSACipher.java b/jdk/src/windows/classes/sun/security/mscapi/RSACipher.java
index 06a82c5..9a4a01c 100644
--- a/jdk/src/windows/classes/sun/security/mscapi/RSACipher.java
+++ b/jdk/src/windows/classes/sun/security/mscapi/RSACipher.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2005-2007 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2009 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
@@ -93,7 +93,6 @@
     private sun.security.mscapi.Key privateKey;
 
     public RSACipher() {
-        SunMSCAPI.verifySelfIntegrity(getClass());
         paddingType = PAD_PKCS1;
     }
 
diff --git a/jdk/src/windows/classes/sun/security/mscapi/SunMSCAPI.java b/jdk/src/windows/classes/sun/security/mscapi/SunMSCAPI.java
index 4dcf217..009406c 100644
--- a/jdk/src/windows/classes/sun/security/mscapi/SunMSCAPI.java
+++ b/jdk/src/windows/classes/sun/security/mscapi/SunMSCAPI.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2005-2008 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2005-2009 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
@@ -117,22 +117,4 @@
             AccessController.doPrivileged(new PutAllAction(this, map));
         }
     }
-
-    // set to true once self verification is complete
-    private static volatile boolean integrityVerified;
-
-    static void verifySelfIntegrity(Class c) {
-        if (integrityVerified) {
-            return;
-        }
-        doVerifySelfIntegrity(c);
-    }
-
-    private static synchronized void doVerifySelfIntegrity(Class c) {
-        integrityVerified = JarVerifier.verify(c);
-        if (integrityVerified == false) {
-            throw new ProviderException
-                ("The SunMSCAPI provider may have been tampered with.");
-        }
-    }
 }
diff --git a/jdk/src/windows/native/sun/windows/awt_Component.cpp b/jdk/src/windows/native/sun/windows/awt_Component.cpp
index 1da71d1..b2767ba 100644
--- a/jdk/src/windows/native/sun/windows/awt_Component.cpp
+++ b/jdk/src/windows/native/sun/windows/awt_Component.cpp
@@ -3739,11 +3739,12 @@
 
 MsgRouting AwtComponent::WmImeSetContext(BOOL fSet, LPARAM *lplParam)
 {
-    // This message causes native status window shown even it is disabled.  So don't
-    // let DefWindowProc process this message if this IMC is disabled.
+    // If the Windows input context is disabled, do not let Windows
+    // display any UIs.
     HIMC hIMC = ImmGetContext();
     if (hIMC == NULL) {
-        return mrConsume;
+        *lplParam = 0;
+        return mrDoDefault;
     }
 
     if (fSet) {
diff --git a/jdk/test/com/sun/jndi/ldap/BalancedParentheses.java b/jdk/test/com/sun/jndi/ldap/BalancedParentheses.java
new file mode 100644
index 0000000..2053aba
--- /dev/null
+++ b/jdk/test/com/sun/jndi/ldap/BalancedParentheses.java
@@ -0,0 +1,259 @@
+/*
+ * Copyright 2009 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 6449574
+ * @summary Invalid ldap filter is accepted and processed
+ */
+
+import java.io.*;
+import javax.naming.*;
+import javax.naming.directory.*;
+import java.util.Properties;
+import java.util.Hashtable;
+
+import java.net.Socket;
+import java.net.ServerSocket;
+
+public class BalancedParentheses {
+    // Should we run the client or server in a separate thread?
+    //
+    // Both sides can throw exceptions, but do you have a preference
+    // as to which side should be the main thread.
+    static boolean separateServerThread = true;
+
+    // use any free port by default
+    volatile int serverPort = 0;
+
+    // Is the server ready to serve?
+    volatile static boolean serverReady = false;
+
+    // Define the server side of the test.
+    //
+    // If the server prematurely exits, serverReady will be set to true
+    // to avoid infinite hangs.
+    void doServerSide() throws Exception {
+        ServerSocket serverSock = new ServerSocket(serverPort);
+
+        // signal client, it's ready to accecpt connection
+        serverPort = serverSock.getLocalPort();
+        serverReady = true;
+
+        // accept a connection
+        Socket socket = serverSock.accept();
+        System.out.println("Server: Connection accepted");
+
+        InputStream is = socket.getInputStream();
+        OutputStream os = socket.getOutputStream();
+
+        // read the bindRequest
+        while (is.read() != -1) {
+            // ignore
+            is.skip(is.available());
+            break;
+        }
+
+        byte[] bindResponse = {0x30, 0x0C, 0x02, 0x01, 0x01, 0x61, 0x07, 0x0A,
+                               0x01, 0x00, 0x04, 0x00, 0x04, 0x00};
+        // write bindResponse
+        os.write(bindResponse);
+        os.flush();
+
+        // ignore any more request.
+        while (is.read() != -1) {
+            // ignore
+            is.skip(is.available());
+        }
+
+        is.close();
+        os.close();
+        socket.close();
+        serverSock.close();
+    }
+
+    //  Define the client side of the test.
+    //
+    // If the server prematurely exits, serverReady will be set to true
+    // to avoid infinite hangs.
+    void doClientSide() throws Exception {
+        // Wait for server to get started.
+        while (!serverReady) {
+            Thread.sleep(50);
+        }
+
+        // set up the environment for creating the initial context
+        Hashtable<Object, Object> env = new Hashtable<Object, Object>();
+        env.put(Context.INITIAL_CONTEXT_FACTORY,
+                                "com.sun.jndi.ldap.LdapCtxFactory");
+        env.put(Context.PROVIDER_URL, "ldap://localhost:" + serverPort);
+        env.put("com.sun.jndi.ldap.read.timeout", "1000");
+
+        // env.put(Context.SECURITY_AUTHENTICATION, "simple");
+        // env.put(Context.SECURITY_PRINCIPAL,"cn=root");
+        // env.put(Context.SECURITY_CREDENTIALS,"root");
+
+        // create initial context
+        DirContext context = new InitialDirContext(env);
+
+        // searching
+        SearchControls scs = new SearchControls();
+        scs.setSearchScope(SearchControls.SUBTREE_SCOPE);
+
+        try {
+            NamingEnumeration answer = context.search(
+                                        "o=sun,c=us", "(&(cn=Bob)))", scs);
+        } catch (InvalidSearchFilterException isfe) {
+            // ignore, it is the expected filter exception.
+            System.out.println("Expected exception: " + isfe.getMessage());
+        } catch (NamingException ne) {
+            // maybe a read timeout exception, as the server does not response.
+            throw new Exception("Expect a InvalidSearchFilterException", ne);
+        }
+
+        try {
+            NamingEnumeration answer = context.search(
+                                        "o=sun,c=us", ")(&(cn=Bob)", scs);
+        } catch (InvalidSearchFilterException isfe) {
+            // ignore, it is the expected filter exception.
+            System.out.println("Expected exception: " + isfe.getMessage());
+        } catch (NamingException ne) {
+            // maybe a read timeout exception, as the server does not response.
+            throw new Exception("Expect a InvalidSearchFilterException", ne);
+        }
+
+        try {
+            NamingEnumeration answer = context.search(
+                                        "o=sun,c=us", "(&(cn=Bob))", scs);
+        } catch (InvalidSearchFilterException isfe) {
+            // ignore, it is the expected filter exception.
+            throw new Exception("Unexpected ISFE", isfe);
+        } catch (NamingException ne) {
+            // maybe a read timeout exception, as the server does not response.
+            System.out.println("Expected exception: " + ne.getMessage());
+        }
+
+        context.close();
+    }
+
+    /*
+     * ============================================================
+     * The remainder is just support stuff
+     */
+
+    // client and server thread
+    Thread clientThread = null;
+    Thread serverThread = null;
+
+    // client and server exceptions
+    volatile Exception serverException = null;
+    volatile Exception clientException = null;
+
+    void startServer(boolean newThread) throws Exception {
+        if (newThread) {
+            serverThread = new Thread() {
+                public void run() {
+                    try {
+                        doServerSide();
+                    } catch (Exception e) {
+                        /*
+                         * Our server thread just died.
+                         *
+                         * Release the client, if not active already...
+                         */
+                        System.err.println("Server died...");
+                        System.err.println(e);
+                        serverReady = true;
+                        serverException = e;
+                    }
+                }
+            };
+            serverThread.start();
+        } else {
+            doServerSide();
+        }
+    }
+
+    void startClient(boolean newThread) throws Exception {
+        if (newThread) {
+            clientThread = new Thread() {
+                public void run() {
+                    try {
+                        doClientSide();
+                    } catch (Exception e) {
+                        /*
+                         * Our client thread just died.
+                         */
+                        System.err.println("Client died...");
+                        clientException = e;
+                    }
+                }
+            };
+            clientThread.start();
+        } else {
+            doClientSide();
+        }
+    }
+
+    // Primary constructor, used to drive remainder of the test.
+    BalancedParentheses() throws Exception {
+        if (separateServerThread) {
+            startServer(true);
+            startClient(false);
+        } else {
+            startClient(true);
+            startServer(false);
+        }
+
+        /*
+         * Wait for other side to close down.
+         */
+        if (separateServerThread) {
+            serverThread.join();
+        } else {
+            clientThread.join();
+        }
+
+        /*
+         * When we get here, the test is pretty much over.
+         *
+         * If the main thread excepted, that propagates back
+         * immediately.  If the other thread threw an exception, we
+         * should report back.
+         */
+        if (serverException != null) {
+            System.out.print("Server Exception:");
+            throw serverException;
+        }
+        if (clientException != null) {
+            System.out.print("Client Exception:");
+            throw clientException;
+        }
+    }
+
+    public static void main(String[] args) throws Exception {
+        // start the test
+        new BalancedParentheses();
+    }
+
+}
diff --git a/jdk/test/com/sun/nio/sctp/SctpChannel/CommUp.java b/jdk/test/com/sun/nio/sctp/SctpChannel/CommUp.java
new file mode 100644
index 0000000..ec2e68a
--- /dev/null
+++ b/jdk/test/com/sun/nio/sctp/SctpChannel/CommUp.java
@@ -0,0 +1,364 @@
+/*
+ * Copyright 2009 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 6863110
+ * @summary Newly connected/accepted SctpChannel should fire OP_READ if registered with a Selector
+ * @author chegar
+ */
+
+import java.net.InetSocketAddress;
+import java.net.SocketAddress;
+import java.io.IOException;
+import java.util.Iterator;
+import java.util.Set;
+import java.util.concurrent.CountDownLatch;
+import java.nio.ByteBuffer;
+import java.nio.channels.Selector;
+import java.nio.channels.SelectionKey;
+import com.sun.nio.sctp.AbstractNotificationHandler;
+import com.sun.nio.sctp.AssociationChangeNotification;
+import com.sun.nio.sctp.AssociationChangeNotification.AssocChangeEvent;
+import com.sun.nio.sctp.HandlerResult;
+import com.sun.nio.sctp.Notification;
+import com.sun.nio.sctp.SctpChannel;
+import com.sun.nio.sctp.SctpServerChannel;
+import com.sun.nio.sctp.ShutdownNotification;
+import static java.lang.System.out;
+import static java.lang.System.err;
+import static java.nio.channels.SelectionKey.OP_CONNECT;
+import static java.nio.channels.SelectionKey.OP_READ;
+
+public class CommUp {
+    static CountDownLatch acceptLatch = new CountDownLatch(1);
+    static final int TIMEOUT = 10000;
+
+    CommUpNotificationHandler clientHandler = new CommUpNotificationHandler();
+    CommUpNotificationHandler serverHandler = new CommUpNotificationHandler();
+    CommUpServer server;
+    Thread clientThread;
+
+    void test(String[] args) {
+        SocketAddress address = null;
+
+        if (!Util.isSCTPSupported()) {
+            out.println("SCTP protocol is not supported");
+            out.println("Test cannot be run");
+            return;
+        }
+
+        if (args.length == 2) {
+            /* requested to connecct to a specific address */
+            try {
+                int port = Integer.valueOf(args[1]);
+                address = new InetSocketAddress(args[0], port);
+            } catch (NumberFormatException nfe) {
+                err.println(nfe);
+            }
+        } else {
+            /* start server on local machine, default */
+            try {
+                server = new CommUpServer();
+                server.start();
+                address = server.address();
+                debug("Server started and listening on " + address);
+            } catch (IOException ioe) {
+                ioe.printStackTrace();
+                return;
+            }
+        }
+
+        /* store the main thread so that the server can interrupt it, if necessary */
+        clientThread = Thread.currentThread();
+
+        doClient(address);
+    }
+
+    void doClient(SocketAddress peerAddress) {
+        SctpChannel sc = null;
+        try {
+            debug("connecting to " + peerAddress);
+            sc = SctpChannel.open();
+            sc.configureBlocking(false);
+            check(sc.isBlocking() == false, "Should be in non-blocking mode");
+            sc.connect(peerAddress);
+
+            Selector selector = Selector.open();
+            SelectionKey selectiontKey = sc.register(selector, OP_CONNECT);
+
+            /* Expect two interest Ops */
+            boolean opConnectReceived = false;
+            boolean opReadReceived = false;
+            for (int z=0; z<2; z++) {
+                debug("select " + z);
+                int keysAdded = selector.select(TIMEOUT);
+                debug("returned " + keysAdded + " keys");
+                if (keysAdded > 0) {
+                    Set<SelectionKey> keys = selector.selectedKeys();
+                    Iterator<SelectionKey> i = keys.iterator();
+                    while(i.hasNext()) {
+                        SelectionKey sk = i.next();
+                        i.remove();
+                        SctpChannel readyChannel =
+                            (SctpChannel)sk.channel();
+
+                        /* OP_CONNECT */
+                        if (sk.isConnectable()) {
+                            /* some trivial checks */
+                            check(opConnectReceived == false,
+                                  "should only received one OP_CONNECT");
+                            check(opReadReceived == false,
+                                  "should not receive OP_READ before OP_CONNECT");
+                            check(readyChannel.equals(sc),
+                                  "channels should be equal");
+                            check(!sk.isAcceptable(),
+                                  "key should not be acceptable");
+                            check(!sk.isReadable(),
+                                  "key should not be readable");
+                            check(!sk.isWritable(),
+                                  "key should not be writable");
+
+                            /* now process the OP_CONNECT */
+                            opConnectReceived = true;
+                            check((sk.interestOps() & OP_CONNECT) == OP_CONNECT,
+                                  "selection key interest ops should contain OP_CONNECT");
+                            sk.interestOps(OP_READ);
+                            check((sk.interestOps() & OP_CONNECT) != OP_CONNECT,
+                                  "selection key interest ops should not contain OP_CONNECT");
+                            check(sc.finishConnect(),
+                                  "finishConnect should return true");
+                        } /* OP_READ */
+                          else if (sk.isReadable()) {
+                            /* some trivial checks */
+                            check(opConnectReceived == true,
+                                  "should receive one OP_CONNECT before OP_READ");
+                            check(opReadReceived == false,
+                                  "should not receive OP_READ before OP_CONNECT");
+                            check(readyChannel.equals(sc),
+                                  "channels should be equal");
+                            check(!sk.isAcceptable(),
+                                  "key should not be acceptable");
+                            check(sk.isReadable(),
+                                  "key should be readable");
+                            check(!sk.isWritable(),
+                                  "key should not be writable");
+                            check(!sk.isConnectable(),
+                                  "key should not be connectable");
+
+                            /* now process the OP_READ */
+                            opReadReceived = true;
+                            selectiontKey.cancel();
+
+                            /* try with small buffer to see if native
+                             * implementation can handle this */
+                            ByteBuffer buffer = ByteBuffer.allocateDirect(1);
+                            readyChannel.receive(buffer, null, clientHandler);
+                            check(clientHandler.receivedCommUp(),
+                                    "Client should have received COMM_UP");
+
+                            /* dont close (or put anything on) the channel until
+                             * we check that the server's accepted channel also
+                             * received COMM_UP */
+                            serverHandler.waitForCommUp();
+                        } else {
+                            fail("Unexpected selection key");
+                        }
+                    }
+                } else {
+                    fail("Client selector returned 0 ready keys");
+                    /* stop the server */
+                    server.thread().interrupt();
+                }
+            } //for
+
+        } catch (IOException ioe) {
+            unexpected(ioe);
+        } catch (InterruptedException ie) {
+            unexpected(ie);
+        }
+    }
+
+    class CommUpServer implements Runnable
+    {
+        final InetSocketAddress serverAddr;
+        private SctpServerChannel ssc;
+        private Thread serverThread;
+
+        public CommUpServer() throws IOException {
+            ssc = SctpServerChannel.open().bind(null);
+            java.util.Set<SocketAddress> addrs = ssc.getAllLocalAddresses();
+            if (addrs.isEmpty())
+                debug("addrs should not be empty");
+
+            serverAddr = (InetSocketAddress) addrs.iterator().next();
+        }
+
+        void start() {
+            serverThread = new Thread(this, "CommUpServer-"  +
+                                              serverAddr.getPort());
+            serverThread.start();
+        }
+
+        InetSocketAddress address () {
+            return serverAddr;
+        }
+
+        Thread thread() {
+            return serverThread;
+        }
+
+        @Override
+        public void run() {
+            Selector selector = null;
+            SctpChannel sc = null;
+            SelectionKey readKey = null;
+            try {
+                sc = ssc.accept();
+                debug("accepted " + sc);
+
+                selector = Selector.open();
+                sc.configureBlocking(false);
+                check(sc.isBlocking() == false, "Should be in non-blocking mode");
+                readKey = sc.register(selector, SelectionKey.OP_READ);
+
+                debug("select");
+                int keysAdded = selector.select(TIMEOUT);
+                debug("returned " + keysAdded + " keys");
+                if (keysAdded > 0) {
+                    Set<SelectionKey> keys = selector.selectedKeys();
+                    Iterator<SelectionKey> i = keys.iterator();
+                    while(i.hasNext()) {
+                        SelectionKey sk = i.next();
+                        i.remove();
+                        SctpChannel readyChannel =
+                            (SctpChannel)sk.channel();
+                        check(readyChannel.equals(sc),
+                                "channels should be equal");
+                        check(!sk.isAcceptable(),
+                                "key should not be acceptable");
+                        check(sk.isReadable(),
+                                "key should be readable");
+                        check(!sk.isWritable(),
+                                "key should not be writable");
+                        check(!sk.isConnectable(),
+                                "key should not be connectable");
+
+                        /* block until we check if the client has received its COMM_UP*/
+                        clientHandler.waitForCommUp();
+
+                        ByteBuffer buffer = ByteBuffer.allocateDirect(1);
+                        sc.receive(buffer, null, serverHandler);
+                        check(serverHandler.receivedCommUp(),
+                                "Accepted channel should have received COMM_UP");
+                    }
+                } else {
+                   fail("Server selector returned 0 ready keys");
+                   /* stop the client */
+                   clientThread.interrupt();
+            }
+            } catch (IOException ioe) {
+                ioe.printStackTrace();
+            } catch (InterruptedException unused) {
+            } finally {
+                if (readKey != null) readKey.cancel();
+                try { if (selector != null) selector.close(); }
+                catch (IOException  ioe) { unexpected(ioe); }
+                try { if (ssc != null) ssc.close(); }
+                catch (IOException  ioe) { unexpected(ioe); }
+                try { if (sc != null) sc.close(); }
+                catch (IOException  ioe) { unexpected(ioe); }
+            }
+        }
+    }
+
+    class CommUpNotificationHandler extends AbstractNotificationHandler<Object>
+    {
+        private boolean receivedCommUp;  // false
+
+        public synchronized boolean receivedCommUp() {
+            return receivedCommUp;
+        }
+
+        public synchronized boolean waitForCommUp() throws InterruptedException {
+            while (receivedCommUp == false) {
+                wait();
+            }
+
+            return false;
+        }
+
+        @Override
+        public HandlerResult handleNotification(
+                Notification notification, Object attachment) {
+            fail("Unknown notification type");
+            return HandlerResult.CONTINUE;
+        }
+
+        @Override
+        public synchronized HandlerResult handleNotification(
+                AssociationChangeNotification notification, Object attachment) {
+            AssocChangeEvent event = notification.event();
+            debug("AssociationChangeNotification");
+            debug("  Association: " + notification.association());
+            debug("  Event: " + event);
+
+            if (event.equals(AssocChangeEvent.COMM_UP)) {
+                receivedCommUp = true;
+                notifyAll();
+            }
+
+            return HandlerResult.RETURN;
+        }
+
+        @Override
+        public HandlerResult handleNotification(
+                ShutdownNotification notification, Object attachment) {
+            debug("ShutdownNotification");
+            debug("  Association: " + notification.association());
+            return HandlerResult.RETURN;
+        }
+    }
+
+        //--------------------- Infrastructure ---------------------------
+    boolean debug = true;
+    volatile int passed = 0, failed = 0;
+    void pass() {passed++;}
+    void fail() {failed++; Thread.dumpStack();}
+    void fail(String msg) {err.println(msg); fail();}
+    void unexpected(Throwable t) {failed++; t.printStackTrace();}
+    void check(boolean cond) {if (cond) pass(); else fail();}
+    void check(boolean cond, String failMessage) {if (cond) pass(); else fail(failMessage);}
+    void debug(String message) {if(debug) { out.println(Thread.currentThread().getName() + ": " + message); }  }
+    void sleep(long millis) { try { Thread.currentThread().sleep(millis); }
+                          catch(InterruptedException ie) { unexpected(ie); }}
+    public static void main(String[] args) throws Throwable {
+        Class<?> k = new Object(){}.getClass().getEnclosingClass();
+        try {k.getMethod("instanceMain",String[].class)
+                .invoke( k.newInstance(), (Object) args);}
+        catch (Throwable e) {throw e.getCause();}}
+    public void instanceMain(String[] args) throws Throwable {
+        try {test(args);} catch (Throwable t) {unexpected(t);}
+        out.printf("%nPassed = %d, failed = %d%n%n", passed, failed);
+        if (failed > 0) throw new AssertionError("Some tests failed");}
+
+}
diff --git a/jdk/test/com/sun/nio/sctp/SctpMultiChannel/Branch.java b/jdk/test/com/sun/nio/sctp/SctpMultiChannel/Branch.java
index eb75415..7db79e3 100644
--- a/jdk/test/com/sun/nio/sctp/SctpMultiChannel/Branch.java
+++ b/jdk/test/com/sun/nio/sctp/SctpMultiChannel/Branch.java
@@ -115,7 +115,6 @@
             /* Receive the COMM_UP */
             buffer.clear();
             BranchNotificationHandler handler = new BranchNotificationHandler();
-            channel.configureBlocking(false);
             info = channel.receive(buffer, null, handler);
             check(handler.receivedCommUp(), "COMM_UP no received");
             Set<Association> associations = channel.associations();
diff --git a/jdk/test/com/sun/nio/sctp/SctpMultiChannel/SocketOptionTests.java b/jdk/test/com/sun/nio/sctp/SctpMultiChannel/SocketOptionTests.java
index 1495f53..e4292dd 100644
--- a/jdk/test/com/sun/nio/sctp/SctpMultiChannel/SocketOptionTests.java
+++ b/jdk/test/com/sun/nio/sctp/SctpMultiChannel/SocketOptionTests.java
@@ -181,7 +181,6 @@
         /* Receive the COMM_UP */
         buffer.clear();
         SOTNotificationHandler handler = new SOTNotificationHandler();
-        smc.configureBlocking(false);
         info = smc.receive(buffer, null, handler);
         check(handler.receivedCommUp(), "COMM_UP no received");
         Set<Association> associations = smc.associations();
@@ -220,6 +219,7 @@
             }
             check(found, "SCTP_PRIMARY_ADDR returned bogus address!");
 
+            System.out.println("Try SCTP_PRIMARY_ADDR set to: " + addrToSet);
             smc.setOption(SCTP_PRIMARY_ADDR, addrToSet, assoc);
             System.out.println("SCTP_PRIMARY_ADDR set to: " + addrToSet);
             primaryAddr = smc.getOption(SCTP_PRIMARY_ADDR, assoc);
diff --git a/jdk/test/java/awt/EventQueue/6638195/bug6638195.java b/jdk/test/java/awt/EventQueue/6638195/bug6638195.java
index 9dc3b50..c461239 100644
--- a/jdk/test/java/awt/EventQueue/6638195/bug6638195.java
+++ b/jdk/test/java/awt/EventQueue/6638195/bug6638195.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2008 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2008-2009 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
@@ -23,7 +23,7 @@
 
 /* @test
  *
- * @bug 6638195
+ * @bug 6638195 6844297
  * @author Igor Kushnirskiy
  * @summary tests if EventQueueDelegate.Delegate is invoked.
  */
@@ -47,11 +47,22 @@
     }
 
     private static void runTest(MyEventQueueDelegate delegate) throws Exception {
+        // We need an empty runnable here, so the next event is
+        // processed with a new EventQueueDelegate. See 6844297
+        // for details
         EventQueue.invokeLater(
             new Runnable() {
                 public void run() {
                 }
             });
+        // The following event is expected to be processed by
+        // the EventQueueDelegate instance
+        EventQueue.invokeLater(
+            new Runnable() {
+                public void run() {
+                }
+            });
+        // Finally, proceed on the main thread
         final CountDownLatch latch = new CountDownLatch(1);
         EventQueue.invokeLater(
             new Runnable() {
@@ -60,7 +71,7 @@
                 }
             });
         latch.await();
-        if (! delegate.allInvoked()) {
+        if (!delegate.allInvoked()) {
             throw new RuntimeException("failed");
         }
     }
@@ -125,6 +136,7 @@
 
         return objectMap;
     }
+
     static class MyEventQueueDelegate implements EventQueueDelegate.Delegate {
         private volatile boolean getNextEventInvoked = false;
         private volatile boolean beforeDispatchInvoked = false;
diff --git a/jdk/test/java/awt/Frame/FrameSize/TestFrameSize.java b/jdk/test/java/awt/Frame/FrameSize/TestFrameSize.java
index b220ec5..29a4399 100644
--- a/jdk/test/java/awt/Frame/FrameSize/TestFrameSize.java
+++ b/jdk/test/java/awt/Frame/FrameSize/TestFrameSize.java
@@ -1,5 +1,6 @@
 /*
  * Copyright 2009 Red Hat, Inc.  All Rights Reserved.
+ * Portions Copyright 2009 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
@@ -37,35 +38,62 @@
  * Test fails if size of window is wrong
  */
 
-import java.awt.Dimension;
-import java.awt.Frame;
+import java.awt.*;
 
 public class TestFrameSize {
 
-        static Dimension desiredDimensions = new Dimension(200, 200);
-        static int ERROR_MARGIN = 15;
-        static Frame mainWindow;
+    static Dimension desiredDimensions = new Dimension(200, 200);
+    static Frame mainWindow;
 
-        public static void drawGui() {
-                mainWindow = new Frame("");
-                mainWindow.setPreferredSize(desiredDimensions);
-                mainWindow.pack();
+    private static Dimension getClientSize(Frame window) {
+        Dimension size = window.getSize();
+        Insets insets = window.getInsets();
 
-                Dimension actualDimensions = mainWindow.getSize();
-                System.out.println("Desired dimensions: " + desiredDimensions.toString());
-                System.out.println("Actual dimensions:  " + actualDimensions.toString());
-                if (Math.abs(actualDimensions.height - desiredDimensions.height) > ERROR_MARGIN) {
-                        throw new RuntimeException("Incorrect widow size");
-                }
+        System.out.println("getClientSize() for " + window);
+        System.out.println("   size: " + size);
+        System.out.println("   insets: " + insets);
+
+        return new Dimension(
+                size.width - insets.left - insets.right,
+                size.height - insets.top - insets.bottom);
+    }
+
+    public static void drawGui() {
+        mainWindow = new Frame("");
+        mainWindow.setPreferredSize(desiredDimensions);
+        mainWindow.pack();
+
+        Dimension actualDimensions = mainWindow.getSize();
+        System.out.println("Desired dimensions: " + desiredDimensions.toString());
+        System.out.println("Actual dimensions:  " + actualDimensions.toString());
+        if (!actualDimensions.equals(desiredDimensions)) {
+            throw new RuntimeException("Incorrect widow size");
         }
 
-        public static void main(String[] args) {
-                try {
-                        drawGui();
-                } finally {
-                        if (mainWindow != null) {
-                                mainWindow.dispose();
-                        }
-                }
+        // pack() guarantees to preserve the size of the client area after
+        // showing the window.
+        Dimension clientSize1 = getClientSize(mainWindow);
+        System.out.println("Client size before showing: " + clientSize1);
+
+        mainWindow.setVisible(true);
+
+        ((sun.awt.SunToolkit)Toolkit.getDefaultToolkit()).realSync();
+
+        Dimension clientSize2 = getClientSize(mainWindow);
+        System.out.println("Client size after showing: " + clientSize2);
+
+        if (!clientSize2.equals(clientSize1)) {
+            throw new RuntimeException("Incorrect client area size.");
         }
+    }
+
+    public static void main(String[] args) {
+        try {
+            drawGui();
+        } finally {
+            if (mainWindow != null) {
+                mainWindow.dispose();
+            }
+        }
+    }
 }
diff --git a/jdk/test/java/nio/channels/AsynchronousChannelGroup/GroupOfOne.java b/jdk/test/java/nio/channels/AsynchronousChannelGroup/GroupOfOne.java
index b116245..4478c9b 100644
--- a/jdk/test/java/nio/channels/AsynchronousChannelGroup/GroupOfOne.java
+++ b/jdk/test/java/nio/channels/AsynchronousChannelGroup/GroupOfOne.java
@@ -44,9 +44,9 @@
         final AsynchronousServerSocketChannel listener =
             AsynchronousServerSocketChannel.open()
                 .bind(new InetSocketAddress(0));
-        listener.accept(null, new CompletionHandler<AsynchronousSocketChannel,Void>() {
+        listener.accept((Void)null, new CompletionHandler<AsynchronousSocketChannel,Void>() {
             public void completed(AsynchronousSocketChannel ch, Void att) {
-                listener.accept(null, this);
+                listener.accept((Void)null, this);
             }
             public void failed(Throwable exc, Void att) {
             }
@@ -81,13 +81,13 @@
         // 2. the close/shutdown completes
         final CountDownLatch latch = new CountDownLatch(2);
 
-        ch.connect(sa, null, new CompletionHandler<Void,Void>() {
+        ch.connect(sa, (Void)null, new CompletionHandler<Void,Void>() {
             public void completed(Void result, Void att)  {
                 System.out.println("Connected");
 
                 // initiate I/O operation that does not complete (successfully)
                 ByteBuffer buf = ByteBuffer.allocate(100);
-                ch.read(buf, null, new CompletionHandler<Integer,Void>() {
+                ch.read(buf, (Void)null, new CompletionHandler<Integer,Void>() {
                     public void completed(Integer bytesRead, Void att)  {
                         throw new RuntimeException();
                     }
diff --git a/jdk/test/java/nio/channels/AsynchronousChannelGroup/Identity.java b/jdk/test/java/nio/channels/AsynchronousChannelGroup/Identity.java
index f41c12c..6214df2 100644
--- a/jdk/test/java/nio/channels/AsynchronousChannelGroup/Identity.java
+++ b/jdk/test/java/nio/channels/AsynchronousChannelGroup/Identity.java
@@ -78,15 +78,15 @@
         final AsynchronousServerSocketChannel listener =
             AsynchronousServerSocketChannel.open()
                 .bind(new InetSocketAddress(0));
-        listener.accept(null, new CompletionHandler<AsynchronousSocketChannel,Void>() {
+        listener.accept((Void)null, new CompletionHandler<AsynchronousSocketChannel,Void>() {
             public void completed(final AsynchronousSocketChannel ch, Void att) {
-                listener.accept(null, this);
+                listener.accept((Void)null, this);
 
                 final ByteBuffer buf = ByteBuffer.allocate(100);
-                ch.read(buf, null, new CompletionHandler<Integer,Void>() {
+                ch.read(buf, (Void)null, new CompletionHandler<Integer,Void>() {
                     public void completed(Integer bytesRead, Void att) {
                         buf.clear();
-                        ch.read(buf, null, this);
+                        ch.read(buf, (Void)null, this);
                     }
                     public void failed(Throwable exc, Void att) {
                     }
diff --git a/jdk/test/java/nio/channels/AsynchronousChannelGroup/Restart.java b/jdk/test/java/nio/channels/AsynchronousChannelGroup/Restart.java
index 567321e..f213227 100644
--- a/jdk/test/java/nio/channels/AsynchronousChannelGroup/Restart.java
+++ b/jdk/test/java/nio/channels/AsynchronousChannelGroup/Restart.java
@@ -94,7 +94,7 @@
         for (int i=0; i<count; i++) {
             final CountDownLatch latch = new CountDownLatch(1);
 
-            listener.accept(null, new CompletionHandler<AsynchronousSocketChannel,Void>() {
+            listener.accept((Void)null, new CompletionHandler<AsynchronousSocketChannel,Void>() {
                 public void completed(AsynchronousSocketChannel ch, Void att) {
                     try {
                         ch.close();
diff --git a/jdk/test/java/nio/channels/AsynchronousChannelGroup/Unbounded.java b/jdk/test/java/nio/channels/AsynchronousChannelGroup/Unbounded.java
index f615c3c..f77f2fc 100644
--- a/jdk/test/java/nio/channels/AsynchronousChannelGroup/Unbounded.java
+++ b/jdk/test/java/nio/channels/AsynchronousChannelGroup/Unbounded.java
@@ -45,10 +45,10 @@
         final AsynchronousServerSocketChannel listener =
             AsynchronousServerSocketChannel.open()
                 .bind(new InetSocketAddress(0));
-        listener.accept(null, new CompletionHandler<AsynchronousSocketChannel,Void>() {
+        listener.accept((Void)null, new CompletionHandler<AsynchronousSocketChannel,Void>() {
             public void completed(AsynchronousSocketChannel ch, Void att) {
                 queue.add(ch);
-                listener.accept(null, this);
+                listener.accept((Void)null, this);
             }
             public void failed(Throwable exc, Void att) {
             }
diff --git a/jdk/test/java/nio/channels/AsynchronousDatagramChannel/Basic.java b/jdk/test/java/nio/channels/AsynchronousDatagramChannel/Basic.java
index 5ed3d83..f90800f 100644
--- a/jdk/test/java/nio/channels/AsynchronousDatagramChannel/Basic.java
+++ b/jdk/test/java/nio/channels/AsynchronousDatagramChannel/Basic.java
@@ -66,7 +66,7 @@
         // Test: datagram packet not received immediately
         dst.clear();
         final CountDownLatch latch = new CountDownLatch(1);
-        ch.receive(dst, null, new CompletionHandler<SocketAddress,Void>() {
+        ch.receive(dst, (Void)null, new CompletionHandler<SocketAddress,Void>() {
             public void completed(SocketAddress source, Void att) {
                 latch.countDown();
             }
@@ -82,7 +82,7 @@
         // Test: timeout
         dst.clear();
         final AtomicReference<Throwable> exception = new AtomicReference<Throwable>();
-        ch.receive(dst, 2, TimeUnit.SECONDS, null, new CompletionHandler<SocketAddress,Void>() {
+        ch.receive(dst, 2, TimeUnit.SECONDS, (Void)null, new CompletionHandler<SocketAddress,Void>() {
             public void completed(SocketAddress source, Void att) {
             }
             public void failed (Throwable exc, Void att) {
@@ -101,7 +101,7 @@
         // AsynchronousCloseException
         dst = ByteBuffer.allocateDirect(100);
         exception.set(null);
-        ch.receive(dst, null, new CompletionHandler<SocketAddress,Void>() {
+        ch.receive(dst, (Void)null, new CompletionHandler<SocketAddress,Void>() {
             public void completed(SocketAddress source, Void att) {
             }
             public void failed (Throwable exc, Void att) {
@@ -156,7 +156,7 @@
         // Test: datagram packet not received immediately
         dst.clear();
         final CountDownLatch l1 = new CountDownLatch(1);
-        ch.read(dst, null, new CompletionHandler<Integer,Void>() {
+        ch.read(dst, (Void)null, new CompletionHandler<Integer,Void>() {
             public void completed(Integer bytesRead, Void att) {
                 l1.countDown();
             }
@@ -172,7 +172,7 @@
         // Test: timeout
         dst.clear();
         final AtomicReference<Throwable> exception = new AtomicReference<Throwable>();
-        ch.read(dst, 2, TimeUnit.SECONDS, null, new CompletionHandler<Integer,Void>() {
+        ch.read(dst, 2, TimeUnit.SECONDS, (Void)null, new CompletionHandler<Integer,Void>() {
             public void completed(Integer bytesRead, Void att) {
             }
             public void failed (Throwable exc, Void att) {
@@ -191,7 +191,7 @@
         // AsynchronousCloseException
         dst.clear();
         exception.set(null);
-        ch.read(dst, null, new CompletionHandler<Integer,Void>() {
+        ch.read(dst, (Void)null, new CompletionHandler<Integer,Void>() {
             public void completed(Integer bytesRead, Void att) {
             }
             public void failed (Throwable exc, Void att) {
@@ -238,7 +238,7 @@
         // Test: send datagram packet to reader and check completion handler
         // is invoked
         final CountDownLatch l2 = new CountDownLatch(1);
-        ch.send(ByteBuffer.wrap(msg), sa, null, new CompletionHandler<Integer,Void>() {
+        ch.send(ByteBuffer.wrap(msg), sa, (Void)null, new CompletionHandler<Integer,Void>() {
             public void completed(Integer bytesSent, Void att) {
                 if (bytesSent != msg.length)
                     throw new RuntimeException("Unexpected number of bytes received");
@@ -261,7 +261,7 @@
         // Test: check that failed method is invoked
         ch.close();
         final CountDownLatch l3 = new CountDownLatch(1);
-        ch.send(ByteBuffer.wrap(msg), sa, null, new CompletionHandler<Integer,Void>() {
+        ch.send(ByteBuffer.wrap(msg), sa, (Void)null, new CompletionHandler<Integer,Void>() {
             public void completed(Integer bytesSent, Void att) {
                 throw new RuntimeException("completed method invoked");
             }
@@ -315,7 +315,7 @@
 
         // Test: write datagram and check completion handler is invoked
         final CountDownLatch l2 = new CountDownLatch(1);
-        ch.write(ByteBuffer.wrap(msg), null, new CompletionHandler<Integer,Void>() {
+        ch.write(ByteBuffer.wrap(msg), (Void)null, new CompletionHandler<Integer,Void>() {
             public void completed(Integer bytesSent, Void att) {
                 if (bytesSent != msg.length)
                     throw new RuntimeException("Unexpected number of bytes received");
@@ -372,7 +372,7 @@
             final CountDownLatch latch = new CountDownLatch(1);
             long timeout = (i == 0) ? 0L : 60L;
             Future<SocketAddress> remote = ch
-                .receive(ByteBuffer.allocate(100), timeout, TimeUnit.SECONDS, null,
+                .receive(ByteBuffer.allocate(100), timeout, TimeUnit.SECONDS, (Void)null,
                     new CompletionHandler<SocketAddress,Void>() {
                         public void completed(SocketAddress source, Void att) {
                         }
@@ -395,7 +395,7 @@
             final CountDownLatch latch = new CountDownLatch(1);
             long timeout = (i == 0) ? 0L : 60L;
             Future<Integer> result = ch
-                .read(ByteBuffer.allocate(100), timeout, TimeUnit.SECONDS, null,
+                .read(ByteBuffer.allocate(100), timeout, TimeUnit.SECONDS, (Void)null,
                     new CompletionHandler<Integer,Void>() {
                         public void completed(Integer bytesRead, Void att) {
                         }
diff --git a/jdk/test/java/nio/channels/AsynchronousFileChannel/Basic.java b/jdk/test/java/nio/channels/AsynchronousFileChannel/Basic.java
index 1f37d4b..9224153 100644
--- a/jdk/test/java/nio/channels/AsynchronousFileChannel/Basic.java
+++ b/jdk/test/java/nio/channels/AsynchronousFileChannel/Basic.java
@@ -190,7 +190,7 @@
             if (fl == null)
                 throw new RuntimeException("Unable to acquire lock");
             try {
-                ch.lock(null, new CompletionHandler<FileLock,Void> () {
+                ch.lock((Void)null, new CompletionHandler<FileLock,Void> () {
                     public void completed(FileLock result, Void att) {
                     }
                     public void failed(Throwable exc, Void att) {
@@ -217,7 +217,7 @@
         ByteBuffer buf = ByteBuffer.allocateDirect(100);
         final CountDownLatch latch = new CountDownLatch(1);
 
-        ch.read(buf, 0L, null, new CompletionHandler<Integer,Void>() {
+        ch.read(buf, 0L, (Void)null, new CompletionHandler<Integer,Void>() {
             public void completed(Integer result, Void att) {
                 try {
                     Thread.currentThread().interrupt();
@@ -311,7 +311,7 @@
                     final AtomicReference<Thread> invoker = new AtomicReference<Thread>();
                     final CountDownLatch latch = new CountDownLatch(1);
 
-                    ch.write(genBuffer(), 0L, null, new CompletionHandler<Integer,Void>() {
+                    ch.write(genBuffer(), 0L, (Void)null, new CompletionHandler<Integer,Void>() {
                         public void completed(Integer result, Void att) {
                             invoker.set(Thread.currentThread());
                             latch.countDown();
@@ -410,7 +410,7 @@
 
             // start write operation
             final CountDownLatch latch = new CountDownLatch(1);
-            Future<Integer> res = ch.write(genBuffer(), 0L, null,
+            Future<Integer> res = ch.write(genBuffer(), 0L, (Void)null,
                 new CompletionHandler<Integer,Void>() {
                     public void completed(Integer result, Void att) {
                     }
diff --git a/jdk/test/java/nio/channels/AsynchronousServerSocketChannel/Basic.java b/jdk/test/java/nio/channels/AsynchronousServerSocketChannel/Basic.java
index e0965fb..e648b78 100644
--- a/jdk/test/java/nio/channels/AsynchronousServerSocketChannel/Basic.java
+++ b/jdk/test/java/nio/channels/AsynchronousServerSocketChannel/Basic.java
@@ -95,7 +95,7 @@
        final AtomicReference<Throwable> exception = new AtomicReference<Throwable>();
 
         // start accepting
-        listener.accept(null, new CompletionHandler<AsynchronousSocketChannel,Void>() {
+        listener.accept((Void)null, new CompletionHandler<AsynchronousSocketChannel,Void>() {
             public void completed(AsynchronousSocketChannel ch, Void att) {
                 try {
                     ch.close();
diff --git a/jdk/test/java/nio/channels/AsynchronousSocketChannel/Basic.java b/jdk/test/java/nio/channels/AsynchronousSocketChannel/Basic.java
index 8b140f1..3c04635 100644
--- a/jdk/test/java/nio/channels/AsynchronousSocketChannel/Basic.java
+++ b/jdk/test/java/nio/channels/AsynchronousSocketChannel/Basic.java
@@ -181,7 +181,7 @@
         }
         final AtomicReference<Throwable> connectException =
             new AtomicReference<Throwable>();
-        ch.connect(server.address(), null, new CompletionHandler<Void,Void>() {
+        ch.connect(server.address(), (Void)null, new CompletionHandler<Void,Void>() {
             public void completed(Void result, Void att) {
             }
             public void failed(Throwable exc, Void att) {
@@ -332,7 +332,7 @@
             // start read operation
             final CountDownLatch latch = new CountDownLatch(1);
             ByteBuffer buf = ByteBuffer.allocate(1);
-            Future<Integer> res = ch.read(buf, null,
+            Future<Integer> res = ch.read(buf, (Void)null,
                 new CompletionHandler<Integer,Void>() {
                     public void completed(Integer result, Void att) {
                     }
@@ -397,11 +397,11 @@
         // reads should complete immediately
         final ByteBuffer dst = ByteBuffer.allocateDirect(src.capacity() + 100);
         final CountDownLatch latch = new CountDownLatch(1);
-        ch.read(dst, null, new CompletionHandler<Integer,Void>() {
+        ch.read(dst, (Void)null, new CompletionHandler<Integer,Void>() {
             public void completed(Integer result, Void att) {
                 int n = result;
                 if (n > 0) {
-                    ch.read(dst, null, this);
+                    ch.read(dst, (Void)null, this);
                 } else {
                     latch.countDown();
                 }
@@ -450,10 +450,10 @@
         // read until the buffer is full
         final ByteBuffer dst = ByteBuffer.allocateDirect(src.capacity());
         final CountDownLatch latch = new CountDownLatch(1);
-        ch.read(dst, null, new CompletionHandler<Integer,Void>() {
+        ch.read(dst, (Void)null, new CompletionHandler<Integer,Void>() {
             public void completed(Integer result, Void att) {
                 if (dst.hasRemaining()) {
-                    ch.read(dst, null, this);
+                    ch.read(dst, (Void)null, this);
                 } else {
                     latch.countDown();
                 }
@@ -508,7 +508,7 @@
 
         // scattering read that completes ascynhronously
         final CountDownLatch latch = new CountDownLatch(1);
-        ch.read(dsts, 0, dsts.length, 0L, TimeUnit.SECONDS, null,
+        ch.read(dsts, 0, dsts.length, 0L, TimeUnit.SECONDS, (Void)null,
             new CompletionHandler<Long,Void>() {
                 public void completed(Long result, Void att) {
                     long n = result;
@@ -536,7 +536,7 @@
             dsts[i].rewind();
         }
         long n = ch
-            .read(dsts, 0, dsts.length, 0L, TimeUnit.SECONDS, null, null).get();
+            .read(dsts, 0, dsts.length, 0L, TimeUnit.SECONDS, (Void)null, null).get();
         if (n <= 0)
             throw new RuntimeException("No bytes read");
 
@@ -562,10 +562,10 @@
 
         // write all bytes and close connection when done
         final ByteBuffer src = genBuffer();
-        ch.write(src, null, new CompletionHandler<Integer,Void>() {
+        ch.write(src, (Void)null, new CompletionHandler<Integer,Void>() {
             public void completed(Integer result, Void att) {
                 if (src.hasRemaining()) {
-                    ch.write(src, null, this);
+                    ch.write(src, (Void)null, this);
                 } else {
                     try {
                         ch.close();
@@ -616,7 +616,7 @@
         // write buffers (should complete immediately)
         ByteBuffer[] srcs = genBuffers(1);
         long n = ch
-            .write(srcs, 0, srcs.length, 0L, TimeUnit.SECONDS, null, null).get();
+            .write(srcs, 0, srcs.length, 0L, TimeUnit.SECONDS, (Void)null, null).get();
         if (n <= 0)
             throw new RuntimeException("No bytes written");
 
@@ -629,7 +629,7 @@
         // write until socket buffer is full so as to create the conditions
         // for when a write does not complete immediately
         srcs = genBuffers(1);
-        ch.write(srcs, 0, srcs.length, 0L, TimeUnit.SECONDS, null,
+        ch.write(srcs, 0, srcs.length, 0L, TimeUnit.SECONDS, (Void)null,
             new CompletionHandler<Long,Void>() {
                 public void completed(Long result, Void att) {
                     long n = result;
@@ -639,7 +639,7 @@
                     if (continueWriting.get()) {
                         ByteBuffer[] srcs = genBuffers(8);
                         ch.write(srcs, 0, srcs.length, 0L, TimeUnit.SECONDS,
-                            null, this);
+                            (Void)null, this);
                     }
                 }
                 public void failed(Throwable exc, Void att) {
@@ -717,7 +717,7 @@
         // this read should timeout
         ByteBuffer dst = ByteBuffer.allocate(512);
         try {
-            ch.read(dst, 3, TimeUnit.SECONDS, null, null).get();
+            ch.read(dst, 3, TimeUnit.SECONDS, (Void)null, null).get();
             throw new RuntimeException("Read did not timeout");
         } catch (ExecutionException x) {
             if (!(x.getCause() instanceof InterruptedByTimeoutException))
diff --git a/jdk/test/java/nio/channels/AsynchronousSocketChannel/StressLoopback.java b/jdk/test/java/nio/channels/AsynchronousSocketChannel/StressLoopback.java
index d3426ba..a3c0db6 100644
--- a/jdk/test/java/nio/channels/AsynchronousSocketChannel/StressLoopback.java
+++ b/jdk/test/java/nio/channels/AsynchronousSocketChannel/StressLoopback.java
@@ -99,7 +99,7 @@
         void start() {
             sentBuffer.position(0);
             sentBuffer.limit(sentBuffer.capacity());
-            channel.write(sentBuffer, null, new CompletionHandler<Integer,Void> () {
+            channel.write(sentBuffer, (Void)null, new CompletionHandler<Integer,Void> () {
                 public void completed(Integer nwrote, Void att) {
                     bytesSent += nwrote;
                     if (finished) {
@@ -107,7 +107,7 @@
                     } else {
                         sentBuffer.position(0);
                         sentBuffer.limit(sentBuffer.capacity());
-                        channel.write(sentBuffer, null, this);
+                        channel.write(sentBuffer, (Void)null, this);
                     }
                 }
                 public void failed(Throwable exc, Void att) {
@@ -142,14 +142,14 @@
         }
 
         void start() {
-            channel.read(readBuffer, null, new CompletionHandler<Integer,Void> () {
+            channel.read(readBuffer, (Void)null, new CompletionHandler<Integer,Void> () {
                 public void completed(Integer nread, Void att) {
                     if (nread < 0) {
                         closeUnchecked(channel);
                     } else {
                         bytesRead += nread;
                         readBuffer.clear();
-                        channel.read(readBuffer, null, this);
+                        channel.read(readBuffer, (Void)null, this);
                     }
                 }
                 public void failed(Throwable exc, Void att) {
diff --git a/jdk/test/java/nio/file/Path/Links.java b/jdk/test/java/nio/file/Path/Links.java
index a6f85be..8ffd89f 100644
--- a/jdk/test/java/nio/file/Path/Links.java
+++ b/jdk/test/java/nio/file/Path/Links.java
@@ -22,7 +22,7 @@
  */
 
 /* @test
- * @bug 4313887 6838333
+ * @bug 4313887 6838333 6863864
  * @summary Unit test for java.nio.file.Path createSymbolicLink,
  *     readSymbolicLink, and createLink methods
  * @library ..
@@ -31,7 +31,6 @@
 import java.nio.file.*;
 import java.nio.file.attribute.*;
 import java.io.*;
-import java.util.*;
 
 public class Links {
 
@@ -47,7 +46,7 @@
      * Exercise createSymbolicLink and readLink methods
      */
     static void testSymLinks(Path dir) throws IOException {
-        Path link = dir.resolve("link");
+        final Path link = dir.resolve("link");
 
         // Check if sym links are supported
         try {
@@ -76,6 +75,63 @@
                 link.delete();
             }
         }
+
+        // Test links to directory
+        Path mydir = dir.resolve("mydir");
+        Path myfile = mydir.resolve("myfile");
+        try {
+            mydir.createDirectory();
+            myfile.createFile();
+
+            // link -> "mydir"
+            link.createSymbolicLink(mydir.getName());
+            assertTrue(link.readSymbolicLink().equals(mydir.getName()));
+
+            // Test access to directory via link
+            DirectoryStream<Path> stream = link.newDirectoryStream();
+            try {
+                boolean found = false;
+                for (Path entry: stream) {
+                    if (entry.getName().equals(myfile.getName())) {
+                        found = true;
+                        break;
+                    }
+                }
+                assertTrue(found);
+            } finally {
+                stream.close();
+            }
+
+            // Test link2 -> link -> mydir
+            final Path link2 = dir.resolve("link2");
+            Path target2 = link.getName();
+            link2.createSymbolicLink(target2);
+            try {
+                assertTrue(link2.readSymbolicLink().equals(target2));
+                link2.newDirectoryStream().close();
+            } finally {
+                link2.delete();
+            }
+
+            // Remove mydir and re-create link2 before re-creating mydir
+            // (This is a useful test on Windows to ensure that creating a
+            // sym link to a directory sym link creates the right type of link).
+            myfile.delete();
+            mydir.delete();
+            link2.createSymbolicLink(target2);
+            try {
+                assertTrue(link2.readSymbolicLink().equals(target2));
+                mydir.createDirectory();
+                link2.newDirectoryStream().close();
+            } finally {
+                link2.delete();
+            }
+
+        } finally {
+            myfile.deleteIfExists();
+            mydir.deleteIfExists();
+            link.deleteIfExists();
+        }
     }
 
     /**
diff --git a/jdk/test/javax/swing/JInternalFrame/Test6505027.java b/jdk/test/javax/swing/JInternalFrame/Test6505027.java
new file mode 100644
index 0000000..2187690
--- /dev/null
+++ b/jdk/test/javax/swing/JInternalFrame/Test6505027.java
@@ -0,0 +1,136 @@
+/*
+ * Copyright 2009 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 6505027
+ * @summary Tests focus problem inside internal frame
+ * @author Sergey Malenkov
+ */
+
+import java.awt.AWTException;
+import java.awt.BorderLayout;
+import java.awt.Component;
+import java.awt.Container;
+import java.awt.KeyboardFocusManager;
+import java.awt.Point;
+import java.awt.Robot;
+import java.awt.event.InputEvent;
+import javax.swing.DefaultCellEditor;
+import javax.swing.JComboBox;
+import javax.swing.JDesktopPane;
+import javax.swing.JFrame;
+import javax.swing.JInternalFrame;
+import javax.swing.JScrollPane;
+import javax.swing.JTable;
+import javax.swing.JTextField;
+import javax.swing.SwingUtilities;
+import javax.swing.WindowConstants;
+import javax.swing.table.DefaultTableModel;
+import javax.swing.table.TableColumn;
+
+public class Test6505027 implements Runnable {
+
+    private static final boolean INTERNAL = true;
+    private static final boolean TERMINATE = true;
+
+    private static final int WIDTH = 450;
+    private static final int HEIGHT = 200;
+    private static final int OFFSET = 10;
+    private static final long PAUSE = 2048L;
+
+    private static final String[] COLUMNS = { "Size", "Shape" }; // NON-NLS
+    private static final String[] ITEMS = { "a", "b", "c", "d" }; // NON-NLS
+    private static final String KEY = "terminateEditOnFocusLost"; // NON-NLS
+
+    public static void main(String[] args) {
+        SwingUtilities.invokeLater(new Test6505027());
+
+        Component component = null;
+        while (component == null) {
+            try {
+                Thread.sleep(PAUSE);
+            }
+            catch (InterruptedException exception) {
+                // ignore interrupted exception
+            }
+            component = KeyboardFocusManager.getCurrentKeyboardFocusManager().getFocusOwner();
+        }
+        if (!component.getClass().equals(JComboBox.class)) {
+            throw new Error("unexpected focus owner: " + component);
+        }
+        SwingUtilities.getWindowAncestor(component).dispose();
+    }
+
+    private JTable table;
+    private Point point;
+
+    public void run() {
+        if (this.table == null) {
+            JFrame main = new JFrame();
+            main.setSize(WIDTH + OFFSET * 3, HEIGHT + OFFSET * 5);
+            main.setLocationRelativeTo(null);
+            main.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
+            main.setVisible(true);
+
+            Container container = main;
+            if (INTERNAL) {
+                JInternalFrame frame = new JInternalFrame();
+                frame.setBounds(OFFSET, OFFSET, WIDTH, HEIGHT);
+                frame.setVisible(true);
+
+                JDesktopPane desktop = new JDesktopPane();
+                desktop.add(frame, new Integer(1));
+
+                container.add(desktop);
+                container = frame;
+            }
+            this.table = new JTable(new DefaultTableModel(COLUMNS, 2));
+            if (TERMINATE) {
+                this.table.putClientProperty(KEY, Boolean.TRUE);
+            }
+            TableColumn column = this.table.getColumn(COLUMNS[1]);
+            column.setCellEditor(new DefaultCellEditor(new JComboBox(ITEMS)));
+
+            container.add(BorderLayout.NORTH, new JTextField());
+            container.add(BorderLayout.CENTER, new JScrollPane(this.table));
+
+            SwingUtilities.invokeLater(this);
+        }
+        else if (this.point == null) {
+            this.point = this.table.getCellRect(1, 1, false).getLocation();
+            SwingUtilities.convertPointToScreen(this.point, this.table);
+            SwingUtilities.invokeLater(this);
+        }
+        else {
+            try {
+                Robot robot = new Robot();
+                robot.mouseMove(this.point.x + 1, this.point.y + 1);
+                robot.mousePress(InputEvent.BUTTON1_MASK);
+            }
+            catch (AWTException exception) {
+                throw new Error("unexpected exception", exception);
+            }
+        }
+    }
+}
diff --git a/jdk/test/javax/swing/JInternalFrame/Test6802868.java b/jdk/test/javax/swing/JInternalFrame/Test6802868.java
new file mode 100644
index 0000000..74410df
--- /dev/null
+++ b/jdk/test/javax/swing/JInternalFrame/Test6802868.java
@@ -0,0 +1,108 @@
+/*
+ * Copyright 2009 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 6802868
+ * @summary JInternalFrame is not maximized when maximized parent frame
+ * @author Alexander Potochkin
+ */
+
+import sun.awt.SunToolkit;
+
+import java.awt.Dimension;
+import java.awt.Point;
+import java.awt.Robot;
+import java.awt.Toolkit;
+import java.beans.PropertyVetoException;
+import javax.swing.JDesktopPane;
+import javax.swing.JFrame;
+import javax.swing.JInternalFrame;
+import javax.swing.SwingUtilities;
+
+public class Test6802868 {
+    static JInternalFrame jif;
+    static JFrame frame;
+    static Dimension size;
+    static Point location;
+
+    public static void main(String[] args) throws Exception {
+        Robot robot = new Robot();
+        robot.setAutoDelay(20);
+        SunToolkit toolkit = (SunToolkit) Toolkit.getDefaultToolkit();
+
+        SwingUtilities.invokeAndWait(new Runnable() {
+            public void run() {
+                frame = new JFrame();
+                frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
+
+                JDesktopPane jdp = new JDesktopPane();
+                frame.getContentPane().add(jdp);
+
+                jif = new JInternalFrame("Title", true, true, true, true);
+                jdp.add(jif);
+                jif.setVisible(true);
+
+                frame.setSize(200, 200);
+                frame.setLocationRelativeTo(null);
+                frame.setVisible(true);
+
+                try {
+                    jif.setMaximum(true);
+                } catch (Exception e) {
+                    e.printStackTrace();
+                }
+            }
+        });
+        toolkit.realSync();
+        SwingUtilities.invokeAndWait(new Runnable() {
+            public void run() {
+                size = jif.getSize();
+                frame.setSize(300, 300);
+            }
+        });
+        toolkit.realSync();
+        SwingUtilities.invokeAndWait(new Runnable() {
+            public void run() {
+                if (jif.getSize().equals(size)) {
+                    throw new RuntimeException("InternalFrame hasn't changed its size");
+                }
+                try {
+                    jif.setIcon(true);
+                } catch (PropertyVetoException e) {
+                    e.printStackTrace();
+                }
+                location = jif.getDesktopIcon().getLocation();
+                frame.setSize(400, 400);
+            }
+        });
+        toolkit.realSync();
+        SwingUtilities.invokeAndWait(new Runnable() {
+            public void run() {
+                if (jif.getDesktopIcon().getLocation().equals(location)) {
+                    throw new RuntimeException("JDesktopIcon hasn't moved");
+                }
+            }
+        });
+    }
+}
diff --git a/jdk/test/javax/swing/JScrollPane/Test6526631.java b/jdk/test/javax/swing/JScrollPane/Test6526631.java
new file mode 100644
index 0000000..ec32462
--- /dev/null
+++ b/jdk/test/javax/swing/JScrollPane/Test6526631.java
@@ -0,0 +1,102 @@
+/*
+ * Copyright 2009 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 6526631
+ * @summary Resizes right-oriented scroll pane
+ * @author Sergey Malenkov
+ * @library ..
+ * @build SwingTest
+ * @run main Test6526631
+ */
+
+import java.awt.Dimension;
+import javax.swing.JFrame;
+import javax.swing.JScrollBar;
+import javax.swing.JScrollPane;
+import javax.swing.JTextArea;
+import javax.swing.JViewport;
+
+import static java.awt.ComponentOrientation.RIGHT_TO_LEFT;
+
+public class Test6526631 {
+
+    private static final int COLS = 90;
+    private static final int ROWS = 50;
+    private static final int OFFSET = 10;
+
+    public static void main(String[] args) {
+        SwingTest.start(Test6526631.class);
+    }
+
+    private final JScrollPane pane;
+    private final JFrame frame;
+
+    public Test6526631(JFrame frame) {
+        this.pane = new JScrollPane(new JTextArea(ROWS, COLS));
+        this.pane.setComponentOrientation(RIGHT_TO_LEFT);
+        this.frame = frame;
+        this.frame.add(this.pane);
+    }
+
+    private void update(int offset) {
+        Dimension size = this.frame.getSize();
+        size.width += offset;
+        this.frame.setSize(size);
+    }
+
+    public void validateFirst() {
+        validateThird();
+        update(OFFSET);
+    }
+
+    public void validateSecond() {
+        validateThird();
+        update(-OFFSET);
+    }
+
+    public void validateThird() {
+        JViewport viewport = this.pane.getViewport();
+        JScrollBar scroller = this.pane.getHorizontalScrollBar();
+        if (!scroller.getComponentOrientation().equals(RIGHT_TO_LEFT)) {
+            throw new IllegalStateException("unexpected component orientation");
+        }
+        int value = scroller.getValue();
+        if (value != 0) {
+            throw new IllegalStateException("unexpected scroll value");
+        }
+        int extent = viewport.getExtentSize().width;
+        if (extent != scroller.getVisibleAmount()) {
+            throw new IllegalStateException("unexpected visible amount");
+        }
+        int size = viewport.getViewSize().width;
+        if (size != scroller.getMaximum()) {
+            throw new IllegalStateException("unexpected maximum");
+        }
+        int pos = size - extent - value;
+        if (pos != viewport.getViewPosition().x) {
+            throw new IllegalStateException("unexpected position");
+        }
+    }
+}
diff --git a/jdk/test/javax/swing/SwingTest.java b/jdk/test/javax/swing/SwingTest.java
new file mode 100644
index 0000000..7f48612
--- /dev/null
+++ b/jdk/test/javax/swing/SwingTest.java
@@ -0,0 +1,160 @@
+/*
+ * Copyright 2009 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 java.io.PrintWriter;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import java.lang.reflect.Modifier;
+import java.util.Comparator;
+import java.util.Iterator;
+import java.util.Set;
+import java.util.TreeSet;
+import javax.swing.JFrame;
+
+import static javax.swing.SwingUtilities.invokeLater;
+
+/**
+ * SwingTestHelper is a utility class for writing regression tests
+ * that require interacting with the UI.
+ *
+ * @author Sergey A. Malenkov
+ */
+final class SwingTest implements Runnable {
+
+    private static final int WIDTH = 640;
+    private static final int HEIGHT = 480;
+
+    public static void start(Class<?> type) {
+        new SwingTest(type).start();
+    }
+
+    private final PrintWriter writer = new PrintWriter(System.out, true);
+
+    private Class<?> type;
+    private JFrame frame;
+    private Iterator<Method> methods;
+    private Object object;
+    private Method method;
+    private Throwable error;
+
+    private SwingTest(Class<?> type) {
+        this.type = type;
+    }
+
+    public void run() {
+        synchronized (this.writer) {
+            if (this.error != null) {
+                this.frame.dispose();
+                this.frame = null;
+            }
+            else if (this.object == null) {
+                invoke();
+                Set<Method> methods = new TreeSet<Method>(new Comparator<Method>() {
+                    public int compare(Method first, Method second) {
+                        return first.getName().compareTo(second.getName());
+                    }
+                });
+                for (Method method : this.type.getMethods()) {
+                    if (method.getDeclaringClass().equals(this.type)) {
+                        if (method.getReturnType().equals(void.class)) {
+                            if (0 == method.getParameterTypes().length) {
+                                methods.add(method);
+                            }
+                        }
+                    }
+                }
+                this.methods = methods.iterator();
+            }
+            else if (this.method != null) {
+                invoke();
+            }
+            else if (this.methods.hasNext()) {
+                this.method = this.methods.next();
+            }
+            else {
+                this.frame.dispose();
+                this.frame = null;
+                this.type = null;
+            }
+            this.writer.notifyAll();
+        }
+    }
+
+    private void start() {
+        synchronized (this.writer) {
+            while (this.type != null) {
+                if ((this.method != null) && Modifier.isStatic(this.method.getModifiers())) {
+                    invoke();
+                }
+                else {
+                    invokeLater(this);
+                    try {
+                        this.writer.wait();
+                    }
+                    catch (InterruptedException exception) {
+                        exception.printStackTrace(this.writer);
+                    }
+                }
+                if ((this.frame == null) && (this.error != null)) {
+                    throw new Error("unexpected error", this.error);
+                }
+            }
+        }
+    }
+
+    private void invoke() {
+        try {
+            if (this.method != null) {
+                this.writer.println(this.method);
+                this.method.invoke(this.object);
+                this.method = null;
+            }
+            else {
+                this.writer.println(this.type);
+                this.frame = new JFrame(this.type.getSimpleName());
+                this.frame.setSize(WIDTH, HEIGHT);
+                this.frame.setLocationRelativeTo(null);
+                this.object = this.type.getConstructor(JFrame.class).newInstance(this.frame);
+                this.frame.setVisible(true);
+            }
+        }
+        catch (NoSuchMethodException exception) {
+            this.error = exception;
+        }
+        catch (SecurityException exception) {
+            this.error = exception;
+        }
+        catch (IllegalAccessException exception) {
+            this.error = exception;
+        }
+        catch (IllegalArgumentException exception) {
+            this.error = exception;
+        }
+        catch (InstantiationException exception) {
+            this.error = exception;
+        }
+        catch (InvocationTargetException exception) {
+            this.error = exception.getTargetException();
+        }
+    }
+}
diff --git a/jdk/test/sun/security/krb5/ConfPlusProp.java b/jdk/test/sun/security/krb5/ConfPlusProp.java
index b1ea2ca..e2c49a2 100644
--- a/jdk/test/sun/security/krb5/ConfPlusProp.java
+++ b/jdk/test/sun/security/krb5/ConfPlusProp.java
@@ -23,31 +23,56 @@
 /*
  * @test
  * @bug 6857795
+ * @buf 6858589
  * @summary krb5.conf ignored if system properties on realm and kdc are provided
  */
 
 import sun.security.krb5.Config;
-import sun.security.krb5.KrbException;
 
 public class ConfPlusProp {
+    Config config;
     public static void main(String[] args) throws Exception {
-        System.setProperty("java.security.krb5.realm", "R2");
-        System.setProperty("java.security.krb5.kdc", "k2");
+        new ConfPlusProp().run();
+    }
+
+    void refresh() throws Exception {
+        Config.refresh();
+        config = Config.getInstance();
+    }
+
+    void checkDefaultRealm(String r) throws Exception {
+        try {
+            if (!config.getDefaultRealm().equals(r)) {
+                throw new AssertionError("Default realm error");
+            }
+        } catch (Exception e) {
+            if (r != null) throw e;
+        }
+    }
+
+    void check(String r, String k) throws Exception {
+        try {
+            if (!config.getKDCList(r).equals(k)) {
+                throw new AssertionError(r + " kdc not " + k);
+            }
+        } catch (Exception e) {
+            if (k != null) throw e;
+        }
+    }
+
+    void run() throws Exception {
+
+        // No prop, only conf
 
         // Point to a file with existing default_realm
         System.setProperty("java.security.krb5.conf",
                 System.getProperty("test.src", ".") +"/confplusprop.conf");
-        Config config = Config.getInstance();
+        refresh();
 
-        if (!config.getDefaultRealm().equals("R2")) {
-            throw new Exception("Default realm error");
-        }
-        if (!config.getKDCList("R1").equals("k1")) {
-            throw new Exception("R1 kdc error");
-        }
-        if (!config.getKDCList("R2").equals("k2")) {
-            throw new Exception("R2 kdc error");
-        }
+        checkDefaultRealm("R1");
+        check("R1", "k1");
+        check("R2", "old");
+        check("R3", null);
         if (!config.getDefault("forwardable", "libdefaults").equals("well")) {
             throw new Exception("Extra config error");
         }
@@ -55,38 +80,66 @@
         // Point to a file with no libdefaults
         System.setProperty("java.security.krb5.conf",
                 System.getProperty("test.src", ".") +"/confplusprop2.conf");
-        Config.refresh();
+        refresh();
 
-        config = Config.getInstance();
+        checkDefaultRealm(null);
+        check("R1", "k12");
+        check("R2", "old");
+        check("R3", null);
 
-        if (!config.getDefaultRealm().equals("R2")) {
-            throw new Exception("Default realm error again");
+        int version = System.getProperty("java.version").charAt(2) - '0';
+        System.out.println("JDK version is " + version);
+
+        // Zero-config is supported since 1.7
+        if (version >= 7) {
+            // Point to a non-existing file
+            System.setProperty("java.security.krb5.conf", "i-am-not-a file");
+            refresh();
+
+            checkDefaultRealm(null);
+            check("R1", null);
+            check("R2", null);
+            check("R3", null);
+            if (config.getDefault("forwardable", "libdefaults") != null) {
+                throw new Exception("Extra config error");
+            }
         }
-        if (!config.getKDCList("R1").equals("k12")) {
-            throw new Exception("R1 kdc error");
+
+        // Add prop
+        System.setProperty("java.security.krb5.realm", "R2");
+        System.setProperty("java.security.krb5.kdc", "k2");
+
+        // Point to a file with existing default_realm
+        System.setProperty("java.security.krb5.conf",
+                System.getProperty("test.src", ".") +"/confplusprop.conf");
+        refresh();
+
+        checkDefaultRealm("R2");
+        check("R1", "k1");
+        check("R2", "k2");
+        check("R3", "k2");
+        if (!config.getDefault("forwardable", "libdefaults").equals("well")) {
+            throw new Exception("Extra config error");
         }
-        if (!config.getKDCList("R2").equals("k2")) {
-            throw new Exception("R2 kdc error");
-        }
+
+        // Point to a file with no libdefaults
+        System.setProperty("java.security.krb5.conf",
+                System.getProperty("test.src", ".") +"/confplusprop2.conf");
+        refresh();
+
+        checkDefaultRealm("R2");
+        check("R1", "k12");
+        check("R2", "k2");
+        check("R3", "k2");
 
         // Point to a non-existing file
         System.setProperty("java.security.krb5.conf", "i-am-not-a file");
-        Config.refresh();
+        refresh();
 
-        config = Config.getInstance();
-
-        if (!config.getDefaultRealm().equals("R2")) {
-            throw new Exception("Default realm error");
-        }
-        try {
-            config.getKDCList("R1");
-            throw new Exception("R1 is nowhere");
-        } catch (KrbException ke) {
-            // OK
-        }
-        if (!config.getKDCList("R2").equals("k2")) {
-            throw new Exception("R2 kdc error");
-        }
+        checkDefaultRealm("R2");
+        check("R1", "k2");
+        check("R2", "k2");
+        check("R3", "k2");
         if (config.getDefault("forwardable", "libdefaults") != null) {
             throw new Exception("Extra config error");
         }
diff --git a/jdk/test/sun/security/tools/jarsigner/newsize7.sh b/jdk/test/sun/security/tools/jarsigner/newsize7.sh
new file mode 100644
index 0000000..0d71979
--- /dev/null
+++ b/jdk/test/sun/security/tools/jarsigner/newsize7.sh
@@ -0,0 +1,73 @@
+#
+# Copyright 2009 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 6561126
+# @summary keytool should use larger default keysize for keypairs
+#
+# @run shell newsize7.sh
+
+# set a few environment variables so that the shell-script can run stand-alone
+# in the source directory
+if [ "${TESTSRC}" = "" ] ; then
+   TESTSRC="."
+fi
+
+if [ "${TESTJAVA}" = "" ] ; then
+  JAVA_CMD=`which java`
+  TESTJAVA=`dirname $JAVA_CMD`/..
+fi
+
+# set platform-dependent variables
+OS=`uname -s`
+case "$OS" in
+  Windows_* )
+    FS="\\"
+    ;;
+  * )
+    FS="/"
+    ;;
+esac
+
+KSFILE=ns7.jks
+
+KT="${TESTJAVA}${FS}bin${FS}keytool -keystore ns7.jks -storepass changeit -keypass changeit"
+JAR="${TESTJAVA}${FS}bin${FS}jar"
+JS="${TESTJAVA}${FS}bin${FS}jarsigner -keystore ns7.jks -storepass changeit"
+
+rm ns7.*
+
+$KT -genkeypair -alias me -dname CN=Me
+
+touch ns7.txt
+$JAR cvf ns7.jar ns7.txt
+
+$JS ns7.jar me
+$JAR xvf ns7.jar
+
+grep SHA-256 META-INF/MANIFEST.MF || exit 1
+grep SHA-256 META-INF/ME.SF || exit 2
+
+#rm -rf META-INF
+
+exit 0
diff --git a/jdk/test/sun/security/tools/keytool/NewSize7.java b/jdk/test/sun/security/tools/keytool/NewSize7.java
new file mode 100644
index 0000000..6235aae
--- /dev/null
+++ b/jdk/test/sun/security/tools/keytool/NewSize7.java
@@ -0,0 +1,56 @@
+/*
+ * Copyright 2009 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 6561126
+ * @summary keytool should use larger default keysize for keypairs
+ */
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.security.KeyStore;
+import java.security.cert.X509Certificate;
+import java.security.interfaces.RSAPublicKey;
+import sun.security.tools.KeyTool;
+
+public class NewSize7 {
+    public static void main(String[] args) throws Exception {
+        String FILE = "newsize7-ks";
+        new File(FILE).delete();
+        KeyTool.main(("-debug -genkeypair -keystore " + FILE +
+                " -alias a -dname cn=c -storepass changeit" +
+                " -keypass changeit -keyalg rsa").split(" "));
+        KeyStore ks = KeyStore.getInstance("JKS");
+        ks.load(new FileInputStream(FILE), null);
+        new File(FILE).delete();
+        RSAPublicKey r = (RSAPublicKey)ks.getCertificate("a").getPublicKey();
+        if (r.getModulus().bitLength() != 2048) {
+            throw new Exception("Bad keysize");
+        }
+        X509Certificate x = (X509Certificate)ks.getCertificate("a");
+        if (!x.getSigAlgName().equals("SHA256withRSA")) {
+            throw new Exception("Bad sigalg");
+        }
+    }
+}
diff --git a/jdk/test/sun/security/tools/keytool/emptysubject.sh b/jdk/test/sun/security/tools/keytool/emptysubject.sh
new file mode 100644
index 0000000..ffe681c
--- /dev/null
+++ b/jdk/test/sun/security/tools/keytool/emptysubject.sh
@@ -0,0 +1,68 @@
+#
+# Copyright 2009 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 6847026
+# @summary keytool should be able to generate certreq and cert without subject name
+#
+# @run shell emptysubject.sh
+#
+
+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
+
+KS=emptysubject.jks
+KT="$TESTJAVA${FS}bin${FS}keytool -storepass changeit -keypass changeit -keystore $KS"
+
+rm $KS
+
+$KT -alias ca -dname CN=CA -genkeypair
+$KT -alias me -dname CN=Me -genkeypair
+
+# When -dname is recognized, SAN must be specfied, otherwise, -printcert fails.
+$KT -alias me -certreq -dname "" | \
+        $KT -alias ca -gencert | $KT -printcert && exit 1
+$KT -alias me -certreq | \
+        $KT -alias ca -gencert -dname "" | $KT -printcert && exit 2
+$KT -alias me -certreq -dname "" | \
+        $KT -alias ca -gencert -ext san:c=email:me@me.com | \
+        $KT -printcert || exit 3
+$KT -alias me -certreq | \
+        $KT -alias ca -gencert -dname "" -ext san:c=email:me@me.com | \
+        $KT -printcert || exit 4
+
+exit 0
+
diff --git a/langtools/.hgtags b/langtools/.hgtags
index 23d21f8..2d35b7f 100644
--- a/langtools/.hgtags
+++ b/langtools/.hgtags
@@ -41,3 +41,4 @@
 d8f23a81d46f47a4186f1044dd9e44841bbeab84 jdk7-b64
 7e0056ded28c802609d2bd79bfcda551d72a3fec jdk7-b65
 634f519d6f9a602b16bba1c7cd4a17242a8f6889 jdk7-b66
+14b1a8ede95493fc53c37ff2626f1f98ce94d108 jdk7-b67
diff --git a/langtools/make/build.properties b/langtools/make/build.properties
index 52df7e9..0782dda 100644
--- a/langtools/make/build.properties
+++ b/langtools/make/build.properties
@@ -60,15 +60,15 @@
 bootstrap.full.version = ${bootstrap.release}-${build.number}
 
 # options for the <javac> tasks used to compile the tools
-javac.source = 5
-javac.target = 5
+javac.source = 7
+javac.target = 7
 javac.debug = true
 javac.debuglevel = source,lines
 javac.no.jdk.warnings = -XDignore.symbol.file=true
 # set the following to -version to verify the versions of javac being used
 javac.version.opt = 
 # in time, there should be no exceptions to -Xlint:all
-javac.lint.opts = -Xlint:all -Werror
+javac.lint.opts = -Xlint:all,-deprecation -Werror
 
 # options for the <javadoc> task for javac
 javadoc.jls3.url=http://java.sun.com/docs/books/jls/
diff --git a/langtools/src/share/classes/com/sun/mirror/apt/AnnotationProcessor.java b/langtools/src/share/classes/com/sun/mirror/apt/AnnotationProcessor.java
index 591793d..5175fd2 100644
--- a/langtools/src/share/classes/com/sun/mirror/apt/AnnotationProcessor.java
+++ b/langtools/src/share/classes/com/sun/mirror/apt/AnnotationProcessor.java
@@ -50,11 +50,17 @@
  * annotations of those types.  It may freely examine any other program
  * elements in the course of its processing.
  *
+ * @deprecated All components of this API have been superseded by the
+ * standardized annotation processing API.  The replacement for the
+ * functionality of this interface is {@link
+ * javax.annotation.processing.Processor}.
+ *
  * @author Joseph D. Darcy
  * @author Scott Seligman
  * @since 1.5
  */
-
+@Deprecated
+@SuppressWarnings("deprecation")
 public interface AnnotationProcessor {
 
     /**
diff --git a/langtools/src/share/classes/com/sun/mirror/apt/AnnotationProcessorEnvironment.java b/langtools/src/share/classes/com/sun/mirror/apt/AnnotationProcessorEnvironment.java
index bdd8277..0cd7db8 100644
--- a/langtools/src/share/classes/com/sun/mirror/apt/AnnotationProcessorEnvironment.java
+++ b/langtools/src/share/classes/com/sun/mirror/apt/AnnotationProcessorEnvironment.java
@@ -48,11 +48,17 @@
  * provides a simple way to select just the items of interest
  * when a method returns a collection of declarations.
  *
+ * @deprecated All components of this API have been superseded by the
+ * standardized annotation processing API.  The replacement for the
+ * functionality of this interface is {@link
+ * javax.annotation.processing.ProcessingEnvironment}.
+ *
  * @author Joseph D. Darcy
  * @author Scott Seligman
  * @since 1.5
  */
-
+@Deprecated
+@SuppressWarnings("deprecation")
 public interface AnnotationProcessorEnvironment {
 
     /**
@@ -87,7 +93,6 @@
     Filer getFiler();
 
 
-
     /**
      * Returns the declarations of the types specified when the
      * annotation processing tool was invoked.
diff --git a/langtools/src/share/classes/com/sun/mirror/apt/AnnotationProcessorFactory.java b/langtools/src/share/classes/com/sun/mirror/apt/AnnotationProcessorFactory.java
index a2169b1..b2b7006 100644
--- a/langtools/src/share/classes/com/sun/mirror/apt/AnnotationProcessorFactory.java
+++ b/langtools/src/share/classes/com/sun/mirror/apt/AnnotationProcessorFactory.java
@@ -42,11 +42,17 @@
  * must provide a public no-argument constructor to be used by tools to
  * instantiate the factory.
  *
+ * @deprecated All components of this API have been superseded by the
+ * standardized annotation processing API.  The replacement for the
+ * functionality of this interface is {@link
+ * javax.annotation.processing.Processor}.
+ *
  * @author Joseph D. Darcy
  * @author Scott Seligman
  * @since 1.5
  */
-
+@Deprecated
+@SuppressWarnings("deprecation")
 public interface AnnotationProcessorFactory {
 
     /**
diff --git a/langtools/src/share/classes/com/sun/mirror/apt/AnnotationProcessorListener.java b/langtools/src/share/classes/com/sun/mirror/apt/AnnotationProcessorListener.java
index 89b1e82..3c040e6 100644
--- a/langtools/src/share/classes/com/sun/mirror/apt/AnnotationProcessorListener.java
+++ b/langtools/src/share/classes/com/sun/mirror/apt/AnnotationProcessorListener.java
@@ -28,8 +28,15 @@
 /**
  * Superinterface for all annotation processor event listeners.
  *
+ * @deprecated All components of this API have been superseded by the
+ * standardized annotation processing API.  This interface has no
+ * direct analog in the standardized API because the different round
+ * model renders it unnecessary.
+ *
  * @author Joseph D. Darcy
  * @author Scott Seligman
  * @since 1.5
  */
+@Deprecated
+@SuppressWarnings("deprecation")
 public interface AnnotationProcessorListener extends java.util.EventListener {}
diff --git a/langtools/src/share/classes/com/sun/mirror/apt/AnnotationProcessors.java b/langtools/src/share/classes/com/sun/mirror/apt/AnnotationProcessors.java
index c3e8f94..19885c3 100644
--- a/langtools/src/share/classes/com/sun/mirror/apt/AnnotationProcessors.java
+++ b/langtools/src/share/classes/com/sun/mirror/apt/AnnotationProcessors.java
@@ -31,10 +31,16 @@
 /**
  * Utilities to create specialized annotation processors.
  *
+ * @deprecated All components of this API have been superseded by the
+ * standardized annotation processing API.  There is no direct analog
+ * of the functionality of this class in the standardized API.
+ *
  * @since 1.5
  * @author Joseph D. Darcy
  * @author Scott Seligman
  */
+@Deprecated
+@SuppressWarnings("deprecation")
 public class AnnotationProcessors {
     static class NoOpAP implements AnnotationProcessor {
         NoOpAP() {}
diff --git a/langtools/src/share/classes/com/sun/mirror/apt/Filer.java b/langtools/src/share/classes/com/sun/mirror/apt/Filer.java
index 4053a0e..e85bcda 100644
--- a/langtools/src/share/classes/com/sun/mirror/apt/Filer.java
+++ b/langtools/src/share/classes/com/sun/mirror/apt/Filer.java
@@ -51,11 +51,17 @@
  * be deleted.  Any subsequent attempt to create the same file during
  * a run will fail.
  *
+ * @deprecated All components of this API have been superseded by the
+ * standardized annotation processing API.  The replacement for the
+ * functionality of this interface is {@link
+ * javax.annotation.processing.Filer}.
+ *
  * @author Joseph D. Darcy
  * @author Scott Seligman
  * @since 1.5
  */
-
+@Deprecated
+@SuppressWarnings("deprecation")
 public interface Filer {
 
     /**
@@ -140,7 +146,13 @@
 
     /**
      * Locations (subtrees within the file system) where new files are created.
+     *
+     * @deprecated All components of this API have been superseded by
+     * the standardized annotation processing API.  The replacement
+     * for the functionality of this enum is {@link
+     * javax.tools.StandardLocation}.
      */
+    @Deprecated
     enum Location {
         /** The location of new source files. */
         SOURCE_TREE,
diff --git a/langtools/src/share/classes/com/sun/mirror/apt/Messager.java b/langtools/src/share/classes/com/sun/mirror/apt/Messager.java
index 37ab26a..e25e352 100644
--- a/langtools/src/share/classes/com/sun/mirror/apt/Messager.java
+++ b/langtools/src/share/classes/com/sun/mirror/apt/Messager.java
@@ -25,20 +25,24 @@
 
 package com.sun.mirror.apt;
 
-
 import com.sun.mirror.util.SourcePosition;
 
-
 /**
  * A <tt>Messager</tt> provides the way for
  * an annotation processor to report error messages, warnings, and
  * other notices.
  *
+ * @deprecated All components of this API have been superseded by the
+ * standardized annotation processing API.  The replacement for the
+ * functionality of this interface is {@link
+ * javax.annotation.processing.Messager}.
+ *
  * @author Joseph D. Darcy
  * @author Scott Seligman
  * @since 1.5
  */
-
+@Deprecated
+@SuppressWarnings("deprecation")
 public interface Messager {
 
     /**
diff --git a/langtools/src/share/classes/com/sun/mirror/apt/RoundCompleteEvent.java b/langtools/src/share/classes/com/sun/mirror/apt/RoundCompleteEvent.java
index a163b9d..aa94151 100644
--- a/langtools/src/share/classes/com/sun/mirror/apt/RoundCompleteEvent.java
+++ b/langtools/src/share/classes/com/sun/mirror/apt/RoundCompleteEvent.java
@@ -32,10 +32,17 @@
  * cannot meaningfully be serialized because all of the annotation
  * processing tool's internal state would potentially be needed.
  *
+ * @deprecated All components of this API have been superseded by the
+ * standardized annotation processing API.  This class has no direct
+ * analog in the standardized API because the different round model
+ * renders it unnecessary.
+ *
  * @author Joseph D. Darcy
  * @author Scott Seligman
  * @since 1.5
  */
+@Deprecated
+@SuppressWarnings("deprecation")
 public abstract class RoundCompleteEvent extends java.util.EventObject {
     private RoundState rs;
 
diff --git a/langtools/src/share/classes/com/sun/mirror/apt/RoundCompleteListener.java b/langtools/src/share/classes/com/sun/mirror/apt/RoundCompleteListener.java
index ae460d8..caefe36 100644
--- a/langtools/src/share/classes/com/sun/mirror/apt/RoundCompleteListener.java
+++ b/langtools/src/share/classes/com/sun/mirror/apt/RoundCompleteListener.java
@@ -28,10 +28,17 @@
 /**
  * Listener for the completion of a round of annotation processing.
  *
+ * @deprecated All components of this API have been superseded by the
+ * standardized annotation processing API.  This interface has no
+ * direct analog in the standardized API because the different round
+ * model renders it unnecessary.
+ *
  * @author Joseph D. Darcy
  * @author Scott Seligman
  * @since 1.5
  */
+@Deprecated
+@SuppressWarnings("deprecation")
 public interface RoundCompleteListener extends AnnotationProcessorListener {
     /**
      * Invoked after all processors for a round have run to completion.
diff --git a/langtools/src/share/classes/com/sun/mirror/apt/RoundState.java b/langtools/src/share/classes/com/sun/mirror/apt/RoundState.java
index 956899d..b39bae2 100644
--- a/langtools/src/share/classes/com/sun/mirror/apt/RoundState.java
+++ b/langtools/src/share/classes/com/sun/mirror/apt/RoundState.java
@@ -28,10 +28,17 @@
 /**
  * Represents the status of a completed round of annotation processing.
  *
+ * @deprecated All components of this API have been superseded by the
+ * standardized annotation processing API.  The replacement for the
+ * functionality of this interface is {@link
+ * javax.annotation.processing.RoundEnvironment}.
+ *
  * @author Joseph D. Darcy
  * @author Scott Seligman
  * @since 1.5
  */
+@Deprecated
+@SuppressWarnings("deprecation")
 public interface RoundState {
     /**
      * Returns <tt>true</tt> if this was the last round of annotation
diff --git a/langtools/src/share/classes/com/sun/mirror/apt/package-info.java b/langtools/src/share/classes/com/sun/mirror/apt/package-info.java
new file mode 100644
index 0000000..b98d789
--- /dev/null
+++ b/langtools/src/share/classes/com/sun/mirror/apt/package-info.java
@@ -0,0 +1,38 @@
+/*
+ * Copyright 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.
+ */
+
+/**
+ * Classes used to communicate information between {@linkplain
+ * com.sun.mirror.apt.AnnotationProcessor annotation processors} and
+ * an annotation processing tool.
+ *
+ * <p>The {@code apt} tool and its associated API have been superseded
+ * by the standardized annotation processing API.  The replacement for
+ * the functionality in this package is {@link
+ * javax.annotation.processing}.
+ *
+ * @since 1.5
+ */
+package com.sun.mirror.apt;
diff --git a/langtools/src/share/classes/com/sun/mirror/apt/package.html b/langtools/src/share/classes/com/sun/mirror/apt/package.html
deleted file mode 100644
index 8330dec..0000000
--- a/langtools/src/share/classes/com/sun/mirror/apt/package.html
+++ /dev/null
@@ -1,42 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
-<html>
-<head>
-<!--
-
-Copyright 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.
--->
-
-</head>
-<body bgcolor="white">
-
-Classes used to communicate information between
-{@linkplain com.sun.mirror.apt.AnnotationProcessor annotation processors}
-and an annotation processing tool.
-
-<p>Note that the <code>apt</code> tool and its associated APIs may be
-changed or superseded in future j2se releases.
-
-@since 1.5
-</body>
-</html>
diff --git a/langtools/src/share/classes/com/sun/mirror/declaration/AnnotationMirror.java b/langtools/src/share/classes/com/sun/mirror/declaration/AnnotationMirror.java
index 03b65de..f05e7c6 100644
--- a/langtools/src/share/classes/com/sun/mirror/declaration/AnnotationMirror.java
+++ b/langtools/src/share/classes/com/sun/mirror/declaration/AnnotationMirror.java
@@ -38,11 +38,17 @@
  * ("<tt>==</tt>").  There is no guarantee that any particular
  * annotation will always be represented by the same object.
  *
+ * @deprecated All components of this API have been superseded by the
+ * standardized annotation processing API.  The replacement for the
+ * functionality of this interface is {@link
+ * javax.lang.model.element.AnnotationMirror}.
+ *
  * @author Joseph D. Darcy
  * @author Scott Seligman
  * @since 1.5
  */
-
+@Deprecated
+@SuppressWarnings("deprecation")
 public interface AnnotationMirror {
 
     /**
diff --git a/langtools/src/share/classes/com/sun/mirror/declaration/AnnotationTypeDeclaration.java b/langtools/src/share/classes/com/sun/mirror/declaration/AnnotationTypeDeclaration.java
index ed7c14e..dda2090 100644
--- a/langtools/src/share/classes/com/sun/mirror/declaration/AnnotationTypeDeclaration.java
+++ b/langtools/src/share/classes/com/sun/mirror/declaration/AnnotationTypeDeclaration.java
@@ -32,11 +32,17 @@
 /**
  * Represents the declaration of an annotation type.
  *
+ * @deprecated All components of this API have been superseded by the
+ * standardized annotation processing API.  The replacement for the
+ * functionality of this interface is included in {@link
+ * javax.lang.model.element.TypeElement}.
+ *
  * @author Joseph D. Darcy
  * @author Scott Seligman
  * @since 1.5
  */
-
+@Deprecated
+@SuppressWarnings("deprecation")
 public interface AnnotationTypeDeclaration extends InterfaceDeclaration {
 
     /**
diff --git a/langtools/src/share/classes/com/sun/mirror/declaration/AnnotationTypeElementDeclaration.java b/langtools/src/share/classes/com/sun/mirror/declaration/AnnotationTypeElementDeclaration.java
index 1864e36..2eae91e 100644
--- a/langtools/src/share/classes/com/sun/mirror/declaration/AnnotationTypeElementDeclaration.java
+++ b/langtools/src/share/classes/com/sun/mirror/declaration/AnnotationTypeElementDeclaration.java
@@ -29,11 +29,17 @@
 /**
  * Represents an element of an annotation type.
  *
+ * @deprecated All components of this API have been superseded by the
+ * standardized annotation processing API.  The replacement for the
+ * functionality of this interface is included in {@link
+ * javax.lang.model.element.ExecutableElement}.
+ *
  * @author Joe Darcy
  * @author Scott Seligman
  * @since 1.5
  */
-
+@Deprecated
+@SuppressWarnings("deprecation")
 public interface AnnotationTypeElementDeclaration extends MethodDeclaration {
 
     /**
diff --git a/langtools/src/share/classes/com/sun/mirror/declaration/AnnotationValue.java b/langtools/src/share/classes/com/sun/mirror/declaration/AnnotationValue.java
index b4f9593..a71ae6d 100644
--- a/langtools/src/share/classes/com/sun/mirror/declaration/AnnotationValue.java
+++ b/langtools/src/share/classes/com/sun/mirror/declaration/AnnotationValue.java
@@ -30,11 +30,17 @@
 /**
  * Represents a value of an annotation type element.
  *
+ * @deprecated All components of this API have been superseded by the
+ * standardized annotation processing API.  The replacement for the
+ * functionality of this interface is {@link
+ * javax.lang.model.element.AnnotationValue}.
+ *
  * @author Joseph D. Darcy
  * @author Scott Seligman
  * @since 1.5
  */
-
+@Deprecated
+@SuppressWarnings("deprecation")
 public interface AnnotationValue {
 
     /**
diff --git a/langtools/src/share/classes/com/sun/mirror/declaration/ClassDeclaration.java b/langtools/src/share/classes/com/sun/mirror/declaration/ClassDeclaration.java
index 8d86c52..0816803 100644
--- a/langtools/src/share/classes/com/sun/mirror/declaration/ClassDeclaration.java
+++ b/langtools/src/share/classes/com/sun/mirror/declaration/ClassDeclaration.java
@@ -46,13 +46,19 @@
  * provides a simple way to select just the items of interest
  * when a method returns a collection of declarations.
  *
+ * @deprecated All components of this API have been superseded by the
+ * standardized annotation processing API.  The replacement for the
+ * functionality of this interface is included in {@link
+ * javax.lang.model.element.TypeElement}.
+ *
  * @author Joseph D. Darcy
  * @author Scott Seligman
  *
  * @see ClassType
  * @since 1.5
  */
-
+@Deprecated
+@SuppressWarnings("deprecation")
 public interface ClassDeclaration extends TypeDeclaration {
 
     /**
diff --git a/langtools/src/share/classes/com/sun/mirror/declaration/ConstructorDeclaration.java b/langtools/src/share/classes/com/sun/mirror/declaration/ConstructorDeclaration.java
index 11391f8..240f45d 100644
--- a/langtools/src/share/classes/com/sun/mirror/declaration/ConstructorDeclaration.java
+++ b/langtools/src/share/classes/com/sun/mirror/declaration/ConstructorDeclaration.java
@@ -29,10 +29,16 @@
 /**
  * Represents a constructor of a class or interface.
  *
+ * @deprecated All components of this API have been superseded by the
+ * standardized annotation processing API.  The replacement for the
+ * functionality of this interface is included in {@link
+ * javax.lang.model.element.ExecutableElement}.
+ *
  * @author Joe Darcy
  * @author Scott Seligman
  * @since 1.5
  */
-
+@Deprecated
+@SuppressWarnings("deprecation")
 public interface ConstructorDeclaration extends ExecutableDeclaration {
 }
diff --git a/langtools/src/share/classes/com/sun/mirror/declaration/Declaration.java b/langtools/src/share/classes/com/sun/mirror/declaration/Declaration.java
index 1cffc64..8c9e8d6 100644
--- a/langtools/src/share/classes/com/sun/mirror/declaration/Declaration.java
+++ b/langtools/src/share/classes/com/sun/mirror/declaration/Declaration.java
@@ -44,6 +44,11 @@
  * method.  There is no guarantee that any particular declaration will
  * always be represented by the same object.
  *
+ * @deprecated All components of this API have been superseded by the
+ * standardized annotation processing API.  The replacement for the
+ * functionality of this interface is {@link
+ * javax.lang.model.element.Element}.
+ *
  * @author Joseph D. Darcy
  * @author Scott Seligman
  *
@@ -51,7 +56,8 @@
  * @see TypeMirror
  * @since 1.5
  */
-
+@Deprecated
+@SuppressWarnings("deprecation")
 public interface Declaration {
 
     /**
diff --git a/langtools/src/share/classes/com/sun/mirror/declaration/EnumConstantDeclaration.java b/langtools/src/share/classes/com/sun/mirror/declaration/EnumConstantDeclaration.java
index 60f45b5..58db4fa 100644
--- a/langtools/src/share/classes/com/sun/mirror/declaration/EnumConstantDeclaration.java
+++ b/langtools/src/share/classes/com/sun/mirror/declaration/EnumConstantDeclaration.java
@@ -29,11 +29,17 @@
 /**
  * Represents an enum constant declaration.
  *
+ * @deprecated All components of this API have been superseded by the
+ * standardized annotation processing API.  The replacement for the
+ * functionality of this interface is included in {@link
+ * javax.lang.model.element.VariableElement}.
+ *
  * @author Joseph D. Darcy
  * @author Scott Seligman
  * @since 1.5
  */
-
+@Deprecated
+@SuppressWarnings("deprecation")
 public interface EnumConstantDeclaration extends FieldDeclaration {
     /**
      * {@inheritDoc}
diff --git a/langtools/src/share/classes/com/sun/mirror/declaration/EnumDeclaration.java b/langtools/src/share/classes/com/sun/mirror/declaration/EnumDeclaration.java
index c102683..96fa36b 100644
--- a/langtools/src/share/classes/com/sun/mirror/declaration/EnumDeclaration.java
+++ b/langtools/src/share/classes/com/sun/mirror/declaration/EnumDeclaration.java
@@ -32,11 +32,17 @@
 /**
  * Represents the declaration of an enum type.
  *
+ * @deprecated All components of this API have been superseded by the
+ * standardized annotation processing API.  The replacement for the
+ * functionality of this interface is included in {@link
+ * javax.lang.model.element.TypeElement}.
+ *
  * @author Joseph D. Darcy
  * @author Scott Seligman
  * @since 1.5
  */
-
+@Deprecated
+@SuppressWarnings("deprecation")
 public interface EnumDeclaration extends ClassDeclaration {
 
     /**
diff --git a/langtools/src/share/classes/com/sun/mirror/declaration/ExecutableDeclaration.java b/langtools/src/share/classes/com/sun/mirror/declaration/ExecutableDeclaration.java
index e3b1b3d..1a5d26c 100644
--- a/langtools/src/share/classes/com/sun/mirror/declaration/ExecutableDeclaration.java
+++ b/langtools/src/share/classes/com/sun/mirror/declaration/ExecutableDeclaration.java
@@ -34,11 +34,17 @@
 /**
  * Represents a method or constructor of a class or interface.
  *
+ * @deprecated All components of this API have been superseded by the
+ * standardized annotation processing API.  The replacement for the
+ * functionality of this interface is {@link
+ * javax.lang.model.element.ExecutableElement}.
+ *
  * @author Joseph D. Darcy
  * @author Scott Seligman
  * @since 1.5
  */
-
+@Deprecated
+@SuppressWarnings("deprecation")
 public interface ExecutableDeclaration extends MemberDeclaration {
 
     /**
diff --git a/langtools/src/share/classes/com/sun/mirror/declaration/FieldDeclaration.java b/langtools/src/share/classes/com/sun/mirror/declaration/FieldDeclaration.java
index 656dd89..eb45a08 100644
--- a/langtools/src/share/classes/com/sun/mirror/declaration/FieldDeclaration.java
+++ b/langtools/src/share/classes/com/sun/mirror/declaration/FieldDeclaration.java
@@ -32,11 +32,17 @@
 /**
  * Represents a field of a type declaration.
  *
+ * @deprecated All components of this API have been superseded by the
+ * standardized annotation processing API.  The replacement for the
+ * functionality of this interface is included in {@link
+ * javax.lang.model.element.VariableElement}.
+ *
  * @author Joseph D. Darcy
  * @author Scott Seligman
  * @since 1.5
  */
-
+@Deprecated
+@SuppressWarnings("deprecation")
 public interface FieldDeclaration extends MemberDeclaration {
 
     /**
diff --git a/langtools/src/share/classes/com/sun/mirror/declaration/InterfaceDeclaration.java b/langtools/src/share/classes/com/sun/mirror/declaration/InterfaceDeclaration.java
index 253371a..2f69d6d 100644
--- a/langtools/src/share/classes/com/sun/mirror/declaration/InterfaceDeclaration.java
+++ b/langtools/src/share/classes/com/sun/mirror/declaration/InterfaceDeclaration.java
@@ -40,12 +40,18 @@
  * represents an interface <i>type</i>.
  * See {@link TypeDeclaration} for more on this distinction.
  *
+ * @deprecated All components of this API have been superseded by the
+ * standardized annotation processing API.  The replacement for the
+ * functionality of this interface is included in {@link
+ * javax.lang.model.element.TypeElement}.
+ *
  * @author Joseph D. Darcy
  * @author Scott Seligman
  *
  * @see InterfaceType
  * @since 1.5
  */
-
+@Deprecated
+@SuppressWarnings("deprecation")
 public interface InterfaceDeclaration extends TypeDeclaration {
 }
diff --git a/langtools/src/share/classes/com/sun/mirror/declaration/MemberDeclaration.java b/langtools/src/share/classes/com/sun/mirror/declaration/MemberDeclaration.java
index 8d5feda..ec8f1aa 100644
--- a/langtools/src/share/classes/com/sun/mirror/declaration/MemberDeclaration.java
+++ b/langtools/src/share/classes/com/sun/mirror/declaration/MemberDeclaration.java
@@ -31,11 +31,17 @@
  * type.  This includes fields, constructors, methods, and (since they
  * may be nested) declared types themselves.
  *
+ * @deprecated All components of this API have been superseded by the
+ * standardized annotation processing API.  The replacement for the
+ * functionality of this interface is {@link
+ * javax.lang.model.element.Element}.
+ *
  * @author Joseph D. Darcy
  * @author Scott Seligman
  * @since 1.5
  */
-
+@Deprecated
+@SuppressWarnings("deprecation")
 public interface MemberDeclaration extends Declaration {
 
     /**
diff --git a/langtools/src/share/classes/com/sun/mirror/declaration/MethodDeclaration.java b/langtools/src/share/classes/com/sun/mirror/declaration/MethodDeclaration.java
index d2abeff..d2fc63b 100644
--- a/langtools/src/share/classes/com/sun/mirror/declaration/MethodDeclaration.java
+++ b/langtools/src/share/classes/com/sun/mirror/declaration/MethodDeclaration.java
@@ -36,11 +36,17 @@
  * {@linkplain AnnotationTypeElementDeclaration annotation type element}
  * is a kind of method.
  *
+ * @deprecated All components of this API have been superseded by the
+ * standardized annotation processing API.  The replacement for the
+ * functionality of this interface is included in {@link
+ * javax.lang.model.element.ExecutableElement}.
+ *
  * @author Joseph D. Darcy
  * @author Scott Seligman
  * @since 1.5
  */
-
+@Deprecated
+@SuppressWarnings("deprecation")
 public interface MethodDeclaration extends ExecutableDeclaration {
 
     /**
diff --git a/langtools/src/share/classes/com/sun/mirror/declaration/Modifier.java b/langtools/src/share/classes/com/sun/mirror/declaration/Modifier.java
index ccd63b4..a00563b 100644
--- a/langtools/src/share/classes/com/sun/mirror/declaration/Modifier.java
+++ b/langtools/src/share/classes/com/sun/mirror/declaration/Modifier.java
@@ -35,11 +35,16 @@
  * then it is customary, though not required, that they appear in the same
  * order as the constants listed in the detail section below.
  *
+ * @deprecated All components of this API have been superseded by the
+ * standardized annotation processing API.  The replacement for the
+ * functionality of this enum is {@link javax.lang.model.element.Modifier}.
+ *
  * @author Joseph D. Darcy
  * @author Scott Seligman
  * @since 1.5
  */
-
+@Deprecated
+@SuppressWarnings("deprecation")
 public enum Modifier {
 
     // See JLS2 sections 8.1.1, 8.3.1, 8.4.3, 8.8.3, and 9.1.1.
diff --git a/langtools/src/share/classes/com/sun/mirror/declaration/PackageDeclaration.java b/langtools/src/share/classes/com/sun/mirror/declaration/PackageDeclaration.java
index 40c09c8..88af259 100644
--- a/langtools/src/share/classes/com/sun/mirror/declaration/PackageDeclaration.java
+++ b/langtools/src/share/classes/com/sun/mirror/declaration/PackageDeclaration.java
@@ -37,11 +37,17 @@
  * provides a simple way to select just the items of interest
  * when a method returns a collection of declarations.
  *
+ * @deprecated All components of this API have been superseded by the
+ * standardized annotation processing API.  The replacement for the
+ * functionality of this interface is {@link
+ * javax.lang.model.element.PackageElement}.
+ *
  * @author Joseph D. Darcy
  * @author Scott Seligman
  * @since 1.5
  */
-
+@Deprecated
+@SuppressWarnings("deprecation")
 public interface PackageDeclaration extends Declaration {
 
     /**
diff --git a/langtools/src/share/classes/com/sun/mirror/declaration/ParameterDeclaration.java b/langtools/src/share/classes/com/sun/mirror/declaration/ParameterDeclaration.java
index 28cc7f8..23f9fa8 100644
--- a/langtools/src/share/classes/com/sun/mirror/declaration/ParameterDeclaration.java
+++ b/langtools/src/share/classes/com/sun/mirror/declaration/ParameterDeclaration.java
@@ -32,11 +32,17 @@
 /**
  * Represents a formal parameter of a method or constructor.
  *
+ * @deprecated All components of this API have been superseded by the
+ * standardized annotation processing API.  The replacement for the
+ * functionality of this interface is included in {@link
+ * javax.lang.model.element.VariableElement}.
+ *
  * @author Joseph D. Darcy
  * @author Scott Seligman
  * @since 1.5
  */
-
+@Deprecated
+@SuppressWarnings("deprecation")
 public interface ParameterDeclaration extends Declaration {
 
     /**
diff --git a/langtools/src/share/classes/com/sun/mirror/declaration/TypeDeclaration.java b/langtools/src/share/classes/com/sun/mirror/declaration/TypeDeclaration.java
index b3d1db5..5b722db 100644
--- a/langtools/src/share/classes/com/sun/mirror/declaration/TypeDeclaration.java
+++ b/langtools/src/share/classes/com/sun/mirror/declaration/TypeDeclaration.java
@@ -54,13 +54,19 @@
  * provides a simple way to select just the items of interest
  * when a method returns a collection of declarations.
  *
+ * @deprecated All components of this API have been superseded by the
+ * standardized annotation processing API.  The replacement for the
+ * functionality of this interface is included in {@link
+ * javax.lang.model.element.TypeElement}.
+ *
  * @author Joseph D. Darcy
  * @author Scott Seligman
  *
  * @see DeclaredType
  * @since 1.5
  */
-
+@Deprecated
+@SuppressWarnings("deprecation")
 public interface TypeDeclaration extends MemberDeclaration {
 
     /**
diff --git a/langtools/src/share/classes/com/sun/mirror/declaration/TypeParameterDeclaration.java b/langtools/src/share/classes/com/sun/mirror/declaration/TypeParameterDeclaration.java
index 458b39f..33f65f9 100644
--- a/langtools/src/share/classes/com/sun/mirror/declaration/TypeParameterDeclaration.java
+++ b/langtools/src/share/classes/com/sun/mirror/declaration/TypeParameterDeclaration.java
@@ -36,11 +36,17 @@
  * or constructor declaration.
  * A type parameter declares a {@link TypeVariable}.
  *
+ * @deprecated All components of this API have been superseded by the
+ * standardized annotation processing API.  The replacement for the
+ * functionality of this interface is {@link
+ * javax.lang.model.element.TypeParameterElement}.
+ *
  * @author Joseph D. Darcy
  * @author Scott Seligman
  * @since 1.5
  */
-
+@Deprecated
+@SuppressWarnings("deprecation")
 public interface TypeParameterDeclaration extends Declaration {
 
     /**
diff --git a/langtools/src/share/classes/com/sun/mirror/declaration/package-info.java b/langtools/src/share/classes/com/sun/mirror/declaration/package-info.java
new file mode 100644
index 0000000..362b1e7
--- /dev/null
+++ b/langtools/src/share/classes/com/sun/mirror/declaration/package-info.java
@@ -0,0 +1,40 @@
+/*
+ * Copyright 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.
+ */
+
+/**
+ * Interfaces used to model program element declarations.  A
+ * declaration is represented by the appropriate subinterface of
+ * {@link com.sun.mirror.declaration.Declaration}, and an annotation
+ * is represented as an {@link
+ * com.sun.mirror.declaration.AnnotationMirror}.
+ *
+ * <p>The {@code apt} tool and its associated API have been superseded
+ * by the standardized annotation processing API.  The replacement for
+ * the functionality in this package is {@link
+ * javax.lang.model.element}.
+ *
+ * @since 1.5
+ */
+package com.sun.mirror.declaration;
diff --git a/langtools/src/share/classes/com/sun/mirror/declaration/package.html b/langtools/src/share/classes/com/sun/mirror/declaration/package.html
deleted file mode 100644
index 1920d4d..0000000
--- a/langtools/src/share/classes/com/sun/mirror/declaration/package.html
+++ /dev/null
@@ -1,44 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
-<html>
-<head>
-<!--
-
-Copyright 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.
--->
-
-</head>
-<body bgcolor="white">
-
-Interfaces used to model program element declarations.
-A declaration is represented by the appropriate subinterface of
-{@link com.sun.mirror.declaration.Declaration},
-and an annotation is represented as an
-{@link com.sun.mirror.declaration.AnnotationMirror}.
-
-<p>Note that the <code>apt</code> tool and its associated APIs may be
-changed or superseded in future j2se releases.
-
-@since 1.5
-</body>
-</html>
diff --git a/langtools/src/share/classes/com/sun/mirror/type/AnnotationType.java b/langtools/src/share/classes/com/sun/mirror/type/AnnotationType.java
index 22db4ca..3d8eca4 100644
--- a/langtools/src/share/classes/com/sun/mirror/type/AnnotationType.java
+++ b/langtools/src/share/classes/com/sun/mirror/type/AnnotationType.java
@@ -32,11 +32,17 @@
 /**
  * Represents an annotation type.
  *
+ * @deprecated All components of this API have been superseded by the
+ * standardized annotation processing API.  The replacement for the
+ * functionality of this interface is included in {@link
+ * javax.lang.model.type.DeclaredType}.
+ *
  * @author Joseph D. Darcy
  * @author Scott Seligman
  * @since 1.5
  */
-
+@Deprecated
+@SuppressWarnings("deprecation")
 public interface AnnotationType extends InterfaceType {
 
     /**
diff --git a/langtools/src/share/classes/com/sun/mirror/type/ArrayType.java b/langtools/src/share/classes/com/sun/mirror/type/ArrayType.java
index 4de386e..56fdfb7 100644
--- a/langtools/src/share/classes/com/sun/mirror/type/ArrayType.java
+++ b/langtools/src/share/classes/com/sun/mirror/type/ArrayType.java
@@ -31,11 +31,17 @@
  * A multidimensional array type is represented as an array type
  * whose component type is also an array type.
  *
+ * @deprecated All components of this API have been superseded by the
+ * standardized annotation processing API.  The replacement for the
+ * functionality of this interface is {@link
+ * javax.lang.model.type.ArrayType}.
+ *
  * @author Joseph D. Darcy
  * @author Scott Seligman
  * @since 1.5
  */
-
+@Deprecated
+@SuppressWarnings("deprecation")
 public interface ArrayType extends ReferenceType {
 
     /**
diff --git a/langtools/src/share/classes/com/sun/mirror/type/ClassType.java b/langtools/src/share/classes/com/sun/mirror/type/ClassType.java
index 051fd59..fbfc867 100644
--- a/langtools/src/share/classes/com/sun/mirror/type/ClassType.java
+++ b/langtools/src/share/classes/com/sun/mirror/type/ClassType.java
@@ -38,11 +38,17 @@
  * of a class, a <tt>ClassType</tt> represents a class <i>type</i>.
  * See {@link TypeDeclaration} for more on this distinction.
  *
+ * @deprecated All components of this API have been superseded by the
+ * standardized annotation processing API.  The replacement for the
+ * functionality of this interface is included in {@link
+ * javax.lang.model.type.DeclaredType}.
+ *
  * @author Joseph D. Darcy
  * @author Scott Seligman
  * @since 1.5
  */
-
+@Deprecated
+@SuppressWarnings("deprecation")
 public interface ClassType extends DeclaredType {
 
     /**
diff --git a/langtools/src/share/classes/com/sun/mirror/type/DeclaredType.java b/langtools/src/share/classes/com/sun/mirror/type/DeclaredType.java
index d473b61..59aaf7e 100644
--- a/langtools/src/share/classes/com/sun/mirror/type/DeclaredType.java
+++ b/langtools/src/share/classes/com/sun/mirror/type/DeclaredType.java
@@ -48,11 +48,17 @@
  * Other method invocations on such an unknown type will not, in general,
  * return meaningful results.
  *
+ * @deprecated All components of this API have been superseded by the
+ * standardized annotation processing API.  The replacement for the
+ * functionality of this interface is included in {@link
+ * javax.lang.model.type.DeclaredType}.
+ *
  * @author Joseph D. Darcy
  * @author Scott Seligman
  * @since 1.5
  */
-
+@Deprecated
+@SuppressWarnings("deprecation")
 public interface DeclaredType extends ReferenceType {
 
     /**
diff --git a/langtools/src/share/classes/com/sun/mirror/type/EnumType.java b/langtools/src/share/classes/com/sun/mirror/type/EnumType.java
index 90113a9..758cddd 100644
--- a/langtools/src/share/classes/com/sun/mirror/type/EnumType.java
+++ b/langtools/src/share/classes/com/sun/mirror/type/EnumType.java
@@ -32,11 +32,17 @@
 /**
  * Represents an enum type.
  *
+ * @deprecated All components of this API have been superseded by the
+ * standardized annotation processing API.  The replacement for the
+ * functionality of this interface is included in {@link
+ * javax.lang.model.type.DeclaredType}.
+ *
  * @author Joseph D. Darcy
  * @author Scott Seligman
  * @since 1.5
  */
-
+@Deprecated
+@SuppressWarnings("deprecation")
 public interface EnumType extends ClassType {
 
     /**
diff --git a/langtools/src/share/classes/com/sun/mirror/type/InterfaceType.java b/langtools/src/share/classes/com/sun/mirror/type/InterfaceType.java
index 8b9068d..48ec1a2 100644
--- a/langtools/src/share/classes/com/sun/mirror/type/InterfaceType.java
+++ b/langtools/src/share/classes/com/sun/mirror/type/InterfaceType.java
@@ -39,11 +39,17 @@
  * represents an interface <i>type</i>.
  * See {@link TypeDeclaration} for more on this distinction.
  *
+ * @deprecated All components of this API have been superseded by the
+ * standardized annotation processing API.  The replacement for the
+ * functionality of this interface is included in {@link
+ * javax.lang.model.type.DeclaredType}.
+ *
  * @author Joseph D. Darcy
  * @author Scott Seligman
  * @since 1.5
  */
-
+@Deprecated
+@SuppressWarnings("deprecation")
 public interface InterfaceType extends DeclaredType {
 
     /**
diff --git a/langtools/src/share/classes/com/sun/mirror/type/MirroredTypeException.java b/langtools/src/share/classes/com/sun/mirror/type/MirroredTypeException.java
index a0048d9..93b22ba 100644
--- a/langtools/src/share/classes/com/sun/mirror/type/MirroredTypeException.java
+++ b/langtools/src/share/classes/com/sun/mirror/type/MirroredTypeException.java
@@ -35,9 +35,16 @@
  * Thrown when an application attempts to access the {@link Class} object
  * corresponding to a {@link TypeMirror}.
  *
+ * @deprecated All components of this API have been superseded by the
+ * standardized annotation processing API.  The replacement for the
+ * functionality of this exception is {@link
+ * javax.lang.model.type.MirroredTypeException}.
+ *
  * @see MirroredTypesException
  * @see Declaration#getAnnotation(Class)
  */
+@Deprecated
+@SuppressWarnings("deprecation")
 public class MirroredTypeException extends RuntimeException {
 
     private static final long serialVersionUID = 1;
diff --git a/langtools/src/share/classes/com/sun/mirror/type/MirroredTypesException.java b/langtools/src/share/classes/com/sun/mirror/type/MirroredTypesException.java
index 8d44ec1..f4647e5 100644
--- a/langtools/src/share/classes/com/sun/mirror/type/MirroredTypesException.java
+++ b/langtools/src/share/classes/com/sun/mirror/type/MirroredTypesException.java
@@ -38,9 +38,16 @@
  * Thrown when an application attempts to access a sequence of {@link Class}
  * objects each corresponding to a {@link TypeMirror}.
  *
+ * @deprecated All components of this API have been superseded by the
+ * standardized annotation processing API.  The replacement for the
+ * functionality of this exception is {@link
+ * javax.lang.model.type.MirroredTypesException}.
+ *
  * @see MirroredTypeException
  * @see Declaration#getAnnotation(Class)
  */
+@Deprecated
+@SuppressWarnings("deprecation")
 public class MirroredTypesException extends RuntimeException {
 
     private static final long serialVersionUID = 1;
diff --git a/langtools/src/share/classes/com/sun/mirror/type/PrimitiveType.java b/langtools/src/share/classes/com/sun/mirror/type/PrimitiveType.java
index d9ec2f3..aee889e 100644
--- a/langtools/src/share/classes/com/sun/mirror/type/PrimitiveType.java
+++ b/langtools/src/share/classes/com/sun/mirror/type/PrimitiveType.java
@@ -31,11 +31,17 @@
  * <tt>boolean</tt>, <tt>byte</tt>, <tt>short</tt>, <tt>int</tt>,
  * <tt>long</tt>, <tt>char</tt>, <tt>float</tt>, and <tt>double</tt>.
  *
+ * @deprecated All components of this API have been superseded by the
+ * standardized annotation processing API.  The replacement for the
+ * functionality of this interface is {@link
+ * javax.lang.model.type.PrimitiveType}.
+ *
  * @author Joseph D. Darcy
  * @author Scott Seligman
  * @since 1.5
  */
-
+@Deprecated
+@SuppressWarnings("deprecation")
 public interface PrimitiveType extends TypeMirror {
 
     /**
@@ -47,7 +53,13 @@
 
     /**
      * An enumeration of the different kinds of primitive types.
+     *
+     * @deprecated All components of this API have been superseded by
+     * the standardized annotation processing API.  The replacement
+     * for the functionality of this enum is {@link
+     * javax.lang.model.type.TypeKind}.
      */
+    @Deprecated
     enum Kind {
         /** The primitive type <tt>boolean</tt> */      BOOLEAN,
         /** The primitive type <tt>byte</tt> */         BYTE,
diff --git a/langtools/src/share/classes/com/sun/mirror/type/ReferenceType.java b/langtools/src/share/classes/com/sun/mirror/type/ReferenceType.java
index 862eb87..c8df049 100644
--- a/langtools/src/share/classes/com/sun/mirror/type/ReferenceType.java
+++ b/langtools/src/share/classes/com/sun/mirror/type/ReferenceType.java
@@ -30,10 +30,16 @@
  * Represents a reference type.
  * These include class and interface types, array types, and type variables.
  *
+ * @deprecated All components of this API have been superseded by the
+ * standardized annotation processing API.  The replacement for the
+ * functionality of this interface is {@link
+ * javax.lang.model.type.ReferenceType}.
+ *
  * @author Joseph D. Darcy
  * @author Scott Seligman
  * @since 1.5
  */
-
+@Deprecated
+@SuppressWarnings("deprecation")
 public interface ReferenceType extends TypeMirror {
 }
diff --git a/langtools/src/share/classes/com/sun/mirror/type/TypeMirror.java b/langtools/src/share/classes/com/sun/mirror/type/TypeMirror.java
index 6b30339..9816f00 100644
--- a/langtools/src/share/classes/com/sun/mirror/type/TypeMirror.java
+++ b/langtools/src/share/classes/com/sun/mirror/type/TypeMirror.java
@@ -43,6 +43,11 @@
  * There is no guarantee that any particular type will
  * always be represented by the same object.
  *
+ * @deprecated All components of this API have been superseded by the
+ * standardized annotation processing API.  The replacement for the
+ * functionality of this interface is {@link
+ * javax.lang.model.type.TypeMirror}.
+ *
  * @author Joseph D. Darcy
  * @author Scott Seligman
  *
@@ -50,7 +55,8 @@
  * @see Types
  * @since 1.5
  */
-
+@Deprecated
+@SuppressWarnings("deprecation")
 public interface TypeMirror {
 
     /**
diff --git a/langtools/src/share/classes/com/sun/mirror/type/TypeVariable.java b/langtools/src/share/classes/com/sun/mirror/type/TypeVariable.java
index 0c5c097..8626a2d 100644
--- a/langtools/src/share/classes/com/sun/mirror/type/TypeVariable.java
+++ b/langtools/src/share/classes/com/sun/mirror/type/TypeVariable.java
@@ -35,11 +35,17 @@
  * {@linkplain TypeParameterDeclaration type parameter} of a
  * type, method, or constructor.
  *
+ * @deprecated All components of this API have been superseded by the
+ * standardized annotation processing API.  The replacement for the
+ * functionality of this interface is {@link
+ * javax.lang.model.type.TypeVariable}.
+ *
  * @author Joe Darcy
  * @author Scott Seligman
  * @since 1.5
  */
-
+@Deprecated
+@SuppressWarnings("deprecation")
 public interface TypeVariable extends ReferenceType {
 
     /**
diff --git a/langtools/src/share/classes/com/sun/mirror/type/VoidType.java b/langtools/src/share/classes/com/sun/mirror/type/VoidType.java
index b913e7f..9db96fa 100644
--- a/langtools/src/share/classes/com/sun/mirror/type/VoidType.java
+++ b/langtools/src/share/classes/com/sun/mirror/type/VoidType.java
@@ -35,9 +35,15 @@
  * @author Joseph D. Darcy
  * @author Scott Seligman
  *
+ * @deprecated All components of this API have been superseded by the
+ * standardized annotation processing API.  The replacement for the
+ * functionality of this interface is included in {@link
+ * javax.lang.model.type.NoType}.
+ *
  * @see MethodDeclaration#getReturnType()
  * @since 1.5
  */
-
+@Deprecated
+@SuppressWarnings("deprecation")
 public interface VoidType extends TypeMirror {
 }
diff --git a/langtools/src/share/classes/com/sun/mirror/type/WildcardType.java b/langtools/src/share/classes/com/sun/mirror/type/WildcardType.java
index fc0fa48..6cf2141 100644
--- a/langtools/src/share/classes/com/sun/mirror/type/WildcardType.java
+++ b/langtools/src/share/classes/com/sun/mirror/type/WildcardType.java
@@ -41,11 +41,17 @@
  * <tt>extends</tt> clause, its lower bound explicitly set by a
  * <tt>super</tt> clause, or neither (but not both).
  *
+ * @deprecated All components of this API have been superseded by the
+ * standardized annotation processing API.  The replacement for the
+ * functionality of this interface is {@link
+ * javax.lang.model.type.WildcardType}.
+ *
  * @author Joseph D. Darcy
  * @author Scott Seligman
  * @since 1.5
  */
-
+@Deprecated
+@SuppressWarnings("deprecation")
 public interface WildcardType extends TypeMirror {
 
     /**
diff --git a/langtools/src/share/classes/com/sun/mirror/type/package-info.java b/langtools/src/share/classes/com/sun/mirror/type/package-info.java
new file mode 100644
index 0000000..d45a71d
--- /dev/null
+++ b/langtools/src/share/classes/com/sun/mirror/type/package-info.java
@@ -0,0 +1,37 @@
+/*
+ * Copyright 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.
+ */
+
+/**
+ * Interfaces used to model types.  A type is represented by the
+ * appropriate subinterface of {@link com.sun.mirror.type.TypeMirror}.
+ *
+ * <p>The {@code apt} tool and its associated API have been
+ * superseded by the standardized annotation processing API.  The
+ * replacement for the functionality in this package is {@link
+ * javax.lang.model.type}.
+ *
+ * @since 1.5
+ */
+package com.sun.mirror.type;
diff --git a/langtools/src/share/classes/com/sun/mirror/type/package.html b/langtools/src/share/classes/com/sun/mirror/type/package.html
deleted file mode 100644
index cb83900..0000000
--- a/langtools/src/share/classes/com/sun/mirror/type/package.html
+++ /dev/null
@@ -1,42 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
-<html>
-<head>
-<!--
-
-Copyright 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.
--->
-
-</head>
-<body bgcolor="white">
-
-Interfaces used to model types.
-A type is represented by the appropriate subinterface of
-{@link com.sun.mirror.type.TypeMirror}.
-
-<p>Note that the <code>apt</code> tool and its associated APIs may be
-changed or superseded in future j2se releases.
-
-@since 1.5
-</body>
-</html>
diff --git a/langtools/src/share/classes/com/sun/mirror/util/DeclarationFilter.java b/langtools/src/share/classes/com/sun/mirror/util/DeclarationFilter.java
index 83936dd..3a64927 100644
--- a/langtools/src/share/classes/com/sun/mirror/util/DeclarationFilter.java
+++ b/langtools/src/share/classes/com/sun/mirror/util/DeclarationFilter.java
@@ -69,11 +69,17 @@
  *                  };
  *     result = nameFilter.filter(decls);               </pre></blockquote>
  *
+ * @deprecated All components of this API have been superseded by the
+ * standardized annotation processing API.  The replacement for the
+ * functionality of this class is {@link
+ * javax.lang.model.util.ElementFilter}.
+ *
  * @author Joseph D. Darcy
  * @author Scott Seligman
  * @since 1.5
  */
-
+@Deprecated
+@SuppressWarnings("deprecation")
 public class DeclarationFilter {
 
     // Predefined filters for convenience.
diff --git a/langtools/src/share/classes/com/sun/mirror/util/DeclarationScanner.java b/langtools/src/share/classes/com/sun/mirror/util/DeclarationScanner.java
index 6dbb275..269a5b58 100644
--- a/langtools/src/share/classes/com/sun/mirror/util/DeclarationScanner.java
+++ b/langtools/src/share/classes/com/sun/mirror/util/DeclarationScanner.java
@@ -39,11 +39,17 @@
  * are scanned; the postprocessing visitor is called after the
  * contained declarations are scanned.
  *
+ * @deprecated All components of this API have been superseded by the
+ * standardized annotation processing API.  The replacement for the
+ * functionality of this class is {@link
+ * javax.lang.model.util.ElementScanner6}.
+ *
  * @author Joseph D. Darcy
  * @author Scott Seligman
  * @since 1.5
  */
-
+@Deprecated
+@SuppressWarnings("deprecation")
 class DeclarationScanner implements DeclarationVisitor {
     protected DeclarationVisitor pre;
     protected DeclarationVisitor post;
diff --git a/langtools/src/share/classes/com/sun/mirror/util/DeclarationVisitor.java b/langtools/src/share/classes/com/sun/mirror/util/DeclarationVisitor.java
index 4b3806e..56401d4 100644
--- a/langtools/src/share/classes/com/sun/mirror/util/DeclarationVisitor.java
+++ b/langtools/src/share/classes/com/sun/mirror/util/DeclarationVisitor.java
@@ -37,11 +37,17 @@
  * <tt>visit<i>Xxx</i></tt> method applicable to that declaration is
  * invoked.
  *
+ * @deprecated All components of this API have been superseded by the
+ * standardized annotation processing API.  The replacement for the
+ * functionality of this interface is {@link
+ * javax.lang.model.element.ElementVisitor}.
+ *
  * @author Joseph D. Darcy
  * @author Scott Seligman
  * @since 1.5
  */
-
+@Deprecated
+@SuppressWarnings("deprecation")
 public interface DeclarationVisitor {
 
     /**
diff --git a/langtools/src/share/classes/com/sun/mirror/util/DeclarationVisitors.java b/langtools/src/share/classes/com/sun/mirror/util/DeclarationVisitors.java
index 9188be7..f8e0171 100644
--- a/langtools/src/share/classes/com/sun/mirror/util/DeclarationVisitors.java
+++ b/langtools/src/share/classes/com/sun/mirror/util/DeclarationVisitors.java
@@ -28,10 +28,17 @@
 /**
  * Utilities to create specialized <tt>DeclarationVisitor</tt> instances.
  *
+ * @deprecated All components of this API have been superseded by the
+ * standardized annotation processing API.  There is no direct
+ * replacement for the functionality of this class in the standardized
+ * API due to that API's different visitor structure.
+ *
  * @author Joseph D. Darcy
  * @author Scott Seligman
  * @since 1.5
  */
+@Deprecated
+@SuppressWarnings("deprecation")
 public class DeclarationVisitors {
     private DeclarationVisitors(){} // do not instantiate.
 
diff --git a/langtools/src/share/classes/com/sun/mirror/util/Declarations.java b/langtools/src/share/classes/com/sun/mirror/util/Declarations.java
index fe87fa5..ec8c9eb 100644
--- a/langtools/src/share/classes/com/sun/mirror/util/Declarations.java
+++ b/langtools/src/share/classes/com/sun/mirror/util/Declarations.java
@@ -32,11 +32,17 @@
 /**
  * Utility methods for operating on declarations.
  *
+ * @deprecated All components of this API have been superseded by the
+ * standardized annotation processing API.  The replacement for the
+ * functionality of this interface is {@link
+ * javax.lang.model.util.Elements}.
+ *
  * @author Joseph D. Darcy
  * @author Scott Seligman
  * @since 1.5
  */
-
+@Deprecated
+@SuppressWarnings("deprecation")
 public interface Declarations {
 
     /**
diff --git a/langtools/src/share/classes/com/sun/mirror/util/SimpleDeclarationVisitor.java b/langtools/src/share/classes/com/sun/mirror/util/SimpleDeclarationVisitor.java
index 7b0ed87..6be5d83 100644
--- a/langtools/src/share/classes/com/sun/mirror/util/SimpleDeclarationVisitor.java
+++ b/langtools/src/share/classes/com/sun/mirror/util/SimpleDeclarationVisitor.java
@@ -37,11 +37,17 @@
  * methods that correspond to the kinds of declarations on which it
  * will operate.
  *
+ * @deprecated All components of this API have been superseded by the
+ * standardized annotation processing API.  The replacement for the
+ * functionality of this class is {@link
+ * javax.lang.model.util.SimpleElementVisitor6}.
+ *
  * @author Joseph D. Darcy
  * @author Scott Seligman
  * @since 1.5
  */
-
+@Deprecated
+@SuppressWarnings("deprecation")
 public class SimpleDeclarationVisitor implements DeclarationVisitor {
 
     /**
diff --git a/langtools/src/share/classes/com/sun/mirror/util/SimpleTypeVisitor.java b/langtools/src/share/classes/com/sun/mirror/util/SimpleTypeVisitor.java
index eaa37b3..2bea63d 100644
--- a/langtools/src/share/classes/com/sun/mirror/util/SimpleTypeVisitor.java
+++ b/langtools/src/share/classes/com/sun/mirror/util/SimpleTypeVisitor.java
@@ -37,11 +37,17 @@
  * methods that correspond to the kinds of types on which it will
  * operate.
  *
+ * @deprecated All components of this API have been superseded by the
+ * standardized annotation processing API.  The replacement for the
+ * functionality of this class is {@link
+ * javax.lang.model.util.SimpleTypeVisitor6}.
+ *
  * @author Joseph D. Darcy
  * @author Scott Seligman
  * @since 1.5
  */
-
+@Deprecated
+@SuppressWarnings("deprecation")
 public class SimpleTypeVisitor implements TypeVisitor {
 
     /**
diff --git a/langtools/src/share/classes/com/sun/mirror/util/SourceOrderDeclScanner.java b/langtools/src/share/classes/com/sun/mirror/util/SourceOrderDeclScanner.java
index 3b6e62b..62b7209 100644
--- a/langtools/src/share/classes/com/sun/mirror/util/SourceOrderDeclScanner.java
+++ b/langtools/src/share/classes/com/sun/mirror/util/SourceOrderDeclScanner.java
@@ -42,10 +42,17 @@
  * are scanned; the postprocessing visitor is called after the
  * contained declarations are scanned.
  *
+ * @deprecated All components of this API have been superseded by the
+ * standardized annotation processing API.  The replacement for the
+ * functionality of this class is {@link
+ * javax.lang.model.util.SimpleElementVisitor6}.
+ *
  * @author Joseph D. Darcy
  * @author Scott Seligman
  * @since 1.5
  */
+@Deprecated
+@SuppressWarnings("deprecation")
 class SourceOrderDeclScanner extends DeclarationScanner {
     static class SourceOrderComparator implements java.util.Comparator<Declaration> {
         SourceOrderComparator(){}
diff --git a/langtools/src/share/classes/com/sun/mirror/util/SourcePosition.java b/langtools/src/share/classes/com/sun/mirror/util/SourcePosition.java
index f300d3c..766cae4 100644
--- a/langtools/src/share/classes/com/sun/mirror/util/SourcePosition.java
+++ b/langtools/src/share/classes/com/sun/mirror/util/SourcePosition.java
@@ -32,11 +32,20 @@
 /**
  * Represents a position in a source file.
  *
+ * @deprecated All components of this API have been superseded by the
+ * standardized annotation processing API.  There is no direct
+ * replacement for the functionality of this interface since the
+ * standardized {@link javax.annotation.processing.Messager Messager}
+ * API implicitly takes a source position argument via any element,
+ * annotation mirror, or annotation value passed along with the
+ * message.
+ *
  * @author Joseph D. Darcy
  * @author Scott Seligman
  * @since 1.5
  */
-
+@Deprecated
+@SuppressWarnings("deprecation")
 public interface SourcePosition {
 
     /**
diff --git a/langtools/src/share/classes/com/sun/mirror/util/TypeVisitor.java b/langtools/src/share/classes/com/sun/mirror/util/TypeVisitor.java
index 4df15f5..4216617 100644
--- a/langtools/src/share/classes/com/sun/mirror/util/TypeVisitor.java
+++ b/langtools/src/share/classes/com/sun/mirror/util/TypeVisitor.java
@@ -38,11 +38,17 @@
  * the most specific <tt>visit<i>Xxx</i></tt> method applicable to
  * that type is invoked.
  *
+ * @deprecated All components of this API have been superseded by the
+ * standardized annotation processing API.  The replacement for the
+ * functionality of this interface is {@link
+ * javax.lang.model.element.TypeVisitor}.
+ *
  * @author Joseph D. Darcy
  * @author Scott Seligman
  * @since 1.5
  */
-
+@Deprecated
+@SuppressWarnings("deprecation")
 public interface TypeVisitor {
 
     /**
diff --git a/langtools/src/share/classes/com/sun/mirror/util/Types.java b/langtools/src/share/classes/com/sun/mirror/util/Types.java
index 8bb2512..4324f59 100644
--- a/langtools/src/share/classes/com/sun/mirror/util/Types.java
+++ b/langtools/src/share/classes/com/sun/mirror/util/Types.java
@@ -35,11 +35,17 @@
 /**
  * Utility methods for operating on types.
  *
+ * @deprecated All components of this API have been superseded by the
+ * standardized annotation processing API.  The replacement for the
+ * functionality of this interface is {@link
+ * javax.lang.model.util.Types}.
+ *
  * @author Joseph D. Darcy
  * @author Scott Seligman
  * @since 1.5
  */
-
+@Deprecated
+@SuppressWarnings("deprecation")
 public interface Types {
 
     /**
diff --git a/langtools/src/share/classes/com/sun/mirror/util/package-info.java b/langtools/src/share/classes/com/sun/mirror/util/package-info.java
new file mode 100644
index 0000000..9a74f19
--- /dev/null
+++ b/langtools/src/share/classes/com/sun/mirror/util/package-info.java
@@ -0,0 +1,37 @@
+/*
+ * Copyright 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.
+ */
+
+/**
+ * Utilities to assist in the processing of {@linkplain
+ * com.sun.mirror.declaration declarations} and {@linkplain
+ * com.sun.mirror.type types}.
+ *
+ * <p>The {@code apt} tool and its associated API have been superseded
+ * by the standardized annotation processing API.  The replacement for
+ * the functionality in this package is {@link javax.lang.model.util}.
+ *
+ * @since 1.5
+ */
+package com.sun.mirror.util;
diff --git a/langtools/src/share/classes/com/sun/mirror/util/package.html b/langtools/src/share/classes/com/sun/mirror/util/package.html
deleted file mode 100644
index ef3e71d..0000000
--- a/langtools/src/share/classes/com/sun/mirror/util/package.html
+++ /dev/null
@@ -1,42 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
-<html>
-<head>
-<!--
-
-Copyright 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.
--->
-
-</head>
-<body bgcolor="white">
-
-Utilities to assist in the processing of {@linkplain
-com.sun.mirror.declaration declarations} and {@linkplain
-com.sun.mirror.type types}.
-
-<p>Note that the <code>apt</code> tool and its associated APIs may be
-changed or superseded in future j2se releases.
-
-@since 1.5
-</body>
-</html>
diff --git a/langtools/src/share/classes/com/sun/tools/apt/comp/Apt.java b/langtools/src/share/classes/com/sun/tools/apt/comp/Apt.java
index 68d5a45..fcdf29d 100644
--- a/langtools/src/share/classes/com/sun/tools/apt/comp/Apt.java
+++ b/langtools/src/share/classes/com/sun/tools/apt/comp/Apt.java
@@ -65,6 +65,7 @@
  *  risk.  This code and its internal interfaces are subject to change
  *  or deletion without notice.</b>
  */
+@SuppressWarnings("deprecation")
 public class Apt extends ListBuffer<Env<AttrContext>> {
     java.util.Set<String> genSourceFileNames = new java.util.LinkedHashSet<String>();
     public java.util.Set<String> getSourceFileNames() {
diff --git a/langtools/src/share/classes/com/sun/tools/apt/comp/BootstrapAPF.java b/langtools/src/share/classes/com/sun/tools/apt/comp/BootstrapAPF.java
index edc71a2..2753d73 100644
--- a/langtools/src/share/classes/com/sun/tools/apt/comp/BootstrapAPF.java
+++ b/langtools/src/share/classes/com/sun/tools/apt/comp/BootstrapAPF.java
@@ -29,6 +29,7 @@
 import com.sun.mirror.apt.*;
 import com.sun.mirror.declaration.AnnotationTypeDeclaration;
 
+@SuppressWarnings("deprecation")
 public class BootstrapAPF implements AnnotationProcessorFactory {
 
     static final Collection<String> supportedOptions =
diff --git a/langtools/src/share/classes/com/sun/tools/apt/comp/PrintAP.java b/langtools/src/share/classes/com/sun/tools/apt/comp/PrintAP.java
index 59f9e7b..a2715b2 100644
--- a/langtools/src/share/classes/com/sun/tools/apt/comp/PrintAP.java
+++ b/langtools/src/share/classes/com/sun/tools/apt/comp/PrintAP.java
@@ -36,6 +36,7 @@
 /**
  * Class used to implement "-print" option.
  */
+@SuppressWarnings("deprecation")
 public class PrintAP implements AnnotationProcessor {
 
 
diff --git a/langtools/src/share/classes/com/sun/tools/apt/main/JavaCompiler.java b/langtools/src/share/classes/com/sun/tools/apt/main/JavaCompiler.java
index 219cd8a..cc6aada 100644
--- a/langtools/src/share/classes/com/sun/tools/apt/main/JavaCompiler.java
+++ b/langtools/src/share/classes/com/sun/tools/apt/main/JavaCompiler.java
@@ -50,6 +50,7 @@
  *  risk.  This code and its internal interfaces are subject to change
  *  or deletion without notice.</b>
  */
+@SuppressWarnings("deprecation")
 public class JavaCompiler extends com.sun.tools.javac.main.JavaCompiler {
     /** The context key for the compiler. */
     protected static final Context.Key<JavaCompiler> compilerKey =
diff --git a/langtools/src/share/classes/com/sun/tools/apt/main/Main.java b/langtools/src/share/classes/com/sun/tools/apt/main/Main.java
index 7783652..d8e9aac 100644
--- a/langtools/src/share/classes/com/sun/tools/apt/main/Main.java
+++ b/langtools/src/share/classes/com/sun/tools/apt/main/Main.java
@@ -64,6 +64,7 @@
  *  risk.  This code and its internal interfaces are subject to change
  *  or deletion without notice.</b>
  */
+@SuppressWarnings("deprecation")
 public class Main {
 
     /** For testing: enter any options you want to be set implicitly
@@ -780,7 +781,6 @@
         // prefixed to command line arguments.
         processArgs(forcedOpts);
 
-
         /*
          * A run of apt only gets passed the most recently generated
          * files; the initial run of apt gets passed the files from
@@ -792,6 +792,11 @@
             // assign args the result of parse to capture results of
             // '@file' expansion
             origFilenames = processArgs((args=CommandLine.parse(args)));
+
+            if (options.get("suppress-tool-api-removal-message") == null) {
+                Bark.printLines(out, getLocalizedString("misc.Deprecation"));
+            }
+
             if (origFilenames == null) {
                 return EXIT_CMDERR;
             } else if (origFilenames.size() == 0) {
diff --git a/langtools/src/share/classes/com/sun/tools/apt/mirror/AptEnv.java b/langtools/src/share/classes/com/sun/tools/apt/mirror/AptEnv.java
index f5e5b1a..4279a97 100644
--- a/langtools/src/share/classes/com/sun/tools/apt/mirror/AptEnv.java
+++ b/langtools/src/share/classes/com/sun/tools/apt/mirror/AptEnv.java
@@ -39,7 +39,7 @@
 /**
  * The environment for a run of apt.
  */
-
+@SuppressWarnings("deprecation")
 public class AptEnv {
 
     public Names names;                 // javac's name table
diff --git a/langtools/src/share/classes/com/sun/tools/apt/mirror/apt/AnnotationProcessorEnvironmentImpl.java b/langtools/src/share/classes/com/sun/tools/apt/mirror/apt/AnnotationProcessorEnvironmentImpl.java
index 974d464..0e37303 100644
--- a/langtools/src/share/classes/com/sun/tools/apt/mirror/apt/AnnotationProcessorEnvironmentImpl.java
+++ b/langtools/src/share/classes/com/sun/tools/apt/mirror/apt/AnnotationProcessorEnvironmentImpl.java
@@ -47,6 +47,7 @@
 /*
  * Annotation Processor Environment implementation.
  */
+@SuppressWarnings("deprecation")
 public class AnnotationProcessorEnvironmentImpl implements AnnotationProcessorEnvironment {
 
     Collection<TypeDeclaration> spectypedecls;
diff --git a/langtools/src/share/classes/com/sun/tools/apt/mirror/apt/FilerImpl.java b/langtools/src/share/classes/com/sun/tools/apt/mirror/apt/FilerImpl.java
index fb01d6b..983eea0 100644
--- a/langtools/src/share/classes/com/sun/tools/apt/mirror/apt/FilerImpl.java
+++ b/langtools/src/share/classes/com/sun/tools/apt/mirror/apt/FilerImpl.java
@@ -45,7 +45,7 @@
 /**
  * Implementation of Filer.
  */
-
+@SuppressWarnings("deprecation")
 public class FilerImpl implements Filer {
     /*
      * The Filer class must maintain a number of constraints.  First,
diff --git a/langtools/src/share/classes/com/sun/tools/apt/mirror/apt/MessagerImpl.java b/langtools/src/share/classes/com/sun/tools/apt/mirror/apt/MessagerImpl.java
index 1280847..903793f 100644
--- a/langtools/src/share/classes/com/sun/tools/apt/mirror/apt/MessagerImpl.java
+++ b/langtools/src/share/classes/com/sun/tools/apt/mirror/apt/MessagerImpl.java
@@ -38,7 +38,7 @@
 /**
  * Implementation of Messager.
  */
-
+@SuppressWarnings("deprecation")
 public class MessagerImpl implements Messager {
     private final Bark bark;
 
diff --git a/langtools/src/share/classes/com/sun/tools/apt/mirror/apt/RoundCompleteEventImpl.java b/langtools/src/share/classes/com/sun/tools/apt/mirror/apt/RoundCompleteEventImpl.java
index 4a4988a..7046b1a 100644
--- a/langtools/src/share/classes/com/sun/tools/apt/mirror/apt/RoundCompleteEventImpl.java
+++ b/langtools/src/share/classes/com/sun/tools/apt/mirror/apt/RoundCompleteEventImpl.java
@@ -29,6 +29,7 @@
 import com.sun.mirror.apt.RoundCompleteEvent;
 import com.sun.mirror.apt.RoundState;
 
+@SuppressWarnings("deprecation")
 public class RoundCompleteEventImpl extends RoundCompleteEvent {
     private static final long serialVersionUID = 7067621446720784300L;
 
diff --git a/langtools/src/share/classes/com/sun/tools/apt/mirror/apt/RoundStateImpl.java b/langtools/src/share/classes/com/sun/tools/apt/mirror/apt/RoundStateImpl.java
index 28edfde..70dbc27 100644
--- a/langtools/src/share/classes/com/sun/tools/apt/mirror/apt/RoundStateImpl.java
+++ b/langtools/src/share/classes/com/sun/tools/apt/mirror/apt/RoundStateImpl.java
@@ -28,6 +28,7 @@
 import com.sun.mirror.apt.RoundState;
 import java.util.Map;
 
+@SuppressWarnings("deprecation")
 public class RoundStateImpl implements RoundState {
     private final boolean finalRound;
     private final boolean errorRaised;
diff --git a/langtools/src/share/classes/com/sun/tools/apt/mirror/declaration/AnnotationMirrorImpl.java b/langtools/src/share/classes/com/sun/tools/apt/mirror/declaration/AnnotationMirrorImpl.java
index acde7c6..226908a 100644
--- a/langtools/src/share/classes/com/sun/tools/apt/mirror/declaration/AnnotationMirrorImpl.java
+++ b/langtools/src/share/classes/com/sun/tools/apt/mirror/declaration/AnnotationMirrorImpl.java
@@ -42,7 +42,7 @@
 /**
  * Implementation of AnnotationMirror
  */
-
+@SuppressWarnings("deprecation")
 public class AnnotationMirrorImpl implements AnnotationMirror {
 
     protected final AptEnv env;
diff --git a/langtools/src/share/classes/com/sun/tools/apt/mirror/declaration/AnnotationProxyMaker.java b/langtools/src/share/classes/com/sun/tools/apt/mirror/declaration/AnnotationProxyMaker.java
index 40eb0d6..e1b5ba8 100644
--- a/langtools/src/share/classes/com/sun/tools/apt/mirror/declaration/AnnotationProxyMaker.java
+++ b/langtools/src/share/classes/com/sun/tools/apt/mirror/declaration/AnnotationProxyMaker.java
@@ -49,7 +49,7 @@
  * <p> The "dynamic proxy return form" of an attribute element value is
  * the form used by sun.reflect.annotation.AnnotationInvocationHandler.
  */
-
+@SuppressWarnings("deprecation")
 class AnnotationProxyMaker {
 
     private final AptEnv env;
diff --git a/langtools/src/share/classes/com/sun/tools/apt/mirror/declaration/AnnotationTypeDeclarationImpl.java b/langtools/src/share/classes/com/sun/tools/apt/mirror/declaration/AnnotationTypeDeclarationImpl.java
index 59a9e6f..494522a 100644
--- a/langtools/src/share/classes/com/sun/tools/apt/mirror/declaration/AnnotationTypeDeclarationImpl.java
+++ b/langtools/src/share/classes/com/sun/tools/apt/mirror/declaration/AnnotationTypeDeclarationImpl.java
@@ -37,7 +37,7 @@
 /**
  * Implementation of AnnotationTypeDeclaration
  */
-
+@SuppressWarnings("deprecation")
 public class AnnotationTypeDeclarationImpl extends InterfaceDeclarationImpl
                                            implements AnnotationTypeDeclaration
 {
diff --git a/langtools/src/share/classes/com/sun/tools/apt/mirror/declaration/AnnotationTypeElementDeclarationImpl.java b/langtools/src/share/classes/com/sun/tools/apt/mirror/declaration/AnnotationTypeElementDeclarationImpl.java
index c608638..d63ddc3 100644
--- a/langtools/src/share/classes/com/sun/tools/apt/mirror/declaration/AnnotationTypeElementDeclarationImpl.java
+++ b/langtools/src/share/classes/com/sun/tools/apt/mirror/declaration/AnnotationTypeElementDeclarationImpl.java
@@ -35,7 +35,7 @@
 /**
  * Implementation of AnnotationTypeElementDeclaration
  */
-
+@SuppressWarnings("deprecation")
 public class AnnotationTypeElementDeclarationImpl extends MethodDeclarationImpl
                                   implements AnnotationTypeElementDeclaration {
 
diff --git a/langtools/src/share/classes/com/sun/tools/apt/mirror/declaration/AnnotationValueImpl.java b/langtools/src/share/classes/com/sun/tools/apt/mirror/declaration/AnnotationValueImpl.java
index a217393..b99bb8a 100644
--- a/langtools/src/share/classes/com/sun/tools/apt/mirror/declaration/AnnotationValueImpl.java
+++ b/langtools/src/share/classes/com/sun/tools/apt/mirror/declaration/AnnotationValueImpl.java
@@ -40,7 +40,7 @@
 /**
  * Implementation of AnnotationValue
  */
-
+@SuppressWarnings("deprecation")
 public class AnnotationValueImpl implements AnnotationValue {
 
     protected final AptEnv env;
diff --git a/langtools/src/share/classes/com/sun/tools/apt/mirror/declaration/ClassDeclarationImpl.java b/langtools/src/share/classes/com/sun/tools/apt/mirror/declaration/ClassDeclarationImpl.java
index 600be29..1359d16 100644
--- a/langtools/src/share/classes/com/sun/tools/apt/mirror/declaration/ClassDeclarationImpl.java
+++ b/langtools/src/share/classes/com/sun/tools/apt/mirror/declaration/ClassDeclarationImpl.java
@@ -42,7 +42,7 @@
 /**
  * Implementation of ClassDeclaration
  */
-
+@SuppressWarnings("deprecation")
 public class ClassDeclarationImpl extends TypeDeclarationImpl
                                   implements ClassDeclaration {
 
diff --git a/langtools/src/share/classes/com/sun/tools/apt/mirror/declaration/Constants.java b/langtools/src/share/classes/com/sun/tools/apt/mirror/declaration/Constants.java
index ba2afd8..63ed3cf 100644
--- a/langtools/src/share/classes/com/sun/tools/apt/mirror/declaration/Constants.java
+++ b/langtools/src/share/classes/com/sun/tools/apt/mirror/declaration/Constants.java
@@ -39,6 +39,7 @@
 /**
  * Utility class for operating on constant expressions.
  */
+@SuppressWarnings("deprecation")
 class Constants {
 
     /**
diff --git a/langtools/src/share/classes/com/sun/tools/apt/mirror/declaration/ConstructorDeclarationImpl.java b/langtools/src/share/classes/com/sun/tools/apt/mirror/declaration/ConstructorDeclarationImpl.java
index 936dfd8..3943100 100644
--- a/langtools/src/share/classes/com/sun/tools/apt/mirror/declaration/ConstructorDeclarationImpl.java
+++ b/langtools/src/share/classes/com/sun/tools/apt/mirror/declaration/ConstructorDeclarationImpl.java
@@ -39,7 +39,7 @@
 /**
  * Implementation of ConstructorDeclaration
  */
-
+@SuppressWarnings("deprecation")
 public class ConstructorDeclarationImpl extends ExecutableDeclarationImpl
                                         implements ConstructorDeclaration {
 
diff --git a/langtools/src/share/classes/com/sun/tools/apt/mirror/declaration/DeclarationImpl.java b/langtools/src/share/classes/com/sun/tools/apt/mirror/declaration/DeclarationImpl.java
index bb2b097..e441424 100644
--- a/langtools/src/share/classes/com/sun/tools/apt/mirror/declaration/DeclarationImpl.java
+++ b/langtools/src/share/classes/com/sun/tools/apt/mirror/declaration/DeclarationImpl.java
@@ -52,7 +52,7 @@
 /**
  * Implementation of Declaration
  */
-
+@SuppressWarnings("deprecation")
 public abstract class DeclarationImpl implements Declaration {
 
     protected final AptEnv env;
diff --git a/langtools/src/share/classes/com/sun/tools/apt/mirror/declaration/DeclarationMaker.java b/langtools/src/share/classes/com/sun/tools/apt/mirror/declaration/DeclarationMaker.java
index 09eeee2..cd90a96 100644
--- a/langtools/src/share/classes/com/sun/tools/apt/mirror/declaration/DeclarationMaker.java
+++ b/langtools/src/share/classes/com/sun/tools/apt/mirror/declaration/DeclarationMaker.java
@@ -40,7 +40,7 @@
 /**
  * Utilities for constructing and caching declarations.
  */
-
+@SuppressWarnings("deprecation")
 public class DeclarationMaker {
 
     private AptEnv env;
diff --git a/langtools/src/share/classes/com/sun/tools/apt/mirror/declaration/EnumConstantDeclarationImpl.java b/langtools/src/share/classes/com/sun/tools/apt/mirror/declaration/EnumConstantDeclarationImpl.java
index 7d4ae31..17191cc 100644
--- a/langtools/src/share/classes/com/sun/tools/apt/mirror/declaration/EnumConstantDeclarationImpl.java
+++ b/langtools/src/share/classes/com/sun/tools/apt/mirror/declaration/EnumConstantDeclarationImpl.java
@@ -35,7 +35,7 @@
 /**
  * Implementation of EnumConstantDeclaration
  */
-
+@SuppressWarnings("deprecation")
 public class EnumConstantDeclarationImpl extends FieldDeclarationImpl
                                          implements EnumConstantDeclaration {
 
diff --git a/langtools/src/share/classes/com/sun/tools/apt/mirror/declaration/EnumDeclarationImpl.java b/langtools/src/share/classes/com/sun/tools/apt/mirror/declaration/EnumDeclarationImpl.java
index 2a498d2..ed882d4 100644
--- a/langtools/src/share/classes/com/sun/tools/apt/mirror/declaration/EnumDeclarationImpl.java
+++ b/langtools/src/share/classes/com/sun/tools/apt/mirror/declaration/EnumDeclarationImpl.java
@@ -37,7 +37,7 @@
 /**
  * Implementation of EnumDeclaration
  */
-
+@SuppressWarnings("deprecation")
 public class EnumDeclarationImpl extends ClassDeclarationImpl
                                  implements EnumDeclaration {
 
diff --git a/langtools/src/share/classes/com/sun/tools/apt/mirror/declaration/ExecutableDeclarationImpl.java b/langtools/src/share/classes/com/sun/tools/apt/mirror/declaration/ExecutableDeclarationImpl.java
index b5d758f..ae4d92f 100644
--- a/langtools/src/share/classes/com/sun/tools/apt/mirror/declaration/ExecutableDeclarationImpl.java
+++ b/langtools/src/share/classes/com/sun/tools/apt/mirror/declaration/ExecutableDeclarationImpl.java
@@ -39,7 +39,7 @@
 /**
  * Implementation of ExecutableDeclaration
  */
-
+@SuppressWarnings("deprecation")
 public abstract class ExecutableDeclarationImpl extends MemberDeclarationImpl
                                              implements ExecutableDeclaration {
     public MethodSymbol sym;
diff --git a/langtools/src/share/classes/com/sun/tools/apt/mirror/declaration/FieldDeclarationImpl.java b/langtools/src/share/classes/com/sun/tools/apt/mirror/declaration/FieldDeclarationImpl.java
index 2ab22fd..14eaefe 100644
--- a/langtools/src/share/classes/com/sun/tools/apt/mirror/declaration/FieldDeclarationImpl.java
+++ b/langtools/src/share/classes/com/sun/tools/apt/mirror/declaration/FieldDeclarationImpl.java
@@ -40,7 +40,7 @@
 /**
  * Implementation of FieldDeclaration
  */
-
+@SuppressWarnings("deprecation")
 class FieldDeclarationImpl extends MemberDeclarationImpl
                                   implements FieldDeclaration {
 
diff --git a/langtools/src/share/classes/com/sun/tools/apt/mirror/declaration/InterfaceDeclarationImpl.java b/langtools/src/share/classes/com/sun/tools/apt/mirror/declaration/InterfaceDeclarationImpl.java
index 866c66d..ee251c3 100644
--- a/langtools/src/share/classes/com/sun/tools/apt/mirror/declaration/InterfaceDeclarationImpl.java
+++ b/langtools/src/share/classes/com/sun/tools/apt/mirror/declaration/InterfaceDeclarationImpl.java
@@ -35,7 +35,7 @@
 /**
  * Implementation of InterfaceDeclaration
  */
-
+@SuppressWarnings("deprecation")
 public class InterfaceDeclarationImpl extends TypeDeclarationImpl
                                       implements InterfaceDeclaration {
 
diff --git a/langtools/src/share/classes/com/sun/tools/apt/mirror/declaration/MemberDeclarationImpl.java b/langtools/src/share/classes/com/sun/tools/apt/mirror/declaration/MemberDeclarationImpl.java
index e47d706..3da4b43 100644
--- a/langtools/src/share/classes/com/sun/tools/apt/mirror/declaration/MemberDeclarationImpl.java
+++ b/langtools/src/share/classes/com/sun/tools/apt/mirror/declaration/MemberDeclarationImpl.java
@@ -40,7 +40,7 @@
 /**
  * Implementation of MemberDeclaration
  */
-
+@SuppressWarnings("deprecation")
 public abstract class MemberDeclarationImpl extends DeclarationImpl
                                             implements MemberDeclaration {
 
diff --git a/langtools/src/share/classes/com/sun/tools/apt/mirror/declaration/MethodDeclarationImpl.java b/langtools/src/share/classes/com/sun/tools/apt/mirror/declaration/MethodDeclarationImpl.java
index fff0041..29c16b2 100644
--- a/langtools/src/share/classes/com/sun/tools/apt/mirror/declaration/MethodDeclarationImpl.java
+++ b/langtools/src/share/classes/com/sun/tools/apt/mirror/declaration/MethodDeclarationImpl.java
@@ -36,7 +36,7 @@
 /**
  * Implementation of MethodDeclaration
  */
-
+@SuppressWarnings("deprecation")
 public class MethodDeclarationImpl extends ExecutableDeclarationImpl
                                    implements MethodDeclaration {
 
diff --git a/langtools/src/share/classes/com/sun/tools/apt/mirror/declaration/PackageDeclarationImpl.java b/langtools/src/share/classes/com/sun/tools/apt/mirror/declaration/PackageDeclarationImpl.java
index 2edbeb4..1f11b1d 100644
--- a/langtools/src/share/classes/com/sun/tools/apt/mirror/declaration/PackageDeclarationImpl.java
+++ b/langtools/src/share/classes/com/sun/tools/apt/mirror/declaration/PackageDeclarationImpl.java
@@ -39,7 +39,7 @@
 /**
  * Implementation of PackageDeclaration.
  */
-
+@SuppressWarnings("deprecation")
 public class PackageDeclarationImpl extends DeclarationImpl
                                     implements PackageDeclaration {
 
diff --git a/langtools/src/share/classes/com/sun/tools/apt/mirror/declaration/ParameterDeclarationImpl.java b/langtools/src/share/classes/com/sun/tools/apt/mirror/declaration/ParameterDeclarationImpl.java
index 9016b80..66890da 100644
--- a/langtools/src/share/classes/com/sun/tools/apt/mirror/declaration/ParameterDeclarationImpl.java
+++ b/langtools/src/share/classes/com/sun/tools/apt/mirror/declaration/ParameterDeclarationImpl.java
@@ -39,7 +39,7 @@
 /**
  * Implementation of ParameterDeclaration
  */
-
+@SuppressWarnings("deprecation")
 public class ParameterDeclarationImpl extends DeclarationImpl
                                       implements ParameterDeclaration
 {
diff --git a/langtools/src/share/classes/com/sun/tools/apt/mirror/declaration/TypeDeclarationImpl.java b/langtools/src/share/classes/com/sun/tools/apt/mirror/declaration/TypeDeclarationImpl.java
index d67d6f2..7deeb7c 100644
--- a/langtools/src/share/classes/com/sun/tools/apt/mirror/declaration/TypeDeclarationImpl.java
+++ b/langtools/src/share/classes/com/sun/tools/apt/mirror/declaration/TypeDeclarationImpl.java
@@ -40,7 +40,7 @@
 /**
  * Implementation of TypeDeclaration
  */
-
+@SuppressWarnings("deprecation")
 public class TypeDeclarationImpl extends MemberDeclarationImpl
                                  implements TypeDeclaration {
 
diff --git a/langtools/src/share/classes/com/sun/tools/apt/mirror/declaration/TypeParameterDeclarationImpl.java b/langtools/src/share/classes/com/sun/tools/apt/mirror/declaration/TypeParameterDeclarationImpl.java
index b169f47..765a11e 100644
--- a/langtools/src/share/classes/com/sun/tools/apt/mirror/declaration/TypeParameterDeclarationImpl.java
+++ b/langtools/src/share/classes/com/sun/tools/apt/mirror/declaration/TypeParameterDeclarationImpl.java
@@ -40,7 +40,7 @@
 /**
  * Implementation of TypeParameterDeclaration
  */
-
+@SuppressWarnings("deprecation")
 public class TypeParameterDeclarationImpl extends DeclarationImpl
                                           implements TypeParameterDeclaration
 {
diff --git a/langtools/src/share/classes/com/sun/tools/apt/mirror/type/AnnotationTypeImpl.java b/langtools/src/share/classes/com/sun/tools/apt/mirror/type/AnnotationTypeImpl.java
index e39a30d..495bc13 100644
--- a/langtools/src/share/classes/com/sun/tools/apt/mirror/type/AnnotationTypeImpl.java
+++ b/langtools/src/share/classes/com/sun/tools/apt/mirror/type/AnnotationTypeImpl.java
@@ -36,7 +36,7 @@
 /**
  * Implementation of AnnotationType
  */
-
+@SuppressWarnings("deprecation")
 public class AnnotationTypeImpl extends InterfaceTypeImpl
                                 implements AnnotationType {
 
diff --git a/langtools/src/share/classes/com/sun/tools/apt/mirror/type/ArrayTypeImpl.java b/langtools/src/share/classes/com/sun/tools/apt/mirror/type/ArrayTypeImpl.java
index 8c1458b..5d62c01 100644
--- a/langtools/src/share/classes/com/sun/tools/apt/mirror/type/ArrayTypeImpl.java
+++ b/langtools/src/share/classes/com/sun/tools/apt/mirror/type/ArrayTypeImpl.java
@@ -35,7 +35,7 @@
 /**
  * Implementation of ArrayType
  */
-
+@SuppressWarnings("deprecation")
 public class ArrayTypeImpl extends TypeMirrorImpl implements ArrayType {
 
     protected Type.ArrayType type;
diff --git a/langtools/src/share/classes/com/sun/tools/apt/mirror/type/ClassTypeImpl.java b/langtools/src/share/classes/com/sun/tools/apt/mirror/type/ClassTypeImpl.java
index a4b9fd2..dd82419 100644
--- a/langtools/src/share/classes/com/sun/tools/apt/mirror/type/ClassTypeImpl.java
+++ b/langtools/src/share/classes/com/sun/tools/apt/mirror/type/ClassTypeImpl.java
@@ -36,7 +36,7 @@
 /**
  * Implementation of ClassType
  */
-
+@SuppressWarnings("deprecation")
 public class ClassTypeImpl extends DeclaredTypeImpl implements ClassType {
 
     ClassTypeImpl(AptEnv env, Type.ClassType type) {
diff --git a/langtools/src/share/classes/com/sun/tools/apt/mirror/type/DeclaredTypeImpl.java b/langtools/src/share/classes/com/sun/tools/apt/mirror/type/DeclaredTypeImpl.java
index 81683248..b5a815d 100644
--- a/langtools/src/share/classes/com/sun/tools/apt/mirror/type/DeclaredTypeImpl.java
+++ b/langtools/src/share/classes/com/sun/tools/apt/mirror/type/DeclaredTypeImpl.java
@@ -38,7 +38,7 @@
 /**
  * Implementation of DeclaredType
  */
-
+@SuppressWarnings("deprecation")
 abstract class DeclaredTypeImpl extends TypeMirrorImpl
                                 implements DeclaredType {
 
diff --git a/langtools/src/share/classes/com/sun/tools/apt/mirror/type/EnumTypeImpl.java b/langtools/src/share/classes/com/sun/tools/apt/mirror/type/EnumTypeImpl.java
index 883a3ec..c2d6346 100644
--- a/langtools/src/share/classes/com/sun/tools/apt/mirror/type/EnumTypeImpl.java
+++ b/langtools/src/share/classes/com/sun/tools/apt/mirror/type/EnumTypeImpl.java
@@ -36,7 +36,7 @@
 /**
  * Implementation of EnumType
  */
-
+@SuppressWarnings("deprecation")
 public class EnumTypeImpl extends ClassTypeImpl implements EnumType {
 
     EnumTypeImpl(AptEnv env, Type.ClassType type) {
diff --git a/langtools/src/share/classes/com/sun/tools/apt/mirror/type/InterfaceTypeImpl.java b/langtools/src/share/classes/com/sun/tools/apt/mirror/type/InterfaceTypeImpl.java
index 3e056de..167ea9b 100644
--- a/langtools/src/share/classes/com/sun/tools/apt/mirror/type/InterfaceTypeImpl.java
+++ b/langtools/src/share/classes/com/sun/tools/apt/mirror/type/InterfaceTypeImpl.java
@@ -36,7 +36,7 @@
 /**
  * Implementation of InterfaceType
  */
-
+@SuppressWarnings("deprecation")
 public class InterfaceTypeImpl extends DeclaredTypeImpl
                                implements InterfaceType {
 
diff --git a/langtools/src/share/classes/com/sun/tools/apt/mirror/type/PrimitiveTypeImpl.java b/langtools/src/share/classes/com/sun/tools/apt/mirror/type/PrimitiveTypeImpl.java
index e176d5b..bf18662 100644
--- a/langtools/src/share/classes/com/sun/tools/apt/mirror/type/PrimitiveTypeImpl.java
+++ b/langtools/src/share/classes/com/sun/tools/apt/mirror/type/PrimitiveTypeImpl.java
@@ -38,7 +38,7 @@
 /**
  * Implementation of PrimitiveType.
  */
-
+@SuppressWarnings("deprecation")
 class PrimitiveTypeImpl extends TypeMirrorImpl implements PrimitiveType {
 
     private final Kind kind;    // the kind of primitive
diff --git a/langtools/src/share/classes/com/sun/tools/apt/mirror/type/TypeMaker.java b/langtools/src/share/classes/com/sun/tools/apt/mirror/type/TypeMaker.java
index 70d322b..d982978 100644
--- a/langtools/src/share/classes/com/sun/tools/apt/mirror/type/TypeMaker.java
+++ b/langtools/src/share/classes/com/sun/tools/apt/mirror/type/TypeMaker.java
@@ -41,7 +41,7 @@
 /**
  * Utilities for constructing type objects.
  */
-
+@SuppressWarnings("deprecation")
 public class TypeMaker {
 
     private final AptEnv env;
diff --git a/langtools/src/share/classes/com/sun/tools/apt/mirror/type/TypeMirrorImpl.java b/langtools/src/share/classes/com/sun/tools/apt/mirror/type/TypeMirrorImpl.java
index 964cd8a..2fa704a 100644
--- a/langtools/src/share/classes/com/sun/tools/apt/mirror/type/TypeMirrorImpl.java
+++ b/langtools/src/share/classes/com/sun/tools/apt/mirror/type/TypeMirrorImpl.java
@@ -35,7 +35,7 @@
 /**
  * Implementation of TypeMirror
  */
-
+@SuppressWarnings("deprecation")
 public abstract class TypeMirrorImpl implements TypeMirror {
 
     protected final AptEnv env;
diff --git a/langtools/src/share/classes/com/sun/tools/apt/mirror/type/TypeVariableImpl.java b/langtools/src/share/classes/com/sun/tools/apt/mirror/type/TypeVariableImpl.java
index 9e65c82..43119bd 100644
--- a/langtools/src/share/classes/com/sun/tools/apt/mirror/type/TypeVariableImpl.java
+++ b/langtools/src/share/classes/com/sun/tools/apt/mirror/type/TypeVariableImpl.java
@@ -40,7 +40,7 @@
 /**
  * Implementation of TypeVariable
  */
-
+@SuppressWarnings("deprecation")
 public class TypeVariableImpl extends TypeMirrorImpl implements TypeVariable {
 
     protected Type.TypeVar type;
diff --git a/langtools/src/share/classes/com/sun/tools/apt/mirror/type/VoidTypeImpl.java b/langtools/src/share/classes/com/sun/tools/apt/mirror/type/VoidTypeImpl.java
index 7f9a7bc..41e9ca1 100644
--- a/langtools/src/share/classes/com/sun/tools/apt/mirror/type/VoidTypeImpl.java
+++ b/langtools/src/share/classes/com/sun/tools/apt/mirror/type/VoidTypeImpl.java
@@ -34,7 +34,7 @@
 /**
  * Implementation of VoidType.
  */
-
+@SuppressWarnings("deprecation")
 class VoidTypeImpl extends TypeMirrorImpl implements VoidType {
 
     VoidTypeImpl(AptEnv env) {
diff --git a/langtools/src/share/classes/com/sun/tools/apt/mirror/type/WildcardTypeImpl.java b/langtools/src/share/classes/com/sun/tools/apt/mirror/type/WildcardTypeImpl.java
index 9bda06f..6221e8c 100644
--- a/langtools/src/share/classes/com/sun/tools/apt/mirror/type/WildcardTypeImpl.java
+++ b/langtools/src/share/classes/com/sun/tools/apt/mirror/type/WildcardTypeImpl.java
@@ -41,7 +41,7 @@
 /**
  * Implementation of WildcardType
  */
-
+@SuppressWarnings("deprecation")
 public class WildcardTypeImpl extends TypeMirrorImpl implements WildcardType {
 
     protected Type.WildcardType type;
diff --git a/langtools/src/share/classes/com/sun/tools/apt/mirror/util/DeclarationsImpl.java b/langtools/src/share/classes/com/sun/tools/apt/mirror/util/DeclarationsImpl.java
index f6008e0..106c713 100644
--- a/langtools/src/share/classes/com/sun/tools/apt/mirror/util/DeclarationsImpl.java
+++ b/langtools/src/share/classes/com/sun/tools/apt/mirror/util/DeclarationsImpl.java
@@ -42,7 +42,7 @@
 /**
  * Implementation of Declarations utility methods for annotation processors
  */
-
+@SuppressWarnings("deprecation")
 public class DeclarationsImpl implements Declarations {
 
     private final AptEnv env;
diff --git a/langtools/src/share/classes/com/sun/tools/apt/mirror/util/SourcePositionImpl.java b/langtools/src/share/classes/com/sun/tools/apt/mirror/util/SourcePositionImpl.java
index d76d0eb..7da66d6 100644
--- a/langtools/src/share/classes/com/sun/tools/apt/mirror/util/SourcePositionImpl.java
+++ b/langtools/src/share/classes/com/sun/tools/apt/mirror/util/SourcePositionImpl.java
@@ -36,7 +36,7 @@
 /**
  * Implementation of SourcePosition
  */
-
+@SuppressWarnings("deprecation")
 public class SourcePositionImpl implements SourcePosition {
 
     private JavaFileObject sourcefile;
diff --git a/langtools/src/share/classes/com/sun/tools/apt/mirror/util/TypesImpl.java b/langtools/src/share/classes/com/sun/tools/apt/mirror/util/TypesImpl.java
index 8ada36d..237bd58 100644
--- a/langtools/src/share/classes/com/sun/tools/apt/mirror/util/TypesImpl.java
+++ b/langtools/src/share/classes/com/sun/tools/apt/mirror/util/TypesImpl.java
@@ -44,7 +44,7 @@
 /**
  * Implementation of Types utility methods for annotation processors
  */
-
+@SuppressWarnings("deprecation")
 public class TypesImpl implements Types {
 
     private final AptEnv env;
diff --git a/langtools/src/share/classes/com/sun/tools/apt/resources/apt.properties b/langtools/src/share/classes/com/sun/tools/apt/resources/apt.properties
index 80446a0..97605c3 100644
--- a/langtools/src/share/classes/com/sun/tools/apt/resources/apt.properties
+++ b/langtools/src/share/classes/com/sun/tools/apt/resources/apt.properties
@@ -111,6 +111,14 @@
 ## miscellaneous strings
 ##
 
+apt.misc.Deprecation=\
+    \nwarning:\u0020The apt tool and its associated API are planned to be\n\
+    removed in the next major JDK release.  These features have been\n\
+    superseded by javac and the standardized annotation processing API,\n\
+    javax.annotation.processing and javax.lang.model.  Users are\n\
+    recommended to migrate to the annotation processing features of\n\
+    javac; see the javac man page for more information.\n
+
 apt.misc.Problem=\
     Problem encountered during annotation processing; \nsee stacktrace below for more information.
 
diff --git a/langtools/src/share/classes/com/sun/tools/classfile/ExtendedAnnotation.java b/langtools/src/share/classes/com/sun/tools/classfile/ExtendedAnnotation.java
index 2527548..85e49d6 100644
--- a/langtools/src/share/classes/com/sun/tools/classfile/ExtendedAnnotation.java
+++ b/langtools/src/share/classes/com/sun/tools/classfile/ExtendedAnnotation.java
@@ -357,6 +357,7 @@
                 sb.append(type_index);
                 break;
             case CLASS_LITERAL:
+            case CLASS_LITERAL_GENERIC_OR_ARRAY:
                 sb.append(", offset = ");
                 sb.append(offset);
                 break;
diff --git a/langtools/src/share/classes/com/sun/tools/javac/api/DiagnosticFormatter.java b/langtools/src/share/classes/com/sun/tools/javac/api/DiagnosticFormatter.java
index 576a168..aaa25d8 100644
--- a/langtools/src/share/classes/com/sun/tools/javac/api/DiagnosticFormatter.java
+++ b/langtools/src/share/classes/com/sun/tools/javac/api/DiagnosticFormatter.java
@@ -32,6 +32,11 @@
 /**
  * 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.
+ * 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 interface DiagnosticFormatter<D extends Diagnostic<?>> {
 
diff --git a/langtools/src/share/classes/com/sun/tools/javac/api/Formattable.java b/langtools/src/share/classes/com/sun/tools/javac/api/Formattable.java
index e2a381f..c942a63 100644
--- a/langtools/src/share/classes/com/sun/tools/javac/api/Formattable.java
+++ b/langtools/src/share/classes/com/sun/tools/javac/api/Formattable.java
@@ -31,6 +31,11 @@
  * 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.
+ * 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>
+ *
  * @author Maurizio Cimadamore
  */
 public interface Formattable {
diff --git a/langtools/src/share/classes/com/sun/tools/javac/api/Messages.java b/langtools/src/share/classes/com/sun/tools/javac/api/Messages.java
index ad76d6c..290d316 100644
--- a/langtools/src/share/classes/com/sun/tools/javac/api/Messages.java
+++ b/langtools/src/share/classes/com/sun/tools/javac/api/Messages.java
@@ -32,6 +32,11 @@
  * 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.
+ * 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>
+ *
  * @author Maurizio Cimadamore
  */
 public interface Messages {
diff --git a/langtools/src/share/classes/com/sun/tools/javac/code/BoundKind.java b/langtools/src/share/classes/com/sun/tools/javac/code/BoundKind.java
index e190f5d..89932ff 100644
--- a/langtools/src/share/classes/com/sun/tools/javac/code/BoundKind.java
+++ b/langtools/src/share/classes/com/sun/tools/javac/code/BoundKind.java
@@ -25,7 +25,13 @@
 
 package com.sun.tools.javac.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.
+ * This code and its internal interfaces are subject to change or
+ * deletion without notice.</b>
+ */
 public enum BoundKind {
     EXTENDS("? extends "),
     SUPER("? super "),
diff --git a/langtools/src/share/classes/com/sun/tools/javac/code/Printer.java b/langtools/src/share/classes/com/sun/tools/javac/code/Printer.java
index 2447ac5..baa4909 100644
--- a/langtools/src/share/classes/com/sun/tools/javac/code/Printer.java
+++ b/langtools/src/share/classes/com/sun/tools/javac/code/Printer.java
@@ -40,6 +40,11 @@
 /**
  * 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.
+ * 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 abstract class Printer implements Type.Visitor<String, Locale>, Symbol.Visitor<String, Locale> {
 
diff --git a/langtools/src/share/classes/com/sun/tools/javac/comp/Resolve.java b/langtools/src/share/classes/com/sun/tools/javac/comp/Resolve.java
index bb62298..808fd99 100644
--- a/langtools/src/share/classes/com/sun/tools/javac/comp/Resolve.java
+++ b/langtools/src/share/classes/com/sun/tools/javac/comp/Resolve.java
@@ -251,7 +251,8 @@
             return true;
         else {
             Symbol s2 = ((MethodSymbol)sym).implementation(site.tsym, types, true);
-            return (s2 == null || s2 == sym);
+            return (s2 == null || s2 == sym ||
+                    !types.isSubSignature(types.memberType(site, s2), types.memberType(site, sym)));
         }
     }
     //where
diff --git a/langtools/src/share/classes/com/sun/tools/javac/file/BaseFileObject.java b/langtools/src/share/classes/com/sun/tools/javac/file/BaseFileObject.java
index e66ae93..ce2736e 100644
--- a/langtools/src/share/classes/com/sun/tools/javac/file/BaseFileObject.java
+++ b/langtools/src/share/classes/com/sun/tools/javac/file/BaseFileObject.java
@@ -36,6 +36,12 @@
 
 import static javax.tools.JavaFileObject.Kind.*;
 
+/**
+ * <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.
+ * This code and its internal interfaces are subject to change or
+ * deletion without notice.</b>
+*/
 public abstract class BaseFileObject implements JavaFileObject {
     protected BaseFileObject(JavacFileManager fileManager) {
         this.fileManager = fileManager;
diff --git a/langtools/src/share/classes/com/sun/tools/javac/file/CacheFSInfo.java b/langtools/src/share/classes/com/sun/tools/javac/file/CacheFSInfo.java
index 9cd55db..cdd0914 100644
--- a/langtools/src/share/classes/com/sun/tools/javac/file/CacheFSInfo.java
+++ b/langtools/src/share/classes/com/sun/tools/javac/file/CacheFSInfo.java
@@ -34,7 +34,12 @@
 import java.util.concurrent.ConcurrentHashMap;
 
 /**
- * Caching implementation of FSInfo
+ * Caching implementation of FSInfo.
+ *
+ * <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.
+ * This code and its internal interfaces are subject to change or
+ * deletion without notice.</b>
  */
 public class CacheFSInfo extends FSInfo {
 
diff --git a/langtools/src/share/classes/com/sun/tools/javac/file/FSInfo.java b/langtools/src/share/classes/com/sun/tools/javac/file/FSInfo.java
index 840757a..cfe0dae 100644
--- a/langtools/src/share/classes/com/sun/tools/javac/file/FSInfo.java
+++ b/langtools/src/share/classes/com/sun/tools/javac/file/FSInfo.java
@@ -16,6 +16,11 @@
 /**
  * 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.
+ * 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 FSInfo {
 
diff --git a/langtools/src/share/classes/com/sun/tools/javac/file/JavacFileManager.java b/langtools/src/share/classes/com/sun/tools/javac/file/JavacFileManager.java
index d8ccc02..3ea1978 100644
--- a/langtools/src/share/classes/com/sun/tools/javac/file/JavacFileManager.java
+++ b/langtools/src/share/classes/com/sun/tools/javac/file/JavacFileManager.java
@@ -82,6 +82,11 @@
 /**
  * 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.
+ * 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 JavacFileManager implements StandardJavaFileManager {
 
diff --git a/langtools/src/share/classes/com/sun/tools/javac/file/RegularFileObject.java b/langtools/src/share/classes/com/sun/tools/javac/file/RegularFileObject.java
index c604134..6b55187 100644
--- a/langtools/src/share/classes/com/sun/tools/javac/file/RegularFileObject.java
+++ b/langtools/src/share/classes/com/sun/tools/javac/file/RegularFileObject.java
@@ -42,6 +42,11 @@
 
 /**
  * A subclass of JavaFileObject representing regular 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.
+ * This code and its internal interfaces are subject to change or
+ * deletion without notice.</b>
  */
 class RegularFileObject extends BaseFileObject {
 
diff --git a/langtools/src/share/classes/com/sun/tools/javac/file/RelativePath.java b/langtools/src/share/classes/com/sun/tools/javac/file/RelativePath.java
index 92cc886..d661f44 100644
--- a/langtools/src/share/classes/com/sun/tools/javac/file/RelativePath.java
+++ b/langtools/src/share/classes/com/sun/tools/javac/file/RelativePath.java
@@ -34,6 +34,11 @@
  * Used to represent a platform-neutral path within a platform-specific
  * 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.
+ * 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 abstract class RelativePath implements Comparable<RelativePath> {
     /**
diff --git a/langtools/src/share/classes/com/sun/tools/javac/file/SymbolArchive.java b/langtools/src/share/classes/com/sun/tools/javac/file/SymbolArchive.java
index 89c9a23..70688db 100644
--- a/langtools/src/share/classes/com/sun/tools/javac/file/SymbolArchive.java
+++ b/langtools/src/share/classes/com/sun/tools/javac/file/SymbolArchive.java
@@ -35,6 +35,12 @@
 import com.sun.tools.javac.file.RelativePath.RelativeFile;
 import com.sun.tools.javac.util.List;
 
+/**
+ * <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.
+ * This code and its internal interfaces are subject to change or
+ * deletion without notice.</b>
+*/
 public class SymbolArchive extends ZipArchive {
 
     final File origFile;
diff --git a/langtools/src/share/classes/com/sun/tools/javac/file/ZipArchive.java b/langtools/src/share/classes/com/sun/tools/javac/file/ZipArchive.java
index 9af25f7..63f0dd1 100644
--- a/langtools/src/share/classes/com/sun/tools/javac/file/ZipArchive.java
+++ b/langtools/src/share/classes/com/sun/tools/javac/file/ZipArchive.java
@@ -48,6 +48,12 @@
 import com.sun.tools.javac.file.RelativePath.RelativeFile;
 import com.sun.tools.javac.util.List;
 
+/**
+ * <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.
+ * This code and its internal interfaces are subject to change or
+ * deletion without notice.</b>
+ */
 public class ZipArchive implements Archive {
 
     public ZipArchive(JavacFileManager fm, ZipFile zdir) throws IOException {
diff --git a/langtools/src/share/classes/com/sun/tools/javac/file/ZipFileIndex.java b/langtools/src/share/classes/com/sun/tools/javac/file/ZipFileIndex.java
index 8a7f650..f393599 100644
--- a/langtools/src/share/classes/com/sun/tools/javac/file/ZipFileIndex.java
+++ b/langtools/src/share/classes/com/sun/tools/javac/file/ZipFileIndex.java
@@ -67,6 +67,11 @@
  * If nonBatchMode option is specified (-XDnonBatchMode) the compiler will use timestamp
  * 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.
+ * 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 ZipFileIndex {
     private static final String MIN_CHAR = String.valueOf(Character.MIN_VALUE);
diff --git a/langtools/src/share/classes/com/sun/tools/javac/file/ZipFileIndexArchive.java b/langtools/src/share/classes/com/sun/tools/javac/file/ZipFileIndexArchive.java
index 4ed00d1..458910e 100644
--- a/langtools/src/share/classes/com/sun/tools/javac/file/ZipFileIndexArchive.java
+++ b/langtools/src/share/classes/com/sun/tools/javac/file/ZipFileIndexArchive.java
@@ -44,6 +44,12 @@
 import com.sun.tools.javac.file.RelativePath.RelativeFile;
 import com.sun.tools.javac.util.List;
 
+/**
+ * <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.
+ * This code and its internal interfaces are subject to change or
+ * deletion without notice.</b>
+ */
 public class ZipFileIndexArchive implements Archive {
 
     private final ZipFileIndex zfIndex;
diff --git a/langtools/src/share/classes/com/sun/tools/javac/parser/ParserFactory.java b/langtools/src/share/classes/com/sun/tools/javac/parser/ParserFactory.java
index 861f3e5..7058836 100644
--- a/langtools/src/share/classes/com/sun/tools/javac/parser/ParserFactory.java
+++ b/langtools/src/share/classes/com/sun/tools/javac/parser/ParserFactory.java
@@ -34,6 +34,11 @@
 
 /**
  * A factory for creating parsers.
+ *
+ * <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.
+ * This code and its internal interfaces are subject to change or
+ * deletion without notice.</b>
  */
 public class ParserFactory {
 
diff --git a/langtools/src/share/classes/com/sun/tools/javac/util/AbstractDiagnosticFormatter.java b/langtools/src/share/classes/com/sun/tools/javac/util/AbstractDiagnosticFormatter.java
index d8578ec..db7b273 100644
--- a/langtools/src/share/classes/com/sun/tools/javac/util/AbstractDiagnosticFormatter.java
+++ b/langtools/src/share/classes/com/sun/tools/javac/util/AbstractDiagnosticFormatter.java
@@ -57,6 +57,10 @@
  *  <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.
+ * 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 abstract class AbstractDiagnosticFormatter implements DiagnosticFormatter<JCDiagnostic> {
 
diff --git a/langtools/src/share/classes/com/sun/tools/javac/util/BasicDiagnosticFormatter.java b/langtools/src/share/classes/com/sun/tools/javac/util/BasicDiagnosticFormatter.java
index 77063af..a4442db 100644
--- a/langtools/src/share/classes/com/sun/tools/javac/util/BasicDiagnosticFormatter.java
+++ b/langtools/src/share/classes/com/sun/tools/javac/util/BasicDiagnosticFormatter.java
@@ -57,6 +57,11 @@
  * <li>%m: the text or the diagnostic, including any appropriate arguments
  * <li>%_: space delimiter, useful for formatting purposes
  * </ul>
+ *
+ * <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.
+ * This code and its internal interfaces are subject to change or
+ * deletion without notice.</b>
  */
 public class BasicDiagnosticFormatter extends AbstractDiagnosticFormatter {
 
diff --git a/langtools/src/share/classes/com/sun/tools/javac/util/ForwardingDiagnosticFormatter.java b/langtools/src/share/classes/com/sun/tools/javac/util/ForwardingDiagnosticFormatter.java
index aca7fd1..f989e38 100644
--- a/langtools/src/share/classes/com/sun/tools/javac/util/ForwardingDiagnosticFormatter.java
+++ b/langtools/src/share/classes/com/sun/tools/javac/util/ForwardingDiagnosticFormatter.java
@@ -37,6 +37,11 @@
 /**
  * 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.
+ * 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 ForwardingDiagnosticFormatter<D extends Diagnostic<?>, F extends DiagnosticFormatter<D>>
         implements DiagnosticFormatter<D> {
diff --git a/langtools/src/share/classes/com/sun/tools/javac/util/RawDiagnosticFormatter.java b/langtools/src/share/classes/com/sun/tools/javac/util/RawDiagnosticFormatter.java
index 13674e2..f9e5126 100644
--- a/langtools/src/share/classes/com/sun/tools/javac/util/RawDiagnosticFormatter.java
+++ b/langtools/src/share/classes/com/sun/tools/javac/util/RawDiagnosticFormatter.java
@@ -39,6 +39,11 @@
  * The raw formatter will format a diagnostic according to one of two format patterns, depending on whether
  * 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.
+ * 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 final class RawDiagnosticFormatter extends AbstractDiagnosticFormatter {
 
diff --git a/langtools/src/share/classes/com/sun/tools/javac/util/RichDiagnosticFormatter.java b/langtools/src/share/classes/com/sun/tools/javac/util/RichDiagnosticFormatter.java
index 6d8538b..0996c42 100644
--- a/langtools/src/share/classes/com/sun/tools/javac/util/RichDiagnosticFormatter.java
+++ b/langtools/src/share/classes/com/sun/tools/javac/util/RichDiagnosticFormatter.java
@@ -58,6 +58,11 @@
  * formatted and (iii) type-variable disambiguation - when the diagnostic refers
  * 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.
+ * 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 RichDiagnosticFormatter extends
         ForwardingDiagnosticFormatter<JCDiagnostic, AbstractDiagnosticFormatter> {
@@ -569,7 +574,8 @@
         @Override
         public Void visitMethodSymbol(MethodSymbol s, Void ignored) {
             visit(s.owner, null);
-            typePreprocessor.visit(s.type);
+            if (s.type != null)
+                typePreprocessor.visit(s.type);
             return null;
         }
     };
diff --git a/langtools/src/share/classes/com/sun/tools/javac/util/Warner.java b/langtools/src/share/classes/com/sun/tools/javac/util/Warner.java
index 4d73941..ea9054c 100644
--- a/langtools/src/share/classes/com/sun/tools/javac/util/Warner.java
+++ b/langtools/src/share/classes/com/sun/tools/javac/util/Warner.java
@@ -31,10 +31,10 @@
  * An interface to support optional warnings, needed for support of
  * unchecked conversions and unchecked casts.
  *
- * <p>Nothing described in this source file is 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.
+ * <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.
+ * This code and its internal interfaces are subject to change or
+ * deletion without notice.</b>
  */
 public class Warner {
     public static final Warner noWarnings = new Warner();
diff --git a/langtools/src/share/classes/com/sun/tools/javap/JavapFileManager.java b/langtools/src/share/classes/com/sun/tools/javap/JavapFileManager.java
index 2a9e87e..85c4092 100644
--- a/langtools/src/share/classes/com/sun/tools/javap/JavapFileManager.java
+++ b/langtools/src/share/classes/com/sun/tools/javap/JavapFileManager.java
@@ -44,6 +44,7 @@
 class JavapFileManager extends JavacFileManager {
     private JavapFileManager(Context context, Charset charset) {
         super(context, true, charset);
+        setIgnoreSymbolFile(true);
     }
 
     static JavapFileManager create(final DiagnosticListener<? super JavaFileObject> dl, PrintWriter log, Options options) {
diff --git a/langtools/src/share/classes/com/sun/tools/javap/JavapTask.java b/langtools/src/share/classes/com/sun/tools/javap/JavapTask.java
index 77e88b7..285f1b4 100644
--- a/langtools/src/share/classes/com/sun/tools/javap/JavapTask.java
+++ b/langtools/src/share/classes/com/sun/tools/javap/JavapTask.java
@@ -235,12 +235,6 @@
             }
         },
 
-        new Option(false, "-XDignore.symbol.file") {
-            void process(JavapTask task, String opt, String arg) {
-                task.options.ignoreSymbolFile = true;
-            }
-        },
-
         new Option(false, "-XDdetails") {
             void process(JavapTask task, String opt, String arg) {
                 task.options.details = EnumSet.allOf(InstructionDetailWriter.Kind.class);
@@ -477,9 +471,6 @@
             throw new BadArgs("err.incompatible.options", sb);
         }
 
-        if (options.ignoreSymbolFile && fileManager instanceof JavapFileManager)
-            ((JavapFileManager) fileManager).setIgnoreSymbolFile(true);
-
         if ((classes == null || classes.size() == 0) &&
                 !(noArgs || options.help || options.version || options.fullVersion)) {
             throw new BadArgs("err.no.classes.specified");
diff --git a/langtools/src/share/classes/com/sun/tools/javap/Options.java b/langtools/src/share/classes/com/sun/tools/javap/Options.java
index ee70afa..70f7606 100644
--- a/langtools/src/share/classes/com/sun/tools/javap/Options.java
+++ b/langtools/src/share/classes/com/sun/tools/javap/Options.java
@@ -88,5 +88,4 @@
 
     public boolean compat;             // bug-for-bug compatibility mode with old javap
     public boolean jsr277;
-    public boolean ignoreSymbolFile;   // file manager should ignore ct.sym
 }
diff --git a/langtools/test/tools/apt/Basics/apt.sh b/langtools/test/tools/apt/Basics/apt.sh
index a040241..b34d9e0 100644
--- a/langtools/test/tools/apt/Basics/apt.sh
+++ b/langtools/test/tools/apt/Basics/apt.sh
@@ -43,7 +43,7 @@
 esac
 
 # Construct path to apt executable
-APT="${TESTJAVA}/bin/apt ${TESTTOOLVMOPTS}"
+APT="${TESTJAVA}/bin/apt ${TESTTOOLVMOPTS} -XDsuppress-tool-api-removal-message "
 
 printf "%s\n" "-classpath ${TESTCLASSES}"                    > options
 printf "%s\n" "-factorypath ./nullap.jar"                   >> options
@@ -58,6 +58,7 @@
 printf "%s\n" "-XListAnnotationTypes"                       >> options1
 printf "%s\n" "-XclassesAsDecls"                            >> options1
 
+
 # Construct path to javac executable
 JAVAC="${TESTJAVA}/bin/javac ${TESTTOOLVMOPTS} -source 1.5 -sourcepath ${TESTSRC} -classpath ${TESTJAVA}/lib/tools.jar -d . "
 JAR="${TESTJAVA}/bin/jar "
diff --git a/langtools/test/tools/apt/Compile/compile.sh b/langtools/test/tools/apt/Compile/compile.sh
index 8e42ea3..d93e5d9 100644
--- a/langtools/test/tools/apt/Compile/compile.sh
+++ b/langtools/test/tools/apt/Compile/compile.sh
@@ -67,7 +67,7 @@
 esac
 
 
-APT="${TESTJAVA}/bin/apt ${TESTTOOLVMOPTS} "
+APT="${TESTJAVA}/bin/apt ${TESTTOOLVMOPTS} -XDsuppress-tool-api-removal-message "
 JAVA="${TESTJAVA}/bin/java ${TESTVMOPTS} "
 JAVAC="${TESTJAVA}/bin/javac ${TESTTOOLVMOPTS} "
 
diff --git a/langtools/test/tools/javac/Diagnostics/6860795/T6860795.java b/langtools/test/tools/javac/Diagnostics/6860795/T6860795.java
new file mode 100644
index 0000000..6480e0f
--- /dev/null
+++ b/langtools/test/tools/javac/Diagnostics/6860795/T6860795.java
@@ -0,0 +1,34 @@
+/*
+ * Copyright 2009 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     6860795
+ * @summary NullPointerException when compiling a negative java source
+ * @author  mcimadamore
+ * @compile/fail/ref=T6860795.out -XDrawDiagnostics  T6860795.java
+ */
+
+class Test {
+    void foo(float x, int x) {}
+}
diff --git a/langtools/test/tools/javac/Diagnostics/6860795/T6860795.out b/langtools/test/tools/javac/Diagnostics/6860795/T6860795.out
new file mode 100644
index 0000000..f7ec112
--- /dev/null
+++ b/langtools/test/tools/javac/Diagnostics/6860795/T6860795.out
@@ -0,0 +1,2 @@
+T6860795.java:33:27: compiler.err.already.defined: x, foo
+1 error
diff --git a/langtools/test/tools/javac/generics/rawOverride/T6846972.java b/langtools/test/tools/javac/generics/rawOverride/T6846972.java
new file mode 100644
index 0000000..af39a2d
--- /dev/null
+++ b/langtools/test/tools/javac/generics/rawOverride/T6846972.java
@@ -0,0 +1,49 @@
+/*
+ * Copyright 2009 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 6846972
+ * @summary cannot access member of raw type when erasure change overriding into overloading
+ * @author mcimadamore
+ * @compile T6846972.java
+ */
+
+import java.util.EnumMap;
+
+public class T6846972 {
+
+    enum Suit {
+        CLUBS, DIAMONDS;
+    }
+
+    static Object [] array = {
+        Suit.CLUBS, "value1",
+        Suit.DIAMONDS, "value2"
+    };
+
+    static void test() {
+        EnumMap map = new EnumMap(Suit.class);
+        map.put(array[0], array[1]);
+    }
+}
diff --git a/langtools/test/tools/javap/T6863746.java b/langtools/test/tools/javap/T6863746.java
new file mode 100644
index 0000000..cceaf0d
--- /dev/null
+++ b/langtools/test/tools/javap/T6863746.java
@@ -0,0 +1,52 @@
+/*
+ * Copyright 2009 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 java.io.*;
+
+/*
+ * @test
+ * @bug 6863746
+ * @summary javap should not scan ct.sym by default
+ */
+
+public class T6863746 {
+    public static void main(String... args) throws Exception{
+        new T6863746().run();
+    }
+
+    public void run() throws Exception {
+        String[] args = { "-c", "java.lang.Object" };
+        StringWriter sw = new StringWriter();
+        PrintWriter pw = new PrintWriter(sw);
+        int rc = com.sun.tools.javap.Main.run(args, pw);
+        pw.close();
+        String out = sw.toString();
+        System.out.println(out);
+        String[] lines = out.split("\n");
+        // If ct.sym is being read, the output does not include
+        // Code attributes, so check for Code attributes as a
+        // way of detecting that ct.sym is not being used.
+        if (lines.length < 50 || out.indexOf("Code:") == -1)
+            throw new Exception("unexpected output from javap");
+    }
+}
diff --git a/langtools/test/tools/javap/typeAnnotations/ArrayClassLiterals.java b/langtools/test/tools/javap/typeAnnotations/ArrayClassLiterals.java
new file mode 100644
index 0000000..f77480f
--- /dev/null
+++ b/langtools/test/tools/javap/typeAnnotations/ArrayClassLiterals.java
@@ -0,0 +1,183 @@
+/*
+ * Copyright 2009 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 java.io.*;
+import com.sun.tools.classfile.*;
+
+/*
+ * @test ArrayClassLiterals
+ * @bug 6863814
+ * @summary test that class literals array doesn't crash javap
+ */
+
+public class ArrayClassLiterals {
+    public static void main(String[] args) throws Exception {
+        new ArrayClassLiterals().run();
+    }
+
+    public void run() throws Exception {
+        File javaFile = writeTestFile();
+        File classFile = compileTestFile(javaFile);
+
+        ClassFile cf = ClassFile.read(classFile);
+        test(cf);
+        for (Field f : cf.fields) {
+            test(cf, f);
+        }
+        for (Method m: cf.methods) {
+            test(cf, m);
+        }
+
+        countAnnotations();
+
+        if (errors > 0)
+            throw new Exception(errors + " errors found");
+        System.out.println("PASSED");
+    }
+
+    void test(ClassFile cf) {
+        test(cf, Attribute.RuntimeVisibleTypeAnnotations, true);
+        test(cf, Attribute.RuntimeInvisibleTypeAnnotations, false);
+    }
+
+    void test(ClassFile cf, Method m) {
+        test(cf, m, Attribute.RuntimeVisibleTypeAnnotations, true);
+        test(cf, m, Attribute.RuntimeInvisibleTypeAnnotations, false);
+    }
+
+    void test(ClassFile cf, Field m) {
+        test(cf, m, Attribute.RuntimeVisibleTypeAnnotations, true);
+        test(cf, m, Attribute.RuntimeInvisibleTypeAnnotations, false);
+    }
+
+    // test the result of Attributes.getIndex according to expectations
+    // encoded in the method's name
+    void test(ClassFile cf, String name, boolean visible) {
+        int index = cf.attributes.getIndex(cf.constant_pool, name);
+        if (index != -1) {
+            Attribute attr = cf.attributes.get(index);
+            assert attr instanceof RuntimeTypeAnnotations_attribute;
+            RuntimeTypeAnnotations_attribute tAttr = (RuntimeTypeAnnotations_attribute)attr;
+            all += tAttr.annotations.length;
+            if (visible)
+                visibles += tAttr.annotations.length;
+            else
+                invisibles += tAttr.annotations.length;
+
+            for (ExtendedAnnotation anno : tAttr.annotations)
+                anno.position.toString();
+        }
+    }
+
+    // test the result of Attributes.getIndex according to expectations
+    // encoded in the method's name
+    void test(ClassFile cf, Method m, String name, boolean visible) {
+        int index = m.attributes.getIndex(cf.constant_pool, name);
+        if (index != -1) {
+            Attribute attr = m.attributes.get(index);
+            assert attr instanceof RuntimeTypeAnnotations_attribute;
+            RuntimeTypeAnnotations_attribute tAttr = (RuntimeTypeAnnotations_attribute)attr;
+            all += tAttr.annotations.length;
+            if (visible)
+                visibles += tAttr.annotations.length;
+            else
+                invisibles += tAttr.annotations.length;
+
+            for (ExtendedAnnotation anno : tAttr.annotations)
+                anno.position.toString();
+        }
+    }
+
+    // test the result of Attributes.getIndex according to expectations
+    // encoded in the method's name
+    void test(ClassFile cf, Field m, String name, boolean visible) {
+        int index = m.attributes.getIndex(cf.constant_pool, name);
+        if (index != -1) {
+            Attribute attr = m.attributes.get(index);
+            assert attr instanceof RuntimeTypeAnnotations_attribute;
+            RuntimeTypeAnnotations_attribute tAttr = (RuntimeTypeAnnotations_attribute)attr;
+            all += tAttr.annotations.length;
+            if (visible)
+                visibles += tAttr.annotations.length;
+            else
+                invisibles += tAttr.annotations.length;
+
+            for (ExtendedAnnotation anno : tAttr.annotations)
+                anno.position.toString();
+        }
+    }
+
+    File writeTestFile() throws IOException {
+      File f = new File("Testa.java");
+        PrintWriter out = new PrintWriter(new BufferedWriter(new FileWriter(f)));
+        out.println("import java.util.*;");
+        out.println("class Testa { ");
+        out.println("  @interface A { }");
+
+        out.println(" void test() {");
+        out.println("  Object a = @A String.class;");
+        out.println("  Object b = @A String @A [] @A [].class;");
+        out.println(" }");
+        out.println("}");
+
+        out.close();
+        return f;
+    }
+
+    File compileTestFile(File f) {
+      int rc = com.sun.tools.javac.Main.compile(new String[] { "-source", "1.7", "-g", f.getPath() });
+        if (rc != 0)
+            throw new Error("compilation failed. rc=" + rc);
+        String path = f.getPath();
+        return new File(path.substring(0, path.length() - 5) + ".class");
+    }
+
+    void countAnnotations() {
+        int expected_visibles = 0, expected_invisibles = 4;
+        int expected_all = expected_visibles + expected_invisibles;
+
+        if (expected_all != all) {
+            errors++;
+            System.err.println("expected " + expected_all
+                    + " annotations but found " + all);
+        }
+
+        if (expected_visibles != visibles) {
+            errors++;
+            System.err.println("expected " + expected_visibles
+                    + " visibles annotations but found " + visibles);
+        }
+
+        if (expected_invisibles != invisibles) {
+            errors++;
+            System.err.println("expected " + expected_invisibles
+                    + " invisibles annotations but found " + invisibles);
+        }
+
+    }
+
+    int errors;
+    int all;
+    int visibles;
+    int invisibles;
+}
diff --git a/make/README.pre-components b/make/README.pre-components
index 8d2eab5..cb79e68 100644
--- a/make/README.pre-components
+++ b/make/README.pre-components
@@ -18,7 +18,7 @@
   ALT_LANGTOOLS_DIST    The dist area from a langtools build to use, if provided
   ALT_OUTPUTDIR         Parent dir of build and dist directories, if provided
   VARIANT               If DBG, debug build, if OPT, optimized build
-  TARGET_CLASS_VERSION  The classfile version number (currently 5)
+  TARGET_CLASS_VERSION  The classfile version number (currently 7)
   ANT_HOME              Home of ant to use, if provided
   QUIET                 If defined, be quiet
   VERBOSE               If defined, be verbose