changeset 4078:6ff36c6e0cf4

Merge
author lana
date Sun, 10 Apr 2011 10:23:28 -0700
parents 376a971344a3 ef4492cbf1d7
children f1ebf4c57417
files src/share/classes/java/nio/BufferPoolMXBean.java src/share/classes/java/util/logging/PlatformLoggingMXBean.java src/windows/native/java/net/NetworkInterface_win9x.c test/java/nio/BufferPoolMXBean/Basic.java test/java/util/logging/PlatformLoggingMXBean/PlatformLoggingMXBeanTest.java
diffstat 286 files changed, 11787 insertions(+), 9213 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/make/common/Defs-embedded.gmk	Sun Apr 10 10:23:28 2011 -0700
@@ -0,0 +1,53 @@
+#
+# Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# This code is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License version 2 only, as
+# published by the Free Software Foundation.  Oracle designates this
+# particular file as subject to the "Classpath" exception as provided
+# by Oracle in the LICENSE file that accompanied this code.
+#
+# This code is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+# version 2 for more details (a copy is included in the LICENSE file that
+# accompanied this code).
+#
+# You should have received a copy of the GNU General Public License version
+# 2 along with this work; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+# or visit www.oracle.com if you need additional information or have any
+# questions.
+#
+
+#
+# Variable definitions for SE Embedded builds.  This file should
+# not contain rules.
+#
+ifdef JAVASE_EMBEDDED
+
+# Compress jar files
+COMPRESS_JARS = true
+
+# Don't mmap zip files
+LIBZIP_CAN_USE_MMAP = false
+
+# Disable ALSA version check
+REQUIRED_ALSA_VERSION =
+
+# Compilation settings
+OTHER_CPPFLAGS += -DJAVASE_EMBEDDED
+
+# Product naming
+PRODUCT_SUFFIX = SE Runtime Environment for Embedded
+RUNTIME_NAME = $(PRODUCT_NAME) $(PRODUCT_SUFFIX)
+
+# Reduced JRE locations
+JRE_REDUCED_HEADLESS_IMAGE_DIR = $(ABS_OUTPUTDIR)/j2re-reduced-headless-image
+JRE_REDUCED_IMAGE_DIR = $(ABS_OUTPUTDIR)/j2re-reduced-image
+
+endif # JAVASE_EMBEDDED
+
--- a/make/common/Defs.gmk	Thu Apr 07 15:21:10 2011 -0700
+++ b/make/common/Defs.gmk	Sun Apr 10 10:23:28 2011 -0700
@@ -116,6 +116,12 @@
 include $(JDK_TOPDIR)/make/common/Defs-$(PLATFORM).gmk
 
 #
+# SE-Embedded support, if enabled
+#
+
+include $(JDK_TOPDIR)/make/common/Defs-embedded.gmk
+
+#
 # Cross-compilation Settings
 #
 ifdef CROSS_COMPILE_ARCH
@@ -144,7 +150,6 @@
   VM_NAME = client
 endif
 
-
 #
 # Freetype logic is applicable to OpenJDK only
 #
--- a/make/common/Library.gmk	Thu Apr 07 15:21:10 2011 -0700
+++ b/make/common/Library.gmk	Sun Apr 10 10:23:28 2011 -0700
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 1995, 2010, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 1995, 2011, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -78,7 +78,7 @@
 endif
 
 $(ACTUAL_LIBRARY):: $(INIT) $(TEMPDIR) $(LIBDIR) $(BINDIR) $(EXTDIR) classheaders
-
+	@$(ECHO) Building lib:$(ACTUAL_LIBRARY) 
 #
 # COMPILE_APPROACH: Different approaches to compile up the native object
 #   files as quickly as possible.
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/make/common/Release-embedded.gmk	Sun Apr 10 10:23:28 2011 -0700
@@ -0,0 +1,232 @@
+#
+# Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# This code is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License version 2 only, as
+# published by the Free Software Foundation.  Oracle designates this
+# particular file as subject to the "Classpath" exception as provided
+# by Oracle in the LICENSE file that accompanied this code.
+#
+# This code is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+# version 2 for more details (a copy is included in the LICENSE file that
+# accompanied this code).
+#
+# You should have received a copy of the GNU General Public License version
+# 2 along with this work; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+# or visit www.oracle.com if you need additional information or have any
+# questions.
+#
+
+#
+# SE-Embedded Reduced JRE targets
+#
+ifdef JAVASE_EMBEDDED
+
+reduced-image-jre reduced-headless-image-jre ::
+	@$(ECHO) ">>>Making "$@" @ `$(DATE)` ..."
+
+# Add the reduced-jre images as pre-reqs. These will be processed last
+images:: reduced-image-jre reduced-headless-image-jre
+
+
+######################################################
+# Create the headless rt.jar
+######################################################
+
+NOT_HEADLESS_RT_JAR_LIST = $(ABS_TEMPDIR)/not_hl_rt_jar.list
+HEADLESS_RT_JAR_FILELIST=$(JARFILELISTS_TEMPDIR)/hl_rt_jar_list
+TOTAL_HEADLESS_JAR_FILELIST=$(REORDER_TEMPDIR)/hl_file_list
+HEADLESS_CLASSLIST=$(ABS_TEMPDIR)/headless_classlist
+
+# Add the jar file directories that we don't want in the
+# headless JRE.  If you want to remove most classes in a
+# directory, put the directory in the NOT_HEADLESS_RT_JAR_LIST
+# and put the individual classes you want to keep in the 
+# HEADLESS_CLASSLIST file. 
+$(NOT_HEADLESS_RT_JAR_LIST): $(NOT_RT_JAR_LIST)
+	$(RM) $(HEADLESS_CLASSLIST)
+	$(RM) $(NOT_HEADLESS_RT_JAR_LIST)
+	$(CP) $(NOT_RT_JAR_LIST) $(NOT_HEADLESS_RT_JAR_LIST)
+	$(ECHO) "sun/awt/motif/" >> $@
+	$(ECHO) "sun/awt/X11/" >> $@
+	$(ECHO) "sun/applet/" >> $@
+	$(ECHO) "sun/java2d/opengl/" >> $@
+	$(ECHO) "com/sun/java/swing/plaf/" >> $@
+	$(ECHO) "sun/awt/motif/MFontConfiguration" >$(HEADLESS_CLASSLIST)
+	$(ECHO) "sun/applet/AppContextCreator" >>$(HEADLESS_CLASSLIST)
+	$(ECHO) "sun/applet/AppletAudioClip" >>$(HEADLESS_CLASSLIST)
+	$(ECHO) "sun/java2d/opengl/GLXSurfaceData" >>$(HEADLESS_CLASSLIST)
+	$(ECHO) "sun/java2d/opengl/GLXSurfaceData"\$$"GLXOffScreenSurfaceData" >>$(HEADLESS_CLASSLIST)
+	$(ECHO) "sun/java2d/opengl/GLXVolatileSurfaceManager" >>$(HEADLESS_CLASSLIST)
+	$(ECHO) "sun/java2d/opengl/OGLSurfaceData" >>$(HEADLESS_CLASSLIST)
+
+$(TOTAL_HEADLESS_JAR_FILELIST): $(JARREORDER_JARFILE) $(NOT_HEADLESS_RT_JAR_LIST)
+	$(prep-target)
+	$(RM) $@.temp
+	$(CD) $(CLASSBINDIR) ; \
+		$(BOOT_JAVA_CMD) -jar $(JARREORDER_JARFILE) \
+		-o  $@.temp $(HEADLESS_CLASSLIST) $(NOT_HEADLESS_RT_JAR_LIST)  .
+	$(MV) $@.temp $@
+	@$(CD) $(CLASSBINDIR); $(java-vm-cleanup)
+
+# Create the headless rt.jar file list & non-class files list
+MakeHeadlessJarFileList: $(TOTAL_HEADLESS_JAR_FILELIST) $(JARSPLIT_JARFILE)
+	@$(RM) $(HEADLESS_RT_JAR_FILELIST) $(RES_JAR_FILELIST)
+	$(BOOT_JAVA_CMD) -jar $(JARSPLIT_JARFILE) $(TOTAL_HEADLESS_JAR_FILELIST) \
+		-o  $(HEADLESS_RT_JAR_FILELIST) $(RES_JAR_FILELIST)
+	@$(java-vm-cleanup)
+
+# Create headless rt.jar
+HL_RT_JAR=$(ABS_TEMPDIR)/rt-hl-orig.jar
+$(HL_RT_JAR): MakeHeadlessJarFileList $(JAR_MANIFEST_FILE)
+	$(prep-target)
+	$(CD) $(CLASSBINDIR) ; \
+		$(BOOT_JAR_CMD) $(CREATE_JAR_OPTS) $(JAR_MANIFEST_FILE) $@ @$(HEADLESS_RT_JAR_FILELIST) \
+		 $(JAR_JFLAGS)
+	@$(CD) $(CLASSBINDIR); $(java-vm-cleanup)
+
+
+#
+# Produce a reduced Headful JRE for Embedded Devices
+#
+# The deployment binaries are added during the deployment build process
+#
+
+# Binaries that don't get included in reduced jre image bin directory
+NOT_REDUCEDJRE_BIN = \
+ java_vm \
+ kinit \
+ klist \
+ ktab \
+ orbd \
+ policytool \
+ rmid \
+ rmiregistry \
+ servertool \
+ tnameserv \
+ pack200 \
+ unpack200
+
+# jars/resources/libs that don't get included in reduced jre image lib directory
+NOT_REDUCEDJRE_LIB = \
+ charsets.jar \
+ ext/dnsns.jar \
+ ext/localedata.jar \
+ $(LIBARCH)/client/classes.jsa \
+ $(LIBARCH)/libjavaplugin_jni.so \
+ $(LIBARCH)/libjavaplugin_nscp_gcc29.so \
+ $(LIBARCH)/libjavaplugin_nscp.so \
+ $(LIBARCH)/libjavaplugin_oji.so
+
+
+ifeq ($(PLATFORM), linux)
+  STRIP_OPTS = --strip-unneeded
+else
+  STRIP_OPTS = -x
+endif
+
+
+reduced-image-jre::
+	@$(ECHO) Starting to Produce Reduced JRE
+	@#
+	@# First make a copy of the full JRE
+	@#
+	$(RM) -r $(JRE_REDUCED_IMAGE_DIR)
+	$(MKDIR) -p $(JRE_REDUCED_IMAGE_DIR)
+	$(CD) $(JRE_IMAGE_DIR); \
+	    $(TAR) cf - . | ($(CD) $(JRE_REDUCED_IMAGE_DIR); $(TAR) xf - ); 
+
+	@# strip the main .so files
+	$(STRIP) $(STRIP_OPTS) $(JRE_REDUCED_IMAGE_DIR)/lib/$(LIBARCH)/client/libjvm.so
+ifndef BUILD_CLIENT_ONLY
+	$(STRIP) $(STRIP_OPTS) $(JRE_REDUCED_IMAGE_DIR)/lib/$(LIBARCH)/server/libjvm.so
+endif
+
+	@#
+	@# Remove all of the files that are not needed for the
+	@# reduced JRE
+	@#
+	for l in $(NOT_REDUCEDJRE_BIN) ; do \
+	    $(RM) $(JRE_REDUCED_IMAGE_DIR)/bin/$$l ; \
+	done
+	for l in $(NOT_REDUCEDJRE_LIB) ; do \
+	    $(RM) $(JRE_REDUCED_IMAGE_DIR)/lib/$$l ; \
+	done
+
+	@# Remove misc. other files
+	$(RM) -r $(JRE_REDUCED_IMAGE_DIR)/man
+	$(RM) -f $(JRE_REDUCED_IMAGE_DIR)/CHANGES
+
+	@$(ECHO) Done Creating Reduced JRE
+
+#
+# Produce a reduced Headless JRE
+#
+reduced-headless-image-jre:: $(RT_JAR) $(RESOURCES_JAR) $(BUILD_META_INDEX) $(HL_RT_JAR)
+	@$(ECHO) Starting to Produce Reduced Headless JRE
+	@#
+	@# First make a copy of the reduced JRE we just built
+	@#
+	$(RM) -r $(JRE_REDUCED_HEADLESS_IMAGE_DIR)
+	$(MKDIR) -p $(JRE_REDUCED_HEADLESS_IMAGE_DIR)
+	$(CD) $(JRE_REDUCED_IMAGE_DIR); \
+	    $(TAR) cf - . | ($(CD) $(JRE_REDUCED_HEADLESS_IMAGE_DIR); $(TAR) xf - ); 
+
+	@# Replace the full rt.jar with the headless rt.jar
+	$(RM) -f $(JRE_REDUCED_HEADLESS_IMAGE_DIR)/lib/rt.jar
+	$(CP) $(HL_RT_JAR) $(JRE_REDUCED_HEADLESS_IMAGE_DIR)/lib/rt.jar
+
+	@#
+	@# Remove all of the files that are not needed for the
+	@# reduced Headless JRE
+	@#
+	$(RM) -f $(JRE_REDUCED_HEADLESS_IMAGE_DIR)/lib/$(LIBARCH)/gtkhelper
+	$(RM)  $(JRE_REDUCED_HEADLESS_IMAGE_DIR)/lib/$(LIBARCH)/libjsoundalsa.so
+	$(RM) -r $(JRE_REDUCED_HEADLESS_IMAGE_DIR)/lib/audio
+	$(RM) -fr $(JRE_REDUCED_HEADLESS_IMAGE_DIR)/lib/applet
+	$(RM)  $(JRE_REDUCED_HEADLESS_IMAGE_DIR)/lib/$(LIBARCH)/awt_robot
+	$(RM) -r $(JRE_REDUCED_HEADLESS_IMAGE_DIR)/lib/$(LIBARCH)/xawt
+	$(RM) -r $(JRE_REDUCED_HEADLESS_IMAGE_DIR)/lib/$(LIBARCH)/libsplashscreen.so
+	@# Remove oblique fonts and reduce font support to LucidaSansRegular only
+	$(RM) -fr $(JRE_REDUCED_HEADLESS_IMAGE_DIR)/lib/oblique-fonts
+	$(RM) -f $(JRE_REDUCED_HEADLESS_IMAGE_DIR)/lib/fonts/LucidaBrightDemiBold.ttf
+	$(RM) -f $(JRE_REDUCED_HEADLESS_IMAGE_DIR)/lib/fonts/LucidaBrightDemiItalic.ttf
+	$(RM) -f $(JRE_REDUCED_HEADLESS_IMAGE_DIR)/lib/fonts/LucidaBrightItalic.ttf
+	$(RM) -f $(JRE_REDUCED_HEADLESS_IMAGE_DIR)/lib/fonts/LucidaBrightRegular.ttf
+	$(RM) -f $(JRE_REDUCED_HEADLESS_IMAGE_DIR)/lib/fonts/LucidaSansDemiBold.ttf
+	$(RM) -f $(JRE_REDUCED_HEADLESS_IMAGE_DIR)/lib/fonts/LucidaTypewriterBold.ttf
+	$(RM) -f $(JRE_REDUCED_HEADLESS_IMAGE_DIR)/lib/fonts/LucidaTypewriterRegular.ttf
+
+ifeq ($(PLATFORM), linux)
+# put out minimal fonts.dir file for the remaining font
+	$(RM) -f $(JRE_REDUCED_HEADLESS_IMAGE_DIR)/lib/fonts/fonts.dir
+	$(ECHO) 6>$(JRE_REDUCED_HEADLESS_IMAGE_DIR)/lib/fonts/fonts.dir
+	$(ECHO) "LucidaSansRegular.ttf -b&h-lucidasans-medium-r-normal-sans-0-0-0-0-p-0-iso8859-1">>$(JRE_REDUCED_HEADLESS_IMAGE_DIR)/lib/fonts/fonts.dir
+	$(ECHO) "LucidaSansRegular.ttf -b&h-lucidasans-medium-r-normal-sans-0-0-0-0-p-0-iso8859-2">>$(JRE_REDUCED_HEADLESS_IMAGE_DIR)/lib/fonts/fonts.dir
+	$(ECHO) "LucidaSansRegular.ttf -b&h-lucidasans-medium-r-normal-sans-0-0-0-0-p-0-iso8859-4">>$(JRE_REDUCED_HEADLESS_IMAGE_DIR)/lib/fonts/fonts.dir
+	$(ECHO) "LucidaSansRegular.ttf -b&h-lucidasans-medium-r-normal-sans-0-0-0-0-p-0-iso8859-5">>$(JRE_REDUCED_HEADLESS_IMAGE_DIR)/lib/fonts/fonts.dir
+	$(ECHO) "LucidaSansRegular.ttf -b&h-lucidasans-medium-r-normal-sans-0-0-0-0-p-0-iso8859-7">>$(JRE_REDUCED_HEADLESS_IMAGE_DIR)/lib/fonts/fonts.dir
+	$(ECHO) "LucidaSansRegular.ttf -b&h-lucidasans-medium-r-normal-sans-0-0-0-0-p-0-iso8859-9">>$(JRE_REDUCED_HEADLESS_IMAGE_DIR)/lib/fonts/fonts.dir
+
+endif # Linux
+
+	@#
+	@# all done with JRE reduced headless image
+	@#
+
+	@$(ECHO) Done Creating Reduced Headless JRE
+
+images-clobber::
+	$(RM) -r $(JRE_REDUCED_IMAGE_DIR)
+	$(RM) -r $(JRE_REDUCED_HEADLESS_IMAGE_DIR)
+
+.PHONY: reduced-image-jre reduced-headless-image-jre 
+
+endif # JAVASE_EMBEDDED
+
--- a/make/common/Release.gmk	Thu Apr 07 15:21:10 2011 -0700
+++ b/make/common/Release.gmk	Sun Apr 10 10:23:28 2011 -0700
@@ -38,7 +38,7 @@
 
 IMAGE_BINDIR = bin
 
-# The compiler should not issue a "Sun Propietary" warning when compiling
+# The compiler should not issue a "Proprietary" warning when compiling
 # classes in the com.sun.java.swing.plaf packages, since we've always
 # allowed, and even advocated, extending them (see bug 6476749).
 #
@@ -195,6 +195,16 @@
 fi
 endef
 
+
+# no compression unless requested
+ifndef COMPRESS_JARS
+  CREATE_JAR_OPTS = c0mf
+  CREATE_JAR_OPTS_NOMANIFEST = c0f
+else
+  CREATE_JAR_OPTS = cmf
+  CREATE_JAR_OPTS_NOMANIFEST = cf
+endif
+
 #
 # Targets.
 #
@@ -222,7 +232,7 @@
 	 $(INITIAL_IMAGE_JRE) $(INITIAL_IMAGE_JDK) \
 	 trim-image-jre trim-image-jdk \
          identify-image-jre identify-image-jdk \
-	 process-image-jre process-image-jdk sec-files sec-files-win jgss-files
+	 process-image-jre process-image-jdk sec-files sec-files-win jgss-files 
 
 # Don't use these
 image-jre:: initial-image-jre trim-image-jre identify-image-jre process-image-jre
@@ -613,7 +623,7 @@
 $(RESOURCES_JAR): $(RES_JAR_FILELIST) $(JAR_MANIFEST_FILE)
 	$(prep-target)
 	$(CD) $(CLASSBINDIR) && \
-	    $(BOOT_JAR_CMD) c0mf $(JAR_MANIFEST_FILE) $@ \
+	    $(BOOT_JAR_CMD) $(CREATE_JAR_OPTS) $(JAR_MANIFEST_FILE) $@ \
 	        @$(RES_JAR_FILELIST) $(BOOT_JAR_JFLAGS)
 	@$(CD) $(CLASSBINDIR) && $(java-vm-cleanup)
 
@@ -622,7 +632,7 @@
 $(JSSE_JAR): $(JAR_MANIFEST_FILE)
 	$(prep-target)
 	$(CD) $(CLASSBINDIR) && \
-	    $(BOOT_JAR_CMD) c0mf $(JAR_MANIFEST_FILE) $@ \
+	    $(BOOT_JAR_CMD) $(CREATE_JAR_OPTS) $(JAR_MANIFEST_FILE) $@ \
 		$(JSSE_CLASSES_DIRS) $(BOOT_JAR_JFLAGS)
 	@$(CD) $(CLASSBINDIR) && $(java-vm-cleanup)
 
@@ -669,7 +679,7 @@
 $(RT_JAR): $(RT_JAR_FILELIST) $(JAR_MANIFEST_FILE)
 	$(prep-target)
 	$(CD) $(CLASSBINDIR) && \
-	    $(BOOT_JAR_CMD) c0mf $(JAR_MANIFEST_FILE) $@ \
+	    $(BOOT_JAR_CMD) $(CREATE_JAR_OPTS) $(JAR_MANIFEST_FILE) $@ \
 	        @$(RT_JAR_FILELIST) $(BOOT_JAR_JFLAGS)
 	@$(CD) $(CLASSBINDIR) && $(java-vm-cleanup)
 
@@ -677,6 +687,10 @@
 
 BUILDMETAINDEX_JARFILE = $(ABS_BUILDTOOLJARDIR)/buildmetaindex.jar
 
+# SE-Embedded targets if enabled
+include $(JDK_TOPDIR)/make/common/Release-embedded.gmk
+
+
 ######################################################
 # JRE Image
 ######################################################
@@ -924,7 +938,7 @@
 	@# lib/tools.jar
 	@#
 	$(CD) $(CLASSBINDIR) && \
-	    $(BOOT_JAR_CMD) c0f $(ABS_LIBDIR)/tools.jar \
+	    $(BOOT_JAR_CMD) $(CREATE_JAR_OPTS_NOMANIFEST) $(ABS_LIBDIR)/tools.jar \
 	        $(TOOLS) $(BOOT_JAR_JFLAGS)
 	@$(CD) $(CLASSBINDIR) && $(java-vm-cleanup)
 	$(CP) $(LIBDIR)/tools.jar $(JDK_IMAGE_DIR)/lib/tools.jar
@@ -937,7 +951,7 @@
 	    -Acom.sun.tools.javac.sym.Jar=$(RT_JAR) \
 	    -Acom.sun.tools.javac.sym.Dest=$(OUTPUTDIR)/symbols/META-INF/sym/rt.jar \
 	    $(CORE_PKGS) $(NON_CORE_PKGS) $(EXCLUDE_PROPWARN_PKGS) $(EXPORTED_PRIVATE_PKGS)
-	$(BOOT_JAR_CMD) c0f $(LIBDIR)/ct.sym \
+	$(BOOT_JAR_CMD) $(CREATE_JAR_OPTS_NOMANIFEST) $(LIBDIR)/ct.sym \
 	    -C $(OUTPUTDIR)/symbols META-INF $(BOOT_JAR_JFLAGS)
 	@$(java-vm-cleanup)
 	$(CP) $(LIBDIR)/ct.sym $(JDK_IMAGE_DIR)/lib/ct.sym
--- a/make/common/shared/Sanity-Settings.gmk	Thu Apr 07 15:21:10 2011 -0700
+++ b/make/common/shared/Sanity-Settings.gmk	Sun Apr 10 10:23:28 2011 -0700
@@ -185,7 +185,9 @@
   endif
 endif
 ifeq ($(PLATFORM),linux)
-  ALL_SETTINGS+=$(call addRequiredSetting,ALSA_VERSION)
+  ifdef REQUIRED_ALSA_VERSION
+    ALL_SETTINGS+=$(call addRequiredSetting,ALSA_VERSION)
+  endif
 endif
 ALL_SETTINGS+=$(call addRequiredVersionSetting,OS_VERSION)
 ALL_SETTINGS+=$(call addOptionalSetting,OS_VARIANT_NAME)
--- a/make/java/java/Makefile	Thu Apr 07 15:21:10 2011 -0700
+++ b/make/java/java/Makefile	Sun Apr 10 10:23:28 2011 -0700
@@ -198,10 +198,12 @@
 
 #
 # What to link?
+# On Windows, shell32 is not normally required and so it is delay loaded.
 #
 ifeq ($(PLATFORM),windows)
 OTHER_LDLIBS += $(JVMLIB) -libpath:$(OBJDIR)/../../../fdlibm/$(OBJDIRNAME) fdlibm.lib \
-		       -libpath:$(OBJDIR)/../../../verify/$(OBJDIRNAME) verify.lib
+		       -libpath:$(OBJDIR)/../../../verify/$(OBJDIRNAME) verify.lib \
+		       shell32.lib delayimp.lib /DELAYLOAD:shell32.dll
 else
 OTHER_LDLIBS += $(JVMLIB) -lverify $(LIBSOCKET) $(LIBNSL) -ldl \
 		-L$(OBJDIR)/../../../fdlibm/$(OBJDIRNAME) -lfdlibm.$(ARCH)
--- a/make/java/management/Makefile	Thu Apr 07 15:21:10 2011 -0700
+++ b/make/java/management/Makefile	Sun Apr 10 10:23:28 2011 -0700
@@ -86,7 +86,8 @@
   -I$(SHARE_SRC)/native/sun/management 
 
 ifeq ($(PLATFORM),windows)
-  OTHER_LDLIBS += $(JVMLIB)
+  # Need process status helper API (psapi) on Windows
+  OTHER_LDLIBS += $(JVMLIB) psapi.lib
 endif
 
 #
--- a/make/java/net/Makefile	Thu Apr 07 15:21:10 2011 -0700
+++ b/make/java/net/Makefile	Sun Apr 10 10:23:28 2011 -0700
@@ -37,10 +37,6 @@
 AUTO_FILES_JAVA_DIRS = java/net
 
 ifeq ($(PLATFORM), windows)
-    # Windows 9x module only needed on 32-bit build
-    ifeq ($(ARCH_DATA_MODEL), 32)
-	FILES_c += NetworkInterface_win9x.c
-    endif
     FILES_c += NTLMAuthSequence.c
     FILES_c += NetworkInterface_winXP.c
 else
@@ -96,7 +92,9 @@
 include $(BUILDDIR)/common/Library.gmk
 
 ifeq ($(PLATFORM), windows)
-  OTHER_LDLIBS = ws2_32.lib $(JVMLIB)
+  OTHER_LDLIBS = ws2_32.lib $(JVMLIB) \
+                 secur32.lib iphlpapi.lib delayimp.lib \
+                 /DELAYLOAD:secur32.dll /DELAYLOAD:iphlpapi.dll
 else
   OTHER_LDLIBS = $(LIBSOCKET) $(LIBNSL) -ldl $(JVMLIB)
 endif
--- a/make/java/zip/Makefile	Thu Apr 07 15:21:10 2011 -0700
+++ b/make/java/zip/Makefile	Sun Apr 10 10:23:28 2011 -0700
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 1996, 2010, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 1996, 2011, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -50,7 +50,10 @@
 	java/util/jar/JarFile.java
 
 ifneq ($(PLATFORM), windows)
-OTHER_CFLAGS += -DUSE_MMAP
+  # Use mmap unless explicitly disallowed
+  ifneq ($(LIBZIP_CAN_USE_MMAP),false)
+    OTHER_CFLAGS += -DUSE_MMAP
+  endif
 endif
 
 #
--- a/make/jprt.properties	Thu Apr 07 15:21:10 2011 -0700
+++ b/make/jprt.properties	Sun Apr 10 10:23:28 2011 -0700
@@ -52,8 +52,11 @@
     ${jprt.my.windows.i586}-{product|fastdebug}, 		\
     windows_x64_5.2-{product|fastdebug}
 
+# User can select the test set with jprt submit "-testset name" option
+jprt.my.test.set=${jprt.test.set}
+
 # Standard vm test target
-jprt.test.targets=						\
+jprt.vm.default.test.targets=					\
     solaris_sparc_5.10-product-c1-jvm98, 			\
     solaris_sparcv9_5.10-product-c2-jvm98, 			\
     solaris_i586_5.10-product-c1-jvm98, 			\
@@ -63,8 +66,10 @@
     ${jprt.my.windows.i586}-product-c1-jvm98, 			\
     windows_x64_5.2-product-c2-jvm98
 
-# User can select the test set with jprt submit "-testset name" option
-jprt.my.test.set=${jprt.test.set}
+# Select vm testlist to use (allow for testset to be empty too)
+jprt.vm.all.test.targets=${jprt.vm.default.test.targets}
+jprt.vm..test.targets=${jprt.vm.default.test.targets} 
+jprt.test.targets=${jprt.vm.${jprt.my.test.set}.test.targets} 
 
 # Default jdk test targets in test/Makefile (no fastdebug & limited c2)
 jprt.make.rule.default.test.targets=				\
@@ -281,6 +286,21 @@
     ${jprt.my.windows.i586}-product-c1-jdk_tools2, 		\
     windows_x64_5.2-product-c2-jdk_tools2
 
+# JCK test targets in test/Makefile (no fastdebug & limited c2, windows broken)
+jprt.my.jck.test.target.set=					\
+    solaris_sparc_5.10-product-c1-JCK7TESTRULE, 		\
+    solaris_sparcv9_5.10-product-c2-JCK7TESTRULE, 		\
+    solaris_i586_5.10-product-c1-JCK7TESTRULE, 			\
+    solaris_x64_5.10-product-c2-JCK7TESTRULE, 			\
+    linux_i586_2.6-product-c1-JCK7TESTRULE, 			\
+    linux_x64_2.6-product-c2-JCK7TESTRULE
+
+# JCK testset targets (e.g. jprt submit -testset jck ... )
+jprt.make.rule.jck.test.targets=				\
+    ${jprt.my.jck.test.target.set:JCK7TESTRULE=jck7devtools},   \
+    ${jprt.my.jck.test.target.set:JCK7TESTRULE=jck7runtime},    \
+    ${jprt.my.jck.test.target.set:JCK7TESTRULE=jck7compiler}
+
 # Select list to use (allow for testset to be empty too)
 jprt.make.rule..test.targets=${jprt.make.rule.default.test.targets} 
 jprt.make.rule.test.targets=${jprt.make.rule.${jprt.my.test.set}.test.targets} 
--- a/make/launchers/Makefile	Thu Apr 07 15:21:10 2011 -0700
+++ b/make/launchers/Makefile	Sun Apr 10 10:23:28 2011 -0700
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2004, 2011, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -44,8 +44,17 @@
 endef
 
 # Run MAKE $@ for all generic launchers
+ifndef BUILD_HEADLESS_ONLY
+define make-appletviewer
+$(call make-launcher, appletviewer, sun.applet.Main, , )
+endef
+else
+define make-appletviewer
+endef
+endif
+
 define make-all-launchers
-$(call make-launcher, appletviewer, sun.applet.Main, , )
+$(make-appletviewer)
 $(call make-launcher, apt, com.sun.tools.apt.Main, , )
 $(call make-launcher, extcheck, com.sun.tools.extcheck.Main, , )
 $(call make-launcher, idlj, com.sun.tools.corba.se.idl.toJavaPortable.Compile, , )
--- a/make/mkdemo/jfc/Makefile	Thu Apr 07 15:21:10 2011 -0700
+++ b/make/mkdemo/jfc/Makefile	Sun Apr 10 10:23:28 2011 -0700
@@ -39,7 +39,8 @@
     Notepad         \
     SampleTree      \
     SwingApplet     \
-    TableExample
+    TableExample    \
+    TransparentRuler
 
 # Some demos aren't currently included in OpenJDK
 ifndef OPENJDK
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/make/mkdemo/jfc/TransparentRuler/Makefile	Sun Apr 10 10:23:28 2011 -0700
@@ -0,0 +1,44 @@
+#
+# Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# This code is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License version 2 only, as
+# published by the Free Software Foundation.  Oracle designates this
+# particular file as subject to the "Classpath" exception as provided
+# by Oracle in the LICENSE file that accompanied this code.
+#
+# This code is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+# version 2 for more details (a copy is included in the LICENSE file that
+# accompanied this code).
+#
+# You should have received a copy of the GNU General Public License version
+# 2 along with this work; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+# or visit www.oracle.com if you need additional information or have any
+# questions.
+#
+
+#
+# Makefile to build the TransparentRuler demo.
+#
+
+BUILDDIR = ../../..
+PRODUCT = demo/jfc
+DEMONAME = TransparentRuler
+include $(BUILDDIR)/common/Defs.gmk
+
+DEMO_ROOT       = $(SHARE_SRC)/demo/jfc/$(DEMONAME)
+DEMO_TOPFILES	= ./README.txt
+DEMO_MAINCLASS  = transparentruler.Ruler
+DEMO_DESTDIR    = $(DEMODIR)/jfc/$(DEMONAME)
+
+
+#
+# Demo jar building rules.
+#
+include $(BUILDDIR)/common/Demo.gmk
--- a/make/sun/Makefile	Thu Apr 07 15:21:10 2011 -0700
+++ b/make/sun/Makefile	Sun Apr 10 10:23:28 2011 -0700
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 1995, 2010, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 1995, 2011, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -69,10 +69,17 @@
 
 # nio need to be compiled before awt to have all charsets ready
 SUBDIRS            = jar security javazic misc net nio text launcher
+
+ifdef BUILD_HEADLESS_ONLY
+  DISPLAY_LIBS = awt $(HEADLESS_SUBDIR)
+  DISPLAY_TOOLS = 
+else
+  DISPLAY_LIBS = awt splashscreen $(XAWT_SUBDIR) $(HEADLESS_SUBDIR)
+  DISPLAY_TOOLS = applet
+endif
 SUBDIRS_desktop    = audio $(RENDER_SUBDIR) image \
-                     awt splashscreen $(XAWT_SUBDIR) \
-                     $(HEADLESS_SUBDIR) $(DGA_SUBDIR) \
-                     jawt font jpeg cmm applet beans
+                     $(DISPLAY_LIBS) $(DGA_SUBDIR) \
+                     jawt font jpeg cmm $(DISPLAY_TOOLS) beans
 SUBDIRS_management = management
 SUBDIRS_misc       = $(ORG_SUBDIR) rmi $(JDBC_SUBDIR) tracing
 SUBDIRS_tools      = native2ascii serialver tools jconsole
--- a/make/sun/awt/mawt.gmk	Thu Apr 07 15:21:10 2011 -0700
+++ b/make/sun/awt/mawt.gmk	Sun Apr 10 10:23:28 2011 -0700
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2000, 2007, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -149,13 +149,13 @@
         LIBXT = -lXt
     else
     # Allows for builds on Debian GNU Linux, X11 is in a different place 
-       LIBXT = $(firstword $(wildcard /usr/X11R6/lib/libXt.a) \
+       LIBXT = $(firstword $(wildcard $(OPENWIN_LIB)/libXt.a) \
                         $(wildcard /usr/lib/libXt.a))
-       LIBSM = $(firstword $(wildcard /usr/X11R6/lib/libSM.a) \
+       LIBSM = $(firstword $(wildcard $(OPENWIN_LIB)/libSM.a) \
                         $(wildcard /usr/lib/libSM.a))
-       LIBICE = $(firstword $(wildcard /usr/X11R6/lib/libICE.a) \
+       LIBICE = $(firstword $(wildcard $(OPENWIN_LIB)/libICE.a) \
                          $(wildcard /usr/lib/libICE.a))
-       LIBXTST = $(firstword $(wildcard /usr/X11R6/lib/libXtst.a) \
+       LIBXTST = $(firstword $(wildcard $(OPENWIN_LIB)/libXtst.a) \
                          $(wildcard /usr/lib/libXtst.a))
    endif
 endif
@@ -224,9 +224,9 @@
         $(EVENT_MODEL)
 
 ifeq ($(PLATFORM), linux)
-# Checking for the X11/extensions headers at the additional location
-  CPPFLAGS += -I/X11R6/include/X11/extensions \
-              -I/usr/include/X11/extensions
+  # Checking for the X11/extensions headers at the additional location
+  CPPFLAGS += -I$(firstword $(wildcard $(OPENWIN_HOME)/include/X11/extensions) \
+                        $(wildcard /usr/include/X11/extensions))
 endif
 
 ifeq ($(PLATFORM), solaris)
--- a/make/sun/javazic/tzdata/VERSION	Thu Apr 07 15:21:10 2011 -0700
+++ b/make/sun/javazic/tzdata/VERSION	Sun Apr 10 10:23:28 2011 -0700
@@ -21,4 +21,4 @@
 # or visit www.oracle.com if you need additional information or have any
 # questions.
 #
-tzdata2011d
+tzdata2011e
--- a/make/sun/javazic/tzdata/africa	Thu Apr 07 15:21:10 2011 -0700
+++ b/make/sun/javazic/tzdata/africa	Sun Apr 10 10:23:28 2011 -0700
@@ -734,6 +734,48 @@
 # http://www.timeanddate.com/news/time/morocco-starts-dst-2010.html
 # </a>
 
+# From Dan Abitol (2011-03-30):
+# ...Rules for Africa/Casablanca are the following (24h format)
+# The 3rd april 2011 at 00:00:00, [it] will be 3rd april 1:00:00
+# The 31th july 2011 at 00:59:59,  [it] will be 31th July 00:00:00
+# ...Official links of change in morocco
+# The change was broadcast on the FM Radio
+# I ve called ANRT (telecom regulations in Morocco) at
+# +212.537.71.84.00
+# <a href="http://www.anrt.net.ma/fr/">
+# http://www.anrt.net.ma/fr/
+# </a>
+# They said that
+# <a href="http://www.map.ma/fr/sections/accueil/l_heure_legale_au_ma/view">
+# http://www.map.ma/fr/sections/accueil/l_heure_legale_au_ma/view
+# </a>
+# is the official publication to look at.
+# They said that the decision was already taken.
+#
+# More articles in the press
+# <a href="http://www.yabiladi.com/articles/details/5058/secret-l-heure-d-ete-maroc-lev">
+# http://www.yabiladi.com/articles/details/5058/secret-l-heure-d-ete-maroc-lev
+# </a>
+# e.html
+# <a href="http://www.lematin.ma/Actualite/Express/Article.asp?id=148923">
+# http://www.lematin.ma/Actualite/Express/Article.asp?id=148923
+# </a>
+# <a href="http://www.lavieeco.com/actualite/Le-Maroc-passe-sur-GMT%2B1-a-partir-de-dim">
+# http://www.lavieeco.com/actualite/Le-Maroc-passe-sur-GMT%2B1-a-partir-de-dim
+# anche-prochain-5538.html
+# </a>
+
+# From Petr Machata (2011-03-30):
+# They have it written in English here:
+# <a href="http://www.map.ma/eng/sections/home/morocco_to_spring_fo/view">
+# http://www.map.ma/eng/sections/home/morocco_to_spring_fo/view
+# </a>
+#
+# It says there that "Morocco will resume its standard time on July 31,
+# 2011 at midnight." Now they don't say whether they mean midnight of
+# wall clock time (i.e. 11pm UTC), but that's what I would assume. It has
+# also been like that in the past.
+
 # RULE	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
 
 Rule	Morocco	1939	only	-	Sep	12	 0:00	1:00	S
@@ -757,6 +799,8 @@
 Rule	Morocco	2009	only	-	Aug	 21	 0:00	0	-
 Rule	Morocco	2010	only	-	May	 2	 0:00	1:00	S
 Rule	Morocco	2010	only	-	Aug	 8	 0:00	0	-
+Rule	Morocco	2011	only	-	Apr	 3	 0:00	1:00	S
+Rule	Morocco	2011	only	-	Jul	 31	 0	0	-
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 Zone Africa/Casablanca	-0:30:20 -	LMT	1913 Oct 26
 			 0:00	Morocco	WE%sT	1984 Mar 16
--- a/make/sun/javazic/tzdata/southamerica	Thu Apr 07 15:21:10 2011 -0700
+++ b/make/sun/javazic/tzdata/southamerica	Sun Apr 10 10:23:28 2011 -0700
@@ -1193,6 +1193,19 @@
 # From Arthur David Olson (2011-03-02):
 # The emol.com article mentions a water shortage as the cause of the
 # postponement, which may mean that it's not a permanent change.
+
+# From Glenn Eychaner (2011-03-28):
+# The article:
+# <a href="http://diario.elmercurio.com/2011/03/28/_portada/_portada/noticias/7565897A-CA86-49E6-9E03-660B21A4883E.htm?id=3D{7565897A-CA86-49E6-9E03-660B21A4883E}">
+# http://diario.elmercurio.com/2011/03/28/_portada/_portada/noticias/7565897A-CA86-49E6-9E03-660B21A4883E.htm?id=3D{7565897A-CA86-49E6-9E03-660B21A4883E}
+# </a>
+#
+# In English:
+# Chile's clocks will go back an hour this year on the 7th of May instead
+# of this Saturday. They will go forward again the 3rd Saturday in
+# August, not in October as they have since 1968. This is a pilot plan
+# which will be reevaluated in 2012.
+
 # Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
 Rule	Chile	1927	1932	-	Sep	 1	0:00	1:00	S
 Rule	Chile	1928	1932	-	Apr	 1	0:00	0	-
@@ -1222,13 +1235,16 @@
 Rule	Chile	1998	only	-	Mar	Sun>=9	3:00u	0	-
 Rule	Chile	1998	only	-	Sep	27	4:00u	1:00	S
 Rule	Chile	1999	only	-	Apr	 4	3:00u	0	-
-Rule	Chile	1999	max	-	Oct	Sun>=9	4:00u	1:00	S
+Rule	Chile	1999	2010	-	Oct	Sun>=9	4:00u	1:00	S
+Rule	Chile	2011	only	-	Aug	Sun>=16	4:00u	1:00	S
+Rule	Chile	2012	max	-	Oct	Sun>=9	4:00u	1:00	S
 Rule	Chile	2000	2007	-	Mar	Sun>=9	3:00u	0	-
 # N.B.: the end of March 29 in Chile is March 30 in Universal time,
 # which is used below in specifying the transition.
 Rule	Chile	2008	only	-	Mar	30	3:00u	0	-
 Rule	Chile	2009	only	-	Mar	Sun>=9	3:00u	0	-
-Rule	Chile	2010	2011	-	Apr	Sun>=1	3:00u	0	-
+Rule	Chile	2010	only	-	Apr	Sun>=1	3:00u	0	-
+Rule	Chile	2011	only	-	May	Sun>=2	3:00u	0	-
 Rule	Chile	2012	max	-	Mar	Sun>=9	3:00u	0	-
 # IATA SSIM anomalies: (1992-02) says 1992-03-14;
 # (1996-09) says 1998-03-08.  Ignore these.
--- a/make/sun/jawt/Makefile	Thu Apr 07 15:21:10 2011 -0700
+++ b/make/sun/jawt/Makefile	Sun Apr 10 10:23:28 2011 -0700
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -112,11 +112,20 @@
 # Libraries to link in.
 #
 ifeq ($(PLATFORM), solaris)
-OTHER_LDLIBS = -L$(LIBDIR)/$(LIBARCH) -L$(OPENWIN_LIB) -L$(LIBDIR)/$(LIBARCH)/xawt -lmawt -L/usr/openwin/sfw/lib$(ISA_DIR) -lXrender
+  ifndef BUILD_HEADLESS_ONLY
+    OTHER_LDLIBS = -L$(LIBDIR)/$(LIBARCH) -L$(OPENWIN_LIB) -L$(LIBDIR)/$(LIBARCH)/xawt -lmawt -L/usr/openwin/sfw/lib$(ISA_DIR) -lXrender
+  else
+    OTHER_LDLIBS = -L$(LIBDIR)/$(LIBARCH) -L$(OPENWIN_LIB) -L$(LIBDIR)/$(LIBARCH)/headless -lmawt -L/usr/openwin/sfw/lib$(ISA_DIR) -lXrender
+  endif
 endif # PLATFORM
 
 ifeq ($(PLATFORM), linux)
-OTHER_LDLIBS = -L$(LIBDIR)/$(LIBARCH) -lawt -L$(LIBDIR)/$(LIBARCH)/xawt -lmawt
+  ifndef BUILD_HEADLESS_ONLY
+    OTHER_LDLIBS = -L$(LIBDIR)/$(LIBARCH) -lawt -L$(LIBDIR)/$(LIBARCH)/xawt -lmawt
+  else
+    OTHER_LDLIBS = -L$(LIBDIR)/$(LIBARCH) -lawt -L$(LIBDIR)/$(LIBARCH)/headless -lmawt
+    CFLAGS += -DHEADLESS
+  endif
 endif # PLATFORM
 
 endif # PLATFORM
--- a/make/sun/jpeg/Makefile	Thu Apr 07 15:21:10 2011 -0700
+++ b/make/sun/jpeg/Makefile	Sun Apr 10 10:23:28 2011 -0700
@@ -73,9 +73,10 @@
   # Recommended way to avoid such warning is to declare the variable as
   # volatile to prevent the optimization. However, this approach does not
   # work because we have to declare all variables as volatile in result.
-
+ifndef CROSS_COMPILE_ARCH
   OTHER_CFLAGS += -Wno-clobbered
 endif
+endif
 
 include $(BUILDDIR)/common/Mapfile-vers.gmk
 include $(BUILDDIR)/common/Library.gmk
--- a/make/sun/nio/cs/Makefile	Thu Apr 07 15:21:10 2011 -0700
+++ b/make/sun/nio/cs/Makefile	Sun Apr 10 10:23:28 2011 -0700
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 1996, 2010, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 1996, 2011, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -120,8 +120,15 @@
   $(SHARE_SRC)/classes/sun/nio/cs/ext/$(SERVICE_DESCRIPTION_PATH)
 	$(install-file)
 
+# no compression unless requested
+ifndef COMPRESS_JARS
+  CREATE_JAR_OPTS_NOMANIFEST = cf0
+else
+  CREATE_JAR_OPTS_NOMANIFEST = cf
+endif
+
 $(CHARSETS_JAR): $(FILES_class) $(CLASSDESTDIR)/$(SERVICE_DESCRIPTION_PATH) $(FILES_DAT)
-	$(BOOT_JAR_CMD) cf0 $(CHARSETS_JAR) \
+	$(BOOT_JAR_CMD) $(CREATE_JAR_OPTS_NOMANIFEST) $(CHARSETS_JAR) \
 	      -C $(CLASSDESTDIR) sun \
 	      -C $(CLASSDESTDIR) $(SERVICE_DESCRIPTION_PATH)  \
 	      $(BOOT_JAR_JFLAGS)
--- a/make/sun/security/tools/Makefile	Thu Apr 07 15:21:10 2011 -0700
+++ b/make/sun/security/tools/Makefile	Sun Apr 10 10:23:28 2011 -0700
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -46,5 +46,7 @@
 
 build:
 	$(call make-launcher, keytool, sun.security.tools.KeyTool, , )
+ifndef BUILD_HEADLESS_ONLY
 	$(call make-launcher, policytool, sun.security.tools.policytool.PolicyTool, , )
+endif
 
--- a/make/sun/xawt/Makefile	Thu Apr 07 15:21:10 2011 -0700
+++ b/make/sun/xawt/Makefile	Sun Apr 10 10:23:28 2011 -0700
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2002, 2011, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -129,10 +129,17 @@
         -I$(PLATFORM_SRC)/native/sun/awt
 
 ifeq ($(PLATFORM), linux)
-# Allows for builds on Debian GNU Linux, X11 is in a different place 
-  CPPFLAGS += -I/usr/X11R6/include/X11/extensions \
-              -I/usr/include/X11/extensions \
-              -I$(OPENWIN_HOME)/include 
+  ifndef CROSS_COMPILE_ARCH
+    # Allows for builds on Debian GNU Linux, X11 is in a different place 
+    # This should really be handled at a higher-level so we don't have to
+    # work-around this when cross-compiling
+    CPPFLAGS += -I/usr/X11R6/include/X11/extensions \
+                -I/usr/include/X11/extensions \
+                -I$(OPENWIN_HOME)/include 
+  else
+    CPPFLAGS += -I$(OPENWIN_HOME)/include/X11/extensions \
+                -I$(OPENWIN_HOME)/include 
+  endif
 endif
 
 # We have some odd logic here because some Solaris 10 updates
@@ -245,7 +252,11 @@
 
 $(SIZERS): $(SIZERS_C) 
 	$(prep-target)
+ifndef CROSS_COMPILE_ARCH
 	$(CC) $(CFLAGS_$(subst .,,$(suffix $@))) $(CPPFLAGS) -o $@ $(SIZER)$(suffix $@).c
+else
+	$(HOST_CC) $(CPPFLAGS) -o $@ $(SIZER)$(suffix $@).c
+endif
 
 $(WRAPPER_GENERATOR_CLASS): $(WRAPPER_GENERATOR_JAVA)
 	$(prep-target)
--- a/make/sun/xawt/mapfile-vers	Thu Apr 07 15:21:10 2011 -0700
+++ b/make/sun/xawt/mapfile-vers	Sun Apr 10 10:23:28 2011 -0700
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2002, 2011, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -158,6 +158,7 @@
         Java_sun_awt_X11_XRobotPeer_mouseReleaseImpl;
         Java_sun_awt_X11_XRobotPeer_mouseWheelImpl;
         Java_sun_awt_X11_XRobotPeer_setup;
+        Java_sun_awt_X11_XRobotPeer__1dispose;
         Java_sun_awt_X11_XToolkit_getNumberOfButtonsImpl;
         Java_java_awt_Component_initIDs;
         Java_java_awt_Container_initIDs;
@@ -225,6 +226,7 @@
 	Java_sun_awt_X11GraphicsConfig_destroyBackBuffer;
 	Java_sun_awt_X11GraphicsConfig_swapBuffers;
 	Java_sun_awt_X11GraphicsConfig_isTranslucencyCapable;
+        Java_sun_awt_X11_XToolkit_getTrayIconDisplayTimeout;
         Java_java_awt_Insets_initIDs;
         Java_java_awt_KeyboardFocusManager_initIDs;
         Java_java_awt_Font_initIDs;
--- a/src/share/classes/com/sun/security/auth/PolicyParser.java	Thu Apr 07 15:21:10 2011 -0700
+++ b/src/share/classes/com/sun/security/auth/PolicyParser.java	Sun Apr 10 10:23:28 2011 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2011, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -30,13 +30,14 @@
 import java.net.MalformedURLException;
 import java.net.SocketPermission;
 import java.net.URL;
+import java.security.GeneralSecurityException;
+import java.text.MessageFormat;
 import java.util.Enumeration;
 import java.util.Hashtable;
 import java.util.LinkedList;
 import java.util.ListIterator;
 import java.util.Vector;
 import java.util.StringTokenizer;
-import java.security.GeneralSecurityException;
 import sun.security.util.PropertyExpander;
 
 /**
@@ -368,8 +369,8 @@
                                 "WILDCARD class but no WILDCARD name");
                     throw new ParsingException
                         (st.lineno(),
-                        rb.getString("can.not.specify.Principal.with.a.") +
-                        rb.getString("wildcard.class.without.a.wildcard.name"));
+                        rb.getString("can.not.specify.Principal.with.a." +
+                                     "wildcard.class.without.a.wildcard.name"));
                 }
 
                 try {
@@ -525,9 +526,10 @@
                                         rb.getString("number.") +
                                         String.valueOf(st.nval));
         case StreamTokenizer.TT_EOF:
-           throw new ParsingException
-                (rb.getString("expected.") + expect +
-                rb.getString(".read.end.of.file"));
+            MessageFormat form = new MessageFormat(
+                    rb.getString("expected.expect.read.end.of.file."));
+            Object[] source = {expect};
+            throw new ParsingException(form.format(source));
         case StreamTokenizer.TT_WORD:
             if (expect.equalsIgnoreCase(st.sval)) {
                 lookahead = st.nextToken();
--- a/src/share/classes/java/awt/Component.java	Thu Apr 07 15:21:10 2011 -0700
+++ b/src/share/classes/java/awt/Component.java	Sun Apr 10 10:23:28 2011 -0700
@@ -5821,7 +5821,7 @@
      * <code>InputMethodRequests</code> instance.
      * If listener <code>l</code> is <code>null</code>,
      * no exception is thrown and no action is performed.
-     * <p>Refer to <a href="doc-files/AWTThreadIssues.html#ListenersThreads"
+     * <p>Refer to <a href="{@docRoot}/java/awt/doc-files/AWTThreadIssues.html#ListenersThreads"
      * >AWT Threading Issues</a> for details on AWT's threading model.
      *
      * @param    l   the input method listener
--- a/src/share/classes/java/awt/Shape.java	Thu Apr 07 15:21:10 2011 -0700
+++ b/src/share/classes/java/awt/Shape.java	Sun Apr 10 10:23:28 2011 -0700
@@ -43,7 +43,7 @@
  * object that describes the trajectory path of the <code>Shape</code>
  * outline.
  * <p>
- * <b>Definition of insideness:</b>
+ * <a name="def_insideness"><b>Definition of insideness:</b></a>
  * A point is considered to lie inside a
  * <code>Shape</code> if and only if:
  * <ul>
@@ -88,6 +88,32 @@
      * <code>getBounds2D</code> method generally returns a
      * tighter bounding box due to its greater flexibility in
      * representation.
+     *
+     * <p>
+     * Note that the <a href="{@docRoot}/java/awt/Shape.html#def_insideness">
+     * definition of insideness</a> can lead to situations where points
+     * on the defining outline of the {@code shape} may not be considered
+     * contained in the returned {@code bounds} object, but only in cases
+     * where those points are also not considered contained in the original
+     * {@code shape}.
+     * </p>
+     * <p>
+     * If a {@code point} is inside the {@code shape} according to the
+     * {@link #contains(double x, double y) contains(point)} method, then
+     * it must be inside the returned {@code Rectangle} bounds object
+     * according to the {@link #contains(double x, double y) contains(point)}
+     * method of the {@code bounds}. Specifically:
+     * </p>
+     * <p>
+     *  {@code shape.contains(x,y)} requires {@code bounds.contains(x,y)}
+     * </p>
+     * <p>
+     * If a {@code point} is not inside the {@code shape}, then it might
+     * still be contained in the {@code bounds} object:
+     * </p>
+     * <p>
+     *  {@code bounds.contains(x,y)} does not imply {@code shape.contains(x,y)}
+     * </p>
      * @return an integer <code>Rectangle</code> that completely encloses
      *                 the <code>Shape</code>.
      * @see #getBounds2D
@@ -107,6 +133,32 @@
      * to overflow problems since the return value can be an instance of
      * the <code>Rectangle2D</code> that uses double precision values to
      * store the dimensions.
+     *
+     * <p>
+     * Note that the <a href="{@docRoot}/java/awt/Shape.html#def_insideness">
+     * definition of insideness</a> can lead to situations where points
+     * on the defining outline of the {@code shape} may not be considered
+     * contained in the returned {@code bounds} object, but only in cases
+     * where those points are also not considered contained in the original
+     * {@code shape}.
+     * </p>
+     * <p>
+     * If a {@code point} is inside the {@code shape} according to the
+     * {@link #contains(Point2D p) contains(point)} method, then it must
+     * be inside the returned {@code Rectangle2D} bounds object according
+     * to the {@link #contains(Point2D p) contains(point)} method of the
+     * {@code bounds}. Specifically:
+     * </p>
+     * <p>
+     *  {@code shape.contains(p)} requires {@code bounds.contains(p)}
+     * </p>
+     * <p>
+     * If a {@code point} is not inside the {@code shape}, then it might
+     * still be contained in the {@code bounds} object:
+     * </p>
+     * <p>
+     *  {@code bounds.contains(p)} does not imply {@code shape.contains(p)}
+     * </p>
      * @return an instance of <code>Rectangle2D</code> that is a
      *                 high-precision bounding box of the <code>Shape</code>.
      * @see #getBounds
@@ -116,7 +168,9 @@
 
     /**
      * Tests if the specified coordinates are inside the boundary of the
-     * <code>Shape</code>.
+     * <code>Shape</code>, as described by the
+     * <a href="{@docRoot}/java/awt/Shape.html#def_insideness">
+     * definition of insideness</a>.
      * @param x the specified X coordinate to be tested
      * @param y the specified Y coordinate to be tested
      * @return <code>true</code> if the specified coordinates are inside
@@ -128,7 +182,9 @@
 
     /**
      * Tests if a specified {@link Point2D} is inside the boundary
-     * of the <code>Shape</code>.
+     * of the <code>Shape</code>, as described by the
+     * <a href="{@docRoot}/java/awt/Shape.html#def_insideness">
+     * definition of insideness</a>.
      * @param p the specified <code>Point2D</code> to be tested
      * @return <code>true</code> if the specified <code>Point2D</code> is
      *          inside the boundary of the <code>Shape</code>;
--- a/src/share/classes/java/awt/Toolkit.java	Thu Apr 07 15:21:10 2011 -0700
+++ b/src/share/classes/java/awt/Toolkit.java	Sun Apr 10 10:23:28 2011 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1995, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1995, 2011, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -858,7 +858,7 @@
                         String nm = null;
                         Class cls = null;
                         try {
-                            nm = System.getProperty("awt.toolkit", "sun.awt.X11.XToolkit");
+                            nm = System.getProperty("awt.toolkit");
                             try {
                                 cls = Class.forName(nm);
                             } catch (ClassNotFoundException e) {
@@ -1157,12 +1157,9 @@
      *          takes JobAttributes and PageAttributes objects. This object
      *          may be updated to reflect the user's job choices on exit. May
      *          be null.
-     *
      * @return  a <code>PrintJob</code> object, or <code>null</code> if the
      *          user cancelled the print job.
-     * @throws  NullPointerException if frame is null.  This exception is
-     *          always thrown when GraphicsEnvironment.isHeadless() returns
-     *          true.
+     * @throws  NullPointerException if frame is null
      * @throws  SecurityException if this thread is not allowed to initiate a
      *          print job request
      * @see     java.awt.GraphicsEnvironment#isHeadless
@@ -1201,12 +1198,9 @@
      *          job. The attributes will be updated to reflect the user's
      *          choices as outlined in the PageAttributes documentation. May be
      *          null.
-     *
      * @return  a <code>PrintJob</code> object, or <code>null</code> if the
      *          user cancelled the print job.
-     * @throws  NullPointerException if frame is null and either jobAttributes
-     *          is null or jobAttributes.getDialog() returns
-     *          JobAttributes.DialogType.NATIVE.
+     * @throws  NullPointerException if frame is null
      * @throws  IllegalArgumentException if pageAttributes specifies differing
      *          cross feed and feed resolutions. Also if this thread has
      *          access to the file system and jobAttributes specifies
@@ -1218,9 +1212,6 @@
      *          opportunity to select a file and proceed with printing.
      *          The dialog will ensure that the selected output file
      *          is valid before returning from this method.
-     *          <p>
-     *          This exception is always thrown when GraphicsEnvironment.isHeadless()
-     *          returns true.
      * @throws  SecurityException if this thread is not allowed to initiate a
      *          print job request, or if jobAttributes specifies print to file,
      *          and this thread is not allowed to access the file system
@@ -1236,10 +1227,6 @@
                                 PageAttributes pageAttributes) {
         // Override to add printing support with new job/page control classes
 
-        if (GraphicsEnvironment.isHeadless()) {
-            throw new IllegalArgumentException();
-        }
-
         if (this != Toolkit.getDefaultToolkit()) {
             return Toolkit.getDefaultToolkit().getPrintJob(frame, jobtitle,
                                                            jobAttributes,
--- a/src/share/classes/java/awt/image/BandedSampleModel.java	Thu Apr 07 15:21:10 2011 -0700
+++ b/src/share/classes/java/awt/image/BandedSampleModel.java	Sun Apr 10 10:23:28 2011 -0700
@@ -408,7 +408,12 @@
      */
     public int[] getPixels(int x, int y, int w, int h,
                            int iArray[], DataBuffer data) {
-        if ((x < 0) || (y < 0) || (x + w > width) || (y + h > height)) {
+        int x1 = x + w;
+        int y1 = y + h;
+
+        if (x < 0 || x >= width || w > width || x1 < 0 || x1 > width ||
+            y < 0 || y >= height || h > height || y1 < 0 || y1 >  height)
+        {
             throw new ArrayIndexOutOfBoundsException
                 ("Coordinate out of bounds!");
         }
@@ -690,7 +695,12 @@
      */
     public void setPixels(int x, int y, int w, int h,
                           int iArray[], DataBuffer data) {
-        if ((x < 0) || (y < 0) || (x + w > width) || (y + h > height)) {
+        int x1 = x + w;
+        int y1 = y + h;
+
+        if (x < 0 || x >= width || w > width || x1 < 0 || x1 > width ||
+            y < 0 || y >= height || h > height || y1 < 0 || y1 >  height)
+        {
             throw new ArrayIndexOutOfBoundsException
                 ("Coordinate out of bounds!");
         }
--- a/src/share/classes/java/awt/image/ComponentSampleModel.java	Thu Apr 07 15:21:10 2011 -0700
+++ b/src/share/classes/java/awt/image/ComponentSampleModel.java	Sun Apr 10 10:23:28 2011 -0700
@@ -739,7 +739,12 @@
      */
     public int[] getPixels(int x, int y, int w, int h,
                            int iArray[], DataBuffer data) {
-        if ((x < 0) || (y < 0) || (x + w > width) || (y + h > height)) {
+        int x1 = x + w;
+        int y1 = y + h;
+
+        if (x < 0 || x >= width || w > width || x1 < 0 || x1 > width ||
+            y < 0 || y >= height || y > height || y1 < 0 || y1 >  height)
+        {
             throw new ArrayIndexOutOfBoundsException
                 ("Coordinate out of bounds!");
         }
@@ -1025,7 +1030,12 @@
      */
     public void setPixels(int x, int y, int w, int h,
                           int iArray[], DataBuffer data) {
-        if ((x < 0) || (y < 0) || (x + w > width) || (y + h > height)) {
+        int x1 = x + w;
+        int y1 = y + h;
+
+        if (x < 0 || x >= width || w > width || x1 < 0 || x1 > width ||
+            y < 0 || y >= height || h > height || y1 < 0 || y1 >  height)
+        {
             throw new ArrayIndexOutOfBoundsException
                 ("Coordinate out of bounds!");
         }
--- a/src/share/classes/java/awt/image/SampleModel.java	Thu Apr 07 15:21:10 2011 -0700
+++ b/src/share/classes/java/awt/image/SampleModel.java	Sun Apr 10 10:23:28 2011 -0700
@@ -361,8 +361,8 @@
         int x1 = x + w;
         int y1 = y + h;
 
-        if (x < 0 || x1 < x || x1 > width ||
-            y < 0 || y1 < y || y1 > height)
+        if (x < 0 || x >= width || w > width || x1 < 0 || x1 > width ||
+            y < 0 || y >= height || h > height || y1 < 0 || y1 > height)
         {
             throw new ArrayIndexOutOfBoundsException("Invalid coordinates.");
         }
@@ -588,6 +588,15 @@
         int type = getTransferType();
         int numDataElems = getNumDataElements();
 
+        int x1 = x + w;
+        int y1 = y + h;
+
+        if (x < 0 || x >= width || w > width || x1 < 0 || x1 > width ||
+            y < 0 || y >= height || h > height || y1 < 0 || y1 > height)
+        {
+            throw new ArrayIndexOutOfBoundsException("Invalid coordinates.");
+        }
+
         switch(type) {
 
         case DataBuffer.TYPE_BYTE:
@@ -595,8 +604,8 @@
             byte[] barray = (byte[])obj;
             byte[] btemp = new byte[numDataElems];
 
-            for (int i=y; i<y+h; i++) {
-                for (int j=x; j<x+w; j++) {
+            for (int i=y; i<y1; i++) {
+                for (int j=x; j<x1; j++) {
                     for (int k=0; k<numDataElems; k++) {
                         btemp[k] = barray[cnt++];
                     }
@@ -612,8 +621,8 @@
             short[] sarray = (short[])obj;
             short[] stemp = new short[numDataElems];
 
-            for (int i=y; i<y+h; i++) {
-                for (int j=x; j<x+w; j++) {
+            for (int i=y; i<y1; i++) {
+                for (int j=x; j<x1; j++) {
                     for (int k=0; k<numDataElems; k++) {
                         stemp[k] = sarray[cnt++];
                     }
@@ -628,8 +637,8 @@
             int[] iArray = (int[])obj;
             int[] itemp = new int[numDataElems];
 
-            for (int i=y; i<y+h; i++) {
-                for (int j=x; j<x+w; j++) {
+            for (int i=y; i<y1; i++) {
+                for (int j=x; j<x1; j++) {
                     for (int k=0; k<numDataElems; k++) {
                         itemp[k] = iArray[cnt++];
                     }
@@ -644,8 +653,8 @@
             float[] fArray = (float[])obj;
             float[] ftemp = new float[numDataElems];
 
-            for (int i=y; i<y+h; i++) {
-                for (int j=x; j<x+w; j++) {
+            for (int i=y; i<y1; i++) {
+                for (int j=x; j<x1; j++) {
                     for (int k=0; k<numDataElems; k++) {
                         ftemp[k] = fArray[cnt++];
                     }
@@ -660,8 +669,8 @@
             double[] dArray = (double[])obj;
             double[] dtemp = new double[numDataElems];
 
-            for (int i=y; i<y+h; i++) {
-                for (int j=x; j<x+w; j++) {
+            for (int i=y; i<y1; i++) {
+                for (int j=x; j<x1; j++) {
                     for (int k=0; k<numDataElems; k++) {
                         dtemp[k] = dArray[cnt++];
                     }
@@ -759,14 +768,22 @@
 
         int pixels[];
         int Offset=0;
+        int x1 = x + w;
+        int y1 = y + h;
+
+        if (x < 0 || x >= width || w > width || x1 < 0 || x1 > width ||
+            y < 0 || y >= height || h > height || y1 < 0 || y1 > height)
+        {
+            throw new ArrayIndexOutOfBoundsException("Invalid coordinates.");
+        }
 
         if (iArray != null)
             pixels = iArray;
         else
             pixels = new int[numBands * w * h];
 
-        for (int i=y; i<(h+y); i++) {
-            for (int j=x; j<(w+x); j++) {
+        for (int i=y; i<y1; i++) {
+            for (int j=x; j<x1; j++) {
                 for(int k=0; k<numBands; k++) {
                     pixels[Offset++] = getSample(j, i, k, data);
                 }
@@ -799,14 +816,22 @@
 
         float pixels[];
         int Offset = 0;
+        int x1 = x + w;
+        int y1 = y + h;
+
+        if (x < 0 || x >= width || w > width || x1 < 0 || x1 > width ||
+            y < 0 || y >= height || h > height || y1 < 0 || y1 > height)
+        {
+            throw new ArrayIndexOutOfBoundsException("Invalid coordinates.");
+        }
 
         if (fArray != null)
             pixels = fArray;
         else
             pixels = new float[numBands * w * h];
 
-        for (int i=y; i<(h+y); i++) {
-            for(int j=x; j<(w+x); j++) {
+        for (int i=y; i<y1; i++) {
+            for(int j=x; j<x1; j++) {
                 for(int k=0; k<numBands; k++) {
                     pixels[Offset++] = getSampleFloat(j, i, k, data);
                 }
@@ -838,6 +863,14 @@
                               double dArray[], DataBuffer data) {
         double pixels[];
         int    Offset = 0;
+        int x1 = x + w;
+        int y1 = y + h;
+
+        if (x < 0 || x >= width || w > width || x1 < 0 || x1 > width ||
+            y < 0 || y >= height || h > height || y1 < 0 || y1 > height)
+        {
+            throw new ArrayIndexOutOfBoundsException("Invalid coordinates.");
+        }
 
         if (dArray != null)
             pixels = dArray;
@@ -845,8 +878,8 @@
             pixels = new double[numBands * w * h];
 
         // Fix 4217412
-        for (int i=y; i<(h+y); i++) {
-            for (int j=x; j<(w+x); j++) {
+        for (int i=y; i<y1; i++) {
+            for (int j=x; j<x1; j++) {
                 for (int k=0; k<numBands; k++) {
                     pixels[Offset++] = getSampleDouble(j, i, k, data);
                 }
@@ -1146,9 +1179,17 @@
     public void setPixels(int x, int y, int w, int h,
                           int iArray[], DataBuffer data) {
         int Offset=0;
+        int x1 = x + w;
+        int y1 = y + h;
 
-        for (int i=y; i<(y+h); i++) {
-            for (int j=x; j<(x+w); j++) {
+        if (x < 0 || x >= width || w > width || x1 < 0 || x1 > width ||
+            y < 0 || y >= height || h > height || y1 < 0 || y1 > height)
+        {
+            throw new ArrayIndexOutOfBoundsException("Invalid coordinates.");
+        }
+
+        for (int i=y; i<y1; i++) {
+            for (int j=x; j<x1; j++) {
                 for (int k=0; k<numBands; k++) {
                     setSample(j, i, k, iArray[Offset++], data);
                 }
@@ -1176,9 +1217,17 @@
     public void setPixels(int x, int y, int w, int h,
                           float fArray[], DataBuffer data) {
         int Offset=0;
+        int x1 = x + w;
+        int y1 = y + h;
 
-        for (int i=y; i<(y+h); i++) {
-            for (int j=x; j<(x+w); j++) {
+        if (x < 0 || x >= width || w > width || x1 < 0 || x1 > width||
+            y < 0 || y >= height || h > height || y1 < 0 || y1 > height)
+        {
+            throw new ArrayIndexOutOfBoundsException("Invalid coordinates.");
+        }
+
+        for (int i=y; i<y1; i++) {
+            for (int j=x; j<x1; j++) {
                 for(int k=0; k<numBands; k++) {
                     setSample(j, i, k, fArray[Offset++], data);
                 }
@@ -1206,9 +1255,17 @@
     public void setPixels(int x, int y, int w, int h,
                           double dArray[], DataBuffer data) {
         int Offset=0;
+        int x1 = x + w;
+        int y1 = y + h;
 
-        for (int i=y; i<(y+h); i++) {
-            for (int j=x; j<(x+w); j++) {
+        if (x < 0 || x >= width || w > width || x1 < 0 || x1 > width ||
+            y < 0 || y >= height || h > height || y1 < 0 || y1 > height)
+        {
+            throw new ArrayIndexOutOfBoundsException("Invalid coordinates.");
+        }
+
+        for (int i=y; i<y1; i++) {
+            for (int j=x; j<x1; j++) {
                 for (int k=0; k<numBands; k++) {
                     setSample(j, i, k, dArray[Offset++], data);
                 }
@@ -1315,9 +1372,16 @@
                            int iArray[], DataBuffer data) {
 
         int Offset=0;
+        int x1 = x + w;
+        int y1 = y + h;
+        if (x < 0 || x >= width || w > width || x1 < 0 || x1 > width ||
+            y < 0 || y >= height || h > height || y1 < 0 || y1 > height)
+        {
+            throw new ArrayIndexOutOfBoundsException("Invalid coordinates.");
+        }
 
-        for (int i=y; i<(y+h); i++) {
-            for (int j=x; j<(x+w); j++) {
+        for (int i=y; i<y1; i++) {
+            for (int j=x; j<x1; j++) {
                 setSample(j, i, b, iArray[Offset++], data);
             }
         }
@@ -1345,9 +1409,17 @@
     public void setSamples(int x, int y, int w, int h, int b,
                            float fArray[], DataBuffer data) {
         int Offset=0;
+        int x1 = x + w;
+        int y1 = y + h;
 
-        for (int i=y; i<(y+h); i++) {
-            for (int j=x; j<(x+w); j++) {
+        if (x < 0 || x >= width || w > width || x1 < 0 || x1 > width ||
+            y < 0 || y >= height || h > height || y1 < 0 || y1 > height)
+        {
+            throw new ArrayIndexOutOfBoundsException("Invalid coordinates.");
+        }
+
+        for (int i=y; i<y1; i++) {
+            for (int j=x; j<x1; j++) {
                 setSample(j, i, b, fArray[Offset++], data);
             }
         }
@@ -1375,9 +1447,18 @@
     public void setSamples(int x, int y, int w, int h, int b,
                            double dArray[], DataBuffer data) {
         int Offset=0;
+        int x1 = x + w;
+        int y1 = y + h;
 
-        for (int i=y; i<(y+h); i++) {
-            for (int j=x; j<(x+w); j++) {
+
+        if (x < 0 || x >= width || w > width || x1 < 0 || x1 > width ||
+            y < 0 || y >= height || h > height || y1 < 0 || y1 > height)
+        {
+            throw new ArrayIndexOutOfBoundsException("Invalid coordinates.");
+        }
+
+        for (int i=y; i<y1; i++) {
+            for (int j=x; j<x1; j++) {
                 setSample(j, i, b, dArray[Offset++], data);
             }
         }
--- a/src/share/classes/java/awt/image/SinglePixelPackedSampleModel.java	Thu Apr 07 15:21:10 2011 -0700
+++ b/src/share/classes/java/awt/image/SinglePixelPackedSampleModel.java	Sun Apr 10 10:23:28 2011 -0700
@@ -461,7 +461,12 @@
      */
     public int[] getPixels(int x, int y, int w, int h,
                            int iArray[], DataBuffer data) {
-        if ((x < 0) || (y < 0) || (x + w > width) || (y + h > height)) {
+        int x1 = x + w;
+        int y1 = y + h;
+
+        if (x < 0 || x >= width || w > width || x1 < 0 || x1 > width ||
+            y < 0 || y >= height || h > height || y1 < 0 || y1 >  height)
+        {
             throw new ArrayIndexOutOfBoundsException
                 ("Coordinate out of bounds!");
         }
@@ -659,7 +664,12 @@
      */
     public void setPixels(int x, int y, int w, int h,
                           int iArray[], DataBuffer data) {
-        if ((x < 0) || (y < 0) || (x + w > width) || (y + h > height)) {
+        int x1 = x + w;
+        int y1 = y + h;
+
+        if (x < 0 || x >= width || w > width || x1 < 0 || x1 > width ||
+            y < 0 || y >= height || h > height || y1 < 0 || y1 >  height)
+        {
             throw new ArrayIndexOutOfBoundsException
                 ("Coordinate out of bounds!");
         }
--- a/src/share/classes/java/lang/ArithmeticException.java	Thu Apr 07 15:21:10 2011 -0700
+++ b/src/share/classes/java/lang/ArithmeticException.java	Sun Apr 10 10:23:28 2011 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1994, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1994, 2011, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -30,15 +30,18 @@
  * example, an integer "divide by zero" throws an
  * instance of this class.
  *
+ * {@code ArithmeticException} objects may be constructed by the
+ * virtual machine as if {@linkplain Throwable#Throwable(String,
+ * Throwable, boolean) suppression were disabled}.
+ *
  * @author  unascribed
  * @since   JDK1.0
  */
-public
-class ArithmeticException extends RuntimeException {
+public class ArithmeticException extends RuntimeException {
     private static final long serialVersionUID = 2256477558314496007L;
 
     /**
-     * Constructs an <code>ArithmeticException</code> with no detail
+     * Constructs an {@code ArithmeticException} with no detail
      * message.
      */
     public ArithmeticException() {
@@ -46,7 +49,7 @@
     }
 
     /**
-     * Constructs an <code>ArithmeticException</code> with the specified
+     * Constructs an {@code ArithmeticException} with the specified
      * detail message.
      *
      * @param   s   the detail message.
--- a/src/share/classes/java/lang/CharSequence.java	Thu Apr 07 15:21:10 2011 -0700
+++ b/src/share/classes/java/lang/CharSequence.java	Sun Apr 10 10:23:28 2011 -0700
@@ -66,7 +66,7 @@
      * indexing. </p>
      *
      * <p>If the <code>char</code> value specified by the index is a
-     * <a href="Character.html#unicode">surrogate</a>, the surrogate
+     * <a href="{@docRoot}/java/lang/Character.html#unicode">surrogate</a>, the surrogate
      * value is returned.
      *
      * @param   index   the index of the <code>char</code> value to be returned
--- a/src/share/classes/java/lang/Character.java	Thu Apr 07 15:21:10 2011 -0700
+++ b/src/share/classes/java/lang/Character.java	Sun Apr 10 10:23:28 2011 -0700
@@ -31,10 +31,10 @@
 import java.util.Locale;
 
 /**
- * The <code>Character</code> class wraps a value of the primitive
- * type <code>char</code> in an object. An object of type
- * <code>Character</code> contains a single field whose type is
- * <code>char</code>.
+ * The {@code Character} class wraps a value of the primitive
+ * type {@code char} in an object. An object of type
+ * {@code Character} contains a single field whose type is
+ * {@code char}.
  * <p>
  * In addition, this class provides several methods for determining
  * a character's category (lowercase letter, digit, etc.) and for converting
@@ -42,7 +42,7 @@
  * <p>
  * Character information is based on the Unicode Standard, version 6.0.0.
  * <p>
- * The methods and data of class <code>Character</code> are defined by
+ * The methods and data of class {@code Character} are defined by
  * the information in the <i>UnicodeData</i> file that is part of the
  * Unicode Character Database maintained by the Unicode
  * Consortium. This file specifies various properties including name
@@ -56,8 +56,8 @@
  *
  * <h4><a name="unicode">Unicode Character Representations</a></h4>
  *
- * <p>The <code>char</code> data type (and therefore the value that a
- * <code>Character</code> object encapsulates) are based on the
+ * <p>The {@code char} data type (and therefore the value that a
+ * {@code Character} object encapsulates) are based on the
  * original Unicode specification, which defined characters as
  * fixed-width 16-bit entities. The Unicode standard has since been
  * changed to allow for characters whose representation requires more
@@ -72,43 +72,43 @@
  * sometimes referred to as the <em>Basic Multilingual Plane (BMP)</em>.
  * <a name="supplementary">Characters</a> whose code points are greater
  * than U+FFFF are called <em>supplementary character</em>s.  The Java
- * platform uses the UTF-16 representation in <code>char</code> arrays and
- * in the <code>String</code> and <code>StringBuffer</code> classes. In
+ * platform uses the UTF-16 representation in {@code char} arrays and
+ * in the {@code String} and {@code StringBuffer} classes. In
  * this representation, supplementary characters are represented as a pair
- * of <code>char</code> values, the first from the <em>high-surrogates</em>
+ * of {@code char} values, the first from the <em>high-surrogates</em>
  * range, (&#92;uD800-&#92;uDBFF), the second from the
  * <em>low-surrogates</em> range (&#92;uDC00-&#92;uDFFF).
  *
- * <p>A <code>char</code> value, therefore, represents Basic
+ * <p>A {@code char} value, therefore, represents Basic
  * Multilingual Plane (BMP) code points, including the surrogate
  * code points, or code units of the UTF-16 encoding. An
- * <code>int</code> value represents all Unicode code points,
+ * {@code int} value represents all Unicode code points,
  * including supplementary code points. The lower (least significant)
- * 21 bits of <code>int</code> are used to represent Unicode code
+ * 21 bits of {@code int} are used to represent Unicode code
  * points and the upper (most significant) 11 bits must be zero.
  * Unless otherwise specified, the behavior with respect to
- * supplementary characters and surrogate <code>char</code> values is
+ * supplementary characters and surrogate {@code char} values is
  * as follows:
  *
  * <ul>
- * <li>The methods that only accept a <code>char</code> value cannot support
- * supplementary characters. They treat <code>char</code> values from the
+ * <li>The methods that only accept a {@code char} value cannot support
+ * supplementary characters. They treat {@code char} values from the
  * surrogate ranges as undefined characters. For example,
- * <code>Character.isLetter('&#92;uD840')</code> returns <code>false</code>, even though
+ * {@code Character.isLetter('\u005CuD840')} returns {@code false}, even though
  * this specific value if followed by any low-surrogate value in a string
  * would represent a letter.
  *
- * <li>The methods that accept an <code>int</code> value support all
+ * <li>The methods that accept an {@code int} value support all
  * Unicode characters, including supplementary characters. For
- * example, <code>Character.isLetter(0x2F81A)</code> returns
- * <code>true</code> because the code point value represents a letter
+ * example, {@code Character.isLetter(0x2F81A)} returns
+ * {@code true} because the code point value represents a letter
  * (a CJK ideograph).
  * </ul>
  *
  * <p>In the Java SE API documentation, <em>Unicode code point</em> is
  * used for character values in the range between U+0000 and U+10FFFF,
  * and <em>Unicode code unit</em> is used for 16-bit
- * <code>char</code> values that are code units of the <em>UTF-16</em>
+ * {@code char} values that are code units of the <em>UTF-16</em>
  * encoding. For more information on Unicode terminology, refer to the
  * <a href="http://www.unicode.org/glossary/">Unicode Glossary</a>.
  *
@@ -125,9 +125,8 @@
      * The minimum radix available for conversion to and from strings.
      * The constant value of this field is the smallest value permitted
      * for the radix argument in radix-conversion methods such as the
-     * <code>digit</code> method, the <code>forDigit</code>
-     * method, and the <code>toString</code> method of class
-     * <code>Integer</code>.
+     * {@code digit} method, the {@code forDigit} method, and the
+     * {@code toString} method of class {@code Integer}.
      *
      * @see     Character#digit(char, int)
      * @see     Character#forDigit(int, int)
@@ -140,9 +139,8 @@
      * The maximum radix available for conversion to and from strings.
      * The constant value of this field is the largest value permitted
      * for the radix argument in radix-conversion methods such as the
-     * <code>digit</code> method, the <code>forDigit</code>
-     * method, and the <code>toString</code> method of class
-     * <code>Integer</code>.
+     * {@code digit} method, the {@code forDigit} method, and the
+     * {@code toString} method of class {@code Integer}.
      *
      * @see     Character#digit(char, int)
      * @see     Character#forDigit(int, int)
@@ -153,7 +151,7 @@
 
     /**
      * The constant value of this field is the smallest value of type
-     * <code>char</code>, <code>'&#92;u0000'</code>.
+     * {@code char}, {@code '\u005Cu0000'}.
      *
      * @since   1.0.2
      */
@@ -161,15 +159,15 @@
 
     /**
      * The constant value of this field is the largest value of type
-     * <code>char</code>, <code>'&#92;uFFFF'</code>.
+     * {@code char}, {@code '\u005CuFFFF'}.
      *
      * @since   1.0.2
      */
     public static final char MAX_VALUE = '\uFFFF';
 
     /**
-     * The <code>Class</code> instance representing the primitive type
-     * <code>char</code>.
+     * The {@code Class} instance representing the primitive type
+     * {@code char}.
      *
      * @since   1.1
      */
@@ -371,7 +369,7 @@
 
 
     /**
-     * Undefined bidirectional character type. Undefined <code>char</code>
+     * Undefined bidirectional character type. Undefined {@code char}
      * values have undefined directionality in the Unicode specification.
      * @since 1.4
      */
@@ -495,7 +493,7 @@
      * The minimum value of a
      * <a href="http://www.unicode.org/glossary/#high_surrogate_code_unit">
      * Unicode high-surrogate code unit</a>
-     * in the UTF-16 encoding, constant <code>'&#92;uD800'</code>.
+     * in the UTF-16 encoding, constant {@code '\u005CuD800'}.
      * A high-surrogate is also known as a <i>leading-surrogate</i>.
      *
      * @since 1.5
@@ -506,7 +504,7 @@
      * The maximum value of a
      * <a href="http://www.unicode.org/glossary/#high_surrogate_code_unit">
      * Unicode high-surrogate code unit</a>
-     * in the UTF-16 encoding, constant <code>'&#92;uDBFF'</code>.
+     * in the UTF-16 encoding, constant {@code '\u005CuDBFF'}.
      * A high-surrogate is also known as a <i>leading-surrogate</i>.
      *
      * @since 1.5
@@ -517,7 +515,7 @@
      * The minimum value of a
      * <a href="http://www.unicode.org/glossary/#low_surrogate_code_unit">
      * Unicode low-surrogate code unit</a>
-     * in the UTF-16 encoding, constant <code>'&#92;uDC00'</code>.
+     * in the UTF-16 encoding, constant {@code '\u005CuDC00'}.
      * A low-surrogate is also known as a <i>trailing-surrogate</i>.
      *
      * @since 1.5
@@ -528,7 +526,7 @@
      * The maximum value of a
      * <a href="http://www.unicode.org/glossary/#low_surrogate_code_unit">
      * Unicode low-surrogate code unit</a>
-     * in the UTF-16 encoding, constant <code>'&#92;uDFFF'</code>.
+     * in the UTF-16 encoding, constant {@code '\u005CuDFFF'}.
      * A low-surrogate is also known as a <i>trailing-surrogate</i>.
      *
      * @since 1.5
@@ -537,7 +535,7 @@
 
     /**
      * The minimum value of a Unicode surrogate code unit in the
-     * UTF-16 encoding, constant <code>'&#92;uD800'</code>.
+     * UTF-16 encoding, constant {@code '\u005CuD800'}.
      *
      * @since 1.5
      */
@@ -545,7 +543,7 @@
 
     /**
      * The maximum value of a Unicode surrogate code unit in the
-     * UTF-16 encoding, constant <code>'&#92;uDFFF'</code>.
+     * UTF-16 encoding, constant {@code '\u005CuDFFF'}.
      *
      * @since 1.5
      */
@@ -582,7 +580,7 @@
     /**
      * Instances of this class represent particular subsets of the Unicode
      * character set.  The only family of subsets defined in the
-     * <code>Character</code> class is {@link Character.UnicodeBlock}.
+     * {@code Character} class is {@link Character.UnicodeBlock}.
      * Other portions of the Java API may define other subsets for their
      * own purposes.
      *
@@ -593,10 +591,10 @@
         private String name;
 
         /**
-         * Constructs a new <code>Subset</code> instance.
+         * Constructs a new {@code Subset} instance.
          *
          * @param  name  The name of this subset
-         * @exception NullPointerException if name is <code>null</code>
+         * @exception NullPointerException if name is {@code null}
          */
         protected Subset(String name) {
             if (name == null) {
@@ -606,10 +604,10 @@
         }
 
         /**
-         * Compares two <code>Subset</code> objects for equality.
-         * This method returns <code>true</code> if and only if
-         * <code>this</code> and the argument refer to the same
-         * object; since this method is <code>final</code>, this
+         * Compares two {@code Subset} objects for equality.
+         * This method returns {@code true} if and only if
+         * {@code this} and the argument refer to the same
+         * object; since this method is {@code final}, this
          * guarantee holds for all subclasses.
          */
         public final boolean equals(Object obj) {
@@ -618,9 +616,9 @@
 
         /**
          * Returns the standard hash code as defined by the
-         * <code>{@link Object#hashCode}</code> method.  This method
-         * is <code>final</code> in order to ensure that the
-         * <code>equals</code> and <code>hashCode</code> methods will
+         * {@link Object#hashCode} method.  This method
+         * is {@code final} in order to ensure that the
+         * {@code equals} and {@code hashCode} methods will
          * be consistent in all subclasses.
          */
         public final int hashCode() {
@@ -2960,7 +2958,7 @@
 
         /**
          * Returns the object representing the Unicode block containing the
-         * given character, or <code>null</code> if the character is not a
+         * given character, or {@code null} if the character is not a
          * member of a defined block.
          *
          * <p><b>Note:</b> This method cannot handle
@@ -2969,9 +2967,9 @@
          * supplementary characters, use the {@link #of(int)} method.
          *
          * @param   c  The character in question
-         * @return  The <code>UnicodeBlock</code> instance representing the
+         * @return  The {@code UnicodeBlock} instance representing the
          *          Unicode block of which this character is a member, or
-         *          <code>null</code> if the character is not a member of any
+         *          {@code null} if the character is not a member of any
          *          Unicode block
          */
         public static UnicodeBlock of(char c) {
@@ -2981,16 +2979,16 @@
         /**
          * Returns the object representing the Unicode block
          * containing the given character (Unicode code point), or
-         * <code>null</code> if the character is not a member of a
+         * {@code null} if the character is not a member of a
          * defined block.
          *
          * @param   codePoint the character (Unicode code point) in question.
-         * @return  The <code>UnicodeBlock</code> instance representing the
+         * @return  The {@code UnicodeBlock} instance representing the
          *          Unicode block of which this character is a member, or
-         *          <code>null</code> if the character is not a member of any
+         *          {@code null} if the character is not a member of any
          *          Unicode block
          * @exception IllegalArgumentException if the specified
-         * <code>codePoint</code> is an invalid Unicode code point.
+         * {@code codePoint} is an invalid Unicode code point.
          * @see Character#isValidCodePoint(int)
          * @since   1.5
          */
@@ -3044,12 +3042,12 @@
          * If the Unicode Standard changes block names, both the previous and
          * current names will be accepted.
          *
-         * @param blockName A <code>UnicodeBlock</code> name.
-         * @return The <code>UnicodeBlock</code> instance identified
-         *         by <code>blockName</code>
-         * @throws IllegalArgumentException if <code>blockName</code> is an
+         * @param blockName A {@code UnicodeBlock} name.
+         * @return The {@code UnicodeBlock} instance identified
+         *         by {@code blockName}
+         * @throws IllegalArgumentException if {@code blockName} is an
          *         invalid name
-         * @throws NullPointerException if <code>blockName</code> is null
+         * @throws NullPointerException if {@code blockName} is null
          * @since 1.5
          */
         public static final UnicodeBlock forName(String blockName) {
@@ -4280,11 +4278,11 @@
          * the given character (Unicode code point) is assigned to.
          *
          * @param   codePoint the character (Unicode code point) in question.
-         * @return  The <code>UnicodeScript</code> constant representing the
+         * @return  The {@code UnicodeScript} constant representing the
          *          Unicode script of which this character is assigned to.
          *
          * @exception IllegalArgumentException if the specified
-         * <code>codePoint</code> is an invalid Unicode code point.
+         * {@code codePoint} is an invalid Unicode code point.
          * @see Character#isValidCodePoint(int)
          *
          */
@@ -4315,12 +4313,12 @@
          * case-insensitive string comparisons for script name validation.
          * <p>
          *
-         * @param scriptName A <code>UnicodeScript</code> name.
-         * @return The <code>UnicodeScript</code> constant identified
-         *         by <code>scriptName</code>
-         * @throws IllegalArgumentException if <code>scriptName</code> is an
+         * @param scriptName A {@code UnicodeScript} name.
+         * @return The {@code UnicodeScript} constant identified
+         *         by {@code scriptName}
+         * @throws IllegalArgumentException if {@code scriptName} is an
          *         invalid name
-         * @throws NullPointerException if <code>scriptName</code> is null
+         * @throws NullPointerException if {@code scriptName} is null
          */
         public static final UnicodeScript forName(String scriptName) {
             scriptName = scriptName.toUpperCase(Locale.ENGLISH);
@@ -4333,7 +4331,7 @@
     }
 
     /**
-     * The value of the <code>Character</code>.
+     * The value of the {@code Character}.
      *
      * @serial
      */
@@ -4343,11 +4341,11 @@
     private static final long serialVersionUID = 3786198910865385080L;
 
     /**
-     * Constructs a newly allocated <code>Character</code> object that
-     * represents the specified <code>char</code> value.
+     * Constructs a newly allocated {@code Character} object that
+     * represents the specified {@code char} value.
      *
      * @param  value   the value to be represented by the
-     *                  <code>Character</code> object.
+     *                  {@code Character} object.
      */
     public Character(char value) {
         this.value = value;
@@ -4374,7 +4372,7 @@
      * frequently requested values.
      *
      * This method will always cache values in the range {@code
-     * '\u005Cu0000'} to {@code '\u005Cu007f'}, inclusive, and may
+     * '\u005Cu0000'} to {@code '\u005Cu007F'}, inclusive, and may
      * cache other values outside of this range.
      *
      * @param  c a char value.
@@ -4389,8 +4387,8 @@
     }
 
     /**
-     * Returns the value of this <code>Character</code> object.
-     * @return  the primitive <code>char</code> value represented by
+     * Returns the value of this {@code Character} object.
+     * @return  the primitive {@code char} value represented by
      *          this object.
      */
     public char charValue() {
@@ -4409,13 +4407,13 @@
 
     /**
      * Compares this object against the specified object.
-     * The result is <code>true</code> if and only if the argument is not
-     * <code>null</code> and is a <code>Character</code> object that
-     * represents the same <code>char</code> value as this object.
+     * The result is {@code true} if and only if the argument is not
+     * {@code null} and is a {@code Character} object that
+     * represents the same {@code char} value as this object.
      *
      * @param   obj   the object to compare with.
-     * @return  <code>true</code> if the objects are the same;
-     *          <code>false</code> otherwise.
+     * @return  {@code true} if the objects are the same;
+     *          {@code false} otherwise.
      */
     public boolean equals(Object obj) {
         if (obj instanceof Character) {
@@ -4425,11 +4423,11 @@
     }
 
     /**
-     * Returns a <code>String</code> object representing this
-     * <code>Character</code>'s value.  The result is a string of
+     * Returns a {@code String} object representing this
+     * {@code Character}'s value.  The result is a string of
      * length 1 whose sole component is the primitive
-     * <code>char</code> value represented by this
-     * <code>Character</code> object.
+     * {@code char} value represented by this
+     * {@code Character} object.
      *
      * @return  a string representation of this object.
      */
@@ -4439,12 +4437,12 @@
     }
 
     /**
-     * Returns a <code>String</code> object representing the
-     * specified <code>char</code>.  The result is a string of length
-     * 1 consisting solely of the specified <code>char</code>.
-     *
-     * @param c the <code>char</code> to be converted
-     * @return the string representation of the specified <code>char</code>
+     * Returns a {@code String} object representing the
+     * specified {@code char}.  The result is a string of length
+     * 1 consisting solely of the specified {@code char}.
+     *
+     * @param c the {@code char} to be converted
+     * @return the string representation of the specified {@code char}
      * @since 1.4
      */
     public static String toString(char c) {
@@ -4578,7 +4576,7 @@
     }
 
     /**
-     * Determines whether the specified pair of <code>char</code>
+     * Determines whether the specified pair of {@code char}
      * values is a valid
      * <a href="http://www.unicode.org/glossary/#surrogate_pair">
      * Unicode surrogate pair</a>.
@@ -4590,9 +4588,9 @@
      *
      * @param  high the high-surrogate code value to be tested
      * @param  low the low-surrogate code value to be tested
-     * @return <code>true</code> if the specified high and
+     * @return {@code true} if the specified high and
      * low-surrogate code values represent a valid surrogate pair;
-     * <code>false</code> otherwise.
+     * {@code false} otherwise.
      * @since  1.5
      */
     public static boolean isSurrogatePair(char high, char low) {
@@ -4600,7 +4598,7 @@
     }
 
     /**
-     * Determines the number of <code>char</code> values needed to
+     * Determines the number of {@code char} values needed to
      * represent the specified character (Unicode code point). If the
      * specified character is equal to or greater than 0x10000, then
      * the method returns 2. Otherwise, the method returns 1.
@@ -4643,23 +4641,23 @@
 
     /**
      * Returns the code point at the given index of the
-     * <code>CharSequence</code>. If the <code>char</code> value at
-     * the given index in the <code>CharSequence</code> is in the
+     * {@code CharSequence}. If the {@code char} value at
+     * the given index in the {@code CharSequence} is in the
      * high-surrogate range, the following index is less than the
-     * length of the <code>CharSequence</code>, and the
-     * <code>char</code> value at the following index is in the
+     * length of the {@code CharSequence}, and the
+     * {@code char} value at the following index is in the
      * low-surrogate range, then the supplementary code point
      * corresponding to this surrogate pair is returned. Otherwise,
-     * the <code>char</code> value at the given index is returned.
-     *
-     * @param seq a sequence of <code>char</code> values (Unicode code
+     * the {@code char} value at the given index is returned.
+     *
+     * @param seq a sequence of {@code char} values (Unicode code
      * units)
-     * @param index the index to the <code>char</code> values (Unicode
-     * code units) in <code>seq</code> to be converted
+     * @param index the index to the {@code char} values (Unicode
+     * code units) in {@code seq} to be converted
      * @return the Unicode code point at the given index
-     * @exception NullPointerException if <code>seq</code> is null.
+     * @exception NullPointerException if {@code seq} is null.
      * @exception IndexOutOfBoundsException if the value
-     * <code>index</code> is negative or not less than
+     * {@code index} is negative or not less than
      * {@link CharSequence#length() seq.length()}.
      * @since  1.5
      */
@@ -4678,23 +4676,23 @@
 
     /**
      * Returns the code point at the given index of the
-     * <code>char</code> array. If the <code>char</code> value at
-     * the given index in the <code>char</code> array is in the
+     * {@code char} array. If the {@code char} value at
+     * the given index in the {@code char} array is in the
      * high-surrogate range, the following index is less than the
-     * length of the <code>char</code> array, and the
-     * <code>char</code> value at the following index is in the
+     * length of the {@code char} array, and the
+     * {@code char} value at the following index is in the
      * low-surrogate range, then the supplementary code point
      * corresponding to this surrogate pair is returned. Otherwise,
-     * the <code>char</code> value at the given index is returned.
-     *
-     * @param a the <code>char</code> array
-     * @param index the index to the <code>char</code> values (Unicode
-     * code units) in the <code>char</code> array to be converted
+     * the {@code char} value at the given index is returned.
+     *
+     * @param a the {@code char} array
+     * @param index the index to the {@code char} values (Unicode
+     * code units) in the {@code char} array to be converted
      * @return the Unicode code point at the given index
-     * @exception NullPointerException if <code>a</code> is null.
+     * @exception NullPointerException if {@code a} is null.
      * @exception IndexOutOfBoundsException if the value
-     * <code>index</code> is negative or not less than
-     * the length of the <code>char</code> array.
+     * {@code index} is negative or not less than
+     * the length of the {@code char} array.
      * @since  1.5
      */
     public static int codePointAt(char[] a, int index) {
@@ -4703,27 +4701,27 @@
 
     /**
      * Returns the code point at the given index of the
-     * <code>char</code> array, where only array elements with
-     * <code>index</code> less than <code>limit</code> can be used. If
-     * the <code>char</code> value at the given index in the
-     * <code>char</code> array is in the high-surrogate range, the
-     * following index is less than the <code>limit</code>, and the
-     * <code>char</code> value at the following index is in the
+     * {@code char} array, where only array elements with
+     * {@code index} less than {@code limit} can be used. If
+     * the {@code char} value at the given index in the
+     * {@code char} array is in the high-surrogate range, the
+     * following index is less than the {@code limit}, and the
+     * {@code char} value at the following index is in the
      * low-surrogate range, then the supplementary code point
      * corresponding to this surrogate pair is returned. Otherwise,
-     * the <code>char</code> value at the given index is returned.
-     *
-     * @param a the <code>char</code> array
-     * @param index the index to the <code>char</code> values (Unicode
-     * code units) in the <code>char</code> array to be converted
-     * @param limit the index after the last array element that can be used in the
-     * <code>char</code> array
+     * the {@code char} value at the given index is returned.
+     *
+     * @param a the {@code char} array
+     * @param index the index to the {@code char} values (Unicode
+     * code units) in the {@code char} array to be converted
+     * @param limit the index after the last array element that
+     * can be used in the {@code char} array
      * @return the Unicode code point at the given index
-     * @exception NullPointerException if <code>a</code> is null.
-     * @exception IndexOutOfBoundsException if the <code>index</code>
-     * argument is negative or not less than the <code>limit</code>
-     * argument, or if the <code>limit</code> argument is negative or
-     * greater than the length of the <code>char</code> array.
+     * @exception NullPointerException if {@code a} is null.
+     * @exception IndexOutOfBoundsException if the {@code index}
+     * argument is negative or not less than the {@code limit}
+     * argument, or if the {@code limit} argument is negative or
+     * greater than the length of the {@code char} array.
      * @since  1.5
      */
     public static int codePointAt(char[] a, int index, int limit) {
@@ -4749,21 +4747,21 @@
 
     /**
      * Returns the code point preceding the given index of the
-     * <code>CharSequence</code>. If the <code>char</code> value at
-     * <code>(index - 1)</code> in the <code>CharSequence</code> is in
-     * the low-surrogate range, <code>(index - 2)</code> is not
-     * negative, and the <code>char</code> value at <code>(index -
-     * 2)</code> in the <code>CharSequence</code> is in the
+     * {@code CharSequence}. If the {@code char} value at
+     * {@code (index - 1)} in the {@code CharSequence} is in
+     * the low-surrogate range, {@code (index - 2)} is not
+     * negative, and the {@code char} value at {@code (index - 2)}
+     * in the {@code CharSequence} is in the
      * high-surrogate range, then the supplementary code point
      * corresponding to this surrogate pair is returned. Otherwise,
-     * the <code>char</code> value at <code>(index - 1)</code> is
+     * the {@code char} value at {@code (index - 1)} is
      * returned.
      *
-     * @param seq the <code>CharSequence</code> instance
+     * @param seq the {@code CharSequence} instance
      * @param index the index following the code point that should be returned
      * @return the Unicode code point value before the given index.
-     * @exception NullPointerException if <code>seq</code> is null.
-     * @exception IndexOutOfBoundsException if the <code>index</code>
+     * @exception NullPointerException if {@code seq} is null.
+     * @exception IndexOutOfBoundsException if the {@code index}
      * argument is less than 1 or greater than {@link
      * CharSequence#length() seq.length()}.
      * @since  1.5
@@ -4783,23 +4781,23 @@
 
     /**
      * Returns the code point preceding the given index of the
-     * <code>char</code> array. If the <code>char</code> value at
-     * <code>(index - 1)</code> in the <code>char</code> array is in
-     * the low-surrogate range, <code>(index - 2)</code> is not
-     * negative, and the <code>char</code> value at <code>(index -
-     * 2)</code> in the <code>char</code> array is in the
+     * {@code char} array. If the {@code char} value at
+     * {@code (index - 1)} in the {@code char} array is in
+     * the low-surrogate range, {@code (index - 2)} is not
+     * negative, and the {@code char} value at {@code (index - 2)}
+     * in the {@code char} array is in the
      * high-surrogate range, then the supplementary code point
      * corresponding to this surrogate pair is returned. Otherwise,
-     * the <code>char</code> value at <code>(index - 1)</code> is
+     * the {@code char} value at {@code (index - 1)} is
      * returned.
      *
-     * @param a the <code>char</code> array
+     * @param a the {@code char} array
      * @param index the index following the code point that should be returned
      * @return the Unicode code point value before the given index.
-     * @exception NullPointerException if <code>a</code> is null.
-     * @exception IndexOutOfBoundsException if the <code>index</code>
+     * @exception NullPointerException if {@code a} is null.
+     * @exception IndexOutOfBoundsException if the {@code index}
      * argument is less than 1 or greater than the length of the
-     * <code>char</code> array
+     * {@code char} array
      * @since  1.5
      */
     public static int codePointBefore(char[] a, int index) {
@@ -4808,29 +4806,29 @@
 
     /**
      * Returns the code point preceding the given index of the
-     * <code>char</code> array, where only array elements with
-     * <code>index</code> greater than or equal to <code>start</code>
-     * can be used. If the <code>char</code> value at <code>(index -
-     * 1)</code> in the <code>char</code> array is in the
-     * low-surrogate range, <code>(index - 2)</code> is not less than
-     * <code>start</code>, and the <code>char</code> value at
-     * <code>(index - 2)</code> in the <code>char</code> array is in
+     * {@code char} array, where only array elements with
+     * {@code index} greater than or equal to {@code start}
+     * can be used. If the {@code char} value at {@code (index - 1)}
+     * in the {@code char} array is in the
+     * low-surrogate range, {@code (index - 2)} is not less than
+     * {@code start}, and the {@code char} value at
+     * {@code (index - 2)} in the {@code char} array is in
      * the high-surrogate range, then the supplementary code point
      * corresponding to this surrogate pair is returned. Otherwise,
-     * the <code>char</code> value at <code>(index - 1)</code> is
+     * the {@code char} value at {@code (index - 1)} is
      * returned.
      *
-     * @param a the <code>char</code> array
+     * @param a the {@code char} array
      * @param index the index following the code point that should be returned
      * @param start the index of the first array element in the
-     * <code>char</code> array
+     * {@code char} array
      * @return the Unicode code point value before the given index.
-     * @exception NullPointerException if <code>a</code> is null.
-     * @exception IndexOutOfBoundsException if the <code>index</code>
-     * argument is not greater than the <code>start</code> argument or
-     * is greater than the length of the <code>char</code> array, or
-     * if the <code>start</code> argument is negative or not less than
-     * the length of the <code>char</code> array.
+     * @exception NullPointerException if {@code a} is null.
+     * @exception IndexOutOfBoundsException if the {@code index}
+     * argument is not greater than the {@code start} argument or
+     * is greater than the length of the {@code char} array, or
+     * if the {@code start} argument is negative or not less than
+     * the length of the {@code char} array.
      * @since  1.5
      */
     public static int codePointBefore(char[] a, int index, int start) {
@@ -4915,31 +4913,31 @@
      * Converts the specified character (Unicode code point) to its
      * UTF-16 representation. If the specified code point is a BMP
      * (Basic Multilingual Plane or Plane 0) value, the same value is
-     * stored in <code>dst[dstIndex]</code>, and 1 is returned. If the
+     * stored in {@code dst[dstIndex]}, and 1 is returned. If the
      * specified code point is a supplementary character, its
-     * surrogate values are stored in <code>dst[dstIndex]</code>
-     * (high-surrogate) and <code>dst[dstIndex+1]</code>
+     * surrogate values are stored in {@code dst[dstIndex]}
+     * (high-surrogate) and {@code dst[dstIndex+1]}
      * (low-surrogate), and 2 is returned.
      *
      * @param  codePoint the character (Unicode code point) to be converted.
-     * @param  dst an array of <code>char</code> in which the
-     * <code>codePoint</code>'s UTF-16 value is stored.
-     * @param dstIndex the start index into the <code>dst</code>
+     * @param  dst an array of {@code char} in which the
+     * {@code codePoint}'s UTF-16 value is stored.
+     * @param dstIndex the start index into the {@code dst}
      * array where the converted value is stored.
      * @return 1 if the code point is a BMP code point, 2 if the
      * code point is a supplementary code point.
      * @exception IllegalArgumentException if the specified
-     * <code>codePoint</code> is not a valid Unicode code point.
-     * @exception NullPointerException if the specified <code>dst</code> is null.
-     * @exception IndexOutOfBoundsException if <code>dstIndex</code>
-     * is negative or not less than <code>dst.length</code>, or if
-     * <code>dst</code> at <code>dstIndex</code> doesn't have enough
-     * array element(s) to store the resulting <code>char</code>
-     * value(s). (If <code>dstIndex</code> is equal to
-     * <code>dst.length-1</code> and the specified
-     * <code>codePoint</code> is a supplementary character, the
+     * {@code codePoint} is not a valid Unicode code point.
+     * @exception NullPointerException if the specified {@code dst} is null.
+     * @exception IndexOutOfBoundsException if {@code dstIndex}
+     * is negative or not less than {@code dst.length}, or if
+     * {@code dst} at {@code dstIndex} doesn't have enough
+     * array element(s) to store the resulting {@code char}
+     * value(s). (If {@code dstIndex} is equal to
+     * {@code dst.length-1} and the specified
+     * {@code codePoint} is a supplementary character, the
      * high-surrogate value is not stored in
-     * <code>dst[dstIndex]</code>.)
+     * {@code dst[dstIndex]}.)
      * @since  1.5
      */
     public static int toChars(int codePoint, char[] dst, int dstIndex) {
@@ -4956,18 +4954,18 @@
 
     /**
      * Converts the specified character (Unicode code point) to its
-     * UTF-16 representation stored in a <code>char</code> array. If
+     * UTF-16 representation stored in a {@code char} array. If
      * the specified code point is a BMP (Basic Multilingual Plane or
-     * Plane 0) value, the resulting <code>char</code> array has
-     * the same value as <code>codePoint</code>. If the specified code
+     * Plane 0) value, the resulting {@code char} array has
+     * the same value as {@code codePoint}. If the specified code
      * point is a supplementary code point, the resulting
-     * <code>char</code> array has the corresponding surrogate pair.
+     * {@code char} array has the corresponding surrogate pair.
      *
      * @param  codePoint a Unicode code point
-     * @return a <code>char</code> array having
-     *         <code>codePoint</code>'s UTF-16 representation.
+     * @return a {@code char} array having
+     *         {@code codePoint}'s UTF-16 representation.
      * @exception IllegalArgumentException if the specified
-     * <code>codePoint</code> is not a valid Unicode code point.
+     * {@code codePoint} is not a valid Unicode code point.
      * @since  1.5
      */
     public static char[] toChars(int codePoint) {
@@ -4991,24 +4989,24 @@
     /**
      * Returns the number of Unicode code points in the text range of
      * the specified char sequence. The text range begins at the
-     * specified <code>beginIndex</code> and extends to the
-     * <code>char</code> at index <code>endIndex - 1</code>. Thus the
-     * length (in <code>char</code>s) of the text range is
-     * <code>endIndex-beginIndex</code>. Unpaired surrogates within
+     * specified {@code beginIndex} and extends to the
+     * {@code char} at index {@code endIndex - 1}. Thus the
+     * length (in {@code char}s) of the text range is
+     * {@code endIndex-beginIndex}. Unpaired surrogates within
      * the text range count as one code point each.
      *
      * @param seq the char sequence
-     * @param beginIndex the index to the first <code>char</code> of
+     * @param beginIndex the index to the first {@code char} of
      * the text range.
-     * @param endIndex the index after the last <code>char</code> of
+     * @param endIndex the index after the last {@code char} of
      * the text range.
      * @return the number of Unicode code points in the specified text
      * range
-     * @exception NullPointerException if <code>seq</code> is null.
+     * @exception NullPointerException if {@code seq} is null.
      * @exception IndexOutOfBoundsException if the
-     * <code>beginIndex</code> is negative, or <code>endIndex</code>
+     * {@code beginIndex} is negative, or {@code endIndex}
      * is larger than the length of the given sequence, or
-     * <code>beginIndex</code> is larger than <code>endIndex</code>.
+     * {@code beginIndex} is larger than {@code endIndex}.
      * @since  1.5
      */
     public static int codePointCount(CharSequence seq, int beginIndex, int endIndex) {
@@ -5029,21 +5027,21 @@
 
     /**
      * Returns the number of Unicode code points in a subarray of the
-     * <code>char</code> array argument. The <code>offset</code>
-     * argument is the index of the first <code>char</code> of the
-     * subarray and the <code>count</code> argument specifies the
-     * length of the subarray in <code>char</code>s. Unpaired
+     * {@code char} array argument. The {@code offset}
+     * argument is the index of the first {@code char} of the
+     * subarray and the {@code count} argument specifies the
+     * length of the subarray in {@code char}s. Unpaired
      * surrogates within the subarray count as one code point each.
      *
-     * @param a the <code>char</code> array
-     * @param offset the index of the first <code>char</code> in the
-     * given <code>char</code> array
-     * @param count the length of the subarray in <code>char</code>s
+     * @param a the {@code char} array
+     * @param offset the index of the first {@code char} in the
+     * given {@code char} array
+     * @param count the length of the subarray in {@code char}s
      * @return the number of Unicode code points in the specified subarray
-     * @exception NullPointerException if <code>a</code> is null.
-     * @exception IndexOutOfBoundsException if <code>offset</code> or
-     * <code>count</code> is negative, or if <code>offset +
-     * count</code> is larger than the length of the given array.
+     * @exception NullPointerException if {@code a} is null.
+     * @exception IndexOutOfBoundsException if {@code offset} or
+     * {@code count} is negative, or if {@code offset +
+     * count} is larger than the length of the given array.
      * @since  1.5
      */
     public static int codePointCount(char[] a, int offset, int count) {
@@ -5068,24 +5066,24 @@
 
     /**
      * Returns the index within the given char sequence that is offset
-     * from the given <code>index</code> by <code>codePointOffset</code>
+     * from the given {@code index} by {@code codePointOffset}
      * code points. Unpaired surrogates within the text range given by
-     * <code>index</code> and <code>codePointOffset</code> count as
+     * {@code index} and {@code codePointOffset} count as
      * one code point each.
      *
      * @param seq the char sequence
      * @param index the index to be offset
      * @param codePointOffset the offset in code points
      * @return the index within the char sequence
-     * @exception NullPointerException if <code>seq</code> is null.
-     * @exception IndexOutOfBoundsException if <code>index</code>
+     * @exception NullPointerException if {@code seq} is null.
+     * @exception IndexOutOfBoundsException if {@code index}
      *   is negative or larger then the length of the char sequence,
-     *   or if <code>codePointOffset</code> is positive and the
-     *   subsequence starting with <code>index</code> has fewer than
-     *   <code>codePointOffset</code> code points, or if
-     *   <code>codePointOffset</code> is negative and the subsequence
-     *   before <code>index</code> has fewer than the absolute value
-     *   of <code>codePointOffset</code> code points.
+     *   or if {@code codePointOffset} is positive and the
+     *   subsequence starting with {@code index} has fewer than
+     *   {@code codePointOffset} code points, or if
+     *   {@code codePointOffset} is negative and the subsequence
+     *   before {@code index} has fewer than the absolute value
+     *   of {@code codePointOffset} code points.
      * @since 1.5
      */
     public static int offsetByCodePoints(CharSequence seq, int index,
@@ -5123,36 +5121,36 @@
     }
 
     /**
-     * Returns the index within the given <code>char</code> subarray
-     * that is offset from the given <code>index</code> by
-     * <code>codePointOffset</code> code points. The
-     * <code>start</code> and <code>count</code> arguments specify a
-     * subarray of the <code>char</code> array. Unpaired surrogates
-     * within the text range given by <code>index</code> and
-     * <code>codePointOffset</code> count as one code point each.
-     *
-     * @param a the <code>char</code> array
-     * @param start the index of the first <code>char</code> of the
+     * Returns the index within the given {@code char} subarray
+     * that is offset from the given {@code index} by
+     * {@code codePointOffset} code points. The
+     * {@code start} and {@code count} arguments specify a
+     * subarray of the {@code char} array. Unpaired surrogates
+     * within the text range given by {@code index} and
+     * {@code codePointOffset} count as one code point each.
+     *
+     * @param a the {@code char} array
+     * @param start the index of the first {@code char} of the
      * subarray
-     * @param count the length of the subarray in <code>char</code>s
+     * @param count the length of the subarray in {@code char}s
      * @param index the index to be offset
      * @param codePointOffset the offset in code points
      * @return the index within the subarray
-     * @exception NullPointerException if <code>a</code> is null.
+     * @exception NullPointerException if {@code a} is null.
      * @exception IndexOutOfBoundsException
-     *   if <code>start</code> or <code>count</code> is negative,
-     *   or if <code>start + count</code> is larger than the length of
+     *   if {@code start} or {@code count} is negative,
+     *   or if {@code start + count} is larger than the length of
      *   the given array,
-     *   or if <code>index</code> is less than <code>start</code> or
-     *   larger then <code>start + count</code>,
-     *   or if <code>codePointOffset</code> is positive and the text range
-     *   starting with <code>index</code> and ending with <code>start
-     *   + count - 1</code> has fewer than <code>codePointOffset</code> code
+     *   or if {@code index} is less than {@code start} or
+     *   larger then {@code start + count},
+     *   or if {@code codePointOffset} is positive and the text range
+     *   starting with {@code index} and ending with {@code start + count - 1}
+     *   has fewer than {@code codePointOffset} code
      *   points,
-     *   or if <code>codePointOffset</code> is negative and the text range
-     *   starting with <code>start</code> and ending with <code>index
-     *   - 1</code> has fewer than the absolute value of
-     *   <code>codePointOffset</code> code points.
+     *   or if {@code codePointOffset} is negative and the text range
+     *   starting with {@code start} and ending with {@code index - 1}
+     *   has fewer than the absolute value of
+     *   {@code codePointOffset} code points.
      * @since 1.5
      */
     public static int offsetByCodePoints(char[] a, int start, int count,
@@ -5198,8 +5196,8 @@
      * Determines if the specified character is a lowercase character.
      * <p>
      * A character is lowercase if its general category type, provided
-     * by <code>Character.getType(ch)</code>, is
-     * <code>LOWERCASE_LETTER</code>.
+     * by {@code Character.getType(ch)}, is
+     * {@code LOWERCASE_LETTER}.
      * <p>
      * The following are examples of lowercase characters:
      * <p><blockquote><pre>
@@ -5217,8 +5215,8 @@
      * the {@link #isLowerCase(int)} method.
      *
      * @param   ch   the character to be tested.
-     * @return  <code>true</code> if the character is lowercase;
-     *          <code>false</code> otherwise.
+     * @return  {@code true} if the character is lowercase;
+     *          {@code false} otherwise.
      * @see     Character#isLowerCase(char)
      * @see     Character#isTitleCase(char)
      * @see     Character#toLowerCase(char)
@@ -5234,7 +5232,7 @@
      * <p>
      * A character is lowercase if its general category type, provided
      * by {@link Character#getType getType(codePoint)}, is
-     * <code>LOWERCASE_LETTER</code>.
+     * {@code LOWERCASE_LETTER}.
      * <p>
      * The following are examples of lowercase characters:
      * <p><blockquote><pre>
@@ -5247,8 +5245,8 @@
      * <p> Many other Unicode characters are lowercase too.
      *
      * @param   codePoint the character (Unicode code point) to be tested.
-     * @return  <code>true</code> if the character is lowercase;
-     *          <code>false</code> otherwise.
+     * @return  {@code true} if the character is lowercase;
+     *          {@code false} otherwise.
      * @see     Character#isLowerCase(int)
      * @see     Character#isTitleCase(int)
      * @see     Character#toLowerCase(int)
@@ -5263,7 +5261,7 @@
      * Determines if the specified character is an uppercase character.
      * <p>
      * A character is uppercase if its general category type, provided by
-     * <code>Character.getType(ch)</code>, is <code>UPPERCASE_LETTER</code>.
+     * {@code Character.getType(ch)}, is {@code UPPERCASE_LETTER}.
      * <p>
      * The following are examples of uppercase characters:
      * <p><blockquote><pre>
@@ -5281,8 +5279,8 @@
      * the {@link #isUpperCase(int)} method.
      *
      * @param   ch   the character to be tested.
-     * @return  <code>true</code> if the character is uppercase;
-     *          <code>false</code> otherwise.
+     * @return  {@code true} if the character is uppercase;
+     *          {@code false} otherwise.
      * @see     Character#isLowerCase(char)
      * @see     Character#isTitleCase(char)
      * @see     Character#toUpperCase(char)
@@ -5297,7 +5295,7 @@
      * Determines if the specified character (Unicode code point) is an uppercase character.
      * <p>
      * A character is uppercase if its general category type, provided by
-     * {@link Character#getType(int) getType(codePoint)}, is <code>UPPERCASE_LETTER</code>.
+     * {@link Character#getType(int) getType(codePoint)}, is {@code UPPERCASE_LETTER}.
      * <p>
      * The following are examples of uppercase characters:
      * <p><blockquote><pre>
@@ -5310,8 +5308,8 @@
      * <p> Many other Unicode characters are uppercase too.<p>
      *
      * @param   codePoint the character (Unicode code point) to be tested.
-     * @return  <code>true</code> if the character is uppercase;
-     *          <code>false</code> otherwise.
+     * @return  {@code true} if the character is uppercase;
+     *          {@code false} otherwise.
      * @see     Character#isLowerCase(int)
      * @see     Character#isTitleCase(int)
      * @see     Character#toUpperCase(int)
@@ -5326,8 +5324,8 @@
      * Determines if the specified character is a titlecase character.
      * <p>
      * A character is a titlecase character if its general
-     * category type, provided by <code>Character.getType(ch)</code>,
-     * is <code>TITLECASE_LETTER</code>.
+     * category type, provided by {@code Character.getType(ch)},
+     * is {@code TITLECASE_LETTER}.
      * <p>
      * Some characters look like pairs of Latin letters. For example, there
      * is an uppercase letter that looks like "LJ" and has a corresponding
@@ -5336,12 +5334,12 @@
      * with initial capitals, as for a book title.
      * <p>
      * These are some of the Unicode characters for which this method returns
-     * <code>true</code>:
+     * {@code true}:
      * <ul>
-     * <li><code>LATIN CAPITAL LETTER D WITH SMALL LETTER Z WITH CARON</code>
-     * <li><code>LATIN CAPITAL LETTER L WITH SMALL LETTER J</code>
-     * <li><code>LATIN CAPITAL LETTER N WITH SMALL LETTER J</code>
-     * <li><code>LATIN CAPITAL LETTER D WITH SMALL LETTER Z</code>
+     * <li>{@code LATIN CAPITAL LETTER D WITH SMALL LETTER Z WITH CARON}
+     * <li>{@code LATIN CAPITAL LETTER L WITH SMALL LETTER J}
+     * <li>{@code LATIN CAPITAL LETTER N WITH SMALL LETTER J}
+     * <li>{@code LATIN CAPITAL LETTER D WITH SMALL LETTER Z}
      * </ul>
      * <p> Many other Unicode characters are titlecase too.<p>
      *
@@ -5351,8 +5349,8 @@
      * the {@link #isTitleCase(int)} method.
      *
      * @param   ch   the character to be tested.
-     * @return  <code>true</code> if the character is titlecase;
-     *          <code>false</code> otherwise.
+     * @return  {@code true} if the character is titlecase;
+     *          {@code false} otherwise.
      * @see     Character#isLowerCase(char)
      * @see     Character#isUpperCase(char)
      * @see     Character#toTitleCase(char)
@@ -5368,7 +5366,7 @@
      * <p>
      * A character is a titlecase character if its general
      * category type, provided by {@link Character#getType(int) getType(codePoint)},
-     * is <code>TITLECASE_LETTER</code>.
+     * is {@code TITLECASE_LETTER}.
      * <p>
      * Some characters look like pairs of Latin letters. For example, there
      * is an uppercase letter that looks like "LJ" and has a corresponding
@@ -5377,18 +5375,18 @@
      * with initial capitals, as for a book title.
      * <p>
      * These are some of the Unicode characters for which this method returns
-     * <code>true</code>:
+     * {@code true}:
      * <ul>
-     * <li><code>LATIN CAPITAL LETTER D WITH SMALL LETTER Z WITH CARON</code>
-     * <li><code>LATIN CAPITAL LETTER L WITH SMALL LETTER J</code>
-     * <li><code>LATIN CAPITAL LETTER N WITH SMALL LETTER J</code>
-     * <li><code>LATIN CAPITAL LETTER D WITH SMALL LETTER Z</code>
+     * <li>{@code LATIN CAPITAL LETTER D WITH SMALL LETTER Z WITH CARON}
+     * <li>{@code LATIN CAPITAL LETTER L WITH SMALL LETTER J}
+     * <li>{@code LATIN CAPITAL LETTER N WITH SMALL LETTER J}
+     * <li>{@code LATIN CAPITAL LETTER D WITH SMALL LETTER Z}
      * </ul>
      * <p> Many other Unicode characters are titlecase too.<p>
      *
      * @param   codePoint the character (Unicode code point) to be tested.
-     * @return  <code>true</code> if the character is titlecase;
-     *          <code>false</code> otherwise.
+     * @return  {@code true} if the character is titlecase;
+     *          {@code false} otherwise.
      * @see     Character#isLowerCase(int)
      * @see     Character#isUpperCase(int)
      * @see     Character#toTitleCase(int)
@@ -5403,20 +5401,20 @@
      * Determines if the specified character is a digit.
      * <p>
      * A character is a digit if its general category type, provided
-     * by <code>Character.getType(ch)</code>, is
-     * <code>DECIMAL_DIGIT_NUMBER</code>.
+     * by {@code Character.getType(ch)}, is
+     * {@code DECIMAL_DIGIT_NUMBER}.
      * <p>
      * Some Unicode character ranges that contain digits:
      * <ul>
-     * <li><code>'&#92;u0030'</code> through <code>'&#92;u0039'</code>,
-     *     ISO-LATIN-1 digits (<code>'0'</code> through <code>'9'</code>)
-     * <li><code>'&#92;u0660'</code> through <code>'&#92;u0669'</code>,
+     * <li>{@code '\u005Cu0030'} through {@code '\u005Cu0039'},
+     *     ISO-LATIN-1 digits ({@code '0'} through {@code '9'})
+     * <li>{@code '\u005Cu0660'} through {@code '\u005Cu0669'},
      *     Arabic-Indic digits
-     * <li><code>'&#92;u06F0'</code> through <code>'&#92;u06F9'</code>,
+     * <li>{@code '\u005Cu06F0'} through {@code '\u005Cu06F9'},
      *     Extended Arabic-Indic digits
-     * <li><code>'&#92;u0966'</code> through <code>'&#92;u096F'</code>,
+     * <li>{@code '\u005Cu0966'} through {@code '\u005Cu096F'},
      *     Devanagari digits
-     * <li><code>'&#92;uFF10'</code> through <code>'&#92;uFF19'</code>,
+     * <li>{@code '\u005CuFF10'} through {@code '\u005CuFF19'},
      *     Fullwidth digits
      * </ul>
      *
@@ -5428,8 +5426,8 @@
      * the {@link #isDigit(int)} method.
      *
      * @param   ch   the character to be tested.
-     * @return  <code>true</code> if the character is a digit;
-     *          <code>false</code> otherwise.
+     * @return  {@code true} if the character is a digit;
+     *          {@code false} otherwise.
      * @see     Character#digit(char, int)
      * @see     Character#forDigit(int, int)
      * @see     Character#getType(char)
@@ -5443,27 +5441,27 @@
      * <p>
      * A character is a digit if its general category type, provided
      * by {@link Character#getType(int) getType(codePoint)}, is
-     * <code>DECIMAL_DIGIT_NUMBER</code>.
+     * {@code DECIMAL_DIGIT_NUMBER}.
      * <p>
      * Some Unicode character ranges that contain digits:
      * <ul>
-     * <li><code>'&#92;u0030'</code> through <code>'&#92;u0039'</code>,
-     *     ISO-LATIN-1 digits (<code>'0'</code> through <code>'9'</code>)
-     * <li><code>'&#92;u0660'</code> through <code>'&#92;u0669'</code>,
+     * <li>{@code '\u005Cu0030'} through {@code '\u005Cu0039'},
+     *     ISO-LATIN-1 digits ({@code '0'} through {@code '9'})
+     * <li>{@code '\u005Cu0660'} through {@code '\u005Cu0669'},
      *     Arabic-Indic digits
-     * <li><code>'&#92;u06F0'</code> through <code>'&#92;u06F9'</code>,
+     * <li>{@code '\u005Cu06F0'} through {@code '\u005Cu06F9'},
      *     Extended Arabic-Indic digits
-     * <li><code>'&#92;u0966'</code> through <code>'&#92;u096F'</code>,
+     * <li>{@code '\u005Cu0966'} through {@code '\u005Cu096F'},
      *     Devanagari digits
-     * <li><code>'&#92;uFF10'</code> through <code>'&#92;uFF19'</code>,
+     * <li>{@code '\u005CuFF10'} through {@code '\u005CuFF19'},
      *     Fullwidth digits
      * </ul>
      *
      * Many other character ranges contain digits as well.
      *
      * @param   codePoint the character (Unicode code point) to be tested.
-     * @return  <code>true</code> if the character is a digit;
-     *          <code>false</code> otherwise.
+     * @return  {@code true} if the character is a digit;
+     *          {@code false} otherwise.
      * @see     Character#forDigit(int, int)
      * @see     Character#getType(int)
      * @since   1.5
@@ -5487,8 +5485,8 @@
      * the {@link #isDefined(int)} method.
      *
      * @param   ch   the character to be tested
-     * @return  <code>true</code> if the character has a defined meaning
-     *          in Unicode; <code>false</code> otherwise.
+     * @return  {@code true} if the character has a defined meaning
+     *          in Unicode; {@code false} otherwise.
      * @see     Character#isDigit(char)
      * @see     Character#isLetter(char)
      * @see     Character#isLetterOrDigit(char)
@@ -5511,8 +5509,8 @@
      * </ul>
      *
      * @param   codePoint the character (Unicode code point) to be tested.
-     * @return  <code>true</code> if the character has a defined meaning
-     *          in Unicode; <code>false</code> otherwise.
+     * @return  {@code true} if the character has a defined meaning
+     *          in Unicode; {@code false} otherwise.
      * @see     Character#isDigit(int)
      * @see     Character#isLetter(int)
      * @see     Character#isLetterOrDigit(int)
@@ -5529,14 +5527,14 @@
      * Determines if the specified character is a letter.
      * <p>
      * A character is considered to be a letter if its general
-     * category type, provided by <code>Character.getType(ch)</code>,
+     * category type, provided by {@code Character.getType(ch)},
      * is any of the following:
      * <ul>
-     * <li> <code>UPPERCASE_LETTER</code>
-     * <li> <code>LOWERCASE_LETTER</code>
-     * <li> <code>TITLECASE_LETTER</code>
-     * <li> <code>MODIFIER_LETTER</code>
-     * <li> <code>OTHER_LETTER</code>
+     * <li> {@code UPPERCASE_LETTER}
+     * <li> {@code LOWERCASE_LETTER}
+     * <li> {@code TITLECASE_LETTER}
+     * <li> {@code MODIFIER_LETTER}
+     * <li> {@code OTHER_LETTER}
      * </ul>
      *
      * Not all letters have case. Many characters are
@@ -5548,8 +5546,8 @@
      * the {@link #isLetter(int)} method.
      *
      * @param   ch   the character to be tested.
-     * @return  <code>true</code> if the character is a letter;
-     *          <code>false</code> otherwise.
+     * @return  {@code true} if the character is a letter;
+     *          {@code false} otherwise.
      * @see     Character#isDigit(char)
      * @see     Character#isJavaIdentifierStart(char)
      * @see     Character#isJavaLetter(char)
@@ -5571,19 +5569,19 @@
      * category type, provided by {@link Character#getType(int) getType(codePoint)},
      * is any of the following:
      * <ul>
-     * <li> <code>UPPERCASE_LETTER</code>
-     * <li> <code>LOWERCASE_LETTER</code>
-     * <li> <code>TITLECASE_LETTER</code>
-     * <li> <code>MODIFIER_LETTER</code>
-     * <li> <code>OTHER_LETTER</code>
+     * <li> {@code UPPERCASE_LETTER}
+     * <li> {@code LOWERCASE_LETTER}
+     * <li> {@code TITLECASE_LETTER}
+     * <li> {@code MODIFIER_LETTER}
+     * <li> {@code OTHER_LETTER}
      * </ul>
      *
      * Not all letters have case. Many characters are
      * letters but are neither uppercase nor lowercase nor titlecase.
      *
      * @param   codePoint the character (Unicode code point) to be tested.
-     * @return  <code>true</code> if the character is a letter;
-     *          <code>false</code> otherwise.
+     * @return  {@code true} if the character is a letter;
+     *          {@code false} otherwise.
      * @see     Character#isDigit(int)
      * @see     Character#isJavaIdentifierStart(int)
      * @see     Character#isLetterOrDigit(int)
@@ -5606,9 +5604,9 @@
      * Determines if the specified character is a letter or digit.
      * <p>
      * A character is considered to be a letter or digit if either
-     * <code>Character.isLetter(char ch)</code> or
-     * <code>Character.isDigit(char ch)</code> returns
-     * <code>true</code> for the character.
+     * {@code Character.isLetter(char ch)} or
+     * {@code Character.isDigit(char ch)} returns
+     * {@code true} for the character.
      *
      * <p><b>Note:</b> This method cannot handle <a
      * href="#supplementary"> supplementary characters</a>. To support
@@ -5616,8 +5614,8 @@
      * the {@link #isLetterOrDigit(int)} method.
      *
      * @param   ch   the character to be tested.
-     * @return  <code>true</code> if the character is a letter or digit;
-     *          <code>false</code> otherwise.
+     * @return  {@code true} if the character is a letter or digit;
+     *          {@code false} otherwise.
      * @see     Character#isDigit(char)
      * @see     Character#isJavaIdentifierPart(char)
      * @see     Character#isJavaLetter(char)
@@ -5636,11 +5634,11 @@
      * A character is considered to be a letter or digit if either
      * {@link #isLetter(int) isLetter(codePoint)} or
      * {@link #isDigit(int) isDigit(codePoint)} returns
-     * <code>true</code> for the character.
+     * {@code true} for the character.
      *
      * @param   codePoint the character (Unicode code point) to be tested.
-     * @return  <code>true</code> if the character is a letter or digit;
-     *          <code>false</code> otherwise.
+     * @return  {@code true} if the character is a letter or digit;
+     *          {@code false} otherwise.
      * @see     Character#isDigit(int)
      * @see     Character#isJavaIdentifierPart(int)
      * @see     Character#isLetter(int)
@@ -5664,15 +5662,15 @@
      * A character may start a Java identifier if and only if
      * one of the following is true:
      * <ul>
-     * <li> {@link #isLetter(char) isLetter(ch)} returns <code>true</code>
-     * <li> {@link #getType(char) getType(ch)} returns <code>LETTER_NUMBER</code>
-     * <li> ch is a currency symbol (such as "$")
-     * <li> ch is a connecting punctuation character (such as "_").
+     * <li> {@link #isLetter(char) isLetter(ch)} returns {@code true}
+     * <li> {@link #getType(char) getType(ch)} returns {@code LETTER_NUMBER}
+     * <li> {@code ch} is a currency symbol (such as {@code '$'})
+     * <li> {@code ch} is a connecting punctuation character (such as {@code '_'}).
      * </ul>
      *
      * @param   ch the character to be tested.
-     * @return  <code>true</code> if the character may start a Java
-     *          identifier; <code>false</code> otherwise.
+     * @return  {@code true} if the character may start a Java
+     *          identifier; {@code false} otherwise.
      * @see     Character#isJavaLetterOrDigit(char)
      * @see     Character#isJavaIdentifierStart(char)
      * @see     Character#isJavaIdentifierPart(char)
@@ -5695,19 +5693,19 @@
      * of the following are true:
      * <ul>
      * <li>  it is a letter
-     * <li>  it is a currency symbol (such as <code>'$'</code>)
-     * <li>  it is a connecting punctuation character (such as <code>'_'</code>)
+     * <li>  it is a currency symbol (such as {@code '$'})
+     * <li>  it is a connecting punctuation character (such as {@code '_'})
      * <li>  it is a digit
      * <li>  it is a numeric letter (such as a Roman numeral character)
      * <li>  it is a combining mark
      * <li>  it is a non-spacing mark
-     * <li> <code>isIdentifierIgnorable</code> returns
-     * <code>true</code> for the character.
+     * <li> {@code isIdentifierIgnorable} returns
+     * {@code true} for the character.
      * </ul>
      *
      * @param   ch the character to be tested.
-     * @return  <code>true</code> if the character may be part of a
-     *          Java identifier; <code>false</code> otherwise.
+     * @return  {@code true} if the character may be part of a
+     *          Java identifier; {@code false} otherwise.
      * @see     Character#isJavaLetter(char)
      * @see     Character#isJavaIdentifierStart(char)
      * @see     Character#isJavaIdentifierPart(char)
@@ -5730,10 +5728,10 @@
      * A character may start a Java identifier if and only if
      * one of the following conditions is true:
      * <ul>
-     * <li> {@link #isLetter(char) isLetter(ch)} returns <code>true</code>
-     * <li> {@link #getType(char) getType(ch)} returns <code>LETTER_NUMBER</code>
-     * <li> ch is a currency symbol (such as "$")
-     * <li> ch is a connecting punctuation character (such as "_").
+     * <li> {@link #isLetter(char) isLetter(ch)} returns {@code true}
+     * <li> {@link #getType(char) getType(ch)} returns {@code LETTER_NUMBER}
+     * <li> {@code ch} is a currency symbol (such as {@code '$'})
+     * <li> {@code ch} is a connecting punctuation character (such as {@code '_'}).
      * </ul>
      *
      * <p><b>Note:</b> This method cannot handle <a
@@ -5742,8 +5740,8 @@
      * the {@link #isJavaIdentifierStart(int)} method.
      *
      * @param   ch the character to be tested.
-     * @return  <code>true</code> if the character may start a Java identifier;
-     *          <code>false</code> otherwise.
+     * @return  {@code true} if the character may start a Java identifier;
+     *          {@code false} otherwise.
      * @see     Character#isJavaIdentifierPart(char)
      * @see     Character#isLetter(char)
      * @see     Character#isUnicodeIdentifierStart(char)
@@ -5762,17 +5760,17 @@
      * one of the following conditions is true:
      * <ul>
      * <li> {@link #isLetter(int) isLetter(codePoint)}
-     *      returns <code>true</code>
+     *      returns {@code true}
      * <li> {@link #getType(int) getType(codePoint)}
-     *      returns <code>LETTER_NUMBER</code>
-     * <li> the referenced character is a currency symbol (such as "$")
+     *      returns {@code LETTER_NUMBER}
+     * <li> the referenced character is a currency symbol (such as {@code '$'})
      * <li> the referenced character is a connecting punctuation character
-     *      (such as "_").
+     *      (such as {@code '_'}).
      * </ul>
      *
      * @param   codePoint the character (Unicode code point) to be tested.
-     * @return  <code>true</code> if the character may start a Java identifier;
-     *          <code>false</code> otherwise.
+     * @return  {@code true} if the character may start a Java identifier;
+     *          {@code false} otherwise.
      * @see     Character#isJavaIdentifierPart(int)
      * @see     Character#isLetter(int)
      * @see     Character#isUnicodeIdentifierStart(int)
@@ -5791,14 +5789,14 @@
      * are true:
      * <ul>
      * <li>  it is a letter
-     * <li>  it is a currency symbol (such as <code>'$'</code>)
-     * <li>  it is a connecting punctuation character (such as <code>'_'</code>)
+     * <li>  it is a currency symbol (such as {@code '$'})
+     * <li>  it is a connecting punctuation character (such as {@code '_'})
      * <li>  it is a digit
      * <li>  it is a numeric letter (such as a Roman numeral character)
      * <li>  it is a combining mark
      * <li>  it is a non-spacing mark
-     * <li> <code>isIdentifierIgnorable</code> returns
-     * <code>true</code> for the character
+     * <li> {@code isIdentifierIgnorable} returns
+     * {@code true} for the character
      * </ul>
      *
      * <p><b>Note:</b> This method cannot handle <a
@@ -5807,8 +5805,8 @@
      * the {@link #isJavaIdentifierPart(int)} method.
      *
      * @param   ch      the character to be tested.
-     * @return <code>true</code> if the character may be part of a
-     *          Java identifier; <code>false</code> otherwise.
+     * @return {@code true} if the character may be part of a
+     *          Java identifier; {@code false} otherwise.
      * @see     Character#isIdentifierIgnorable(char)
      * @see     Character#isJavaIdentifierStart(char)
      * @see     Character#isLetterOrDigit(char)
@@ -5828,20 +5826,20 @@
      * are true:
      * <ul>
      * <li>  it is a letter
-     * <li>  it is a currency symbol (such as <code>'$'</code>)
-     * <li>  it is a connecting punctuation character (such as <code>'_'</code>)
+     * <li>  it is a currency symbol (such as {@code '$'})
+     * <li>  it is a connecting punctuation character (such as {@code '_'})
      * <li>  it is a digit
      * <li>  it is a numeric letter (such as a Roman numeral character)
      * <li>  it is a combining mark
      * <li>  it is a non-spacing mark
      * <li> {@link #isIdentifierIgnorable(int)
-     * isIdentifierIgnorable(codePoint)} returns <code>true</code> for
+     * isIdentifierIgnorable(codePoint)} returns {@code true} for
      * the character
      * </ul>
      *
      * @param   codePoint the character (Unicode code point) to be tested.
-     * @return <code>true</code> if the character may be part of a
-     *          Java identifier; <code>false</code> otherwise.
+     * @return {@code true} if the character may be part of a
+     *          Java identifier; {@code false} otherwise.
      * @see     Character#isIdentifierIgnorable(int)
      * @see     Character#isJavaIdentifierStart(int)
      * @see     Character#isLetterOrDigit(int)
@@ -5860,9 +5858,9 @@
      * A character may start a Unicode identifier if and only if
      * one of the following conditions is true:
      * <ul>
-     * <li> {@link #isLetter(char) isLetter(ch)} returns <code>true</code>
+     * <li> {@link #isLetter(char) isLetter(ch)} returns {@code true}
      * <li> {@link #getType(char) getType(ch)} returns
-     *      <code>LETTER_NUMBER</code>.
+     *      {@code LETTER_NUMBER}.
      * </ul>
      *
      * <p><b>Note:</b> This method cannot handle <a
@@ -5871,8 +5869,8 @@
      * the {@link #isUnicodeIdentifierStart(int)} method.
      *
      * @param   ch      the character to be tested.
-     * @return  <code>true</code> if the character may start a Unicode
-     *          identifier; <code>false</code> otherwise.
+     * @return  {@code true} if the character may start a Unicode
+     *          identifier; {@code false} otherwise.
      * @see     Character#isJavaIdentifierStart(char)
      * @see     Character#isLetter(char)
      * @see     Character#isUnicodeIdentifierPart(char)
@@ -5890,13 +5888,13 @@
      * one of the following conditions is true:
      * <ul>
      * <li> {@link #isLetter(int) isLetter(codePoint)}
-     *      returns <code>true</code>
+     *      returns {@code true}
      * <li> {@link #getType(int) getType(codePoint)}
-     *      returns <code>LETTER_NUMBER</code>.
+     *      returns {@code LETTER_NUMBER}.
      * </ul>
      * @param   codePoint the character (Unicode code point) to be tested.
-     * @return  <code>true</code> if the character may start a Unicode
-     *          identifier; <code>false</code> otherwise.
+     * @return  {@code true} if the character may start a Unicode
+     *          identifier; {@code false} otherwise.
      * @see     Character#isJavaIdentifierStart(int)
      * @see     Character#isLetter(int)
      * @see     Character#isUnicodeIdentifierPart(int)
@@ -5914,13 +5912,13 @@
      * one of the following statements is true:
      * <ul>
      * <li>  it is a letter
-     * <li>  it is a connecting punctuation character (such as <code>'_'</code>)
+     * <li>  it is a connecting punctuation character (such as {@code '_'})
      * <li>  it is a digit
      * <li>  it is a numeric letter (such as a Roman numeral character)
      * <li>  it is a combining mark
      * <li>  it is a non-spacing mark
-     * <li> <code>isIdentifierIgnorable</code> returns
-     * <code>true</code> for this character.
+     * <li> {@code isIdentifierIgnorable} returns
+     * {@code true} for this character.
      * </ul>
      *
      * <p><b>Note:</b> This method cannot handle <a
@@ -5929,8 +5927,8 @@
      * the {@link #isUnicodeIdentifierPart(int)} method.
      *
      * @param   ch      the character to be tested.
-     * @return  <code>true</code> if the character may be part of a
-     *          Unicode identifier; <code>false</code> otherwise.
+     * @return  {@code true} if the character may be part of a
+     *          Unicode identifier; {@code false} otherwise.
      * @see     Character#isIdentifierIgnorable(char)
      * @see     Character#isJavaIdentifierPart(char)
      * @see     Character#isLetterOrDigit(char)
@@ -5949,17 +5947,17 @@
      * one of the following statements is true:
      * <ul>
      * <li>  it is a letter
-     * <li>  it is a connecting punctuation character (such as <code>'_'</code>)
+     * <li>  it is a connecting punctuation character (such as {@code '_'})
      * <li>  it is a digit
      * <li>  it is a numeric letter (such as a Roman numeral character)
      * <li>  it is a combining mark
      * <li>  it is a non-spacing mark
-     * <li> <code>isIdentifierIgnorable</code> returns
-     * <code>true</code> for this character.
+     * <li> {@code isIdentifierIgnorable} returns
+     * {@code true} for this character.
      * </ul>
      * @param   codePoint the character (Unicode code point) to be tested.
-     * @return  <code>true</code> if the character may be part of a
-     *          Unicode identifier; <code>false</code> otherwise.
+     * @return  {@code true} if the character may be part of a
+     *          Unicode identifier; {@code false} otherwise.
      * @see     Character#isIdentifierIgnorable(int)
      * @see     Character#isJavaIdentifierPart(int)
      * @see     Character#isLetterOrDigit(int)
@@ -5979,12 +5977,12 @@
      * <ul>
      * <li>ISO control characters that are not whitespace
      * <ul>
-     * <li><code>'&#92;u0000'</code> through <code>'&#92;u0008'</code>
-     * <li><code>'&#92;u000E'</code> through <code>'&#92;u001B'</code>
-     * <li><code>'&#92;u007F'</code> through <code>'&#92;u009F'</code>
+     * <li>{@code '\u005Cu0000'} through {@code '\u005Cu0008'}
+     * <li>{@code '\u005Cu000E'} through {@code '\u005Cu001B'}
+     * <li>{@code '\u005Cu007F'} through {@code '\u005Cu009F'}
      * </ul>
      *
-     * <li>all characters that have the <code>FORMAT</code> general
+     * <li>all characters that have the {@code FORMAT} general
      * category value
      * </ul>
      *
@@ -5994,9 +5992,9 @@
      * the {@link #isIdentifierIgnorable(int)} method.
      *
      * @param   ch      the character to be tested.
-     * @return  <code>true</code> if the character is an ignorable control
+     * @return  {@code true} if the character is an ignorable control
      *          character that may be part of a Java or Unicode identifier;
-     *           <code>false</code> otherwise.
+     *           {@code false} otherwise.
      * @see     Character#isJavaIdentifierPart(char)
      * @see     Character#isUnicodeIdentifierPart(char)
      * @since   1.1
@@ -6014,19 +6012,19 @@
      * <ul>
      * <li>ISO control characters that are not whitespace
      * <ul>
-     * <li><code>'&#92;u0000'</code> through <code>'&#92;u0008'</code>
-     * <li><code>'&#92;u000E'</code> through <code>'&#92;u001B'</code>
-     * <li><code>'&#92;u007F'</code> through <code>'&#92;u009F'</code>
+     * <li>{@code '\u005Cu0000'} through {@code '\u005Cu0008'}
+     * <li>{@code '\u005Cu000E'} through {@code '\u005Cu001B'}
+     * <li>{@code '\u005Cu007F'} through {@code '\u005Cu009F'}
      * </ul>
      *
-     * <li>all characters that have the <code>FORMAT</code> general
+     * <li>all characters that have the {@code FORMAT} general
      * category value
      * </ul>
      *
      * @param   codePoint the character (Unicode code point) to be tested.
-     * @return  <code>true</code> if the character is an ignorable control
+     * @return  {@code true} if the character is an ignorable control
      *          character that may be part of a Java or Unicode identifier;
-     *          <code>false</code> otherwise.
+     *          {@code false} otherwise.
      * @see     Character#isJavaIdentifierPart(int)
      * @see     Character#isUnicodeIdentifierPart(int)
      * @since   1.5
@@ -6040,16 +6038,16 @@
      * mapping information from the UnicodeData file.
      * <p>
      * Note that
-     * <code>Character.isLowerCase(Character.toLowerCase(ch))</code>
-     * does not always return <code>true</code> for some ranges of
+     * {@code Character.isLowerCase(Character.toLowerCase(ch))}
+     * does not always return {@code true} for some ranges of
      * characters, particularly those that are symbols or ideographs.
      *
      * <p>In general, {@link String#toLowerCase()} should be used to map
-     * characters to lowercase. <code>String</code> case mapping methods
-     * have several benefits over <code>Character</code> case mapping methods.
-     * <code>String</code> case mapping methods can perform locale-sensitive
+     * characters to lowercase. {@code String} case mapping methods
+     * have several benefits over {@code Character} case mapping methods.
+     * {@code String} case mapping methods can perform locale-sensitive
      * mappings, context-sensitive mappings, and 1:M character mappings, whereas
-     * the <code>Character</code> case mapping methods cannot.
+     * the {@code Character} case mapping methods cannot.
      *
      * <p><b>Note:</b> This method cannot handle <a
      * href="#supplementary"> supplementary characters</a>. To support
@@ -6072,16 +6070,16 @@
      * file.
      *
      * <p> Note that
-     * <code>Character.isLowerCase(Character.toLowerCase(codePoint))</code>
-     * does not always return <code>true</code> for some ranges of
+     * {@code Character.isLowerCase(Character.toLowerCase(codePoint))}
+     * does not always return {@code true} for some ranges of
      * characters, particularly those that are symbols or ideographs.
      *
      * <p>In general, {@link String#toLowerCase()} should be used to map
-     * characters to lowercase. <code>String</code> case mapping methods
-     * have several benefits over <code>Character</code> case mapping methods.
-     * <code>String</code> case mapping methods can perform locale-sensitive
+     * characters to lowercase. {@code String} case mapping methods
+     * have several benefits over {@code Character} case mapping methods.
+     * {@code String} case mapping methods can perform locale-sensitive
      * mappings, context-sensitive mappings, and 1:M character mappings, whereas
-     * the <code>Character</code> case mapping methods cannot.
+     * the {@code Character} case mapping methods cannot.
      *
      * @param   codePoint   the character (Unicode code point) to be converted.
      * @return  the lowercase equivalent of the character (Unicode code
@@ -6100,16 +6098,16 @@
      * information from the UnicodeData file.
      * <p>
      * Note that
-     * <code>Character.isUpperCase(Character.toUpperCase(ch))</code>
-     * does not always return <code>true</code> for some ranges of
+     * {@code Character.isUpperCase(Character.toUpperCase(ch))}
+     * does not always return {@code true} for some ranges of
      * characters, particularly those that are symbols or ideographs.
      *
      * <p>In general, {@link String#toUpperCase()} should be used to map
-     * characters to uppercase. <code>String</code> case mapping methods
-     * have several benefits over <code>Character</code> case mapping methods.
-     * <code>String</code> case mapping methods can perform locale-sensitive
+     * characters to uppercase. {@code String} case mapping methods
+     * have several benefits over {@code Character} case mapping methods.
+     * {@code String} case mapping methods can perform locale-sensitive
      * mappings, context-sensitive mappings, and 1:M character mappings, whereas
-     * the <code>Character</code> case mapping methods cannot.
+     * the {@code Character} case mapping methods cannot.
      *
      * <p><b>Note:</b> This method cannot handle <a
      * href="#supplementary"> supplementary characters</a>. To support
@@ -6132,16 +6130,16 @@
      * file.
      *
      * <p>Note that
-     * <code>Character.isUpperCase(Character.toUpperCase(codePoint))</code>
-     * does not always return <code>true</code> for some ranges of
+     * {@code Character.isUpperCase(Character.toUpperCase(codePoint))}
+     * does not always return {@code true} for some ranges of
      * characters, particularly those that are symbols or ideographs.
      *
      * <p>In general, {@link String#toUpperCase()} should be used to map
-     * characters to uppercase. <code>String</code> case mapping methods
-     * have several benefits over <code>Character</code> case mapping methods.
-     * <code>String</code> case mapping methods can perform locale-sensitive
+     * characters to uppercase. {@code String} case mapping methods
+     * have several benefits over {@code Character} case mapping methods.
+     * {@code String} case mapping methods can perform locale-sensitive
      * mappings, context-sensitive mappings, and 1:M character mappings, whereas
-     * the <code>Character</code> case mapping methods cannot.
+     * the {@code Character} case mapping methods cannot.
      *
      * @param   codePoint   the character (Unicode code point) to be converted.
      * @return  the uppercase equivalent of the character, if any;
@@ -6161,13 +6159,13 @@
      * explicit titlecase mapping and is not itself a titlecase char
      * according to UnicodeData, then the uppercase mapping is
      * returned as an equivalent titlecase mapping. If the
-     * <code>char</code> argument is already a titlecase
-     * <code>char</code>, the same <code>char</code> value will be
+     * {@code char} argument is already a titlecase
+     * {@code char}, the same {@code char} value will be
      * returned.
      * <p>
      * Note that
-     * <code>Character.isTitleCase(Character.toTitleCase(ch))</code>
-     * does not always return <code>true</code> for some ranges of
+     * {@code Character.isTitleCase(Character.toTitleCase(ch))}
+     * does not always return {@code true} for some ranges of
      * characters.
      *
      * <p><b>Note:</b> This method cannot handle <a
@@ -6198,8 +6196,8 @@
      * returned.
      *
      * <p>Note that
-     * <code>Character.isTitleCase(Character.toTitleCase(codePoint))</code>
-     * does not always return <code>true</code> for some ranges of
+     * {@code Character.isTitleCase(Character.toTitleCase(codePoint))}
+     * does not always return {@code true} for some ranges of
      * characters.
      *
      * @param   codePoint   the character (Unicode code point) to be converted.
@@ -6215,28 +6213,40 @@
     }
 
     /**
-     * Returns the numeric value of the character <code>ch</code> in the
+     * Returns the numeric value of the character {@code ch} in the
      * specified radix.
      * <p>
-     * If the radix is not in the range <code>MIN_RADIX</code>&nbsp;&lt;=
-     * <code>radix</code>&nbsp;&lt;= <code>MAX_RADIX</code> or if the
-     * value of <code>ch</code> is not a valid digit in the specified
-     * radix, <code>-1</code> is returned. A character is a valid digit
+     * If the radix is not in the range {@code MIN_RADIX} &le;
+     * {@code radix} &le; {@code MAX_RADIX} or if the
+     * value of {@code ch} is not a valid digit in the specified
+     * radix, {@code -1} is returned. A character is a valid digit
      * if at least one of the following is true:
      * <ul>
-     * <li>The method <code>isDigit</code> is <code>true</code> of the character
+     * <li>The method {@code isDigit} is {@code true} of the character
      *     and the Unicode decimal digit value of the character (or its
      *     single-character decomposition) is less than the specified radix.
      *     In this case the decimal digit value is returned.
      * <li>The character is one of the uppercase Latin letters
-     *     <code>'A'</code> through <code>'Z'</code> and its code is less than
-     *     <code>radix&nbsp;+ 'A'&nbsp;-&nbsp;10</code>.
-     *     In this case, <code>ch&nbsp;- 'A'&nbsp;+&nbsp;10</code>
+     *     {@code 'A'} through {@code 'Z'} and its code is less than
+     *     {@code radix + 'A' - 10}.
+     *     In this case, {@code ch - 'A' + 10}
      *     is returned.
      * <li>The character is one of the lowercase Latin letters
-     *     <code>'a'</code> through <code>'z'</code> and its code is less than
-     *     <code>radix&nbsp;+ 'a'&nbsp;-&nbsp;10</code>.
-     *     In this case, <code>ch&nbsp;- 'a'&nbsp;+&nbsp;10</code>
+     *     {@code 'a'} through {@code 'z'} and its code is less than
+     *     {@code radix + 'a' - 10}.
+     *     In this case, {@code ch - 'a' + 10}
+     *     is returned.
+     * <li>The character is one of the fullwidth uppercase Latin letters A
+     *     ({@code '\u005CuFF21'}) through Z ({@code '\u005CuFF3A'})
+     *     and its code is less than
+     *     {@code radix + '\u005CuFF21' - 10}.
+     *     In this case, {@code ch - '\u005CuFF21' + 10}
+     *     is returned.
+     * <li>The character is one of the fullwidth lowercase Latin letters a
+     *     ({@code '\u005CuFF41'}) through z ({@code '\u005CuFF5A'})
+     *     and its code is less than
+     *     {@code radix + '\u005CuFF41' - 10}.
+     *     In this case, {@code ch - '\u005CuFF41' + 10}
      *     is returned.
      * </ul>
      *
@@ -6260,25 +6270,39 @@
      * Returns the numeric value of the specified character (Unicode
      * code point) in the specified radix.
      *
-     * <p>If the radix is not in the range <code>MIN_RADIX</code>&nbsp;&lt;=
-     * <code>radix</code>&nbsp;&lt;= <code>MAX_RADIX</code> or if the
+     * <p>If the radix is not in the range {@code MIN_RADIX} &le;
+     * {@code radix} &le; {@code MAX_RADIX} or if the
      * character is not a valid digit in the specified
-     * radix, <code>-1</code> is returned. A character is a valid digit
+     * radix, {@code -1} is returned. A character is a valid digit
      * if at least one of the following is true:
      * <ul>
-     * <li>The method {@link #isDigit(int) isDigit(codePoint)} is <code>true</code> of the character
+     * <li>The method {@link #isDigit(int) isDigit(codePoint)} is {@code true} of the character
      *     and the Unicode decimal digit value of the character (or its
      *     single-character decomposition) is less than the specified radix.
      *     In this case the decimal digit value is returned.
      * <li>The character is one of the uppercase Latin letters
-     *     <code>'A'</code> through <code>'Z'</code> and its code is less than
-     *     <code>radix&nbsp;+ 'A'&nbsp;-&nbsp;10</code>.
-     *     In this case, <code>ch&nbsp;- 'A'&nbsp;+&nbsp;10</code>
+     *     {@code 'A'} through {@code 'Z'} and its code is less than
+     *     {@code radix + 'A' - 10}.
+     *     In this case, {@code codePoint - 'A' + 10}
      *     is returned.
      * <li>The character is one of the lowercase Latin letters
-     *     <code>'a'</code> through <code>'z'</code> and its code is less than
-     *     <code>radix&nbsp;+ 'a'&nbsp;-&nbsp;10</code>.
-     *     In this case, <code>ch&nbsp;- 'a'&nbsp;+&nbsp;10</code>
+     *     {@code 'a'} through {@code 'z'} and its code is less than
+     *     {@code radix + 'a' - 10}.
+     *     In this case, {@code codePoint - 'a' + 10}
+     *     is returned.
+     * <li>The character is one of the fullwidth uppercase Latin letters A
+     *     ({@code '\u005CuFF21'}) through Z ({@code '\u005CuFF3A'})
+     *     and its code is less than
+     *     {@code radix + '\u005CuFF21' - 10}.
+     *     In this case,
+     *     {@code codePoint - '\u005CuFF21' + 10}
+     *     is returned.
+     * <li>The character is one of the fullwidth lowercase Latin letters a
+     *     ({@code '\u005CuFF41'}) through z ({@code '\u005CuFF5A'})
+     *     and its code is less than
+     *     {@code radix + '\u005CuFF41'- 10}.
+     *     In this case,
+     *     {@code codePoint - '\u005CuFF41' + 10}
      *     is returned.
      * </ul>
      *
@@ -6295,19 +6319,19 @@
     }
 
     /**
-     * Returns the <code>int</code> value that the specified Unicode
+     * Returns the {@code int} value that the specified Unicode
      * character represents. For example, the character
-     * <code>'&#92;u216C'</code> (the roman numeral fifty) will return
+     * {@code '\u005Cu216C'} (the roman numeral fifty) will return
      * an int with a value of 50.
      * <p>
-     * The letters A-Z in their uppercase (<code>'&#92;u0041'</code> through
-     * <code>'&#92;u005A'</code>), lowercase
-     * (<code>'&#92;u0061'</code> through <code>'&#92;u007A'</code>), and
-     * full width variant (<code>'&#92;uFF21'</code> through
-     * <code>'&#92;uFF3A'</code> and <code>'&#92;uFF41'</code> through
-     * <code>'&#92;uFF5A'</code>) forms have numeric values from 10
+     * The letters A-Z in their uppercase ({@code '\u005Cu0041'} through
+     * {@code '\u005Cu005A'}), lowercase
+     * ({@code '\u005Cu0061'} through {@code '\u005Cu007A'}), and
+     * full width variant ({@code '\u005CuFF21'} through
+     * {@code '\u005CuFF3A'} and {@code '\u005CuFF41'} through
+     * {@code '\u005CuFF5A'}) forms have numeric values from 10
      * through 35. This is independent of the Unicode specification,
-     * which does not assign numeric values to these <code>char</code>
+     * which does not assign numeric values to these {@code char}
      * values.
      * <p>
      * If the character does not have a numeric value, then -1 is returned.
@@ -6321,7 +6345,7 @@
      * the {@link #getNumericValue(int)} method.
      *
      * @param   ch      the character to be converted.
-     * @return  the numeric value of the character, as a nonnegative <code>int</code>
+     * @return  the numeric value of the character, as a nonnegative {@code int}
      *           value; -2 if the character has a numeric value that is not a
      *          nonnegative integer; -1 if the character has no numeric value.
      * @see     Character#forDigit(int, int)
@@ -6333,19 +6357,19 @@
     }
 
     /**
-     * Returns the <code>int</code> value that the specified
+     * Returns the {@code int} value that the specified
      * character (Unicode code point) represents. For example, the character
-     * <code>'&#92;u216C'</code> (the Roman numeral fifty) will return
-     * an <code>int</code> with a value of 50.
+     * {@code '\u005Cu216C'} (the Roman numeral fifty) will return
+     * an {@code int} with a value of 50.
      * <p>
-     * The letters A-Z in their uppercase (<code>'&#92;u0041'</code> through
-     * <code>'&#92;u005A'</code>), lowercase
-     * (<code>'&#92;u0061'</code> through <code>'&#92;u007A'</code>), and
-     * full width variant (<code>'&#92;uFF21'</code> through
-     * <code>'&#92;uFF3A'</code> and <code>'&#92;uFF41'</code> through
-     * <code>'&#92;uFF5A'</code>) forms have numeric values from 10
+     * The letters A-Z in their uppercase ({@code '\u005Cu0041'} through
+     * {@code '\u005Cu005A'}), lowercase
+     * ({@code '\u005Cu0061'} through {@code '\u005Cu007A'}), and
+     * full width variant ({@code '\u005CuFF21'} through
+     * {@code '\u005CuFF3A'} and {@code '\u005CuFF41'} through
+     * {@code '\u005CuFF5A'}) forms have numeric values from 10
      * through 35. This is independent of the Unicode specification,
-     * which does not assign numeric values to these <code>char</code>
+     * which does not assign numeric values to these {@code char}
      * values.
      * <p>
      * If the character does not have a numeric value, then -1 is returned.
@@ -6354,7 +6378,7 @@
      * is returned.
      *
      * @param   codePoint the character (Unicode code point) to be converted.
-     * @return  the numeric value of the character, as a nonnegative <code>int</code>
+     * @return  the numeric value of the character, as a nonnegative {@code int}
      *          value; -2 if the character has a numeric value that is not a
      *          nonnegative integer; -1 if the character has no numeric value.
      * @see     Character#forDigit(int, int)
@@ -6367,24 +6391,24 @@
 
     /**
      * Determines if the specified character is ISO-LATIN-1 white space.
-     * This method returns <code>true</code> for the following five
+     * This method returns {@code true} for the following five
      * characters only:
      * <table>
-     * <tr><td><code>'\t'</code></td>            <td><code>U+0009</code></td>
-     *     <td><code>HORIZONTAL TABULATION</code></td></tr>
-     * <tr><td><code>'\n'</code></td>            <td><code>U+000A</code></td>
-     *     <td><code>NEW LINE</code></td></tr>
-     * <tr><td><code>'\f'</code></td>            <td><code>U+000C</code></td>
-     *     <td><code>FORM FEED</code></td></tr>
-     * <tr><td><code>'\r'</code></td>            <td><code>U+000D</code></td>
-     *     <td><code>CARRIAGE RETURN</code></td></tr>
-     * <tr><td><code>'&nbsp;'</code></td>  <td><code>U+0020</code></td>
-     *     <td><code>SPACE</code></td></tr>
+     * <tr><td>{@code '\t'}</td>            <td>{@code U+0009}</td>
+     *     <td>{@code HORIZONTAL TABULATION}</td></tr>
+     * <tr><td>{@code '\n'}</td>            <td>{@code U+000A}</td>
+     *     <td>{@code NEW LINE}</td></tr>
+     * <tr><td>{@code '\f'}</td>            <td>{@code U+000C}</td>
+     *     <td>{@code FORM FEED}</td></tr>
+     * <tr><td>{@code '\r'}</td>            <td>{@code U+000D}</td>
+     *     <td>{@code CARRIAGE RETURN}</td></tr>
+     * <tr><td>{@code '&nbsp;'}</td>  <td>{@code U+0020}</td>
+     *     <td>{@code SPACE}</td></tr>
      * </table>
      *
      * @param      ch   the character to be tested.
-     * @return     <code>true</code> if the character is ISO-LATIN-1 white
-     *             space; <code>false</code> otherwise.
+     * @return     {@code true} if the character is ISO-LATIN-1 white
+     *             space; {@code false} otherwise.
      * @see        Character#isSpaceChar(char)
      * @see        Character#isWhitespace(char)
      * @deprecated Replaced by isWhitespace(char).
@@ -6407,9 +6431,9 @@
      * method returns true if the character's general category type is any of
      * the following:
      * <ul>
-     * <li> <code>SPACE_SEPARATOR</code>
-     * <li> <code>LINE_SEPARATOR</code>
-     * <li> <code>PARAGRAPH_SEPARATOR</code>
+     * <li> {@code SPACE_SEPARATOR}
+     * <li> {@code LINE_SEPARATOR}
+     * <li> {@code PARAGRAPH_SEPARATOR}
      * </ul>
      *
      * <p><b>Note:</b> This method cannot handle <a
@@ -6418,8 +6442,8 @@
      * the {@link #isSpaceChar(int)} method.
      *
      * @param   ch      the character to be tested.
-     * @return  <code>true</code> if the character is a space character;
-     *          <code>false</code> otherwise.
+     * @return  {@code true} if the character is a space character;
+     *          {@code false} otherwise.
      * @see     Character#isWhitespace(char)
      * @since   1.1
      */
@@ -6441,8 +6465,8 @@
      * </ul>
      *
      * @param   codePoint the character (Unicode code point) to be tested.
-     * @return  <code>true</code> if the character is a space character;
-     *          <code>false</code> otherwise.
+     * @return  {@code true} if the character is a space character;
+     *          {@code false} otherwise.
      * @see     Character#isWhitespace(int)
      * @since   1.5
      */
@@ -6458,19 +6482,19 @@
      * A character is a Java whitespace character if and only if it satisfies
      * one of the following criteria:
      * <ul>
-     * <li> It is a Unicode space character (<code>SPACE_SEPARATOR</code>,
-     *      <code>LINE_SEPARATOR</code>, or <code>PARAGRAPH_SEPARATOR</code>)
-     *      but is not also a non-breaking space (<code>'&#92;u00A0'</code>,
-     *      <code>'&#92;u2007'</code>, <code>'&#92;u202F'</code>).
-     * <li> It is <code>'&#92;t'</code>, U+0009 HORIZONTAL TABULATION.
-     * <li> It is <code>'&#92;n'</code>, U+000A LINE FEED.
-     * <li> It is <code>'&#92;u000B'</code>, U+000B VERTICAL TABULATION.
-     * <li> It is <code>'&#92;f'</code>, U+000C FORM FEED.
-     * <li> It is <code>'&#92;r'</code>, U+000D CARRIAGE RETURN.
-     * <li> It is <code>'&#92;u001C'</code>, U+001C FILE SEPARATOR.
-     * <li> It is <code>'&#92;u001D'</code>, U+001D GROUP SEPARATOR.
-     * <li> It is <code>'&#92;u001E'</code>, U+001E RECORD SEPARATOR.
-     * <li> It is <code>'&#92;u001F'</code>, U+001F UNIT SEPARATOR.
+     * <li> It is a Unicode space character ({@code SPACE_SEPARATOR},
+     *      {@code LINE_SEPARATOR}, or {@code PARAGRAPH_SEPARATOR})
+     *      but is not also a non-breaking space ({@code '\u005Cu00A0'},
+     *      {@code '\u005Cu2007'}, {@code '\u005Cu202F'}).
+     * <li> It is {@code '\u005Ct'}, U+0009 HORIZONTAL TABULATION.
+     * <li> It is {@code '\u005Cn'}, U+000A LINE FEED.
+     * <li> It is {@code '\u005Cu000B'}, U+000B VERTICAL TABULATION.
+     * <li> It is {@code '\u005Cf'}, U+000C FORM FEED.
+     * <li> It is {@code '\u005Cr'}, U+000D CARRIAGE RETURN.
+     * <li> It is {@code '\u005Cu001C'}, U+001C FILE SEPARATOR.
+     * <li> It is {@code '\u005Cu001D'}, U+001D GROUP SEPARATOR.
+     * <li> It is {@code '\u005Cu001E'}, U+001E RECORD SEPARATOR.
+     * <li> It is {@code '\u005Cu001F'}, U+001F UNIT SEPARATOR.
      * </ul>
      *
      * <p><b>Note:</b> This method cannot handle <a
@@ -6479,8 +6503,8 @@
      * the {@link #isWhitespace(int)} method.
      *
      * @param   ch the character to be tested.
-     * @return  <code>true</code> if the character is a Java whitespace
-     *          character; <code>false</code> otherwise.
+     * @return  {@code true} if the character is a Java whitespace
+     *          character; {@code false} otherwise.
      * @see     Character#isSpaceChar(char)
      * @since   1.1
      */
@@ -6496,23 +6520,23 @@
      * <ul>
      * <li> It is a Unicode space character ({@link #SPACE_SEPARATOR},
      *      {@link #LINE_SEPARATOR}, or {@link #PARAGRAPH_SEPARATOR})
-     *      but is not also a non-breaking space (<code>'&#92;u00A0'</code>,
-     *      <code>'&#92;u2007'</code>, <code>'&#92;u202F'</code>).
-     * <li> It is <code>'&#92;t'</code>, U+0009 HORIZONTAL TABULATION.
-     * <li> It is <code>'&#92;n'</code>, U+000A LINE FEED.
-     * <li> It is <code>'&#92;u000B'</code>, U+000B VERTICAL TABULATION.
-     * <li> It is <code>'&#92;f'</code>, U+000C FORM FEED.
-     * <li> It is <code>'&#92;r'</code>, U+000D CARRIAGE RETURN.
-     * <li> It is <code>'&#92;u001C'</code>, U+001C FILE SEPARATOR.
-     * <li> It is <code>'&#92;u001D'</code>, U+001D GROUP SEPARATOR.
-     * <li> It is <code>'&#92;u001E'</code>, U+001E RECORD SEPARATOR.
-     * <li> It is <code>'&#92;u001F'</code>, U+001F UNIT SEPARATOR.
+     *      but is not also a non-breaking space ({@code '\u005Cu00A0'},
+     *      {@code '\u005Cu2007'}, {@code '\u005Cu202F'}).
+     * <li> It is {@code '\u005Ct'}, U+0009 HORIZONTAL TABULATION.
+     * <li> It is {@code '\u005Cn'}, U+000A LINE FEED.
+     * <li> It is {@code '\u005Cu000B'}, U+000B VERTICAL TABULATION.
+     * <li> It is {@code '\u005Cf'}, U+000C FORM FEED.
+     * <li> It is {@code '\u005Cr'}, U+000D CARRIAGE RETURN.
+     * <li> It is {@code '\u005Cu001C'}, U+001C FILE SEPARATOR.
+     * <li> It is {@code '\u005Cu001D'}, U+001D GROUP SEPARATOR.
+     * <li> It is {@code '\u005Cu001E'}, U+001E RECORD SEPARATOR.
+     * <li> It is {@code '\u005Cu001F'}, U+001F UNIT SEPARATOR.
      * </ul>
      * <p>
      *
      * @param   codePoint the character (Unicode code point) to be tested.
-     * @return  <code>true</code> if the character is a Java whitespace
-     *          character; <code>false</code> otherwise.
+     * @return  {@code true} if the character is a Java whitespace
+     *          character; {@code false} otherwise.
      * @see     Character#isSpaceChar(int)
      * @since   1.5
      */
@@ -6523,9 +6547,9 @@
     /**
      * Determines if the specified character is an ISO control
      * character.  A character is considered to be an ISO control
-     * character if its code is in the range <code>'&#92;u0000'</code>
-     * through <code>'&#92;u001F'</code> or in the range
-     * <code>'&#92;u007F'</code> through <code>'&#92;u009F'</code>.
+     * character if its code is in the range {@code '\u005Cu0000'}
+     * through {@code '\u005Cu001F'} or in the range
+     * {@code '\u005Cu007F'} through {@code '\u005Cu009F'}.
      *
      * <p><b>Note:</b> This method cannot handle <a
      * href="#supplementary"> supplementary characters</a>. To support
@@ -6533,8 +6557,8 @@
      * the {@link #isISOControl(int)} method.
      *
      * @param   ch      the character to be tested.
-     * @return  <code>true</code> if the character is an ISO control character;
-     *          <code>false</code> otherwise.
+     * @return  {@code true} if the character is an ISO control character;
+     *          {@code false} otherwise.
      *
      * @see     Character#isSpaceChar(char)
      * @see     Character#isWhitespace(char)
@@ -6547,13 +6571,13 @@
     /**
      * Determines if the referenced character (Unicode code point) is an ISO control
      * character.  A character is considered to be an ISO control
-     * character if its code is in the range <code>'&#92;u0000'</code>
-     * through <code>'&#92;u001F'</code> or in the range
-     * <code>'&#92;u007F'</code> through <code>'&#92;u009F'</code>.
+     * character if its code is in the range {@code '\u005Cu0000'}
+     * through {@code '\u005Cu001F'} or in the range
+     * {@code '\u005Cu007F'} through {@code '\u005Cu009F'}.
      *
      * @param   codePoint the character (Unicode code point) to be tested.
-     * @return  <code>true</code> if the character is an ISO control character;
-     *          <code>false</code> otherwise.
+     * @return  {@code true} if the character is an ISO control character;
+     *          {@code false} otherwise.
      * @see     Character#isSpaceChar(int)
      * @see     Character#isWhitespace(int)
      * @since   1.5
@@ -6575,7 +6599,7 @@
      * the {@link #getType(int)} method.
      *
      * @param   ch      the character to be tested.
-     * @return  a value of type <code>int</code> representing the
+     * @return  a value of type {@code int} representing the
      *          character's general category.
      * @see     Character#COMBINING_SPACING_MARK
      * @see     Character#CONNECTOR_PUNCTUATION
@@ -6617,7 +6641,7 @@
      * Returns a value indicating a character's general category.
      *
      * @param   codePoint the character (Unicode code point) to be tested.
-     * @return  a value of type <code>int</code> representing the
+     * @return  a value of type {@code int} representing the
      *          character's general category.
      * @see     Character#COMBINING_SPACING_MARK COMBINING_SPACING_MARK
      * @see     Character#CONNECTOR_PUNCTUATION CONNECTOR_PUNCTUATION
@@ -6657,23 +6681,23 @@
 
     /**
      * Determines the character representation for a specific digit in
-     * the specified radix. If the value of <code>radix</code> is not a
-     * valid radix, or the value of <code>digit</code> is not a valid
+     * the specified radix. If the value of {@code radix} is not a
+     * valid radix, or the value of {@code digit} is not a valid
      * digit in the specified radix, the null character
-     * (<code>'&#92;u0000'</code>) is returned.
+     * ({@code '\u005Cu0000'}) is returned.
      * <p>
-     * The <code>radix</code> argument is valid if it is greater than or
-     * equal to <code>MIN_RADIX</code> and less than or equal to
-     * <code>MAX_RADIX</code>. The <code>digit</code> argument is valid if
-     * <code>0&nbsp;&lt;=digit&nbsp;&lt;&nbsp;radix</code>.
+     * The {@code radix} argument is valid if it is greater than or
+     * equal to {@code MIN_RADIX} and less than or equal to
+     * {@code MAX_RADIX}. The {@code digit} argument is valid if
+     * {@code 0 <= digit < radix}.
      * <p>
      * If the digit is less than 10, then
-     * <code>'0'&nbsp;+ digit</code> is returned. Otherwise, the value
-     * <code>'a'&nbsp;+ digit&nbsp;-&nbsp;10</code> is returned.
+     * {@code '0' + digit} is returned. Otherwise, the value
+     * {@code 'a' + digit - 10} is returned.
      *
      * @param   digit   the number to convert to a character.
      * @param   radix   the radix.
-     * @return  the <code>char</code> representation of the specified digit
+     * @return  the {@code char} representation of the specified digit
      *          in the specified radix.
      * @see     Character#MIN_RADIX
      * @see     Character#MAX_RADIX
@@ -6696,16 +6720,16 @@
      * Returns the Unicode directionality property for the given
      * character.  Character directionality is used to calculate the
      * visual ordering of text. The directionality value of undefined
-     * <code>char</code> values is <code>DIRECTIONALITY_UNDEFINED</code>.
+     * {@code char} values is {@code DIRECTIONALITY_UNDEFINED}.
      *
      * <p><b>Note:</b> This method cannot handle <a
      * href="#supplementary"> supplementary characters</a>. To support
      * all Unicode characters, including supplementary characters, use
      * the {@link #getDirectionality(int)} method.
      *
-     * @param  ch <code>char</code> for which the directionality property
+     * @param  ch {@code char} for which the directionality property
      *            is requested.
-     * @return the directionality property of the <code>char</code> value.
+     * @return the directionality property of the {@code char} value.
      *
      * @see Character#DIRECTIONALITY_UNDEFINED
      * @see Character#DIRECTIONALITY_LEFT_TO_RIGHT
@@ -6774,7 +6798,7 @@
      * Determines whether the character is mirrored according to the
      * Unicode specification.  Mirrored characters should have their
      * glyphs horizontally mirrored when displayed in text that is
-     * right-to-left.  For example, <code>'&#92;u0028'</code> LEFT
+     * right-to-left.  For example, {@code '\u005Cu0028'} LEFT
      * PARENTHESIS is semantically defined to be an <i>opening
      * parenthesis</i>.  This will appear as a "(" in text that is
      * left-to-right but as a ")" in text that is right-to-left.
@@ -6784,9 +6808,9 @@
      * all Unicode characters, including supplementary characters, use
      * the {@link #isMirrored(int)} method.
      *
-     * @param  ch <code>char</code> for which the mirrored property is requested
-     * @return <code>true</code> if the char is mirrored, <code>false</code>
-     *         if the <code>char</code> is not mirrored or is not defined.
+     * @param  ch {@code char} for which the mirrored property is requested
+     * @return {@code true} if the char is mirrored, {@code false}
+     *         if the {@code char} is not mirrored or is not defined.
      * @since 1.4
      */
     public static boolean isMirrored(char ch) {
@@ -6798,13 +6822,13 @@
      * is mirrored according to the Unicode specification.  Mirrored
      * characters should have their glyphs horizontally mirrored when
      * displayed in text that is right-to-left.  For example,
-     * <code>'&#92;u0028'</code> LEFT PARENTHESIS is semantically
+     * {@code '\u005Cu0028'} LEFT PARENTHESIS is semantically
      * defined to be an <i>opening parenthesis</i>.  This will appear
      * as a "(" in text that is left-to-right but as a ")" in text
      * that is right-to-left.
      *
      * @param   codePoint the character (Unicode code point) to be tested.
-     * @return  <code>true</code> if the character is mirrored, <code>false</code>
+     * @return  {@code true} if the character is mirrored, {@code false}
      *          if the character is not mirrored or is not defined.
      * @since   1.5
      */
@@ -6813,16 +6837,16 @@
     }
 
     /**
-     * Compares two <code>Character</code> objects numerically.
-     *
-     * @param   anotherCharacter   the <code>Character</code> to be compared.
-
-     * @return  the value <code>0</code> if the argument <code>Character</code>
-     *          is equal to this <code>Character</code>; a value less than
-     *          <code>0</code> if this <code>Character</code> is numerically less
-     *          than the <code>Character</code> argument; and a value greater than
-     *          <code>0</code> if this <code>Character</code> is numerically greater
-     *          than the <code>Character</code> argument (unsigned comparison).
+     * Compares two {@code Character} objects numerically.
+     *
+     * @param   anotherCharacter   the {@code Character} to be compared.
+
+     * @return  the value {@code 0} if the argument {@code Character}
+     *          is equal to this {@code Character}; a value less than
+     *          {@code 0} if this {@code Character} is numerically less
+     *          than the {@code Character} argument; and a value greater than
+     *          {@code 0} if this {@code Character} is numerically greater
+     *          than the {@code Character} argument (unsigned comparison).
      *          Note that this is strictly a numerical comparison; it is not
      *          locale-dependent.
      * @since   1.2
@@ -6856,8 +6880,8 @@
      *
      * @param   codePoint   the character (Unicode code point) to be converted.
      * @return  either the uppercase equivalent of the character, if
-     *          any, or an error flag (<code>Character.ERROR</code>)
-     *          that indicates that a 1:M <code>char</code> mapping exists.
+     *          any, or an error flag ({@code Character.ERROR})
+     *          that indicates that a 1:M {@code char} mapping exists.
      * @see     Character#isLowerCase(char)
      * @see     Character#isUpperCase(char)
      * @see     Character#toLowerCase(char)
@@ -6873,11 +6897,11 @@
      * Converts the character (Unicode code point) argument to uppercase using case
      * mapping information from the SpecialCasing file in the Unicode
      * specification. If a character has no explicit uppercase
-     * mapping, then the <code>char</code> itself is returned in the
-     * <code>char[]</code>.
+     * mapping, then the {@code char} itself is returned in the
+     * {@code char[]}.
      *
      * @param   codePoint   the character (Unicode code point) to be converted.
-     * @return a <code>char[]</code> with the uppercased character.
+     * @return a {@code char[]} with the uppercased character.
      * @since 1.4
      */
     static char[] toUpperCaseCharArray(int codePoint) {
@@ -6908,7 +6932,7 @@
 
     /**
      * Returns the Unicode name of the specified character
-     * <code>codePoint</code>, or null if the code point is
+     * {@code codePoint}, or null if the code point is
      * {@link #UNASSIGNED unassigned}.
      * <p>
      * Note: if the specified character is not assigned a name by
@@ -6916,14 +6940,12 @@
      * Database maintained by the Unicode Consortium), the returned
      * name is the same as the result of expression
      *
-     * <blockquote><code>
-     *     Character.UnicodeBlock.of(codePoint)
-     *                           .toString()
-     *                           .replace('_', ' ')
+     * <blockquote>{@code
+     *     Character.UnicodeBlock.of(codePoint).toString().replace('_', ' ')
      *     + " "
      *     + Integer.toHexString(codePoint).toUpperCase(Locale.ENGLISH);
      *
-     * </code></blockquote>
+     * }</blockquote>
      *
      * @param  codePoint the character (Unicode code point)
      *
@@ -6931,7 +6953,7 @@
      *         the code point is unassigned.
      *
      * @exception IllegalArgumentException if the specified
-     *            <code>codePoint</code> is not a valid Unicode
+     *            {@code codePoint} is not a valid Unicode
      *            code point.
      *
      * @since 1.7
--- a/src/share/classes/java/lang/NullPointerException.java	Thu Apr 07 15:21:10 2011 -0700
+++ b/src/share/classes/java/lang/NullPointerException.java	Sun Apr 10 10:23:28 2011 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1994, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1994, 2011, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -26,20 +26,24 @@
 package java.lang;
 
 /**
- * Thrown when an application attempts to use <code>null</code> in a
+ * Thrown when an application attempts to use {@code null} in a
  * case where an object is required. These include:
  * <ul>
- * <li>Calling the instance method of a <code>null</code> object.
- * <li>Accessing or modifying the field of a <code>null</code> object.
- * <li>Taking the length of <code>null</code> as if it were an array.
- * <li>Accessing or modifying the slots of <code>null</code> as if it
+ * <li>Calling the instance method of a {@code null} object.
+ * <li>Accessing or modifying the field of a {@code null} object.
+ * <li>Taking the length of {@code null} as if it were an array.
+ * <li>Accessing or modifying the slots of {@code null} as if it
  *     were an array.
- * <li>Throwing <code>null</code> as if it were a <code>Throwable</code>
+ * <li>Throwing {@code null} as if it were a {@code Throwable}
  *     value.
  * </ul>
  * <p>
  * Applications should throw instances of this class to indicate
- * other illegal uses of the <code>null</code> object.
+ * other illegal uses of the {@code null} object.
+ *
+ * {@code NullPointerException} objects may be constructed by the
+ * virtual machine as if {@linkplain Throwable#Throwable(String,
+ * Throwable, boolean) suppression were disabled}.
  *
  * @author  unascribed
  * @since   JDK1.0
@@ -49,14 +53,14 @@
     private static final long serialVersionUID = 5162710183389028792L;
 
     /**
-     * Constructs a <code>NullPointerException</code> with no detail message.
+     * Constructs a {@code NullPointerException} with no detail message.
      */
     public NullPointerException() {
         super();
     }
 
     /**
-     * Constructs a <code>NullPointerException</code> with the specified
+     * Constructs a {@code NullPointerException} with the specified
      * detail message.
      *
      * @param   s   the detail message.
--- a/src/share/classes/java/lang/OutOfMemoryError.java	Thu Apr 07 15:21:10 2011 -0700
+++ b/src/share/classes/java/lang/OutOfMemoryError.java	Sun Apr 10 10:23:28 2011 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1994, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1994, 2011, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -30,22 +30,25 @@
  * because it is out of memory, and no more memory could be made
  * available by the garbage collector.
  *
+ * {@code OutOfMemoryError} objects may be constructed by the virtual
+ * machine as if {@linkplain Throwable#Throwable(String, Throwable,
+ * boolean) suppression were disabled}.
+ *
  * @author  unascribed
  * @since   JDK1.0
  */
-public
-class OutOfMemoryError extends VirtualMachineError {
+public class OutOfMemoryError extends VirtualMachineError {
     private static final long serialVersionUID = 8228564086184010517L;
 
     /**
-     * Constructs an <code>OutOfMemoryError</code> with no detail message.
+     * Constructs an {@code OutOfMemoryError} with no detail message.
      */
     public OutOfMemoryError() {
         super();
     }
 
     /**
-     * Constructs an <code>OutOfMemoryError</code> with the specified
+     * Constructs an {@code OutOfMemoryError} with the specified
      * detail message.
      *
      * @param   s   the detail message.
--- a/src/share/classes/java/lang/Throwable.java	Thu Apr 07 15:21:10 2011 -0700
+++ b/src/share/classes/java/lang/Throwable.java	Sun Apr 10 10:23:28 2011 -0700
@@ -46,13 +46,16 @@
  * are freshly created in the context of the exceptional situation so
  * as to include relevant information (such as stack trace data).
  *
- * <p>A throwable contains a snapshot of the execution stack of its thread at
- * the time it was created. It can also contain a message string that gives
- * more information about the error. Finally, it can contain a <i>cause</i>:
- * another throwable that caused this throwable to get thrown.  The cause
- * facility is new in release 1.4.  It is also known as the <i>chained
- * exception</i> facility, as the cause can, itself, have a cause, and so on,
- * leading to a "chain" of exceptions, each caused by another.
+ * <p>A throwable contains a snapshot of the execution stack of its
+ * thread at the time it was created. It can also contain a message
+ * string that gives more information about the error. Over time, a
+ * throwable can {@linkplain Throwable#addSuppressed suppress} other
+ * throwables from being propagated.  Finally, the throwable can also
+ * contain a <i>cause</i>: another throwable that caused this
+ * throwable to be constructed.  The recording of this causal information
+ * is referred to as the <i>chained exception</i> facility, as the
+ * cause can, itself, have a cause, and so on, leading to a "chain" of
+ * exceptions, each caused by another.
  *
  * <p>One reason that a throwable may have a cause is that the class that
  * throws it is built atop a lower layered abstraction, and an operation on
@@ -86,47 +89,12 @@
  * {@link #initCause(Throwable)} method.  New throwable classes that
  * wish to allow causes to be associated with them should provide constructors
  * that take a cause and delegate (perhaps indirectly) to one of the
- * {@code Throwable} constructors that takes a cause.  For example:
- * <pre>
- *     try {
- *         lowLevelOp();
- *     } catch (LowLevelException le) {
- *         throw new HighLevelException(le);  // Chaining-aware constructor
- *     }
- * </pre>
+ * {@code Throwable} constructors that takes a cause.
+ *
  * Because the {@code initCause} method is public, it allows a cause to be
  * associated with any throwable, even a "legacy throwable" whose
  * implementation predates the addition of the exception chaining mechanism to
- * {@code Throwable}. For example:
- * <pre>
- *     try {
- *         lowLevelOp();
- *     } catch (LowLevelException le) {
- *         throw (HighLevelException)
- *               new HighLevelException().initCause(le);  // Legacy constructor
- *     }
- * </pre>
- *
- * <p>Prior to release 1.4, there were many throwables that had their own
- * non-standard exception chaining mechanisms (
- * {@link ExceptionInInitializerError}, {@link ClassNotFoundException},
- * {@link java.lang.reflect.UndeclaredThrowableException},
- * {@link java.lang.reflect.InvocationTargetException},
- * {@link java.io.WriteAbortedException},
- * {@link java.security.PrivilegedActionException},
- * {@link java.awt.print.PrinterIOException},
- * {@link java.rmi.RemoteException} and
- * {@link javax.naming.NamingException}).
- * All of these throwables have been retrofitted to
- * use the standard exception chaining mechanism, while continuing to
- * implement their "legacy" chaining mechanisms for compatibility.
- *
- * <p>Further, as of release 1.4, many general purpose {@code Throwable}
- * classes (for example {@link Exception}, {@link RuntimeException},
- * {@link Error}) have been retrofitted with constructors that take
- * a cause.  This was not strictly necessary, due to the existence of the
- * {@code initCause} method, but it is more convenient and expressive to
- * delegate to a constructor that takes a cause.
+ * {@code Throwable}.
  *
  * <p>By convention, class {@code Throwable} and its subclasses have two
  * constructors, one that takes no arguments and one that takes a
@@ -137,14 +105,6 @@
  * {@code String} (the detail message) and a {@code Throwable} (the
  * cause).
  *
- * <p>Also introduced in release 1.4 is the {@link #getStackTrace()} method,
- * which allows programmatic access to the stack trace information that was
- * previously available only in text form, via the various forms of the
- * {@link #printStackTrace()} method.  This information has been added to the
- * <i>serialized representation</i> of this class so {@code getStackTrace}
- * and {@code printStackTrace} will operate properly on a throwable that
- * was obtained by deserialization.
- *
  * @author  unascribed
  * @author  Josh Bloch (Added exception chaining and programmatic access to
  *          stack trace in 1.4.)
@@ -323,6 +283,41 @@
     }
 
     /**
+     * Constructs a new throwable with the specified detail message,
+     * cause, and {@linkplain #addSuppressed suppression} enabled or
+     * disabled.  If suppression is disabled, {@link #getSuppressed}
+     * for this object will return a zero-length array and calls to
+     * {@link #addSuppressed} that would otherwise append an exception
+     * to the suppressed list will have no effect.
+     *
+     * <p>Note that the other constructors of {@code Throwable} treat
+     * suppression as being enabled.  Subclasses of {@code Throwable}
+     * should document any conditions under which suppression is
+     * disabled.  Disabling of suppression should only occur in
+     * exceptional circumstances where special requirements exist,
+     * such as a virtual machine reusing exception objects under
+     * low-memory situations.
+     *
+     * @param  message the detail message.
+     * @param cause the cause.  (A {@code null} value is permitted,
+     * and indicates that the cause is nonexistent or unknown.)
+     * @param enableSuppression whether or not suppression is enabled or disabled
+     *
+     * @see OutOfMemoryError
+     * @see NullPointerException
+     * @see ArithmeticException
+     * @since 1.7
+     */
+    protected Throwable(String message, Throwable cause,
+                        boolean enableSuppression) {
+        fillInStackTrace();
+        detailMessage = message;
+        this.cause = cause;
+        if (!enableSuppression)
+            suppressedExceptions = null;
+    }
+
+    /**
      * Returns the detail message string of this throwable.
      *
      * @return  the detail message string of this {@code Throwable} instance
@@ -870,54 +865,64 @@
      * typically called (automatically and implicitly) by the {@code
      * try}-with-resources statement.
      *
-     * If the first exception to be suppressed is {@code null}, that
-     * indicates suppressed exception information will <em>not</em> be
-     * recorded for this exception.  Subsequent calls to this method
-     * will not record any suppressed exceptions.  Otherwise,
-     * attempting to suppress {@code null} after an exception has
-     * already been successfully suppressed results in a {@code
-     * NullPointerException}.
+     * <p>The suppression behavior is enabled <em>unless</em> disabled
+     * {@linkplain #Throwable(String, Throwable, boolean) via a
+     * constructor}.  When suppression is disabled, this method does
+     * nothing other than to validate its argument.
      *
      * <p>Note that when one exception {@linkplain
      * #initCause(Throwable) causes} another exception, the first
      * exception is usually caught and then the second exception is
-     * thrown in response.  In contrast, when one exception suppresses
-     * another, two exceptions are thrown in sibling code blocks, such
-     * as in a {@code try} block and in its {@code finally} block, and
-     * control flow can only continue with one exception so the second
-     * is recorded as a suppressed exception of the first.
+     * thrown in response.  In other words, there is a causal
+     * connection between the two exceptions.
+     *
+     * In contrast, there are situations where two independent
+     * exceptions can be thrown in sibling code blocks, in particular
+     * in the {@code try} block of a {@code try}-with-resources
+     * statement and the compiler-generated {@code finally} block
+     * which closes the resource.
+     *
+     * In these situations, only one of the thrown exceptions can be
+     * propagated.  In the {@code try}-with-resources statement, when
+     * there are two such exceptions, the exception originating from
+     * the {@code try} block is propagated and the exception from the
+     * {@code finally} block is added to the list of exceptions
+     * suppressed by the exception from the {@code try} block.  As an
+     * exception unwinds the stack, it can accumulate multiple
+     * suppressed exceptions.
+     *
+     * <p>An exception may have suppressed exceptions while also being
+     * caused by another exception.  Whether or not an exception has a
+     * cause is semantically known at the time of its creation, unlike
+     * whether or not an exception will suppress other exceptions
+     * which is typically only determined after an exception is
+     * thrown.
+     *
+     * <p>Note that programmer written code is also able to take
+     * advantage of calling this method in situations where there are
+     * multiple sibling exceptions and only one can be propagated.
      *
      * @param exception the exception to be added to the list of
      *        suppressed exceptions
      * @throws IllegalArgumentException if {@code exception} is this
      *         throwable; a throwable cannot suppress itself.
-     * @throws NullPointerException if {@code exception} is null and
-     *         an exception has already been suppressed by this exception
+     * @throws NullPointerException if {@code exception} is {@code null}
      * @since 1.7
      */
     public final synchronized void addSuppressed(Throwable exception) {
         if (exception == this)
             throw new IllegalArgumentException(SELF_SUPPRESSION_MESSAGE);
 
-        if (exception == null) {
-            if (suppressedExceptions == SUPPRESSED_SENTINEL) {
-                suppressedExceptions = null; // No suppression information recorded
-                return;
-            } else
-                throw new NullPointerException(NULL_CAUSE_MESSAGE);
-        } else {
-            assert exception != null && exception != this;
+        if (exception == null)
+            throw new NullPointerException(NULL_CAUSE_MESSAGE);
 
-            if (suppressedExceptions == null) // Suppressed exceptions not recorded
-                return;
+        if (suppressedExceptions == null) // Suppressed exceptions not recorded
+            return;
 
-            if (suppressedExceptions == SUPPRESSED_SENTINEL)
-                suppressedExceptions = new ArrayList<>(1);
+        if (suppressedExceptions == SUPPRESSED_SENTINEL)
+            suppressedExceptions = new ArrayList<>(1);
 
-            assert suppressedExceptions != SUPPRESSED_SENTINEL;
-
-            suppressedExceptions.add(exception);
-        }
+        suppressedExceptions.add(exception);
     }
 
     private static final Throwable[] EMPTY_THROWABLE_ARRAY = new Throwable[0];
@@ -927,7 +932,9 @@
      * suppressed, typically by the {@code try}-with-resources
      * statement, in order to deliver this exception.
      *
-     * If no exceptions were suppressed, an empty array is returned.
+     * If no exceptions were suppressed or {@linkplain
+     * Throwable(String, Throwable, boolean) suppression is disabled},
+     * an empty array is returned.
      *
      * @return an array containing all of the exceptions that were
      *         suppressed to deliver this exception.
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/classes/java/lang/management/BufferPoolMXBean.java	Sun Apr 10 10:23:28 2011 -0700
@@ -0,0 +1,93 @@
+/*
+ * Copyright (c) 2007, 2008, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package java.lang.management;
+
+/**
+ * The management interface for a buffer pool, for example a pool of
+ * {@link java.nio.ByteBuffer#allocateDirect direct} or {@link
+ * java.nio.MappedByteBuffer mapped} buffers.
+ *
+ * <p> A class implementing this interface is an
+ * {@link javax.management.MXBean}. A Java
+ * virtual machine has one or more implementations of this interface. The {@link
+ * java.lang.management.ManagementFactory#getPlatformMXBeans getPlatformMXBeans}
+ * method can be used to obtain the list of {@code BufferPoolMXBean} objects
+ * representing the management interfaces for pools of buffers as follows:
+ * <pre>
+ *     List&lt;BufferPoolMXBean&gt; pools = ManagementFactory.getPlatformMXBeans(BufferPoolMXBean.class);
+ * </pre>
+ *
+ * <p> The management interfaces are also registered with the platform {@link
+ * javax.management.MBeanServer MBeanServer}. The {@link
+ * javax.management.ObjectName ObjectName} that uniquely identifies the
+ * management interface within the {@code MBeanServer} takes the form:
+ * <pre>
+ *     java.nio:type=BufferPool,name=<i>pool name</i>
+ * </pre>
+ * where <em>pool name</em> is the {@link #getName name} of the buffer pool.
+ *
+ * @since   1.7
+ */
+public interface BufferPoolMXBean extends PlatformManagedObject {
+
+    /**
+     * Returns the name representing this buffer pool.
+     *
+     * @return  The name of this buffer pool.
+     */
+    String getName();
+
+    /**
+     * Returns an estimate of the number of buffers in the pool.
+     *
+     * @return  An estimate of the number of buffers in this pool
+     */
+    long getCount();
+
+    /**
+     * Returns an estimate of the total capacity of the buffers in this pool.
+     * A buffer's capacity is the number of elements it contains and the value
+     * returned by this method is an estimate of the total capacity of buffers
+     * in the pool in bytes.
+     *
+     * @return  An estimate of the total capacity of the buffers in this pool
+     *          in bytes
+     */
+    long getTotalCapacity();
+
+    /**
+     * Returns an estimate of the memory that the Java virtual machine is using
+     * for this buffer pool. The value returned by this method may differ
+     * from the estimate of the total {@link #getTotalCapacity capacity} of
+     * the buffers in this pool. This difference is explained by alignment,
+     * memory allocator, and other implementation specific reasons.
+     *
+     * @return  An estimate of the memory that the Java virtual machine is using
+     *          for this buffer pool in bytes, or {@code -1L} if an estimate of
+     *          the memory usage is not available
+     */
+    long getMemoryUsed();
+}
--- a/src/share/classes/java/lang/management/ManagementFactory.java	Thu Apr 07 15:21:10 2011 -0700
+++ b/src/share/classes/java/lang/management/ManagementFactory.java	Sun Apr 10 10:23:28 2011 -0700
@@ -40,8 +40,9 @@
 import javax.management.StandardEmitterMBean;
 import javax.management.StandardMBean;
 import java.util.Collections;
-import java.util.ArrayList;
 import java.util.List;
+import java.util.Set;
+import java.util.TreeSet;
 import java.security.AccessController;
 import java.security.Permission;
 import java.security.PrivilegedAction;
@@ -51,37 +52,63 @@
 import sun.management.ManagementFactoryHelper;
 
 /**
- * The <tt>ManagementFactory</tt> class is a factory class for getting
+ * The {@code ManagementFactory} class is a factory class for getting
  * managed beans for the Java platform.
  * This class consists of static methods each of which returns
- * one or more <a href="#MXBean">platform MXBean(s)</a> representing
+ * one or more <i>platform MXBeans</i> representing
  * the management interface of a component of the Java virtual
  * machine.
+ * <p>
+ * <h4><a name="MXBean">Platform MXBeans</a></h4>
+ * <p>
+ * A platform MXBean is a <i>managed bean</i> that
+ * conforms to the <a href="../../../javax/management/package-summary.html">JMX</a>
+ * Instrumentation Specification and only uses a set of basic data types.
+ * A JMX management application and the {@linkplain
+ * #getPlatformMBeanServer platform MBeanServer}
+ * can interoperate without requiring classes for MXBean specific
+ * data types.
+ * The data types being transmitted between the JMX connector
+ * server and the connector client are
+ * {@linkplain javax.management.openmbean.OpenType open types}
+ * and this allows interoperation across versions.
+ * See <a href="../../../javax/management/MXBean.html#MXBean-spec">
+ * the specification of MXBeans</a> for details.
+ *
+ * <a name="MXBeanNames"></a>
+ * <p>Each platform MXBean is a {@link PlatformManagedObject}
+ * and it has a unique
+ * {@link javax.management.ObjectName ObjectName} for
+ * registration in the platform {@code MBeanServer} as returned by
+ * by the {@link PlatformManagedObject#getObjectName getObjectName}
+ * method.
  *
  * <p>
  * An application can access a platform MXBean in the following ways:
+ * <h5>1. Direct access to an MXBean interface</h5>
+ * <blockquote>
  * <ul>
- * <li><i>Direct access to an MXBean interface</i>
- *     <ol type="a">
- *     <li>Get the MXBean instance through the static factory method,
- *         or the {@link #getPlatformMXBeans(Class)} method
- *         and access the MXBean locally of the running
+ *     <li>Get an MXBean instance by calling the
+ *         {@link #getPlatformMXBean(Class) getPlatformMXBean} or
+ *         {@link #getPlatformMXBeans(Class) getPlatformMXBeans} method
+ *         and access the MXBean locally in the running
  *         virtual machine.
  *         </li>
  *     <li>Construct an MXBean proxy instance that forwards the
  *         method calls to a given {@link MBeanServer MBeanServer} by calling
- *         the {@link #newPlatformMXBeanProxy newPlatformMXBeanProxy} method
- *         or the {@link #getPlatformMXBeans(MBeanServerConnection, Class)}
- *         method.
+ *         the {@link #getPlatformMXBean(MBeanServerConnection, Class)} or
+ *         {@link #getPlatformMXBeans(MBeanServerConnection, Class)} method.
+ *         The {@link #newPlatformMXBeanProxy newPlatformMXBeanProxy} method
+ *         can also be used to construct an MXBean proxy instance of
+ *         a given {@code ObjectName}.
  *         A proxy is typically constructed to remotely access
  *         an MXBean of another running virtual machine.
  *         </li>
- *     </ol></li>
- * <li><i>Indirect access to an MXBean interface via MBeanServer</i>
- *     <ol type="a">
- *     <li>Go through the {@link #getPlatformMBeanServer
- *         platform MBeanServer} to access MXBeans locally or
- *         a specific <tt>MBeanServerConnection</tt> to access
+ * </ul>
+ * <h5>2. Indirect access to an MXBean interface via MBeanServer</h5>
+ * <ul>
+ *     <li>Go through the platform {@code MBeanServer} to access MXBeans
+ *         locally or a specific <tt>MBeanServerConnection</tt> to access
  *         MXBeans remotely.
  *         The attributes and operations of an MXBean use only
  *         <em>JMX open types</em> which include basic data types,
@@ -89,133 +116,19 @@
  *         and {@link javax.management.openmbean.TabularData TabularData}
  *         defined in
  *         {@link javax.management.openmbean.OpenType OpenType}.
- *         The mapping is specified below.
+ *         The mapping is specified in
+ *         the {@linkplain javax.management.MXBean MXBean} specification
+ *         for details.
  *        </li>
- *     </ol></li>
  * </ul>
- *
- * <h4><a name="MXBean">Platform MXBeans</a></h4>
- * A platform MXBean is a <i>managed bean</i> that conforms to
- * the JMX Instrumentation Specification and only uses
- * a set of basic data types described below.
- * See <a href="../../../javax/management/MXBean.html#MXBean-spec">
- * the specification of MXBeans</a> for details.
- * All platform MXBean interfaces extend {@link PlatformManagedObject}s
- * and new methods may be added in these interfaces
- * in future Java SE releases.
- * <p>
- * A JMX management application and the platform <tt>MBeanServer</tt>
- * can interoperate without requiring classes for MXBean specific
- * data types.
- * The data types being transmitted between the JMX connector
- * server and the connector client are
- * {@linkplain javax.management.openmbean.OpenType open types}
- * and this allows interoperation across versions.
- * <p>
- * The platform MXBean interfaces use only the following data types:
- * <ul>
- *   <li>Primitive types such as <tt>int</tt>, <tt>long</tt>,
- *       <tt>boolean</tt>, etc</li>
- *   <li>Wrapper classes for primitive types such as
- *       {@link java.lang.Integer Integer}, {@link java.lang.Long Long},
- *       {@link java.lang.Boolean Boolean}, etc and
- *       {@link java.lang.String String}</li>
- *   <li>{@link java.lang.Enum Enum} classes</li>
- *   <li>Classes that define only getter methods and define a static
- *       <tt>from</tt> method with a
- *       {@link javax.management.openmbean.CompositeData CompositeData}
- *       argument to convert from an input <tt>CompositeData</tt> to
- *       an instance of that class
- *       </li>
- *   <li>{@link java.util.List List&lt;E&gt;}
- *       where <tt>E</tt> is a primitive type, a wrapper class,
- *       an enum class, or a class supporting conversion from a
- *       <tt>CompositeData</tt> to its class
- *       </li>
- *   <li>{@link java.util.Map Map&lt;K,V&gt;}
- *       where <tt>K</tt> and <tt>V</tt> are
- *       a primitive type, a wrapper class,
- *       an enum class, or a class supporting conversion from a
- *       <tt>CompositeData</tt> to its class
- *       </li>
- * </ul>
+ * </blockquote>
  *
  * <p>
- * When an attribute or operation of a platform MXBean
- * is accessed via an <tt>MBeanServer</tt>, the data types are mapped
- * as follows:
- * <ul>
- *   <li>A primitive type or a wrapper class is mapped
- *       to the same type.
- *       </li>
- *   <li>An {@link Enum} is mapped to
- *       <tt>String</tt> whose value is the name of the enum constant.
- *   <li>A class that defines only getter methods and a static
- *       <tt>from</tt> method with a
- *       {@link javax.management.openmbean.CompositeData CompositeData}
- *       argument is mapped to
- *       {@link javax.management.openmbean.CompositeData CompositeData}.
- *       </li>
- *   <li><tt>Map&lt;K,V&gt;</tt> is mapped to
- *       {@link javax.management.openmbean.TabularData TabularData}
- *       whose row type is a
- *       {@link javax.management.openmbean.CompositeType CompositeType} with
- *       two items whose names are <i>"key"</i> and <i>"value"</i>
- *       and the item types are
- *       the corresponding mapped type of <tt>K</tt> and <tt>V</tt>
- *       respectively and the <i>"key"</i> is the index.
- *       </li>
- *   <li><tt>List&lt;E&gt;</tt> is mapped to an array with the mapped
- *       type of <tt>E</tt> as the element type.
- *       </li>
- *   <li>An array of element type <tt>E</tt> is mapped to
- *       an array of the same dimenions with the mapped type of <tt>E</tt>
- *       as the element type.</li>
- * </ul>
- *
- * The {@link javax.management.MBeanInfo MBeanInfo}
- * for a platform MXBean
- * describes the data types of the attributes and operations
- * as primitive or open types mapped as specified above.
- *
+ * The {@link #getPlatformManagementInterfaces getPlatformManagementInterfaces}
+ * method returns all management interfaces supported in the Java virtual machine
+ * including the standard management interfaces listed in the tables
+ * below as well as the management interfaces extended by the JDK implementation.
  * <p>
- * For example, the {@link MemoryMXBean}
- * interface has the following <i>getter</i> and <i>setter</i> methods:
- *
- * <blockquote><pre>
- * public MemoryUsage getHeapMemoryUsage();
- * public boolean isVerbose();
- * public void setVerbose(boolean value);
- * </pre></blockquote>
- *
- * These attributes in the <tt>MBeanInfo</tt>
- * of the <tt>MemoryMXBean</tt> have the following names and types:
- *
- * <blockquote>
- * <table border>
- * <tr>
- *   <th>Attribute Name</th>
- *   <th>Type</th>
- *   </tr>
- * <tr>
- *   <td><tt>HeapMemoryUsage</tt></td>
- *   <td>{@link MemoryUsage#from
- *              CompositeData representing MemoryUsage}</td>
- * </tr>
- * <tr>
- *   <td><tt>Verbose</tt></td>
- *   <td><tt>boolean</tt></td>
- * </tr>
- * </table>
- * </blockquote>
- *
- * <h4><a name="MXBeanNames">MXBean Names</a></h4>
- * Each platform MXBean for a Java virtual machine has a unique
- * {@link javax.management.ObjectName ObjectName} for
- * registration in the platform <tt>MBeanServer</tt> that can
- * be obtained by calling the {@link PlatformManagedObject#getObjectName}
- * method.
- *
  * A Java virtual machine has a single instance of the following management
  * interfaces:
  *
@@ -228,27 +141,32 @@
  * <tr>
  * <td> {@link ClassLoadingMXBean} </td>
  * <td> {@link #CLASS_LOADING_MXBEAN_NAME
- *             <tt>java.lang:type=ClassLoading</tt>}</td>
+ *             java.lang:type=ClassLoading}</td>
  * </tr>
  * <tr>
  * <td> {@link MemoryMXBean} </td>
  * <td> {@link #MEMORY_MXBEAN_NAME
- *             <tt>java.lang:type=Memory</tt>}</td>
+ *             java.lang:type=Memory}</td>
  * </tr>
  * <tr>
  * <td> {@link ThreadMXBean} </td>
  * <td> {@link #THREAD_MXBEAN_NAME
- *             <tt>java.lang:type=Threading</tt>}</td>
+ *             java.lang:type=Threading}</td>
  * </tr>
  * <tr>
  * <td> {@link RuntimeMXBean} </td>
  * <td> {@link #RUNTIME_MXBEAN_NAME
- *             <tt>java.lang:type=Runtime</tt>}</td>
+ *             java.lang:type=Runtime}</td>
  * </tr>
  * <tr>
  * <td> {@link OperatingSystemMXBean} </td>
  * <td> {@link #OPERATING_SYSTEM_MXBEAN_NAME
- *             <tt>java.lang:type=OperatingSystem</tt>}</td>
+ *             java.lang:type=OperatingSystem}</td>
+ * </tr>
+ * <tr>
+ * <td> {@link PlatformLoggingMXBean} </td>
+ * <td> {@link java.util.logging.LogManager#LOGGING_MXBEAN_NAME
+ *             java.util.logging:type=Logging}</td>
  * </tr>
  * </table>
  * </blockquote>
@@ -266,7 +184,7 @@
  * <tr>
  * <td> {@link CompilationMXBean} </td>
  * <td> {@link #COMPILATION_MXBEAN_NAME
- *             <tt>java.lang:type=Compilation</tt>}</td>
+ *             java.lang:type=Compilation}</td>
  * </tr>
  * </table>
  * </blockquote>
@@ -283,17 +201,21 @@
  * <tr>
  * <td> {@link GarbageCollectorMXBean} </td>
  * <td> {@link #GARBAGE_COLLECTOR_MXBEAN_DOMAIN_TYPE
- *    <tt>java.lang:type=GarbageCollector</tt>}<tt>,name=</tt><i>collector's name</i></td>
+ *             java.lang:type=GarbageCollector}<tt>,name=</tt><i>collector's name</i></td>
  * </tr>
  * <tr>
  * <td> {@link MemoryManagerMXBean} </td>
  * <td> {@link #MEMORY_MANAGER_MXBEAN_DOMAIN_TYPE
- *    <tt>java.lang:type=MemoryManager</tt>}<tt>,name=</tt><i>manager's name</i></td>
+ *             java.lang:type=MemoryManager}<tt>,name=</tt><i>manager's name</i></td>
  * </tr>
  * <tr>
  * <td> {@link MemoryPoolMXBean} </td>
  * <td> {@link #MEMORY_POOL_MXBEAN_DOMAIN_TYPE
- *    <tt>java.lang:type=MemoryPool</tt>}<tt>,name=</tt><i>pool's name</i></td>
+ *             java.lang:type=MemoryPool}<tt>,name=</tt><i>pool's name</i></td>
+ * </tr>
+ * <tr>
+ * <td> {@link BufferPoolMXBean} </td>
+ * <td> {@code java.nio:type=BufferPool,name=}<i>pool name</i></td>
  * </tr>
  * </table>
  * </blockquote>
@@ -302,7 +224,6 @@
  *      JMX Specification</a>
  * @see <a href="package-summary.html#examples">
  *      Ways to Access Management Metrics</a>
- * @see java.util.logging.LoggingMXBean
  * @see javax.management.MXBean
  *
  * @author  Mandy Chung
@@ -496,35 +417,35 @@
     /**
      * Returns the platform {@link javax.management.MBeanServer MBeanServer}.
      * On the first call to this method, it first creates the platform
-     * <tt>MBeanServer</tt> by calling the
+     * {@code MBeanServer} by calling the
      * {@link javax.management.MBeanServerFactory#createMBeanServer
      * MBeanServerFactory.createMBeanServer}
-     * method and registers the platform MXBeans in this platform
-     * <tt>MBeanServer</tt> using the <a href="#MXBeanNames">MXBean names</a>
-     * defined in the class description.
+     * method and registers each platform MXBean in this platform
+     * {@code MBeanServer} with its
+     * {@link PlatformManagedObject#getObjectName ObjectName}.
      * This method, in subsequent calls, will simply return the
-     * initially created platform <tt>MBeanServer</tt>.
+     * initially created platform {@code MBeanServer}.
      * <p>
      * MXBeans that get created and destroyed dynamically, for example,
      * memory {@link MemoryPoolMXBean pools} and
      * {@link MemoryManagerMXBean managers},
      * will automatically be registered and deregistered into the platform
-     * <tt>MBeanServer</tt>.
+     * {@code MBeanServer}.
      * <p>
-     * If the system property <tt>javax.management.builder.initial</tt>
-     * is set, the platform <tt>MBeanServer</tt> creation will be done
+     * If the system property {@code javax.management.builder.initial}
+     * is set, the platform {@code MBeanServer} creation will be done
      * by the specified {@link javax.management.MBeanServerBuilder}.
      * <p>
      * It is recommended that this platform MBeanServer also be used
      * to register other application managed beans
      * besides the platform MXBeans.
      * This will allow all MBeans to be published through the same
-     * <tt>MBeanServer</tt> and hence allow for easier network publishing
+     * {@code MBeanServer} and hence allow for easier network publishing
      * and discovery.
      * Name conflicts with the platform MXBeans should be avoided.
      *
-     * @return the platform <tt>MBeanServer</tt>; the platform
-     *         MXBeans are registered into the platform <tt>MBeanServer</tt>
+     * @return the platform {@code MBeanServer}; the platform
+     *         MXBeans are registered into the platform {@code MBeanServer}
      *         at the first time this method is called.
      *
      * @exception SecurityException if there is a security manager
@@ -671,7 +592,9 @@
 
         try {
             final ObjectName objName = new ObjectName(mxbeanName);
-            if (!connection.isInstanceOf(objName, interfaceClass.getName())) {
+            // skip the isInstanceOf check for LoggingMXBean
+            String intfName = interfaceClass.getName();
+            if (!connection.isInstanceOf(objName, intfName)) {
                 throw new IllegalArgumentException(mxbeanName +
                     " is not an instance of " + interfaceClass);
             }
@@ -683,55 +606,128 @@
             // create an MXBean proxy
             return JMX.newMXBeanProxy(connection, objName, mxbeanInterface,
                                       emitter);
-        } catch (InstanceNotFoundException e) {
-            final IllegalArgumentException iae =
-                new IllegalArgumentException(mxbeanName +
-                    " not found in the connection.");
-            iae.initCause(e);
-            throw iae;
-        } catch (MalformedObjectNameException e) {
-            final IllegalArgumentException iae =
-                new IllegalArgumentException(mxbeanName +
-                    " is not a valid ObjectName format.");
-            iae.initCause(e);
-            throw iae;
+        } catch (InstanceNotFoundException|MalformedObjectNameException e) {
+            throw new IllegalArgumentException(e);
         }
     }
 
     /**
-     * Returns the list of platform MXBeans that implement
-     * the given {@code mxbeanInterface} in the running Java
+     * Returns the platform MXBean implementing
+     * the given {@code mxbeanInterface} which is specified
+     * to have one single instance in the Java virtual machine.
+     * This method may return {@code null} if the management interface
+     * is not implemented in the Java virtual machine (for example,
+     * a Java virtual machine with no compilation system does not
+     * implement {@link CompilationMXBean});
+     * otherwise, this method is equivalent to calling:
+     * <pre>
+     *    {@link #getPlatformMXBeans(Class)
+     *      getPlatformMXBeans(mxbeanInterface)}.get(0);
+     * </pre>
+     *
+     * @param mxbeanInterface a management interface for a platform
+     *     MXBean with one single instance in the Java virtual machine
+     *     if implemented.
+     *
+     * @return the platform MXBean that implements
+     * {@code mxbeanInterface}, or {@code null} if not exist.
+     *
+     * @throws IllegalArgumentException if {@code mxbeanInterface}
+     * is not a platform management interface or
+     * not a singleton platform MXBean.
+     *
+     * @since 1.7
+     */
+    public static <T extends PlatformManagedObject>
+            T getPlatformMXBean(Class<T> mxbeanInterface) {
+        PlatformComponent pc = PlatformComponent.getPlatformComponent(mxbeanInterface);
+        if (pc == null)
+            throw new IllegalArgumentException(mxbeanInterface.getName() +
+                " is not a platform management interface");
+        if (!pc.isSingleton())
+            throw new IllegalArgumentException(mxbeanInterface.getName() +
+                " can have zero or more than one instances");
+
+        return pc.getSingletonMXBean(mxbeanInterface);
+    }
+
+    /**
+     * Returns the list of platform MXBeans implementing
+     * the given {@code mxbeanInterface} in the Java
      * virtual machine.
      * The returned list may contain zero, one, or more instances.
      * The number of instances in the returned list is defined
      * in the specification of the given management interface.
+     * The order is undefined and there is no guarantee that
+     * the list returned is in the same order as previous invocations.
      *
      * @param mxbeanInterface a management interface for a platform
      *                        MXBean
      *
-     * @return the list of platform MXBeans that implements
+     * @return the list of platform MXBeans that implement
      * {@code mxbeanInterface}.
      *
      * @throws IllegalArgumentException if {@code mxbeanInterface}
-     * is not a management interface for the platform.
+     * is not a platform management interface.
      *
      * @since 1.7
      */
     public static <T extends PlatformManagedObject> List<T>
             getPlatformMXBeans(Class<T> mxbeanInterface) {
-        String className = mxbeanInterface.getName();
-        for (PlatformComponent component: PlatformComponent.values()) {
-            // comparing the class name first instead of the Class instance
-            // to avoid causing unnecessary class loading of
-            // the other MXBean interfaces
-            if (className.equals(component.getMXBeanInterfaceName())) {
-                if (component.getMXBeanInterface() == mxbeanInterface) {
-                    return component.getMXBeans(mxbeanInterface);
-                }
-            }
-        }
-        throw new IllegalArgumentException(mxbeanInterface.getName() +
-            " is not implemented by any of the platform MXBeans.");
+        PlatformComponent pc = PlatformComponent.getPlatformComponent(mxbeanInterface);
+        if (pc == null)
+            throw new IllegalArgumentException(mxbeanInterface.getName() +
+                " is not a platform management interface");
+        return Collections.unmodifiableList(pc.getMXBeans(mxbeanInterface));
+    }
+
+    /**
+     * Returns the platform MXBean proxy for
+     * {@code mxbeanInterface} which is specified to have one single
+     * instance in a Java virtual machine and the proxy will
+     * forward the method calls through the given {@code MBeanServerConnection}.
+     * This method may return {@code null} if the management interface
+     * is not implemented in the Java virtual machine being monitored
+     * (for example, a Java virtual machine with no compilation system
+     * does not implement {@link CompilationMXBean});
+     * otherwise, this method is equivalent to calling:
+     * <pre>
+     *     {@link #getPlatformMXBeans(MBeanServerConnection, Class)
+     *        getPlatformMXBeans(connection, mxbeanInterface)}.get(0);
+     * </pre>
+     *
+     * @param connection the {@code MBeanServerConnection} to forward to.
+     * @param mxbeanInterface a management interface for a platform
+     *     MXBean with one single instance in the Java virtual machine
+     *     being monitored, if implemented.
+     *
+     * @return the platform MXBean proxy for
+     * forwarding the method calls of the {@code mxbeanInterface}
+     * through the given {@code MBeanServerConnection},
+     * or {@code null} if not exist.
+     *
+     * @throws IllegalArgumentException if {@code mxbeanInterface}
+     * is not a platform management interface or
+     * not a singleton platform MXBean.
+     * @throws java.io.IOException if a communication problem
+     * occurred when accessing the {@code MBeanServerConnection}.
+     *
+     * @see #newPlatformMXBeanProxy
+     * @since 1.7
+     */
+    public static <T extends PlatformManagedObject>
+            T getPlatformMXBean(MBeanServerConnection connection,
+                                Class<T> mxbeanInterface)
+        throws java.io.IOException
+    {
+        PlatformComponent pc = PlatformComponent.getPlatformComponent(mxbeanInterface);
+        if (pc == null)
+            throw new IllegalArgumentException(mxbeanInterface.getName() +
+                " is not a platform management interface");
+        if (!pc.isSingleton())
+            throw new IllegalArgumentException(mxbeanInterface.getName() +
+                " can have zero or more than one instances");
+        return pc.getSingletonMXBean(connection, mxbeanInterface);
     }
 
     /**
@@ -741,6 +737,8 @@
      * The returned list may contain zero, one, or more instances.
      * The number of instances in the returned list is defined
      * in the specification of the given management interface.
+     * The order is undefined and there is no guarantee that
+     * the list returned is in the same order as previous invocations.
      *
      * @param connection the {@code MBeanServerConnection} to forward to.
      * @param mxbeanInterface a management interface for a platform
@@ -751,54 +749,49 @@
      * through the given {@code MBeanServerConnection}.
      *
      * @throws IllegalArgumentException if {@code mxbeanInterface}
-     * is not a management interface for the platform.
+     * is not a platform management interface.
      *
      * @throws java.io.IOException if a communication problem
      * occurred when accessing the {@code MBeanServerConnection}.
      *
+     * @see #newPlatformMXBeanProxy
      * @since 1.7
      */
     public static <T extends PlatformManagedObject>
-        List<T> getPlatformMXBeans(MBeanServerConnection connection,
-                                   Class<T> mxbeanInterface)
+            List<T> getPlatformMXBeans(MBeanServerConnection connection,
+                                       Class<T> mxbeanInterface)
         throws java.io.IOException
     {
-        String className = mxbeanInterface.getName();
-        for (PlatformComponent component: PlatformComponent.values()) {
-            // comparing the class name first instead of the Class instance
-            // to avoid causing unnecessary class loading of
-            // the other MXBean interfaces
-            if (className.equals(component.getMXBeanInterfaceName())) {
-                if (component.getMXBeanInterface() == mxbeanInterface) {
-                    return component.getMXBeans(connection,
-                                                mxbeanInterface);
-                }
-            }
+        PlatformComponent pc = PlatformComponent.getPlatformComponent(mxbeanInterface);
+        if (pc == null) {
+            throw new IllegalArgumentException(mxbeanInterface.getName() +
+                " is not a platform management interface");
         }
-        throw new IllegalArgumentException(mxbeanInterface.getName() +
-            " is not implemented by any of the platform MXBeans.");
+        return Collections.unmodifiableList(pc.getMXBeans(connection, mxbeanInterface));
     }
 
     /**
-     * Returns a list of {@code Class} objects, subinterface of
+     * Returns the set of {@code Class} objects, subinterface of
      * {@link PlatformManagedObject}, representing
      * all management interfaces for
      * monitoring and managing the Java platform.
      *
-     * @return a list of {@code Class} objects, subinterface of
+     * @return the set of {@code Class} objects, subinterface of
      * {@link PlatformManagedObject} representing
      * the management interfaces for
      * monitoring and managing the Java platform.
      *
      * @since 1.7
      */
-    public static List<Class<? extends PlatformManagedObject>> getAllPlatformMXBeanInterfaces() {
-        List<Class<? extends PlatformManagedObject>> result =
-            new ArrayList<>();
+    public static Set<Class<? extends PlatformManagedObject>>
+           getPlatformManagementInterfaces()
+    {
+        Set<Class<? extends PlatformManagedObject>> result =
+            new TreeSet<>();
         for (PlatformComponent component: PlatformComponent.values()) {
             result.add(component.getMXBeanInterface());
         }
-        return result;
+        return Collections.unmodifiableSet(result);
     }
 
     private static final String NOTIF_EMITTER =
@@ -810,7 +803,9 @@
     private static void addMXBean(final MBeanServer mbs, final PlatformManagedObject pmo) {
         // Make DynamicMBean out of MXBean by wrapping it with a StandardMBean
         final DynamicMBean dmbean;
-        if (pmo instanceof NotificationEmitter) {
+        if (pmo instanceof DynamicMBean) {
+            dmbean = DynamicMBean.class.cast(pmo);
+        } else if (pmo instanceof NotificationEmitter) {
             dmbean = new StandardEmitterMBean(pmo, null, true, (NotificationEmitter) pmo);
         } else {
             dmbean = new StandardMBean(pmo, null, true);
--- a/src/share/classes/java/lang/management/PlatformComponent.java	Thu Apr 07 15:21:10 2011 -0700
+++ b/src/share/classes/java/lang/management/PlatformComponent.java	Sun Apr 10 10:23:28 2011 -0700
@@ -29,9 +29,9 @@
 import java.util.Collections;
 import java.util.List;
 import java.util.HashSet;
+import java.util.HashMap;
+import java.util.Map;
 import java.util.Set;
-import java.util.logging.PlatformLoggingMXBean;
-import java.nio.BufferPoolMXBean;
 import javax.management.MBeanServerConnection;
 import javax.management.ObjectName;
 
@@ -66,6 +66,7 @@
     CLASS_LOADING(
         "java.lang.management.ClassLoadingMXBean",
         "java.lang", "ClassLoading", defaultKeyProperties(),
+        true, // singleton
         new MXBeanFetcher<ClassLoadingMXBean>() {
             public List<ClassLoadingMXBean> getMXBeans() {
                 return Collections.singletonList(ManagementFactoryHelper.getClassLoadingMXBean());
@@ -78,6 +79,7 @@
     COMPILATION(
         "java.lang.management.CompilationMXBean",
         "java.lang", "Compilation", defaultKeyProperties(),
+        true, // singleton
         new MXBeanFetcher<CompilationMXBean>() {
             public List<CompilationMXBean> getMXBeans() {
                 CompilationMXBean m = ManagementFactoryHelper.getCompilationMXBean();
@@ -95,6 +97,7 @@
     MEMORY(
         "java.lang.management.MemoryMXBean",
         "java.lang", "Memory", defaultKeyProperties(),
+        true, // singleton
         new MXBeanFetcher<MemoryMXBean>() {
             public List<MemoryMXBean> getMXBeans() {
                 return Collections.singletonList(ManagementFactoryHelper.getMemoryMXBean());
@@ -107,6 +110,7 @@
     GARBAGE_COLLECTOR(
         "java.lang.management.GarbageCollectorMXBean",
         "java.lang", "GarbageCollector", keyProperties("name"),
+        false, // zero or more instances
         new MXBeanFetcher<GarbageCollectorMXBean>() {
             public List<GarbageCollectorMXBean> getMXBeans() {
                 return ManagementFactoryHelper.
@@ -120,6 +124,7 @@
     MEMORY_MANAGER(
         "java.lang.management.MemoryManagerMXBean",
         "java.lang", "MemoryManager", keyProperties("name"),
+        false, // zero or more instances
         new MXBeanFetcher<MemoryManagerMXBean>() {
             public List<MemoryManagerMXBean> getMXBeans() {
                 return ManagementFactoryHelper.getMemoryManagerMXBeans();
@@ -133,6 +138,7 @@
     MEMORY_POOL(
         "java.lang.management.MemoryPoolMXBean",
         "java.lang", "MemoryPool", keyProperties("name"),
+        false, // zero or more instances
         new MXBeanFetcher<MemoryPoolMXBean>() {
             public List<MemoryPoolMXBean> getMXBeans() {
                 return ManagementFactoryHelper.getMemoryPoolMXBeans();
@@ -145,6 +151,7 @@
     OPERATING_SYSTEM(
         "java.lang.management.OperatingSystemMXBean",
         "java.lang", "OperatingSystem", defaultKeyProperties(),
+        true, // singleton
         new MXBeanFetcher<OperatingSystemMXBean>() {
             public List<OperatingSystemMXBean> getMXBeans() {
                 return Collections.singletonList(ManagementFactoryHelper.getOperatingSystemMXBean());
@@ -157,6 +164,7 @@
     RUNTIME(
         "java.lang.management.RuntimeMXBean",
         "java.lang", "Runtime", defaultKeyProperties(),
+        true, // singleton
         new MXBeanFetcher<RuntimeMXBean>() {
             public List<RuntimeMXBean> getMXBeans() {
                 return Collections.singletonList(ManagementFactoryHelper.getRuntimeMXBean());
@@ -169,6 +177,7 @@
     THREADING(
         "java.lang.management.ThreadMXBean",
         "java.lang", "Threading", defaultKeyProperties(),
+        true, // singleton
         new MXBeanFetcher<ThreadMXBean>() {
             public List<ThreadMXBean> getMXBeans() {
                 return Collections.singletonList(ManagementFactoryHelper.getThreadMXBean());
@@ -180,11 +189,17 @@
      * Logging facility.
      */
     LOGGING(
-        "java.util.logging.PlatformLoggingMXBean",
+        "java.lang.management.PlatformLoggingMXBean",
         "java.util.logging", "Logging", defaultKeyProperties(),
+        true, // singleton
         new MXBeanFetcher<PlatformLoggingMXBean>() {
             public List<PlatformLoggingMXBean> getMXBeans() {
-                return ManagementFactoryHelper.getLoggingMXBean();
+                PlatformLoggingMXBean m = ManagementFactoryHelper.getPlatformLoggingMXBean();
+                if (m == null) {
+                   return Collections.emptyList();
+                } else {
+                   return Collections.singletonList(m);
+                }
             }
         }),
 
@@ -192,8 +207,9 @@
      * Buffer pools.
      */
     BUFFER_POOL(
-        "java.nio.BufferPoolMXBean",
+        "java.lang.management.BufferPoolMXBean",
         "java.nio", "BufferPool", keyProperties("name"),
+        false, // zero or more instances
         new MXBeanFetcher<BufferPoolMXBean>() {
             public List<BufferPoolMXBean> getMXBeans() {
                 return ManagementFactoryHelper.getBufferPoolMXBeans();
@@ -209,6 +225,7 @@
     SUN_GARBAGE_COLLECTOR(
         "com.sun.management.GarbageCollectorMXBean",
         "java.lang", "GarbageCollector", keyProperties("name"),
+        false, // zero or more instances
         new MXBeanFetcher<com.sun.management.GarbageCollectorMXBean>() {
             public List<com.sun.management.GarbageCollectorMXBean> getMXBeans() {
                 return getGcMXBeanList(com.sun.management.GarbageCollectorMXBean.class);
@@ -222,6 +239,7 @@
     SUN_OPERATING_SYSTEM(
         "com.sun.management.OperatingSystemMXBean",
         "java.lang", "OperatingSystem", defaultKeyProperties(),
+        true, // singleton
         new MXBeanFetcher<com.sun.management.OperatingSystemMXBean>() {
             public List<com.sun.management.OperatingSystemMXBean> getMXBeans() {
                 return getOSMXBeanList(com.sun.management.OperatingSystemMXBean.class);
@@ -234,6 +252,7 @@
     SUN_UNIX_OPERATING_SYSTEM(
         "com.sun.management.UnixOperatingSystemMXBean",
         "java.lang", "OperatingSystem", defaultKeyProperties(),
+        true, // singleton
         new MXBeanFetcher<UnixOperatingSystemMXBean>() {
             public List<UnixOperatingSystemMXBean> getMXBeans() {
                 return getOSMXBeanList(com.sun.management.UnixOperatingSystemMXBean.class);
@@ -246,6 +265,7 @@
     HOTSPOT_DIAGNOSTIC(
         "com.sun.management.HotSpotDiagnosticMXBean",
         "com.sun.management", "HotSpotDiagnostic", defaultKeyProperties(),
+        true, // singleton
         new MXBeanFetcher<HotSpotDiagnosticMXBean>() {
             public List<HotSpotDiagnosticMXBean> getMXBeans() {
                 return Collections.singletonList(ManagementFactoryHelper.getDiagnosticMXBean());
@@ -296,27 +316,19 @@
     private final Set<String> keyProperties;
     private final MXBeanFetcher fetcher;
     private final PlatformComponent[] subComponents;
+    private final boolean singleton;
 
     private PlatformComponent(String intfName,
                               String domain, String type,
                               Set<String> keyProperties,
-                              MXBeanFetcher fetcher) {
-        this.mxbeanInterfaceName = intfName;
-        this.domain = domain;
-        this.type = type;
-        this.keyProperties = keyProperties;
-        this.fetcher = fetcher;
-        this.subComponents = new PlatformComponent[0];
-    }
-    private PlatformComponent(String intfName,
-                              String domain, String type,
-                              Set<String> keyProperties,
+                              boolean singleton,
                               MXBeanFetcher fetcher,
                               PlatformComponent... subComponents) {
         this.mxbeanInterfaceName = intfName;
         this.domain = domain;
         this.type = type;
         this.keyProperties = keyProperties;
+        this.singleton = singleton;
         this.fetcher = fetcher;
         this.subComponents = subComponents;
     }
@@ -338,6 +350,10 @@
         return set;
     }
 
+    boolean isSingleton() {
+        return singleton;
+    }
+
     String getMXBeanInterfaceName() {
         return mxbeanInterfaceName;
     }
@@ -360,8 +376,35 @@
         return fetcher.getMXBeans();
     }
 
+    <T extends PlatformManagedObject> T getSingletonMXBean(Class<T> mxbeanInterface)
+    {
+        if (!singleton)
+            throw new IllegalArgumentException(mxbeanInterfaceName +
+                " can have zero or more than one instances");
+
+        List<T> list = fetcher.getMXBeans();
+        assert list.size() == 1;
+        return list.isEmpty() ? null : list.get(0);
+    }
+
     <T extends PlatformManagedObject>
-        List<T> getMXBeans(MBeanServerConnection mbs, Class<T> mxbeanInterface)
+            T getSingletonMXBean(MBeanServerConnection mbs, Class<T> mxbeanInterface)
+        throws java.io.IOException
+    {
+        if (!singleton)
+            throw new IllegalArgumentException(mxbeanInterfaceName +
+                " can have zero or more than one instances");
+
+        // ObjectName of a singleton MXBean contains only domain and type
+        assert keyProperties.size() == 1;
+        String on = domain + ":type=" + type;
+        return ManagementFactory.newPlatformMXBeanProxy(mbs,
+                                                        on,
+                                                        mxbeanInterface);
+    }
+
+    <T extends PlatformManagedObject>
+            List<T> getMXBeans(MBeanServerConnection mbs, Class<T> mxbeanInterface)
         throws java.io.IOException
     {
         List<T> result = new ArrayList<>();
@@ -391,5 +434,34 @@
         return set;
     }
 
+    // a map from MXBean interface name to PlatformComponent
+    private static Map<String, PlatformComponent> enumMap;
+    private static synchronized void ensureInitialized() {
+        if (enumMap == null) {
+            enumMap = new HashMap<>();
+            for (PlatformComponent pc: PlatformComponent.values()) {
+                // Use String as the key rather than Class<?> to avoid
+                // causing unnecessary class loading of management interface
+                enumMap.put(pc.getMXBeanInterfaceName(), pc);
+            }
+        }
+    }
+
+    static boolean isPlatformMXBean(String cn) {
+        ensureInitialized();
+        return enumMap.containsKey(cn);
+    }
+
+    static <T extends PlatformManagedObject>
+        PlatformComponent getPlatformComponent(Class<T> mxbeanInterface)
+    {
+        ensureInitialized();
+        String cn = mxbeanInterface.getName();
+        PlatformComponent pc = enumMap.get(cn);
+        if (pc != null && pc.getMXBeanInterface() == mxbeanInterface)
+            return pc;
+        return null;
+    }
+
     private static final long serialVersionUID = 6992337162326171013L;
 }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/classes/java/lang/management/PlatformLoggingMXBean.java	Sun Apr 10 10:23:28 2011 -0700
@@ -0,0 +1,138 @@
+/*
+ * Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package java.lang.management;
+
+/**
+ * The management interface for the {@linkplain java.util.logging logging} facility.
+ *
+ * <p>There is a single global instance of the <tt>PlatformLoggingMXBean</tt>.
+ * The {@link java.lang.management.ManagementFactory#getPlatformMXBean(Class)
+ * ManagementFactory.getPlatformMXBean} method can be used to obtain
+ * the {@code PlatformLoggingMXBean} object as follows:
+ * <pre>
+ *     PlatformLoggingMXBean logging = ManagementFactory.getPlatformMXBean(PlatformLoggingMXBean.class);
+ * </pre>
+ * The {@code PlatformLoggingMXBean} object is also registered with the
+ * platform {@linkplain java.lang.management.ManagementFactory#getPlatformMBeanServer
+ * MBeanServer}.
+ * The {@link javax.management.ObjectName ObjectName} for uniquely
+ * identifying the {@code PlatformLoggingMXBean} within an MBeanServer is:
+ * <pre>
+ *      {@link java.util.logging.LogManager#LOGGING_MXBEAN_NAME java.util.logging:type=Logging}
+ * </pre>
+ *
+ * <p>The instance registered in the platform <tt>MBeanServer</tt> with
+ * this {@code ObjectName} implements all attributes defined by
+ * {@link java.util.logging.LoggingMXBean}.
+ *
+ * @since   1.7
+ */
+public interface PlatformLoggingMXBean extends PlatformManagedObject {
+
+    /**
+     * Returns the list of the currently registered
+     * {@linkplain java.util.logging.Logger logger} names. This method
+     * calls {@link java.util.logging.LogManager#getLoggerNames} and
+     * returns a list of the logger names.
+     *
+     * @return A list of {@code String} each of which is a
+     *         currently registered {@code Logger} name.
+     */
+    java.util.List<String> getLoggerNames();
+
+    /**
+     * Gets the name of the log {@linkplain java.util.logging.Logger#getLevel
+     * level} associated with the specified logger.
+     * If the specified logger does not exist, {@code null}
+     * is returned.
+     * This method first finds the logger of the given name and
+     * then returns the name of the log level by calling:
+     * <blockquote>
+     *   {@link java.util.logging.Logger#getLevel
+     *    Logger.getLevel()}.{@link java.util.logging.Level#getName getName()};
+     * </blockquote>
+     *
+     * <p>
+     * If the {@code Level} of the specified logger is {@code null},
+     * which means that this logger's effective level is inherited
+     * from its parent, an empty string will be returned.
+     *
+     * @param loggerName The name of the {@code Logger} to be retrieved.
+     *
+     * @return The name of the log level of the specified logger; or
+     *         an empty string if the log level of the specified logger
+     *         is {@code null}.  If the specified logger does not
+     *         exist, {@code null} is returned.
+     *
+     * @see java.util.logging.Logger#getLevel
+     */
+    String getLoggerLevel(String loggerName);
+
+    /**
+     * Sets the specified logger to the specified new
+     * {@linkplain java.util.logging.Logger#setLevel level}.
+     * If the {@code levelName} is not {@code null}, the level
+     * of the specified logger is set to the parsed
+     * {@link java.util.logging.Level Level}
+     * matching the {@code levelName}.
+     * If the {@code levelName} is {@code null}, the level
+     * of the specified logger is set to {@code null} and
+     * the effective level of the logger is inherited from
+     * its nearest ancestor with a specific (non-null) level value.
+     *
+     * @param loggerName The name of the {@code Logger} to be set.
+     *                   Must be non-null.
+     * @param levelName The name of the level to set on the specified logger,
+     *                 or  {@code null} if setting the level to inherit
+     *                 from its nearest ancestor.
+     *
+     * @throws IllegalArgumentException if the specified logger
+     * does not exist, or {@code levelName} is not a valid level name.
+     *
+     * @throws SecurityException if a security manager exists and if
+     * the caller does not have LoggingPermission("control").
+     *
+     * @see java.util.logging.Logger#setLevel
+     */
+    void setLoggerLevel(String loggerName, String levelName);
+
+    /**
+     * Returns the name of the
+     * {@linkplain java.util.logging.Logger#getParent parent}
+     * for the specified logger.
+     * If the specified logger does not exist, {@code null} is returned.
+     * If the specified logger is the root {@code Logger} in the namespace,
+     * the result will be an empty string.
+     *
+     * @param loggerName The name of a {@code Logger}.
+     *
+     * @return the name of the nearest existing parent logger;
+     *         an empty string if the specified logger is the root logger.
+     *         If the specified logger does not exist, {@code null}
+     *         is returned.
+     */
+    String getParentLoggerName(String loggerName);
+}
--- a/src/share/classes/java/lang/management/PlatformManagedObject.java	Thu Apr 07 15:21:10 2011 -0700
+++ b/src/share/classes/java/lang/management/PlatformManagedObject.java	Sun Apr 10 10:23:28 2011 -0700
@@ -46,7 +46,7 @@
  * intended for the management interfaces for the platform to extend but
  * not for applications.
  *
- * @see <a href="ManagementFactory.html#MXBean">Platform MXBeans</a>
+ * @see ManagementFactory
  * @since 1.7
  */
 public interface PlatformManagedObject {
--- a/src/share/classes/java/lang/management/package.html	Thu Apr 07 15:21:10 2011 -0700
+++ b/src/share/classes/java/lang/management/package.html	Sun Apr 10 10:23:28 2011 -0700
@@ -27,160 +27,124 @@
 <html>
 <body bgcolor="white">
 
-Provides the management interface for monitoring and management of the 
-Java virtual machine as well as the operating system on which the 
-Java virtual machine is running.  It allows both local and remote 
-monitoring and management of the running Java virtual machine.  
+Provides the management interfaces for monitoring and management of the
+Java virtual machine and other components in the Java runtime.
+It allows both local and remote
+monitoring and management of the running Java virtual machine.
+<p>
 
-<h4>Platform MXBeans</h4>
-
-This package defines the management interface of the following
-components:
-
-<blockquote>
-<table cellspacing=1 summary="Description of the MBeans">
-<tr>
-<th><p align="left">Management Interface</p></th>
-<th><p align="left">Description</p></th>
-</tr>
-<tr>
-<td> <tt>{@link java.lang.management.ClassLoadingMXBean}</tt> </td>
-<td> Class loading system of the Java virtual machine.</td>
-</tr>
-<tr>
-<td> <tt>{@link java.lang.management.CompilationMXBean}</tt> </td>
-<td> Compilation system of the Java virtual machine.</td>
-</tr>
-<tr>
-<td> <tt>{@link java.lang.management.MemoryMXBean}</tt> </td>
-<td> Memory system of the Java virtual machine.</td>
-</tr>
-<tr>
-<td> <tt>{@link java.lang.management.ThreadMXBean}</tt> </td>
-<td> Threads system of the Java virtual machine.</td>
-</tr>
-<tr>
-<td> <tt>{@link java.lang.management.RuntimeMXBean}</tt> </td>
-<td> Runtime system of the Java virtual machine.</td>
-</tr>
-<tr>
-<td> <tt>{@link java.lang.management.OperatingSystemMXBean}</tt> </td>
-<td> Operating system on which the Java virtual machine is running.</td>
-</tr>
-<tr>
-<td> <tt>{@link java.lang.management.GarbageCollectorMXBean}</tt> </td>
-<td> Garbage collector in the Java virtual machine.</td>
-</tr>
-<tr>
-<td> <tt>{@link java.lang.management.MemoryManagerMXBean}</tt> </td>
-<td> Memory manager in the Java virtual machine.</td>
-</tr>
-<tr>
-<td> <tt>{@link java.lang.management.MemoryPoolMXBean}</tt> </td>
-<td> Memory pool in the Java virtual machine.</td>
-</tr>
-</table>
-</blockquote>
-
+<h4><a name="MXBean">Platform MXBean</a></h4>
 <p>
-A platform MXBean is a <i>managed bean</i> that defines the management
-interface for one component for the platform and is specified in the
-<a href="ManagementFactory.html#MXBean">
-ManagementFactory</a> class.
-
-<p>An application can monitor the instrumentation of the 
-Java virtual machine and manage certain characteristics in
-the following ways:
-<ul>
-<li><i>Direct access to an MXBean interface</i>
-    <ol type="a">
-    <li>Get the MXBean instance through the static factory method
-        and access the MXBean interface locally of the running
-        virtual machine.</li>
-    <li>Construct an MXBean proxy instance that
-        forwards the method calls to a given 
-        {@link javax.management.MBeanServer MBeanServer}
-        by calling
-        {@link java.lang.management.ManagementFactory#newPlatformMXBeanProxy
-         ManagementFactory.newPlatformMXBeanProxy}.
-         A proxy is typically constructed to remotely access
-         an MXBean of another running virtual machine.</li>
-    </ol></li>
-<li><i>Indirect access via {@link javax.management.MBeanServer MBeanServer} 
-       interface</i>
-    <ol type="a">
-    <li>Go through the 
-        {@link java.lang.management.ManagementFactory#getPlatformMBeanServer
-        platform MBeanServer} to access MXBeans locally or
-        a specific <tt>MBeanServerConnection</tt> to access
-        MXBeans remotely.
-        The attributes and operations of an MXBean use only
-        <em>JMX open types</em> which include basic data types, 
-        {@link javax.management.openmbean.CompositeData CompositeData},
-        and {@link javax.management.openmbean.TabularData TabularData} 
-        defined in {@link javax.management.openmbean.OpenType OpenType}.
-       </li>
-    </ol></li>
-</ul>
-
-Below shows a few <a href="#examples">examples</a> of different
-ways to access MXBeans.
-
+A platform MXBean is a <i>managed bean</i> that
+conforms to the <a href="../../../javax/management/package-summary.html">JMX</a>
+Instrumentation Specification and only uses a set of basic data types.
+Each platform MXBean is a {@link java.lang.management.PlatformManagedObject}
+with a unique
+{@linkplain java.lang.management.PlatformManagedObject#getObjectName name}.
+<p>
 <h4>ManagementFactory</h4>
 
-The {@link java.lang.management.ManagementFactory} class is the management
-factory class for the Java platform.  This class provides a set of 
+<p>The {@link java.lang.management.ManagementFactory} class is the management
+factory class for the Java platform.  This class provides a set of
 static factory methods to obtain the MXBeans for the Java platform
 to allow an application to access the MXBeans directly.
 
 <p>A <em>platform MBeanServer</em> can be accessed with the
 {@link java.lang.management.ManagementFactory#getPlatformMBeanServer
  getPlatformMBeanServer} method.  On the first call to this method,
-it creates the platform MBeanServer and registers all platform MXBeans 
-including platform MXBeans defined in other packages such as
-{@link java.util.logging.LoggingMXBean}.  
-Each platform MXBean is registered with a unique name defined in the
-{@link java.lang.management.ManagementFactory ManagementFactory} class
-for constructing {@link javax.management.ObjectName ObjectName}. 
-This is a single MBeanServer that can be shared by different managed 
+it creates the platform MBeanServer and registers all platform MXBeans
+including {@linkplain java.lang.management.PlatformManagedObject
+platform MXBeans}.
+Each platform MXBean is registered with a unique name defined in
+the specification of the management interface.
+This is a single MBeanServer that can be shared by different managed
 components running within the same Java virtual machine.
- 
+
 <h4>Interoperability</h4>
 
-A management application and a platform MBeanServer of a running
-virtual machine can interoperate 
+<p>A management application and a platform MBeanServer of a running
+virtual machine can interoperate
 without requiring classes used by the platform MXBean interfaces.
 The data types being transmitted between the JMX connector
 server and the connector client are JMX
-{@link javax.management.openmbean.OpenType open types} and
+{@linkplain javax.management.openmbean.OpenType open types} and
 this allows interoperation across versions.
-
-<p>A data type used by the MXBean interfaces are mapped to
-an open type when being accessed via MBeanServer interface.
-The data type mapping is specified in the
-{@link java.lang.management.ManagementFactory ManagementFactory} class.
+A data type used by the MXBean interfaces are mapped to an
+open type when being accessed via MBeanServer interface.
+See the <a href="../../../javax/management/MXBean.html#MXBean-spec">
+MXBean</a> specification for details.
 
 <h4><a name="examples">Ways to Access MXBeans</a></h4>
 
-There are three different ways to access the management interfaces. 
-
+<p>An application can monitor the instrumentation of the
+Java virtual machine and the runtime in the following ways:
 <p>
-<ol>
-<li>Call the methods in the MXBean directly within the same 
-    Java virtual machine.
-<blockquote><pre>
+<b>1. Direct access to an MXBean interface</b>
+<p>
+<ul>
+<li>Get an MXBean instance locally in the running Java virtual machine:<p>
+<pre>
    RuntimeMXBean mxbean = ManagementFactory.getRuntimeMXBean();
 
    // Get the standard attribute "VmVendor"
    String vendor = mxbean.getVmVendor();
+</pre>
+<p>Or by calling the
+        {@link java.lang.management.ManagementFactory#getPlatformMXBean(Class)
+               getPlatformMXBean} or
+        {@link java.lang.management.ManagementFactory#getPlatformMXBeans(Class)
+               getPlatformMXBeans} method:
+<pre>
+   RuntimeMXBean mxbean = ManagementFactory.getPlatformMXBean(RuntimeMXBean.class);
 
+   // Get the standard attribute "VmVendor"
+   String vendor = mxbean.getVmVendor();
 </pre>
-</blockquote>
+<p>
 </li>
+<li>Construct an MXBean proxy instance that forwards the
+    method calls to a given MBeanServer:<p>
+<pre>
+   MBeanServerConnection mbs;
 
-<li>Go through a <tt>MBeanServerConnection</tt> connecting 
-    to the <tt>platform MBeanServer</tt> of a running virtual machine.</li>
-<blockquote><pre>
+   // Connect to a running JVM (or itself) and get MBeanServerConnection
+   // that has the JVM MBeans registered in it
+   ...
+
+   // Get a MBean proxy for RuntimeMXBean interface
+   RuntimeMXBean proxy =
+       {@link java.lang.management.ManagementFactory#getPlatformMXBean(MBeanServerConnection, Class)
+       ManagementFactory.getPlatformMXBean}(mbs,
+                                           RuntimeMXBean.class);
+   // Get standard attribute "VmVendor"
+   String vendor = proxy.getVmVendor();
+</pre>
+<p>A proxy is typically used to access an MXBean
+   in a remote Java virtual machine.
+   An alternative way to create an MXBean proxy is:
+<pre>
+   RuntimeMXBean proxy =
+       {@link java.lang.management.ManagementFactory#newPlatformMXBeanProxy
+              ManagementFactory.newPlatformMXBeanProxy}(mbs,
+                                                ManagementFactory.RUNTIME_MXBEAN_NAME,
+                                                RuntimeMXBean.class);
+</pre>
+</li>
+</ul>
+<p>
+<b>2. Indirect access to an MXBean interface via MBeanServer</b><p>
+<ul>
+<li>Go through the
+    {@link java.lang.management.ManagementFactory#getPlatformMBeanServer
+    platform MBeanServer} to access MXBeans locally or
+    a specific {@code MBeanServerConnection} to access
+    MXBeans remotely.
+    The attributes and operations of an MXBean use only
+    <em>JMX open types</em> which include basic data types,
+    {@link javax.management.openmbean.CompositeData CompositeData},
+    and {@link javax.management.openmbean.TabularData TabularData}
+    defined in {@link javax.management.openmbean.OpenType OpenType}.<p>
+<pre>
    MBeanServerConnection mbs;
 
    // Connect to a running JVM (or itself) and get MBeanServerConnection
@@ -190,7 +154,7 @@
    try {
        // Assuming the RuntimeMXBean has been registered in mbs
        ObjectName oname = new ObjectName(ManagementFactory.RUNTIME_MXBEAN_NAME);
-    
+
        // Get standard attribute "VmVendor"
        String vendor = (String) mbs.getAttribute(oname, "VmVendor");
    } catch (....) {
@@ -198,36 +162,19 @@
        // and MBeanServer.getAttribute method
        ...
    }
-
-</pre></blockquote>
-
-<li>Use MXBean proxy.</li>
-<blockquote><pre>
-   MBeanServerConnection mbs;
-
-   // Connect to a running JVM (or itself) and get MBeanServerConnection
-   // that has the JVM MBeans registered in it
-   ...
-
-   // Get a MBean proxy for RuntimeMXBean interface
-   RuntimeMXBean proxy = 
-       ManagementFactory.newPlatformMXBeanProxy(mbs,
-                                                ManagementFactory.RUNTIME_MXBEAN_NAME,
-                                                RuntimeMXBean.class);
-   // Get standard attribute "VmVendor" 
-   String vendor = proxy.getVmVendor();
-</pre></blockquote>
-</ol>
+</pre>
+</li>
+</ul>
 
 
 <h4><a name="extension">Platform Extension</a></h4>
 
-A Java virtual machine implementation may add its platform extension to
+<p>A Java virtual machine implementation may add its platform extension to
 the management interface by defining platform-dependent
 interfaces that extend the standard management interfaces to include
-platform-specific metrics and management operations.  
+platform-specific metrics and management operations.
 The static factory methods in the <tt>ManagementFactory</tt> class will
-return the MBeans with the platform extension.
+return the MXBeans with the platform extension.
 
 <p>
 It is recommended to name the platform-specific attributes with
@@ -240,26 +187,30 @@
 the applications accessing that vendor-specific attribute would have
 to be modified to cope with versioning and compatibility issues.
 
-<p>Below is an example showing how to access a platform-specific
-attribute from Sun's implementation of the <tt>RuntimeMXBean</tt>.
+<p>Below is an example showing how to access an attribute
+from the platform extension:
 
 <p>
-1) Direct access to the Sun-specific MXBean interface
-<blockquote><pre>
-   com.sun.management.RuntimeMXBean mxbean = 
-       (com.sun.management.RuntimeMXBean) ManagementFactory.getRuntimeMXBean();
+1) Direct access to the Oracle-specific MXBean interface
+<blockquote>
+<pre>
+   List&lt;com.sun.management.GarbageCollectorMXBean&gt; mxbeans =
+       ManagementFactory.getPlatformMXBeans(com.sun.management.GarbageCollectorMXBean.class);
 
-   // Get the standard attribute "VmVendor"
-   String vendor = mxbean.getVmVendor();
+   for (com.sun.management.GarbageCollectorMXBean gc : mxbeans) {
+       // Get the standard attribute "CollectionCount"
+       String count = mxbean.getCollectionCount();
 
-   // Get the platform-specific attribute "Bar"
-   BarType bar = mxbean.getBar();
-
+       // Get the platform-specific attribute "LastGcInfo"
+       GcInfo gcinfo = gc.getLastGcInfo();
+       ...
+   }
 </pre>
 </blockquote>
 
 <p>
-2) Access the Sun-specific MXBean interface via <tt>MBeanServer</tt>
+2) Access the Oracle-specific MXBean interface via <tt>MBeanServer</tt>
+   through proxy
 
 <blockquote><pre>
    MBeanServerConnection mbs;
@@ -268,24 +219,17 @@
    // that has the JVM MXBeans registered in it
    ...
 
-   try {
-       // Assuming the RuntimeMXBean has been registered in mbs
-       ObjectName oname = new ObjectName(ManagementFactory.RUNTIME_MXBEAN_NAME);
-    
-       // Get standard attribute "VmVendor"
-       String vendor = (String) mbs.getAttribute(oname, "VmVendor");
+   List&lt;com.sun.management.GarbageCollectorMXBean&gt; mxbeans =
+       ManagementFactory.getPlatformMXBeans(mbs, com.sun.management.GarbageCollectorMXBean.class);
 
-       // Check if this MXBean contains Sun's extension
-       if (mbs.isInstanceOf(oname, "com.sun.management.RuntimeMXBean")) {
-           // Get platform-specific attribute "Bar"
-           BarType bar = (String) mbs.getAttribute(oname, "Bar");
-       }
-   } catch (....) {
-       // Catch the exceptions thrown by ObjectName constructor
-       // and MBeanServer methods
+   for (com.sun.management.GarbageCollectorMXBean gc : mxbeans) {
+       // Get the standard attribute "CollectionCount"
+       String count = mxbean.getCollectionCount();
+
+       // Get the platform-specific attribute "LastGcInfo"
+       GcInfo gcinfo = gc.getLastGcInfo();
        ...
    }
-
 </pre></blockquote>
 
 <p> Unless otherwise noted, passing a <tt>null</tt> argument to a constructor
--- a/src/share/classes/java/lang/reflect/AccessibleObject.java	Thu Apr 07 15:21:10 2011 -0700
+++ b/src/share/classes/java/lang/reflect/AccessibleObject.java	Sun Apr 10 10:23:28 2011 -0700
@@ -26,6 +26,7 @@
 package java.lang.reflect;
 
 import java.security.AccessController;
+import sun.reflect.Reflection;
 import sun.reflect.ReflectionFactory;
 import java.lang.annotation.Annotation;
 
@@ -201,4 +202,73 @@
     public Annotation[] getDeclaredAnnotations()  {
         throw new AssertionError("All subclasses should override this method");
     }
+
+
+    // Shared access checking logic.
+
+    // For non-public members or members in package-private classes,
+    // it is necessary to perform somewhat expensive security checks.
+    // If the security check succeeds for a given class, it will
+    // always succeed (it is not affected by the granting or revoking
+    // of permissions); we speed up the check in the common case by
+    // remembering the last Class for which the check succeeded.
+    //
+    // The simple security check for Constructor is to see if
+    // the caller has already been seen, verified, and cached.
+    // (See also Class.newInstance(), which uses a similar method.)
+    //
+    // A more complicated security check cache is needed for Method and Field
+    // The cache can be either null (empty cache), a 2-array of {caller,target},
+    // or a caller (with target implicitly equal to this.clazz).
+    // In the 2-array case, the target is always different from the clazz.
+    volatile Object securityCheckCache;
+
+    void checkAccess(Class<?> caller, Class<?> clazz, Object obj, int modifiers)
+        throws IllegalAccessException
+    {
+        if (caller == clazz) {  // quick check
+            return;             // ACCESS IS OK
+        }
+        Object cache = securityCheckCache;  // read volatile
+        Class<?> targetClass = clazz;
+        if (obj != null
+            && Modifier.isProtected(modifiers)
+            && ((targetClass = obj.getClass()) != clazz)) {
+            // Must match a 2-list of { caller, targetClass }.
+            if (cache instanceof Class[]) {
+                Class<?>[] cache2 = (Class<?>[]) cache;
+                if (cache2[1] == targetClass &&
+                    cache2[0] == caller) {
+                    return;     // ACCESS IS OK
+                }
+                // (Test cache[1] first since range check for [1]
+                // subsumes range check for [0].)
+            }
+        } else if (cache == caller) {
+            // Non-protected case (or obj.class == this.clazz).
+            return;             // ACCESS IS OK
+        }
+
+        // If no return, fall through to the slow path.
+        slowCheckMemberAccess(caller, clazz, obj, modifiers, targetClass);
+    }
+
+    // Keep all this slow stuff out of line:
+    void slowCheckMemberAccess(Class<?> caller, Class<?> clazz, Object obj, int modifiers,
+                               Class<?> targetClass)
+        throws IllegalAccessException
+    {
+        Reflection.ensureMemberAccess(caller, clazz, obj, modifiers);
+
+        // Success: Update the cache.
+        Object cache = ((targetClass == clazz)
+                        ? caller
+                        : new Class<?>[] { caller, targetClass });
+
+        // Note:  The two cache elements are not volatile,
+        // but they are effectively final.  The Java memory model
+        // guarantees that the initializing stores for the cache
+        // elements will occur before the volatile write.
+        securityCheckCache = cache;         // write volatile
+    }
 }
--- a/src/share/classes/java/lang/reflect/Constructor.java	Thu Apr 07 15:21:10 2011 -0700
+++ b/src/share/classes/java/lang/reflect/Constructor.java	Sun Apr 10 10:23:28 2011 -0700
@@ -74,14 +74,6 @@
     private byte[]              annotations;
     private byte[]              parameterAnnotations;
 
-    // For non-public members or members in package-private classes,
-    // it is necessary to perform somewhat expensive security checks.
-    // If the security check succeeds for a given class, it will
-    // always succeed (it is not affected by the granting or revoking
-    // of permissions); we speed up the check in the common case by
-    // remembering the last Class for which the check succeeded.
-    private volatile Class<?> securityCheckCache;
-
     // Generics infrastructure
     // Accessor for factory
     private GenericsFactory getFactory() {
@@ -495,7 +487,7 @@
      * this object represents
      *
      * @exception IllegalAccessException    if this {@code Constructor} object
-     *              enforces Java language access control and the underlying
+     *              is enforcing Java language access control and the underlying
      *              constructor is inaccessible.
      * @exception IllegalArgumentException  if the number of actual
      *              and formal parameters differ; if an unwrapping
@@ -518,16 +510,17 @@
         if (!override) {
             if (!Reflection.quickCheckMemberAccess(clazz, modifiers)) {
                 Class<?> caller = Reflection.getCallerClass(2);
-                if (securityCheckCache != caller) {
-                    Reflection.ensureMemberAccess(caller, clazz, null, modifiers);
-                    securityCheckCache = caller;
-                }
+
+                checkAccess(caller, clazz, null, modifiers);
             }
         }
         if ((clazz.getModifiers() & Modifier.ENUM) != 0)
             throw new IllegalArgumentException("Cannot reflectively create enum objects");
-        if (constructorAccessor == null) acquireConstructorAccessor();
-        return (T) constructorAccessor.newInstance(initargs);
+        ConstructorAccessor ca = constructorAccessor;   // read volatile
+        if (ca == null) {
+            ca = acquireConstructorAccessor();
+        }
+        return (T) ca.newInstance(initargs);
     }
 
     /**
@@ -560,18 +553,20 @@
     // ConstructorAccessor for a given Constructor. However, avoiding
     // synchronization will probably make the implementation more
     // scalable.
-    private void acquireConstructorAccessor() {
+    private ConstructorAccessor acquireConstructorAccessor() {
         // First check to see if one has been created yet, and take it
         // if so.
         ConstructorAccessor tmp = null;
         if (root != null) tmp = root.getConstructorAccessor();
         if (tmp != null) {
             constructorAccessor = tmp;
-            return;
+        } else {
+            // Otherwise fabricate one and propagate it up to the root
+            tmp = reflectionFactory.newConstructorAccessor(this);
+            setConstructorAccessor(tmp);
         }
-        // Otherwise fabricate one and propagate it up to the root
-        tmp = reflectionFactory.newConstructorAccessor(this);
-        setConstructorAccessor(tmp);
+
+        return tmp;
     }
 
     // Returns ConstructorAccessor for this Constructor object, not
--- a/src/share/classes/java/lang/reflect/Field.java	Thu Apr 07 15:21:10 2011 -0700
+++ b/src/share/classes/java/lang/reflect/Field.java	Sun Apr 10 10:23:28 2011 -0700
@@ -79,11 +79,6 @@
     // potentially many Field objects pointing to it.)
     private Field               root;
 
-    // More complicated security check cache needed here than for
-    // Class.newInstance() and Constructor.newInstance()
-    private Class<?> securityCheckCache;
-    private Class<?> securityCheckTargetClassCache;
-
     // Generics infrastructure
 
     private String getGenericSignature() {return signature;}
@@ -340,7 +335,7 @@
      * instance of the class or interface declaring the underlying
      * field, the method throws an {@code IllegalArgumentException}.
      *
-     * <p>If this {@code Field} object enforces Java language access control, and
+     * <p>If this {@code Field} object is enforcing Java language access control, and
      * the underlying field is inaccessible, the method throws an
      * {@code IllegalAccessException}.
      * If the underlying field is static, the class that declared the
@@ -360,8 +355,9 @@
      * {@code obj}; primitive values are wrapped in an appropriate
      * object before being returned
      *
-     * @exception IllegalAccessException    if the underlying field
-     *              is inaccessible.
+     * @exception IllegalAccessException    if this {@code Field} object
+     *              is enforcing Java language access control and the underlying
+     *              field is inaccessible.
      * @exception IllegalArgumentException  if the specified object is not an
      *              instance of the class or interface declaring the underlying
      *              field (or a subclass or implementor thereof).
@@ -383,8 +379,9 @@
      * from
      * @return the value of the {@code boolean} field
      *
-     * @exception IllegalAccessException    if the underlying field
-     *              is inaccessible.
+     * @exception IllegalAccessException    if this {@code Field} object
+     *              is enforcing Java language access control and the underlying
+     *              field is inaccessible.
      * @exception IllegalArgumentException  if the specified object is not
      *              an instance of the class or interface declaring the
      *              underlying field (or a subclass or implementor
@@ -410,8 +407,9 @@
      * from
      * @return the value of the {@code byte} field
      *
-     * @exception IllegalAccessException    if the underlying field
-     *              is inaccessible.
+     * @exception IllegalAccessException    if this {@code Field} object
+     *              is enforcing Java language access control and the underlying
+     *              field is inaccessible.
      * @exception IllegalArgumentException  if the specified object is not
      *              an instance of the class or interface declaring the
      *              underlying field (or a subclass or implementor
@@ -439,8 +437,9 @@
      * from
      * @return the value of the field converted to type {@code char}
      *
-     * @exception IllegalAccessException    if the underlying field
-     *              is inaccessible.
+     * @exception IllegalAccessException    if this {@code Field} object
+     *              is enforcing Java language access control and the underlying
+     *              field is inaccessible.
      * @exception IllegalArgumentException  if the specified object is not
      *              an instance of the class or interface declaring the
      *              underlying field (or a subclass or implementor
@@ -468,8 +467,9 @@
      * from
      * @return the value of the field converted to type {@code short}
      *
-     * @exception IllegalAccessException    if the underlying field
-     *              is inaccessible.
+     * @exception IllegalAccessException    if this {@code Field} object
+     *              is enforcing Java language access control and the underlying
+     *              field is inaccessible.
      * @exception IllegalArgumentException  if the specified object is not
      *              an instance of the class or interface declaring the
      *              underlying field (or a subclass or implementor
@@ -497,8 +497,9 @@
      * from
      * @return the value of the field converted to type {@code int}
      *
-     * @exception IllegalAccessException    if the underlying field
-     *              is inaccessible.
+     * @exception IllegalAccessException    if this {@code Field} object
+     *              is enforcing Java language access control and the underlying
+     *              field is inaccessible.
      * @exception IllegalArgumentException  if the specified object is not
      *              an instance of the class or interface declaring the
      *              underlying field (or a subclass or implementor
@@ -526,8 +527,9 @@
      * from
      * @return the value of the field converted to type {@code long}
      *
-     * @exception IllegalAccessException    if the underlying field
-     *              is inaccessible.
+     * @exception IllegalAccessException    if this {@code Field} object
+     *              is enforcing Java language access control and the underlying
+     *              field is inaccessible.
      * @exception IllegalArgumentException  if the specified object is not
      *              an instance of the class or interface declaring the
      *              underlying field (or a subclass or implementor
@@ -555,8 +557,9 @@
      * from
      * @return the value of the field converted to type {@code float}
      *
-     * @exception IllegalAccessException    if the underlying field
-     *              is inaccessible.
+     * @exception IllegalAccessException    if this {@code Field} object
+     *              is enforcing Java language access control and the underlying
+     *              field is inaccessible.
      * @exception IllegalArgumentException  if the specified object is not
      *              an instance of the class or interface declaring the
      *              underlying field (or a subclass or implementor
@@ -584,8 +587,9 @@
      * from
      * @return the value of the field converted to type {@code double}
      *
-     * @exception IllegalAccessException    if the underlying field
-     *              is inaccessible.
+     * @exception IllegalAccessException    if this {@code Field} object
+     *              is enforcing Java language access control and the underlying
+     *              field is inaccessible.
      * @exception IllegalArgumentException  if the specified object is not
      *              an instance of the class or interface declaring the
      *              underlying field (or a subclass or implementor
@@ -621,14 +625,14 @@
      * an instance of the class or interface declaring the underlying
      * field, the method throws an {@code IllegalArgumentException}.
      *
-     * <p>If this {@code Field} object enforces Java language access control, and
+     * <p>If this {@code Field} object is enforcing Java language access control, and
      * the underlying field is inaccessible, the method throws an
      * {@code IllegalAccessException}.
      *
      * <p>If the underlying field is final, the method throws an
-     * {@code IllegalAccessException} unless
-     * {@code setAccessible(true)} has succeeded for this field
-     * and this field is non-static. Setting a final field in this way
+     * {@code IllegalAccessException} unless {@code setAccessible(true)}
+     * has succeeded for this {@code Field} object
+     * and the field is non-static. Setting a final field in this way
      * is meaningful only during deserialization or reconstruction of
      * instances of classes with blank final fields, before they are
      * made available for access by other parts of a program. Use in
@@ -658,8 +662,9 @@
      * @param value the new value for the field of {@code obj}
      * being modified
      *
-     * @exception IllegalAccessException    if the underlying field
-     *              is inaccessible.
+     * @exception IllegalAccessException    if this {@code Field} object
+     *              is enforcing Java language access control and the underlying
+     *              field is either inaccessible or final.
      * @exception IllegalArgumentException  if the specified object is not an
      *              instance of the class or interface declaring the underlying
      *              field (or a subclass or implementor thereof),
@@ -686,8 +691,9 @@
      * @param z   the new value for the field of {@code obj}
      * being modified
      *
-     * @exception IllegalAccessException    if the underlying field
-     *              is inaccessible.
+     * @exception IllegalAccessException    if this {@code Field} object
+     *              is enforcing Java language access control and the underlying
+     *              field is either inaccessible or final.
      * @exception IllegalArgumentException  if the specified object is not an
      *              instance of the class or interface declaring the underlying
      *              field (or a subclass or implementor thereof),
@@ -715,8 +721,9 @@
      * @param b   the new value for the field of {@code obj}
      * being modified
      *
-     * @exception IllegalAccessException    if the underlying field
-     *              is inaccessible.
+     * @exception IllegalAccessException    if this {@code Field} object
+     *              is enforcing Java language access control and the underlying
+     *              field is either inaccessible or final.
      * @exception IllegalArgumentException  if the specified object is not an
      *              instance of the class or interface declaring the underlying
      *              field (or a subclass or implementor thereof),
@@ -744,8 +751,9 @@
      * @param c   the new value for the field of {@code obj}
      * being modified
      *
-     * @exception IllegalAccessException    if the underlying field
-     *              is inaccessible.
+     * @exception IllegalAccessException    if this {@code Field} object
+     *              is enforcing Java language access control and the underlying
+     *              field is either inaccessible or final.
      * @exception IllegalArgumentException  if the specified object is not an
      *              instance of the class or interface declaring the underlying
      *              field (or a subclass or implementor thereof),
@@ -773,8 +781,9 @@
      * @param s   the new value for the field of {@code obj}
      * being modified
      *
-     * @exception IllegalAccessException    if the underlying field
-     *              is inaccessible.
+     * @exception IllegalAccessException    if this {@code Field} object
+     *              is enforcing Java language access control and the underlying
+     *              field is either inaccessible or final.
      * @exception IllegalArgumentException  if the specified object is not an
      *              instance of the class or interface declaring the underlying
      *              field (or a subclass or implementor thereof),
@@ -802,8 +811,9 @@
      * @param i   the new value for the field of {@code obj}
      * being modified
      *
-     * @exception IllegalAccessException    if the underlying field
-     *              is inaccessible.
+     * @exception IllegalAccessException    if this {@code Field} object
+     *              is enforcing Java language access control and the underlying
+     *              field is either inaccessible or final.
      * @exception IllegalArgumentException  if the specified object is not an
      *              instance of the class or interface declaring the underlying
      *              field (or a subclass or implementor thereof),
@@ -831,8 +841,9 @@
      * @param l   the new value for the field of {@code obj}
      * being modified
      *
-     * @exception IllegalAccessException    if the underlying field
-     *              is inaccessible.
+     * @exception IllegalAccessException    if this {@code Field} object
+     *              is enforcing Java language access control and the underlying
+     *              field is either inaccessible or final.
      * @exception IllegalArgumentException  if the specified object is not an
      *              instance of the class or interface declaring the underlying
      *              field (or a subclass or implementor thereof),
@@ -860,8 +871,9 @@
      * @param f   the new value for the field of {@code obj}
      * being modified
      *
-     * @exception IllegalAccessException    if the underlying field
-     *              is inaccessible.
+     * @exception IllegalAccessException    if this {@code Field} object
+     *              is enforcing Java language access control and the underlying
+     *              field is either inaccessible or final.
      * @exception IllegalArgumentException  if the specified object is not an
      *              instance of the class or interface declaring the underlying
      *              field (or a subclass or implementor thereof),
@@ -889,8 +901,9 @@
      * @param d   the new value for the field of {@code obj}
      * being modified
      *
-     * @exception IllegalAccessException    if the underlying field
-     *              is inaccessible.
+     * @exception IllegalAccessException    if this {@code Field} object
+     *              is enforcing Java language access control and the underlying
+     *              field is either inaccessible or final.
      * @exception IllegalArgumentException  if the specified object is not an
      *              instance of the class or interface declaring the underlying
      *              field (or a subclass or implementor thereof),
@@ -936,6 +949,7 @@
             tmp = reflectionFactory.newFieldAccessor(this, overrideFinalCheck);
             setFieldAccessor(tmp, overrideFinalCheck);
         }
+
         return tmp;
     }
 
@@ -965,21 +979,8 @@
         if (!override) {
             if (!Reflection.quickCheckMemberAccess(clazz, modifiers)) {
                 Class<?> caller = Reflection.getCallerClass(4);
-                Class<?> targetClass = ((obj == null || !Modifier.isProtected(modifiers))
-                                        ? clazz
-                                        : obj.getClass());
 
-                synchronized (this) {
-                    if ((securityCheckCache == caller)
-                            && (securityCheckTargetClassCache == targetClass)) {
-                        return;
-                    }
-                }
-                Reflection.ensureMemberAccess(caller, clazz, obj, modifiers);
-                synchronized (this) {
-                    securityCheckCache = caller;
-                    securityCheckTargetClassCache = targetClass;
-                }
+                checkAccess(caller, clazz, obj, modifiers);
             }
         }
     }
--- a/src/share/classes/java/lang/reflect/Method.java	Thu Apr 07 15:21:10 2011 -0700
+++ b/src/share/classes/java/lang/reflect/Method.java	Sun Apr 10 10:23:28 2011 -0700
@@ -83,11 +83,6 @@
     // potentially many Method objects pointing to it.)
     private Method              root;
 
-    // More complicated security check cache needed here than for
-    // Class.newInstance() and Constructor.newInstance()
-    private Class<?> securityCheckCache;
-    private Class<?> securityCheckTargetClassCache;
-
    // Generics infrastructure
 
     private String getGenericSignature() {return signature;}
@@ -402,28 +397,28 @@
      */
     public String toString() {
         try {
-            StringBuffer sb = new StringBuffer();
+            StringBuilder sb = new StringBuilder();
             int mod = getModifiers() & Modifier.methodModifiers();
             if (mod != 0) {
-                sb.append(Modifier.toString(mod) + " ");
+                sb.append(Modifier.toString(mod)).append(' ');
             }
-            sb.append(Field.getTypeName(getReturnType()) + " ");
-            sb.append(Field.getTypeName(getDeclaringClass()) + ".");
-            sb.append(getName() + "(");
+            sb.append(Field.getTypeName(getReturnType())).append(' ');
+            sb.append(Field.getTypeName(getDeclaringClass())).append('.');
+            sb.append(getName()).append('(');
             Class<?>[] params = parameterTypes; // avoid clone
             for (int j = 0; j < params.length; j++) {
                 sb.append(Field.getTypeName(params[j]));
                 if (j < (params.length - 1))
-                    sb.append(",");
+                    sb.append(',');
             }
-            sb.append(")");
+            sb.append(')');
             Class<?>[] exceptions = exceptionTypes; // avoid clone
             if (exceptions.length > 0) {
                 sb.append(" throws ");
                 for (int k = 0; k < exceptions.length; k++) {
                     sb.append(exceptions[k].getName());
                     if (k < (exceptions.length - 1))
-                        sb.append(",");
+                        sb.append(',');
                 }
             }
             return sb.toString();
@@ -475,15 +470,15 @@
             StringBuilder sb = new StringBuilder();
             int mod = getModifiers() & Modifier.methodModifiers();
             if (mod != 0) {
-                sb.append(Modifier.toString(mod) + " ");
+                sb.append(Modifier.toString(mod)).append(' ');
             }
             TypeVariable<?>[] typeparms = getTypeParameters();
             if (typeparms.length > 0) {
                 boolean first = true;
-                sb.append("<");
+                sb.append('<');
                 for(TypeVariable<?> typeparm: typeparms) {
                     if (!first)
-                        sb.append(",");
+                        sb.append(',');
                     // Class objects can't occur here; no need to test
                     // and call Class.getName().
                     sb.append(typeparm.toString());
@@ -494,10 +489,11 @@
 
             Type genRetType = getGenericReturnType();
             sb.append( ((genRetType instanceof Class<?>)?
-                        Field.getTypeName((Class<?>)genRetType):genRetType.toString())  + " ");
+                        Field.getTypeName((Class<?>)genRetType):genRetType.toString()))
+                    .append(' ');
 
-            sb.append(Field.getTypeName(getDeclaringClass()) + ".");
-            sb.append(getName() + "(");
+            sb.append(Field.getTypeName(getDeclaringClass())).append('.');
+            sb.append(getName()).append('(');
             Type[] params = getGenericParameterTypes();
             for (int j = 0; j < params.length; j++) {
                 String param = (params[j] instanceof Class)?
@@ -507,9 +503,9 @@
                     param = param.replaceFirst("\\[\\]$", "...");
                 sb.append(param);
                 if (j < (params.length - 1))
-                    sb.append(",");
+                    sb.append(',');
             }
-            sb.append(")");
+            sb.append(')');
             Type[] exceptions = getGenericExceptionTypes();
             if (exceptions.length > 0) {
                 sb.append(" throws ");
@@ -518,7 +514,7 @@
                               ((Class)exceptions[k]).getName():
                               exceptions[k].toString());
                     if (k < (exceptions.length - 1))
-                        sb.append(",");
+                        sb.append(',');
                 }
             }
             return sb.toString();
@@ -565,7 +561,7 @@
      * {@code args}
      *
      * @exception IllegalAccessException    if this {@code Method} object
-     *              enforces Java language access control and the underlying
+     *              is enforcing Java language access control and the underlying
      *              method is inaccessible.
      * @exception IllegalArgumentException  if the method is an
      *              instance method and the specified object argument
@@ -591,26 +587,15 @@
         if (!override) {
             if (!Reflection.quickCheckMemberAccess(clazz, modifiers)) {
                 Class<?> caller = Reflection.getCallerClass(1);
-                Class<?> targetClass = ((obj == null || !Modifier.isProtected(modifiers))
-                                        ? clazz
-                                        : obj.getClass());
 
-                boolean cached;
-                synchronized (this) {
-                    cached = (securityCheckCache == caller)
-                            && (securityCheckTargetClassCache == targetClass);
-                }
-                if (!cached) {
-                    Reflection.ensureMemberAccess(caller, clazz, obj, modifiers);
-                    synchronized (this) {
-                        securityCheckCache = caller;
-                        securityCheckTargetClassCache = targetClass;
-                    }
-                }
+                checkAccess(caller, clazz, obj, modifiers);
             }
         }
-        if (methodAccessor == null) acquireMethodAccessor();
-        return methodAccessor.invoke(obj, args);
+        MethodAccessor ma = methodAccessor;             // read volatile
+        if (ma == null) {
+            ma = acquireMethodAccessor();
+        }
+        return ma.invoke(obj, args);
     }
 
     /**
@@ -654,18 +639,20 @@
     // (though not efficient) to generate more than one MethodAccessor
     // for a given Method. However, avoiding synchronization will
     // probably make the implementation more scalable.
-    private void acquireMethodAccessor() {
+    private MethodAccessor acquireMethodAccessor() {
         // First check to see if one has been created yet, and take it
         // if so
         MethodAccessor tmp = null;
         if (root != null) tmp = root.getMethodAccessor();
         if (tmp != null) {
             methodAccessor = tmp;
-            return;
+        } else {
+            // Otherwise fabricate one and propagate it up to the root
+            tmp = reflectionFactory.newMethodAccessor(this);
+            setMethodAccessor(tmp);
         }
-        // Otherwise fabricate one and propagate it up to the root
-        tmp = reflectionFactory.newMethodAccessor(this);
-        setMethodAccessor(tmp);
+
+        return tmp;
     }
 
     // Returns MethodAccessor for this Method object, not looking up
--- a/src/share/classes/java/nio/BufferPoolMXBean.java	Thu Apr 07 15:21:10 2011 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,94 +0,0 @@
-/*
- * Copyright (c) 2007, 2008, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package java.nio;
-
-import java.lang.management.PlatformManagedObject;
-
-/**
- * The management interface for a buffer pool.
- *
- * <p> A class implementing this interface is an <a href=
- * "java.lang.management.ManagementFactory.html#MXBean">MXBean</a>. A Java
- * virtual machine has one or more implementations of this interface. The {@link
- * java.lang.management.ManagementFactory#getPlatformMXBeans getPlatformMXBeans}
- * method can be used to obtain the list of {@code BufferPoolMXBean} objects
- * representing the management interfaces for pools of buffers as follows:
- * <pre>
- *     List&lt;BufferPoolMXBean&gt; pools = ManagementFactory.getPlatformMXBeans(BufferPoolMXBean.class);
- * </pre>
- *
- * <p> The management interfaces are also registered with the platform {@link
- * javax.management.MBeanServer MBeanServer}. The {@link
- * javax.management.ObjectName ObjectName} that uniquely identifies the
- * management interface within the {@code MBeanServer} takes the form:
- * <blockquote>
- *    <tt>java.nio:type=BufferPool</tt><tt>,name=</tt><i>pool name</i>
- * </blockquote>
- * where <em>pool name</em> is the {@link #getName name} of the buffer pool.
- *
- * @since   1.7
- */
-
-public interface BufferPoolMXBean extends PlatformManagedObject {
-
-    /**
-     * Returns the name representing this buffer pool.
-     *
-     * @return  The name of this buffer pool.
-     */
-    String getName();
-
-    /**
-     * Returns an estimate of the number of buffers in the pool.
-     *
-     * @return  An estimate of the number of buffers in this pool
-     */
-    long getCount();
-
-    /**
-     * Returns an estimate of the total capacity of the buffers in this pool.
-     * A buffer's capacity is the number of elements it contains and the value
-     * returned by this method is an estimate of the total capacity of buffers
-     * in the pool in bytes.
-     *
-     * @return  An estimate of the total capacity of the buffers in this pool
-     *          in bytes
-     */
-    long getTotalCapacity();
-
-    /**
-     * Returns an estimate of the memory that the Java virtual machine is using
-     * for this buffer pool. The value returned by this method may differ
-     * from the estimate of the total {@link #getTotalCapacity capacity} of
-     * the buffers in this pool. This difference is explained by alignment,
-     * memory allocator, and other implementation specific reasons.
-     *
-     * @return  An estimate of the memory that the Java virtual machine is using
-     *          for this buffer pool in bytes, or {@code -1L} if an estimate of
-     *          the memory usage is not available
-     */
-    long getMemoryUsed();
-}
--- a/src/share/classes/java/nio/file/Files.java	Thu Apr 07 15:21:10 2011 -0700
+++ b/src/share/classes/java/nio/file/Files.java	Sun Apr 10 10:23:28 2011 -0700
@@ -2067,7 +2067,7 @@
      *
      * @return  {@code true} if the file is a symbolic link; {@code false} if
      *          the file does not exist, is not a symbolic link, or it cannot
-     *          be determined if the file is symbolic link or not.
+     *          be determined if the file is a symbolic link or not.
      *
      * @throws  SecurityException
      *          In the case of the default provider, and a security manager is
@@ -2106,7 +2106,7 @@
      *
      * @return  {@code true} if the file is a directory; {@code false} if
      *          the file does not exist, is not a directory, or it cannot
-     *          be determined if the file is directory or not.
+     *          be determined if the file is a directory or not.
      *
      * @throws  SecurityException
      *          In the case of the default provider, and a security manager is
@@ -2142,8 +2142,8 @@
      *          options indicating how symbolic links are handled
      *
      * @return  {@code true} if the file is a regular file; {@code false} if
-     *          the file does not exist, is not a direcregular filetory, or it
-     *          cannot be determined if the file is regular file or not.
+     *          the file does not exist, is not a regular file, or it
+     *          cannot be determined if the file is a regular file or not.
      *
      * @throws  SecurityException
      *          In the case of the default provider, and a security manager is
--- a/src/share/classes/java/nio/file/Path.java	Thu Apr 07 15:21:10 2011 -0700
+++ b/src/share/classes/java/nio/file/Path.java	Sun Apr 10 10:23:28 2011 -0700
@@ -550,18 +550,21 @@
      * <p> If this path is relative then its absolute path is first obtained,
      * as if by invoking the {@link #toAbsolutePath toAbsolutePath} method.
      *
-     * <p> The {@code resolveLinks} parameter specifies if symbolic links
-     * should be resolved. This parameter is ignored when symbolic links are
-     * not supported. Where supported, and the parameter has the value {@code
-     * true} then symbolic links are resolved to their final target. Where the
-     * parameter has the value {@code false} then this method does not resolve
-     * symbolic links. Some implementations allow special names such as
-     * "{@code ..}" to refer to the parent directory. When deriving the <em>real
-     * path</em>, and a "{@code ..}" (or equivalent) is preceded by a
-     * non-"{@code ..}" name then an implementation will typically causes both
-     * names to be removed. When not resolving symbolic links and the preceding
-     * name is a symbolic link then the names are only removed if it guaranteed
-     * that the resulting path will locate the same file as this path.
+     * <p> The {@code options} array may be used to indicate how symbolic links
+     * are handled. By default, symbolic links are resolved to their final
+     * target. If the option {@link LinkOption#NOFOLLOW_LINKS NOFOLLOW_LINKS} is
+     * present then this method does not resolve symbolic links.
+     *
+     * Some implementations allow special names such as "{@code ..}" to refer to
+     * the parent directory. When deriving the <em>real path</em>, and a
+     * "{@code ..}" (or equivalent) is preceded by a non-"{@code ..}" name then
+     * an implementation will typically cause both names to be removed. When
+     * not resolving symbolic links and the preceding name is a symbolic link
+     * then the names are only removed if it guaranteed that the resulting path
+     * will locate the same file as this path.
+     *
+     * @param   options
+     *          options indicating how symbolic links are handled
      *
      * @return  an absolute path represent the <em>real</em> path of the file
      *          located by this object
@@ -576,7 +579,7 @@
      *          checkPropertyAccess} method is invoked to check access to the
      *          system property {@code user.dir}
      */
-    Path toRealPath(boolean resolveLinks) throws IOException;
+    Path toRealPath(LinkOption... options) throws IOException;
 
     /**
      * Returns a {@link File} object representing this path. Where this {@code
--- a/src/share/classes/java/util/Collections.java	Thu Apr 07 15:21:10 2011 -0700
+++ b/src/share/classes/java/util/Collections.java	Sun Apr 10 10:23:28 2011 -0700
@@ -3533,20 +3533,20 @@
     }
 
     /**
-     * Returns a comparator that imposes the reverse of the <i>natural
-     * ordering</i> on a collection of objects that implement the
-     * <tt>Comparable</tt> interface.  (The natural ordering is the ordering
-     * imposed by the objects' own <tt>compareTo</tt> method.)  This enables a
+     * Returns a comparator that imposes the reverse of the <em>natural
+     * ordering</em> on a collection of objects that implement the
+     * {@code Comparable} interface.  (The natural ordering is the ordering
+     * imposed by the objects' own {@code compareTo} method.)  This enables a
      * simple idiom for sorting (or maintaining) collections (or arrays) of
-     * objects that implement the <tt>Comparable</tt> interface in
-     * reverse-natural-order.  For example, suppose a is an array of
+     * objects that implement the {@code Comparable} interface in
+     * reverse-natural-order.  For example, suppose {@code a} is an array of
      * strings. Then: <pre>
      *          Arrays.sort(a, Collections.reverseOrder());
      * </pre> sorts the array in reverse-lexicographic (alphabetical) order.<p>
      *
      * The returned comparator is serializable.
      *
-     * @return a comparator that imposes the reverse of the <i>natural
+     * @return A comparator that imposes the reverse of the <i>natural
      *         ordering</i> on a collection of objects that implement
      *         the <tt>Comparable</tt> interface.
      * @see Comparable
@@ -3575,16 +3575,18 @@
 
     /**
      * Returns a comparator that imposes the reverse ordering of the specified
-     * comparator.  If the specified comparator is null, this method is
+     * comparator.  If the specified comparator is {@code null}, this method is
      * equivalent to {@link #reverseOrder()} (in other words, it returns a
-     * comparator that imposes the reverse of the <i>natural ordering</i> on a
-     * collection of objects that implement the Comparable interface).
+     * comparator that imposes the reverse of the <em>natural ordering</em> on
+     * a collection of objects that implement the Comparable interface).
      *
      * <p>The returned comparator is serializable (assuming the specified
-     * comparator is also serializable or null).
+     * comparator is also serializable or {@code null}).
      *
-     * @return a comparator that imposes the reverse ordering of the
-     *         specified comparator
+     * @param cmp a comparator who's ordering is to be reversed by the returned
+     * comparator or {@code null}
+     * @return A comparator that imposes the reverse ordering of the
+     *         specified comparator.
      * @since 1.5
      */
     public static <T> Comparator<T> reverseOrder(Comparator<T> cmp) {
--- a/src/share/classes/java/util/ComparableTimSort.java	Thu Apr 07 15:21:10 2011 -0700
+++ b/src/share/classes/java/util/ComparableTimSort.java	Sun Apr 10 10:23:28 2011 -0700
@@ -241,7 +241,7 @@
              * pivot < all in [left, start), so pivot belongs at left.  Note
              * that if there are elements equal to pivot, left points to the
              * first slot after them -- that's why this sort is stable.
-             * Slide elements over to make room to make room for pivot.
+             * Slide elements over to make room for pivot.
              */
             int n = start - left;  // The number of elements to move
             // Switch is just an optimization for arraycopy in default case
--- a/src/share/classes/java/util/SortedMap.java	Thu Apr 07 15:21:10 2011 -0700
+++ b/src/share/classes/java/util/SortedMap.java	Sun Apr 10 10:23:28 2011 -0700
@@ -26,69 +26,70 @@
 package java.util;
 
 /**
- * A {@link Map} that further provides a <i>total ordering</i> on its keys.
+ * A {@link Map} that further provides a <em>total ordering</em> on its keys.
  * The map is ordered according to the {@linkplain Comparable natural
  * ordering} of its keys, or by a {@link Comparator} typically
  * provided at sorted map creation time.  This order is reflected when
  * iterating over the sorted map's collection views (returned by the
- * <tt>entrySet</tt>, <tt>keySet</tt> and <tt>values</tt> methods).
+ * {@code entrySet}, {@code keySet} and {@code values} methods).
  * Several additional operations are provided to take advantage of the
- * ordering.  (This interface is the map analogue of {@link
- * SortedSet}.)
+ * ordering.  (This interface is the map analogue of {@link SortedSet}.)
  *
- * <p>All keys inserted into a sorted map must implement the <tt>Comparable</tt>
+ * <p>All keys inserted into a sorted map must implement the {@code Comparable}
  * interface (or be accepted by the specified comparator).  Furthermore, all
- * such keys must be <i>mutually comparable</i>: <tt>k1.compareTo(k2)</tt> (or
- * <tt>comparator.compare(k1, k2)</tt>) must not throw a
- * <tt>ClassCastException</tt> for any keys <tt>k1</tt> and <tt>k2</tt> in
+ * such keys must be <em>mutually comparable</em>: {@code k1.compareTo(k2)} (or
+ * {@code comparator.compare(k1, k2)}) must not throw a
+ * {@code ClassCastException} for any keys {@code k1} and {@code k2} in
  * the sorted map.  Attempts to violate this restriction will cause the
  * offending method or constructor invocation to throw a
- * <tt>ClassCastException</tt>.
+ * {@code ClassCastException}.
  *
  * <p>Note that the ordering maintained by a sorted map (whether or not an
- * explicit comparator is provided) must be <i>consistent with equals</i> if
- * the sorted map is to correctly implement the <tt>Map</tt> interface.  (See
- * the <tt>Comparable</tt> interface or <tt>Comparator</tt> interface for a
- * precise definition of <i>consistent with equals</i>.)  This is so because
- * the <tt>Map</tt> interface is defined in terms of the <tt>equals</tt>
+ * explicit comparator is provided) must be <em>consistent with equals</em> if
+ * the sorted map is to correctly implement the {@code Map} interface.  (See
+ * the {@code Comparable} interface or {@code Comparator} interface for a
+ * precise definition of <em>consistent with equals</em>.)  This is so because
+ * the {@code Map} interface is defined in terms of the {@code equals}
  * operation, but a sorted map performs all key comparisons using its
- * <tt>compareTo</tt> (or <tt>compare</tt>) method, so two keys that are
+ * {@code compareTo} (or {@code compare}) method, so two keys that are
  * deemed equal by this method are, from the standpoint of the sorted map,
- * equal.  The behavior of a tree map <i>is</i> well-defined even if its
+ * equal.  The behavior of a tree map <em>is</em> well-defined even if its
  * ordering is inconsistent with equals; it just fails to obey the general
- * contract of the <tt>Map</tt> interface.
+ * contract of the {@code Map} interface.
  *
- * <p>All general-purpose sorted map implementation classes should
- * provide four "standard" constructors: 1) A void (no arguments)
- * constructor, which creates an empty sorted map sorted according to
- * the natural ordering of its keys.  2) A constructor with a
- * single argument of type <tt>Comparator</tt>, which creates an empty
- * sorted map sorted according to the specified comparator.  3) A
- * constructor with a single argument of type <tt>Map</tt>, which
- * creates a new map with the same key-value mappings as its argument,
- * sorted according to the keys' natural ordering.  4) A constructor
- * with a single argument of type <tt>SortedMap</tt>,
- * which creates a new sorted map with the same key-value mappings and
- * the same ordering as the input sorted map.  There is no way to
- * enforce this recommendation, as interfaces cannot contain
- * constructors.
+ * <p>All general-purpose sorted map implementation classes should provide four
+ * "standard" constructors. It is not possible to enforce this recommendation
+ * though as required constructors cannot be specified by interfaces. The
+ * expected "standard" constructors for all sorted map implementations are:
+ * <ol>
+ *   <li>A void (no arguments) constructor, which creates an empty sorted map
+ *   sorted according to the natural ordering of its keys.</li>
+ *   <li>A constructor with a single argument of type {@code Comparator}, which
+ *   creates an empty sorted map sorted according to the specified comparator.</li>
+ *   <li>A constructor with a single argument of type {@code Map}, which creates
+ *   a new map with the same key-value mappings as its argument, sorted
+ *   according to the keys' natural ordering.</li>
+ *   <li>A constructor with a single argument of type {@code SortedMap}, which
+ *   creates a new sorted map with the same key-value mappings and the same
+ *   ordering as the input sorted map.</li>
+ * </ol>
  *
- * <p>Note: several methods return submaps with restricted key ranges.
- * Such ranges are <i>half-open</i>, that is, they include their low
+ * <p><strong>Note</strong>: several methods return submaps with restricted key
+ * ranges. Such ranges are <em>half-open</em>, that is, they include their low
  * endpoint but not their high endpoint (where applicable).  If you need a
- * <i>closed range</i> (which includes both endpoints), and the key type
+ * <em>closed range</em> (which includes both endpoints), and the key type
  * allows for calculation of the successor of a given key, merely request
- * the subrange from <tt>lowEndpoint</tt> to
- * <tt>successor(highEndpoint)</tt>.  For example, suppose that <tt>m</tt>
+ * the subrange from {@code lowEndpoint} to
+ * {@code successor(highEndpoint)}.  For example, suppose that {@code m}
  * is a map whose keys are strings.  The following idiom obtains a view
- * containing all of the key-value mappings in <tt>m</tt> whose keys are
- * between <tt>low</tt> and <tt>high</tt>, inclusive:<pre>
+ * containing all of the key-value mappings in {@code m} whose keys are
+ * between {@code low} and {@code high}, inclusive:<pre>
  *   SortedMap&lt;String, V&gt; sub = m.subMap(low, high+"\0");</pre>
  *
- * A similar technique can be used to generate an <i>open range</i>
+ * A similar technique can be used to generate an <em>open range</em>
  * (which contains neither endpoint).  The following idiom obtains a
- * view containing all of the key-value mappings in <tt>m</tt> whose keys
- * are between <tt>low</tt> and <tt>high</tt>, exclusive:<pre>
+ * view containing all of the key-value mappings in {@code m} whose keys
+ * are between {@code low} and {@code high}, exclusive:<pre>
  *   SortedMap&lt;String, V&gt; sub = m.subMap(low+"\0", high);</pre>
  *
  * <p>This interface is a member of the
@@ -112,96 +113,96 @@
 public interface SortedMap<K,V> extends Map<K,V> {
     /**
      * Returns the comparator used to order the keys in this map, or
-     * <tt>null</tt> if this map uses the {@linkplain Comparable
+     * {@code null} if this map uses the {@linkplain Comparable
      * natural ordering} of its keys.
      *
      * @return the comparator used to order the keys in this map,
-     *         or <tt>null</tt> if this map uses the natural ordering
+     *         or {@code null} if this map uses the natural ordering
      *         of its keys
      */
     Comparator<? super K> comparator();
 
     /**
      * Returns a view of the portion of this map whose keys range from
-     * <tt>fromKey</tt>, inclusive, to <tt>toKey</tt>, exclusive.  (If
-     * <tt>fromKey</tt> and <tt>toKey</tt> are equal, the returned map
+     * {@code fromKey}, inclusive, to {@code toKey}, exclusive.  (If
+     * {@code fromKey} and {@code toKey} are equal, the returned map
      * is empty.)  The returned map is backed by this map, so changes
      * in the returned map are reflected in this map, and vice-versa.
      * The returned map supports all optional map operations that this
      * map supports.
      *
-     * <p>The returned map will throw an <tt>IllegalArgumentException</tt>
+     * <p>The returned map will throw an {@code IllegalArgumentException}
      * on an attempt to insert a key outside its range.
      *
      * @param fromKey low endpoint (inclusive) of the keys in the returned map
      * @param toKey high endpoint (exclusive) of the keys in the returned map
      * @return a view of the portion of this map whose keys range from
-     *         <tt>fromKey</tt>, inclusive, to <tt>toKey</tt>, exclusive
-     * @throws ClassCastException if <tt>fromKey</tt> and <tt>toKey</tt>
+     *         {@code fromKey}, inclusive, to {@code toKey}, exclusive
+     * @throws ClassCastException if {@code fromKey} and {@code toKey}
      *         cannot be compared to one another using this map's comparator
      *         (or, if the map has no comparator, using natural ordering).
      *         Implementations may, but are not required to, throw this
-     *         exception if <tt>fromKey</tt> or <tt>toKey</tt>
+     *         exception if {@code fromKey} or {@code toKey}
      *         cannot be compared to keys currently in the map.
-     * @throws NullPointerException if <tt>fromKey</tt> or <tt>toKey</tt>
+     * @throws NullPointerException if {@code fromKey} or {@code toKey}
      *         is null and this map does not permit null keys
-     * @throws IllegalArgumentException if <tt>fromKey</tt> is greater than
-     *         <tt>toKey</tt>; or if this map itself has a restricted
-     *         range, and <tt>fromKey</tt> or <tt>toKey</tt> lies
+     * @throws IllegalArgumentException if {@code fromKey} is greater than
+     *         {@code toKey}; or if this map itself has a restricted
+     *         range, and {@code fromKey} or {@code toKey} lies
      *         outside the bounds of the range
      */
     SortedMap<K,V> subMap(K fromKey, K toKey);
 
     /**
      * Returns a view of the portion of this map whose keys are
-     * strictly less than <tt>toKey</tt>.  The returned map is backed
+     * strictly less than {@code toKey}.  The returned map is backed
      * by this map, so changes in the returned map are reflected in
      * this map, and vice-versa.  The returned map supports all
      * optional map operations that this map supports.
      *
-     * <p>The returned map will throw an <tt>IllegalArgumentException</tt>
+     * <p>The returned map will throw an {@code IllegalArgumentException}
      * on an attempt to insert a key outside its range.
      *
      * @param toKey high endpoint (exclusive) of the keys in the returned map
      * @return a view of the portion of this map whose keys are strictly
-     *         less than <tt>toKey</tt>
-     * @throws ClassCastException if <tt>toKey</tt> is not compatible
+     *         less than {@code toKey}
+     * @throws ClassCastException if {@code toKey} is not compatible
      *         with this map's comparator (or, if the map has no comparator,
-     *         if <tt>toKey</tt> does not implement {@link Comparable}).
+     *         if {@code toKey} does not implement {@link Comparable}).
      *         Implementations may, but are not required to, throw this
-     *         exception if <tt>toKey</tt> cannot be compared to keys
+     *         exception if {@code toKey} cannot be compared to keys
      *         currently in the map.
-     * @throws NullPointerException if <tt>toKey</tt> is null and
+     * @throws NullPointerException if {@code toKey} is null and
      *         this map does not permit null keys
      * @throws IllegalArgumentException if this map itself has a
-     *         restricted range, and <tt>toKey</tt> lies outside the
+     *         restricted range, and {@code toKey} lies outside the
      *         bounds of the range
      */
     SortedMap<K,V> headMap(K toKey);
 
     /**
      * Returns a view of the portion of this map whose keys are
-     * greater than or equal to <tt>fromKey</tt>.  The returned map is
+     * greater than or equal to {@code fromKey}.  The returned map is
      * backed by this map, so changes in the returned map are
      * reflected in this map, and vice-versa.  The returned map
      * supports all optional map operations that this map supports.
      *
-     * <p>The returned map will throw an <tt>IllegalArgumentException</tt>
+     * <p>The returned map will throw an {@code IllegalArgumentException}
      * on an attempt to insert a key outside its range.
      *
      * @param fromKey low endpoint (inclusive) of the keys in the returned map
      * @return a view of the portion of this map whose keys are greater
-     *         than or equal to <tt>fromKey</tt>
-     * @throws ClassCastException if <tt>fromKey</tt> is not compatible
+     *         than or equal to {@code fromKey}
+     * @throws ClassCastException if {@code fromKey} is not compatible
      *         with this map's comparator (or, if the map has no comparator,
-     *         if <tt>fromKey</tt> does not implement {@link Comparable}).
+     *         if {@code fromKey} does not implement {@link Comparable}).
      *         Implementations may, but are not required to, throw this
-     *         exception if <tt>fromKey</tt> cannot be compared to keys
+     *         exception if {@code fromKey} cannot be compared to keys
      *         currently in the map.
-     * @throws NullPointerException if <tt>fromKey</tt> is null and
+     * @throws NullPointerException if {@code fromKey} is null and
      *         this map does not permit null keys
      * @throws IllegalArgumentException if this map itself has a
-     *         restricted range, and <tt>fromKey</tt> lies outside the
+     *         restricted range, and {@code fromKey} lies outside the
      *         bounds of the range
      */
     SortedMap<K,V> tailMap(K fromKey);
@@ -228,12 +229,12 @@
      * The set is backed by the map, so changes to the map are
      * reflected in the set, and vice-versa.  If the map is modified
      * while an iteration over the set is in progress (except through
-     * the iterator's own <tt>remove</tt> operation), the results of
+     * the iterator's own {@code remove} operation), the results of
      * the iteration are undefined.  The set supports element removal,
      * which removes the corresponding mapping from the map, via the
-     * <tt>Iterator.remove</tt>, <tt>Set.remove</tt>,
-     * <tt>removeAll</tt>, <tt>retainAll</tt>, and <tt>clear</tt>
-     * operations.  It does not support the <tt>add</tt> or <tt>addAll</tt>
+     * {@code Iterator.remove}, {@code Set.remove},
+     * {@code removeAll}, {@code retainAll}, and {@code clear}
+     * operations.  It does not support the {@code add} or {@code addAll}
      * operations.
      *
      * @return a set view of the keys contained in this map, sorted in
@@ -248,13 +249,13 @@
      * The collection is backed by the map, so changes to the map are
      * reflected in the collection, and vice-versa.  If the map is
      * modified while an iteration over the collection is in progress
-     * (except through the iterator's own <tt>remove</tt> operation),
+     * (except through the iterator's own {@code remove} operation),
      * the results of the iteration are undefined.  The collection
      * supports element removal, which removes the corresponding
-     * mapping from the map, via the <tt>Iterator.remove</tt>,
-     * <tt>Collection.remove</tt>, <tt>removeAll</tt>,
-     * <tt>retainAll</tt> and <tt>clear</tt> operations.  It does not
-     * support the <tt>add</tt> or <tt>addAll</tt> operations.
+     * mapping from the map, via the {@code Iterator.remove},
+     * {@code Collection.remove}, {@code removeAll},
+     * {@code retainAll} and {@code clear} operations.  It does not
+     * support the {@code add} or {@code addAll} operations.
      *
      * @return a collection view of the values contained in this map,
      *         sorted in ascending key order
@@ -267,14 +268,14 @@
      * The set is backed by the map, so changes to the map are
      * reflected in the set, and vice-versa.  If the map is modified
      * while an iteration over the set is in progress (except through
-     * the iterator's own <tt>remove</tt> operation, or through the
-     * <tt>setValue</tt> operation on a map entry returned by the
+     * the iterator's own {@code remove} operation, or through the
+     * {@code setValue} operation on a map entry returned by the
      * iterator) the results of the iteration are undefined.  The set
      * supports element removal, which removes the corresponding
-     * mapping from the map, via the <tt>Iterator.remove</tt>,
-     * <tt>Set.remove</tt>, <tt>removeAll</tt>, <tt>retainAll</tt> and
-     * <tt>clear</tt> operations.  It does not support the
-     * <tt>add</tt> or <tt>addAll</tt> operations.
+     * mapping from the map, via the {@code Iterator.remove},
+     * {@code Set.remove}, {@code removeAll}, {@code retainAll} and
+     * {@code clear} operations.  It does not support the
+     * {@code add} or {@code addAll} operations.
      *
      * @return a set view of the mappings contained in this map,
      *         sorted in ascending key order
--- a/src/share/classes/java/util/TimSort.java	Thu Apr 07 15:21:10 2011 -0700
+++ b/src/share/classes/java/util/TimSort.java	Sun Apr 10 10:23:28 2011 -0700
@@ -274,7 +274,7 @@
              * pivot < all in [left, start), so pivot belongs at left.  Note
              * that if there are elements equal to pivot, left points to the
              * first slot after them -- that's why this sort is stable.
-             * Slide elements over to make room to make room for pivot.
+             * Slide elements over to make room for pivot.
              */
             int n = start - left;  // The number of elements to move
             // Switch is just an optimization for arraycopy in default case
--- a/src/share/classes/java/util/jar/JarVerifier.java	Thu Apr 07 15:21:10 2011 -0700
+++ b/src/share/classes/java/util/jar/JarVerifier.java	Sun Apr 10 10:23:28 2011 -0700
@@ -415,6 +415,12 @@
         pendingBlocks = null;
         signerCache = null;
         manDig = null;
+        // MANIFEST.MF is always treated as signed and verified,
+        // move its signers from sigFileSigners to verifiedSigners.
+        if (sigFileSigners.containsKey(JarFile.MANIFEST_NAME)) {
+            verifiedSigners.put(JarFile.MANIFEST_NAME,
+                    sigFileSigners.remove(JarFile.MANIFEST_NAME));
+        }
     }
 
     static class VerifierStream extends java.io.InputStream {
--- a/src/share/classes/java/util/logging/LogManager.java	Thu Apr 07 15:21:10 2011 -0700
+++ b/src/share/classes/java/util/logging/LogManager.java	Sun Apr 10 10:23:28 2011 -0700
@@ -1166,7 +1166,12 @@
     private static LoggingMXBean loggingMXBean = null;
     /**
      * String representation of the
-     * {@link javax.management.ObjectName} for {@link LoggingMXBean}.
+     * {@link javax.management.ObjectName} for the management interface
+     * for the logging facility.
+     *
+     * @see java.lang.management.PlatformLoggingMXBean
+     * @see java.util.logging.LoggingMXBean
+     *
      * @since 1.5
      */
     public final static String LOGGING_MXBEAN_NAME
@@ -1174,20 +1179,20 @@
 
     /**
      * Returns <tt>LoggingMXBean</tt> for managing loggers.
-     * An alternative way to manage loggers is using
-     * the {@link java.lang.management.ManagementFactory#getPlatformMXBeans(Class)
-     * ManagementFactory.getPlatformMXBeans} method as follows:
+     * An alternative way to manage loggers is through the
+     * {@link java.lang.management.PlatformLoggingMXBean} interface
+     * that can be obtained by calling:
      * <pre>
-     *     List&lt{@link PlatformLoggingMXBean}&gt result = ManagementFactory.getPlatformMXBeans(PlatformLoggingMXBean.class);
+     *     PlatformLoggingMXBean logging = {@link java.lang.management.ManagementFactory#getPlatformMXBean(Class)
+     *         ManagementFactory.getPlatformMXBean}(PlatformLoggingMXBean.class);
      * </pre>
      *
      * @return a {@link LoggingMXBean} object.
      *
-     * @see PlatformLoggingMXBean
-     * @see java.lang.management.ManagementFactory
+     * @see java.lang.management.PlatformLoggingMXBean
      * @since 1.5
      */
-    public static synchronized LoggingMXBean  getLoggingMXBean() {
+    public static synchronized LoggingMXBean getLoggingMXBean() {
         if (loggingMXBean == null) {
             loggingMXBean =  new Logging();
         }
--- a/src/share/classes/java/util/logging/LoggingMXBean.java	Thu Apr 07 15:21:10 2011 -0700
+++ b/src/share/classes/java/util/logging/LoggingMXBean.java	Sun Apr 10 10:23:28 2011 -0700
@@ -27,36 +27,41 @@
 
 
 /**
- * The management interface for the logging facility.
+ * The management interface for the logging facility. It is recommended
+ * to use the {@link java.lang.management.PlatformLoggingMXBean} management
+ * interface that implements all attributes defined in this
+ * {@code LoggingMXBean}.  The
+ * {@link java.lang.management.ManagementFactory#getPlatformMXBean(Class)
+ * ManagementFactory.getPlatformMXBean} method can be used to obtain
+ * the {@code PlatformLoggingMXBean} object representing the management
+ * interface for logging.
  *
  * <p>There is a single global instance of the <tt>LoggingMXBean</tt>.
- * This instance is an
- * <a href="../../lang/management/ManagementFactory.html#MXBean">MXBean</a>
- * can be obtained by calling
- * the {@link LogManager#getLoggingMXBean} method or from the
+ * This instance is an {@link javax.management.MXBean MXBean} that
+ * can be obtained by calling the {@link LogManager#getLoggingMXBean}
+ * method or from the
  * {@linkplain java.lang.management.ManagementFactory#getPlatformMBeanServer
  * platform <tt>MBeanServer</tt>}.
- *
- * The {@link javax.management.ObjectName ObjectName} for uniquely
- * identifying the <tt>LoggingMXBean</tt> within an MBeanServer is:
- * <blockquote>
- *    {@link LogManager#LOGGING_MXBEAN_NAME
- *           <tt>java.util.logging:type=Logging</tt>}
- * </blockquote>
- *
- * The instance registered in the platform <tt>MBeanServer</tt> with
- * this {@code ObjectName} is also a {@link PlatformLoggingMXBean}.
+ * <p>
+ * The {@link javax.management.ObjectName ObjectName} that uniquely identifies
+ * the management interface for logging within the {@code MBeanServer} is:
+ * <pre>
+ *    {@link LogManager#LOGGING_MXBEAN_NAME java.util.logging:type=Logging}
+ * </pre>
+ * <p>
+ * The instance registered in the platform {@code MBeanServer}
+ * is also a {@link java.lang.management.PlatformLoggingMXBean}.
  *
  * @author  Ron Mann
  * @author  Mandy Chung
  * @since   1.5
  *
- * @see PlatformLoggingMXBean
+ * @see java.lang.management.PlatformLoggingMXBean
  */
 public interface LoggingMXBean {
 
     /**
-     * Returns the list of currently registered loggers. This method
+     * Returns the list of currently registered logger names. This method
      * calls {@link LogManager#getLoggerNames} and returns a list
      * of the logger names.
      *
@@ -89,7 +94,7 @@
      *
      * @see Logger#getLevel
      */
-    public String getLoggerLevel( String loggerName );
+    public String getLoggerLevel(String loggerName);
 
     /**
      * Sets the specified logger to the specified new level.
@@ -115,7 +120,7 @@
      *
      * @see Logger#setLevel
      */
-    public void setLoggerLevel( String loggerName, String levelName );
+    public void setLoggerLevel(String loggerName, String levelName);
 
     /**
      * Returns the name of the parent for the specified logger.
--- a/src/share/classes/java/util/logging/LoggingProxyImpl.java	Thu Apr 07 15:21:10 2011 -0700
+++ b/src/share/classes/java/util/logging/LoggingProxyImpl.java	Sun Apr 10 10:23:28 2011 -0700
@@ -99,4 +99,9 @@
     public String getLevelName(Object level) {
         return ((Level) level).getName();
     }
+
+    @Override
+    public String getProperty(String key) {
+        return LogManager.getLogManager().getProperty(key);
+    }
 }
--- a/src/share/classes/java/util/logging/PlatformLoggingMXBean.java	Thu Apr 07 15:21:10 2011 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,60 +0,0 @@
-/*
- * Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package java.util.logging;
-
-import java.lang.management.PlatformManagedObject;
-
-/**
- * The {@linkplain PlatformManagedObject platform managed object} for the
- * logging facility.  This interface simply unifies {@link LoggingMXBean}
- * {@link PlatformManagedObject};
- * and it does not specify any new operations.
- *
- * <p>The {@link java.lang.management.ManagementFactory#getPlatformMXBeans(Class)
- * ManagementFactory.getPlatformMXBeans} method can be used to obtain
- * the {@code PlatformLoggingMXBean} object as follows:
- * <pre>
- *     ManagementFactory.getPlatformMXBeans(PlatformLoggingMXBean.class);
- * </pre>
- * or from the {@linkplain java.lang.management.ManagementFactory#getPlatformMBeanServer
- * platform <tt>MBeanServer</tt>}.
- *
- * The {@link javax.management.ObjectName ObjectName} for uniquely
- * identifying the <tt>LoggingMXBean</tt> within an MBeanServer is:
- * <blockquote>
- *           <tt>java.util.logging:type=Logging</tt>
- * </blockquote>
- *
- * The {@link PlatformManagedObject#getObjectName} method
- * can be used to obtain its {@code ObjectName}.
- *
- * @see java.lang.management.PlatformManagedObject
- *
- * @author  Mandy Chung
- * @since   1.7
- */
-public interface PlatformLoggingMXBean extends LoggingMXBean, PlatformManagedObject {
-}
--- a/src/share/classes/java/util/logging/SimpleFormatter.java	Thu Apr 07 15:21:10 2011 -0700
+++ b/src/share/classes/java/util/logging/SimpleFormatter.java	Sun Apr 10 10:23:28 2011 -0700
@@ -29,31 +29,108 @@
 import java.io.*;
 import java.text.*;
 import java.util.Date;
+import sun.util.logging.LoggingSupport;
 
 /**
- * Print a brief summary of the LogRecord in a human readable
+ * Print a brief summary of the {@code LogRecord} in a human readable
  * format.  The summary will typically be 1 or 2 lines.
  *
+ * <p>
+ * <a name="formatting">
+ * <b>Configuration:</b></a>
+ * The {@code SimpleFormatter} is initialized with the
+ * <a href="../Formatter.html#syntax">format string</a>
+ * specified in the {@code java.util.logging.SimpleFormatter.format}
+ * property to {@linkplain #format format} the log messages.
+ * This property can be defined
+ * in the {@linkplain LogManager#getProperty logging properties}
+ * configuration file
+ * or as a system property.  If this property is set in both
+ * the logging properties and system properties,
+ * the format string specified in the system property will be used.
+ * If this property is not defined or the given format string
+ * is {@linkplain java.util.IllegalFormatException illegal},
+ * the default format is implementation-specific.
+ *
  * @since 1.4
+ * @see java.util.Formatter
  */
 
 public class SimpleFormatter extends Formatter {
 
-    Date dat = new Date();
-    private final static String format = "{0,date} {0,time}";
-    private MessageFormat formatter;
-
-    private Object args[] = new Object[1];
-
-    // Line separator string.  This is the value of the line.separator
-    // property at the moment that the SimpleFormatter was created.
-    private String lineSeparator = java.security.AccessController.doPrivileged(
-               new sun.security.action.GetPropertyAction("line.separator"));
+    // format string for printing the log record
+    private static final String format = LoggingSupport.getSimpleFormat();
+    private final Date dat = new Date();
 
     /**
      * Format the given LogRecord.
      * <p>
-     * This method can be overridden in a subclass.
+     * The formatting can be customized by specifying the
+     * <a href="../Formatter.html#syntax">format string</a>
+     * in the <a href="#formatting">
+     * {@code java.util.logging.SimpleFormatter.format}</a> property.
+     * The given {@code LogRecord} will be formatted as if by calling:
+     * <pre>
+     *    {@link String#format String.format}(format, date, source, logger, level, message, thrown);
+     * </pre>
+     * where the arguments are:<br>
+     * <ol>
+     * <li>{@code format} - the {@link java.util.Formatter
+     *     java.util.Formatter} format string specified in the
+     *     {@code java.util.logging.SimpleFormatter.format} property
+     *     or the default format.</li>
+     * <li>{@code date} - a {@link Date} object representing
+     *     {@linkplain LogRecord#getMillis event time} of the log record.</li>
+     * <li>{@code source} - a string representing the caller, if available;
+     *     otherwise, the logger's name.</li>
+     * <li>{@code logger} - the logger's name.</li>
+     * <li>{@code level} - the {@linkplain Level#getLocalizedName
+     *     log level}.</li>
+     * <li>{@code message} - the formatted log message
+     *     returned from the {@link Formatter#formatMessage(LogRecord)}
+     *     method.  It uses {@link java.text.MessageFormat java.text}
+     *     formatting and does not use the {@code java.util.Formatter
+     *     format} argument.</li>
+     * <li>{@code thrown} - a string representing
+     *     the {@linkplain LogRecord#getThrown throwable}
+     *     associated with the log record and its backtrace
+     *     beginning with a newline character, if any;
+     *     otherwise, an empty string.</li>
+     * </ol>
+     *
+     * <p>Some example formats:<br>
+     * <ul>
+     * <li> {@code java.util.logging.SimpleFormatter.format="%4$s: %5$s [%1$tc]%n"}
+     *     <p>This prints 1 line with the log level ({@code 4$}),
+     *     the log message ({@code 5$}) and the timestamp ({@code 1$}) in
+     *     a square bracket.
+     *     <pre>
+     *     WARNING: warning message [Tue Mar 22 13:11:31 PDT 2011]
+     *     </pre></li>
+     * <li> {@code java.util.logging.SimpleFormatter.format="%1$tc %2$s%n%4$s: %5$s%6$s%n"}
+     *     <p>This prints 2 lines where the first line includes
+     *     the timestamp ({@code 1$}) and the source ({@code 2$});
+     *     the second line includes the log level ({@code 4$}) and
+     *     the log message ({@code 5$}) followed with the throwable
+     *     and its backtrace ({@code 6$}), if any:
+     *     <pre>
+     *     Tue Mar 22 13:11:31 PDT 2011 MyClass fatal
+     *     SEVERE: several message with an exception
+     *     java.lang.IllegalArgumentException: invalid argument
+     *             at MyClass.mash(MyClass.java:9)
+     *             at MyClass.crunch(MyClass.java:6)
+     *             at MyClass.main(MyClass.java:3)
+     *     </pre></li>
+     * <li> {@code java.util.logging.SimpleFormatter.format="%1$tb %1$td, %1$tY %1$tl:%1$tM:%1$tS %1$Tp %2$s%n%4$s: %5$s%n"}
+     *      <p>This prints 2 lines similar to the example above
+     *         with a different date/time formatting and does not print
+     *         the throwable and its backtrace:
+     *     <pre>
+     *     Mar 22, 2011 1:11:31 PM MyClass fatal
+     *     SEVERE: several message with an exception
+     *     </pre></li>
+     * </ul>
+     * <p>This method can also be overridden in a subclass.
      * It is recommended to use the {@link Formatter#formatMessage}
      * convenience method to localize and format the message field.
      *
@@ -61,42 +138,32 @@
      * @return a formatted log record
      */
     public synchronized String format(LogRecord record) {
-        StringBuffer sb = new StringBuffer();
-        // Minimize memory allocations here.
         dat.setTime(record.getMillis());
-        args[0] = dat;
-        StringBuffer text = new StringBuffer();
-        if (formatter == null) {
-            formatter = new MessageFormat(format);
+        String source;
+        if (record.getSourceClassName() != null) {
+            source = record.getSourceClassName();
+            if (record.getSourceMethodName() != null) {
+               source += " " + record.getSourceMethodName();
+            }
+        } else {
+            source = record.getLoggerName();
         }
-        formatter.format(args, text, null);
-        sb.append(text);
-        sb.append(" ");
-        if (record.getSourceClassName() != null) {
-            sb.append(record.getSourceClassName());
-        } else {
-            sb.append(record.getLoggerName());
+        String message = formatMessage(record);
+        String throwable = "";
+        if (record.getThrown() != null) {
+            StringWriter sw = new StringWriter();
+            PrintWriter pw = new PrintWriter(sw);
+            pw.println();
+            record.getThrown().printStackTrace(pw);
+            pw.close();
+            throwable = sw.toString();
         }
-        if (record.getSourceMethodName() != null) {
-            sb.append(" ");
-            sb.append(record.getSourceMethodName());
-        }
-        sb.append(lineSeparator);
-        String message = formatMessage(record);
-        sb.append(record.getLevel().getLocalizedName());
-        sb.append(": ");
-        sb.append(message);
-        sb.append(lineSeparator);
-        if (record.getThrown() != null) {
-            try {
-                StringWriter sw = new StringWriter();
-                PrintWriter pw = new PrintWriter(sw);
-                record.getThrown().printStackTrace(pw);
-                pw.close();
-                sb.append(sw.toString());
-            } catch (Exception ex) {
-            }
-        }
-        return sb.toString();
+        return String.format(format,
+                             dat,
+                             source,
+                             record.getLoggerName(),
+                             record.getLevel().getLocalizedName(),
+                             message,
+                             throwable);
     }
 }
--- a/src/share/classes/java/util/zip/DeflaterOutputStream.java	Thu Apr 07 15:21:10 2011 -0700
+++ b/src/share/classes/java/util/zip/DeflaterOutputStream.java	Sun Apr 10 10:23:28 2011 -0700
@@ -206,14 +206,9 @@
             return;
         }
         if (!def.finished()) {
-            // Deflate no more than stride bytes at a time.  This avoids
-            // excess copying in deflateBytes (see Deflater.c)
-            int stride = buf.length;
-            for (int i = 0; i < len; i+= stride) {
-                def.setInput(b, off + i, Math.min(stride, len - i));
-                while (!def.needsInput()) {
-                    deflate();
-                }
+            def.setInput(b, off, len);
+            while (!def.needsInput()) {
+                deflate();
             }
         }
     }
--- a/src/share/classes/javax/imageio/metadata/IIOMetadataNode.java	Thu Apr 07 15:21:10 2011 -0700
+++ b/src/share/classes/javax/imageio/metadata/IIOMetadataNode.java	Sun Apr 10 10:23:28 2011 -0700
@@ -724,7 +724,7 @@
     /**
      * Equivalent to <code>getNodeName</code>.
      *
-     * @return the node name, as a <code>String</code
+     * @return the node name, as a <code>String</code>
      */
     public String getTagName() {
         return nodeName;
--- a/src/share/classes/javax/net/ssl/KeyStoreBuilderParameters.java	Thu Apr 07 15:21:10 2011 -0700
+++ b/src/share/classes/javax/net/ssl/KeyStoreBuilderParameters.java	Sun Apr 10 10:23:28 2011 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2005, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -51,7 +51,7 @@
      * @exception NullPointerException if builder is null
      */
     public KeyStoreBuilderParameters(Builder builder) {
-        parameters = Collections.singletonList(builder);
+        parameters = Collections.singletonList(Objects.requireNonNull(builder));
     }
 
     /**
@@ -64,11 +64,12 @@
      * @exception IllegalArgumentException if parameters is an empty list
      */
     public KeyStoreBuilderParameters(List<Builder> parameters) {
+        if (parameters.isEmpty()) {
+            throw new IllegalArgumentException();
+        }
+
         this.parameters = Collections.unmodifiableList(
             new ArrayList<Builder>(parameters));
-        if (this.parameters.isEmpty()) {
-            throw new IllegalArgumentException();
-        }
     }
 
     /**
--- a/src/share/classes/javax/swing/JLayer.java	Thu Apr 07 15:21:10 2011 -0700
+++ b/src/share/classes/javax/swing/JLayer.java	Sun Apr 10 10:23:28 2011 -0700
@@ -476,7 +476,7 @@
      * for this {@code JLayer} and the {@code JLayer}
      * is displayable.
      * <p/>
-     * The following example shows how to correclty use this method
+     * The following example shows how to correctly use this method
      * in the {@code LayerUI} implementations:
      * <pre>
      *    public void installUI(JComponent c) {
@@ -834,7 +834,7 @@
         }
 
         /**
-         * First, implementatation of this method iterates through
+         * First, implementation of this method iterates through
          * glassPane's child components and returns {@code true}
          * if any of them is visible and contains passed x,y point.
          * After that it checks if no mouseListeners is attached to this component
--- a/src/share/classes/javax/swing/PopupFactory.java	Thu Apr 07 15:21:10 2011 -0700
+++ b/src/share/classes/javax/swing/PopupFactory.java	Sun Apr 10 10:23:28 2011 -0700
@@ -203,6 +203,12 @@
                     popupType = HEAVY_WEIGHT_POPUP;
                     break;
                 }
+            } else if (c instanceof Window) {
+                Window w = (Window) c;
+                if (!w.isOpaque() || w.getOpacity() < 1 || w.getShape() != null) {
+                    popupType = HEAVY_WEIGHT_POPUP;
+                    break;
+                }
             }
             c = c.getParent();
         }
--- a/src/share/classes/javax/swing/SpringLayout.java	Thu Apr 07 15:21:10 2011 -0700
+++ b/src/share/classes/javax/swing/SpringLayout.java	Sun Apr 10 10:23:28 2011 -0700
@@ -727,6 +727,9 @@
         * For any other <code>String</code> value passed as the edge,
         * no action is taken. For a <code>null</code> edge, a
         * <code>NullPointerException</code> is thrown.
+        * <p/>
+        * <b>Note:</b> This method can affect {@code x} and {@code y} values
+        * previously set for this {@code Constraints}.
         *
         * @param edgeName the edge to be set
         * @param s the spring controlling the specified edge
--- a/src/share/classes/javax/swing/plaf/LayerUI.java	Thu Apr 07 15:21:10 2011 -0700
+++ b/src/share/classes/javax/swing/plaf/LayerUI.java	Sun Apr 10 10:23:28 2011 -0700
@@ -25,9 +25,7 @@
 
 package javax.swing.plaf;
 
-import javax.accessibility.Accessible;
 import javax.swing.*;
-import javax.swing.plaf.ComponentUI;
 import java.awt.*;
 import java.awt.event.*;
 import java.beans.PropertyChangeEvent;
@@ -38,7 +36,7 @@
 /**
  * The base class for all {@link javax.swing.JLayer}'s UI delegates.
  * <p/>
- * {@link #paint(java.awt.Graphics, javax.swing.JComponent)} method performes the
+ * {@link #paint(java.awt.Graphics, javax.swing.JComponent)} method performs the
  * painting of the {@code JLayer}
  * and {@link #eventDispatched(AWTEvent, JLayer)} method is notified
  * about any {@code AWTEvent}s which have been generated by a {@code JLayer}
@@ -165,7 +163,7 @@
      *    l.setLayerEventMask(AWTEvent.COMPONENT_EVENT_MASK);
      * }
      *
-     * public void unistallUI(JComponent c) {
+     * public void uninstallUI(JComponent c) {
      *     super.uninstallUI(c);
      *     JLayer l = (JLayer) c;
      *     l.setLayerEventMask(0);
@@ -197,7 +195,7 @@
      *    l.setLayerEventMask(AWTEvent.FOCUS_EVENT_MASK);
      * }
      *
-     * public void unistallUI(JComponent c) {
+     * public void uninstallUI(JComponent c) {
      *     super.uninstallUI(c);
      *     JLayer l = (JLayer) c;
      *     l.setLayerEventMask(0);
@@ -229,7 +227,7 @@
      *    l.setLayerEventMask(AWTEvent.KEY_EVENT_MASK);
      * }
      *
-     * public void unistallUI(JComponent c) {
+     * public void uninstallUI(JComponent c) {
      *     super.uninstallUI(c);
      *     JLayer l = (JLayer) c;
      *     l.setLayerEventMask(0);
@@ -261,7 +259,7 @@
      *    l.setLayerEventMask(AWTEvent.MOUSE_EVENT_MASK);
      * }
      *
-     * public void unistallUI(JComponent c) {
+     * public void uninstallUI(JComponent c) {
      *     super.uninstallUI(c);
      *     JLayer l = (JLayer) c;
      *     l.setLayerEventMask(0);
@@ -293,7 +291,7 @@
      *    l.setLayerEventMask(AWTEvent.MOUSE_MOTION_EVENT_MASK);
      * }
      *
-     * public void unistallUI(JComponent c) {
+     * public void uninstallUI(JComponent c) {
      *     super.uninstallUI(c);
      *     JLayer l = (JLayer) c;
      *     l.setLayerEventMask(0);
@@ -325,7 +323,7 @@
      *    l.setLayerEventMask(AWTEvent.MOUSE_WHEEL_EVENT_MASK);
      * }
      *
-     * public void unistallUI(JComponent c) {
+     * public void uninstallUI(JComponent c) {
      *     super.uninstallUI(c);
      *     JLayer l = (JLayer) c;
      *     l.setLayerEventMask(0);
@@ -357,7 +355,7 @@
      *    l.setLayerEventMask(AWTEvent.INPUT_METHOD_EVENT_MASK);
      * }
      *
-     * public void unistallUI(JComponent c) {
+     * public void uninstallUI(JComponent c) {
      *     super.uninstallUI(c);
      *     JLayer l = (JLayer) c;
      *     l.setLayerEventMask(0);
@@ -389,7 +387,7 @@
      *    l.setLayerEventMask(AWTEvent.HIERARCHY_EVENT_MASK);
      * }
      *
-     * public void unistallUI(JComponent c) {
+     * public void uninstallUI(JComponent c) {
      *     super.uninstallUI(c);
      *     JLayer l = (JLayer) c;
      *     l.setLayerEventMask(0);
@@ -421,7 +419,7 @@
      *    l.setLayerEventMask(AWTEvent.HIERARCHY_BOUNDS_EVENT_MASK);
      * }
      *
-     * public void unistallUI(JComponent c) {
+     * public void uninstallUI(JComponent c) {
      *     super.uninstallUI(c);
      *     JLayer l = (JLayer) c;
      *     l.setLayerEventMask(0);
@@ -691,7 +689,7 @@
      * Otherwise, the default implementation is used.
      *
      * @param c {@code JLayer} to return preferred size for
-     * @return maximun size for the passed {@code JLayer}
+     * @return maximum size for the passed {@code JLayer}
      */
     public Dimension getMaximumSize(JComponent c) {
         JLayer l = (JLayer) c;
--- a/src/share/classes/javax/swing/plaf/nimbus/LoweredBorder.java	Thu Apr 07 15:21:10 2011 -0700
+++ b/src/share/classes/javax/swing/plaf/nimbus/LoweredBorder.java	Sun Apr 10 10:23:28 2011 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -26,13 +26,11 @@
 
 import javax.swing.border.Border;
 import javax.swing.JComponent;
-import javax.swing.plaf.UIResource;
 import java.awt.Insets;
 import java.awt.Component;
 import java.awt.Graphics;
 import java.awt.Graphics2D;
 import java.awt.Color;
-import java.awt.Transparency;
 import java.awt.RenderingHints;
 import java.awt.Dimension;
 import java.awt.image.BufferedImage;
@@ -58,7 +56,9 @@
 
     @Override
     protected Object[] getExtendedCacheKeys(JComponent c) {
-        return new Object[] {c.getBackground()};
+        return (c != null)
+                ? new Object[] { c.getBackground() }
+                : null;
     }
 
     /**
@@ -85,6 +85,7 @@
      */
     protected void doPaint(Graphics2D g, JComponent c, int width, int height,
             Object[] extendedCacheKeys) {
+        Color color = (c == null) ? Color.BLACK : c.getBackground();
         BufferedImage img1 = new BufferedImage(IMG_SIZE,IMG_SIZE,
                     BufferedImage.TYPE_INT_ARGB);
         BufferedImage img2 = new BufferedImage(IMG_SIZE,IMG_SIZE,
@@ -93,14 +94,14 @@
         Graphics2D g2 = (Graphics2D)img1.getGraphics();
         g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
                 RenderingHints.VALUE_ANTIALIAS_ON);
-        g2.setColor(c.getBackground());
+        g2.setColor(color);
         g2.fillRoundRect(2,0,26,26,RADIUS,RADIUS);
         g2.dispose();
         // draw shadow
         InnerShadowEffect effect = new InnerShadowEffect();
         effect.setDistance(1);
         effect.setSize(3);
-        effect.setColor(getLighter(c.getBackground(),2.1f));
+        effect.setColor(getLighter(color, 2.1f));
         effect.setAngle(90);
         effect.applyEffect(img1,img2,IMG_SIZE,IMG_SIZE);
         // draw outline to img2
@@ -108,7 +109,7 @@
         g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
                 RenderingHints.VALUE_ANTIALIAS_ON);
         g2.setClip(0,28,IMG_SIZE,1);
-        g2.setColor(getLighter(c.getBackground(),0.90f));
+        g2.setColor(getLighter(color, 0.90f));
         g2.drawRoundRect(2,1,25,25,RADIUS,RADIUS);
         g2.dispose();
         // draw final image
@@ -150,7 +151,7 @@
      * @param c the component for which this border insets value applies
      */
     public Insets getBorderInsets(Component c) {
-        return INSETS;
+        return (Insets) INSETS.clone();
     }
 
     /**
--- a/src/share/classes/javax/swing/plaf/synth/SynthTableUI.java	Thu Apr 07 15:21:10 2011 -0700
+++ b/src/share/classes/javax/swing/plaf/synth/SynthTableUI.java	Sun Apr 10 10:23:28 2011 -0700
@@ -786,9 +786,9 @@
                                                 hasFocus, row, column);
 
             setIcon(null);
-            Class columnClass = table.getColumnClass(column);
-            configureValue(value, columnClass);
-
+            if (table != null) {
+                configureValue(value, table.getColumnClass(column));
+            }
             return this;
         }
 
--- a/src/share/classes/sun/awt/FontConfiguration.java	Thu Apr 07 15:21:10 2011 -0700
+++ b/src/share/classes/sun/awt/FontConfiguration.java	Sun Apr 10 10:23:28 2011 -0700
@@ -82,6 +82,10 @@
      * one to ensure proper static initialisation takes place.
      */
     public FontConfiguration(SunFontManager fm) {
+        if (FontUtilities.debugFonts()) {
+            FontUtilities.getLogger()
+                .info("Creating standard Font Configuration");
+        }
         if (FontUtilities.debugFonts() && logger == null) {
             logger = PlatformLogger.getLogger("sun.awt.FontConfiguration");
         }
@@ -111,6 +115,10 @@
                              boolean preferLocaleFonts,
                              boolean preferPropFonts) {
         fontManager = fm;
+        if (FontUtilities.debugFonts()) {
+            FontUtilities.getLogger()
+                .info("Creating alternate Font Configuration");
+        }
         this.preferLocaleFonts = preferLocaleFonts;
         this.preferPropFonts = preferPropFonts;
         /* fontConfig should be initialised by default constructor, and
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/classes/sun/awt/HToolkit.java	Sun Apr 10 10:23:28 2011 -0700
@@ -0,0 +1,378 @@
+/*
+ * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package sun.awt;
+
+import java.awt.*;
+import java.awt.dnd.*;
+import java.awt.dnd.peer.DragSourceContextPeer;
+import java.awt.im.InputMethodHighlight;
+import java.awt.im.spi.InputMethodDescriptor;
+import java.awt.image.*;
+import java.awt.datatransfer.Clipboard;
+import java.awt.peer.*;
+import java.util.Map;
+import java.util.Properties;
+
+/*
+ * HToolkit is a platform independent Toolkit used
+ * with the HeadlessToolkit.  It is primarily used
+ * in embedded JRE's that do not have sun/awt/X11 classes.
+ */
+public class HToolkit extends SunToolkit
+    implements ComponentFactory {
+
+    public HToolkit() {
+    }
+
+    /*
+     * Component peer objects - unsupported.
+     */
+
+    public WindowPeer createWindow(Window target)
+        throws HeadlessException {
+        throw new HeadlessException();
+    }
+
+    public FramePeer createFrame(Frame target)
+        throws HeadlessException {
+        throw new HeadlessException();
+    }
+
+    public DialogPeer createDialog(Dialog target)
+        throws HeadlessException {
+        throw new HeadlessException();
+    }
+
+    public ButtonPeer createButton(Button target)
+        throws HeadlessException {
+        throw new HeadlessException();
+    }
+
+    public TextFieldPeer createTextField(TextField target)
+        throws HeadlessException {
+        throw new HeadlessException();
+    }
+
+    public ChoicePeer createChoice(Choice target)
+        throws HeadlessException {
+        throw new HeadlessException();
+    }
+
+    public LabelPeer createLabel(Label target)
+        throws HeadlessException {
+        throw new HeadlessException();
+    }
+
+    public ListPeer createList(List target)
+        throws HeadlessException {
+        throw new HeadlessException();
+    }
+
+    public CheckboxPeer createCheckbox(Checkbox target)
+        throws HeadlessException {
+        throw new HeadlessException();
+    }
+
+    public ScrollbarPeer createScrollbar(Scrollbar target)
+        throws HeadlessException {
+        throw new HeadlessException();
+    }
+
+    public ScrollPanePeer createScrollPane(ScrollPane target)
+        throws HeadlessException {
+        throw new HeadlessException();
+    }
+
+    public TextAreaPeer createTextArea(TextArea target)
+        throws HeadlessException {
+        throw new HeadlessException();
+    }
+
+    public FileDialogPeer createFileDialog(FileDialog target)
+        throws HeadlessException {
+        throw new HeadlessException();
+    }
+
+    public MenuBarPeer createMenuBar(MenuBar target)
+        throws HeadlessException {
+        throw new HeadlessException();
+    }
+
+    public MenuPeer createMenu(Menu target)
+        throws HeadlessException {
+        throw new HeadlessException();
+    }
+
+    public PopupMenuPeer createPopupMenu(PopupMenu target)
+        throws HeadlessException {
+        throw new HeadlessException();
+    }
+
+    public MenuItemPeer createMenuItem(MenuItem target)
+        throws HeadlessException {
+        throw new HeadlessException();
+    }
+
+    public CheckboxMenuItemPeer createCheckboxMenuItem(CheckboxMenuItem target)
+        throws HeadlessException {
+        throw new HeadlessException();
+    }
+
+    public DragSourceContextPeer createDragSourceContextPeer(
+        DragGestureEvent dge)
+        throws InvalidDnDOperationException {
+        throw new InvalidDnDOperationException("Headless environment");
+    }
+
+    public RobotPeer createRobot(Robot target, GraphicsDevice screen)
+        throws AWTException, HeadlessException {
+        throw new HeadlessException();
+    }
+
+    public KeyboardFocusManagerPeer createKeyboardFocusManagerPeer(KeyboardFocusManager manager) {
+        // See 6833019.
+        return
+            new KeyboardFocusManagerPeer() {
+                public Window getCurrentFocusedWindow() { return null; }
+                public void setCurrentFocusOwner(Component comp) {}
+                public Component getCurrentFocusOwner() { return null; }
+                public void clearGlobalFocusOwner(Window activeWindow) {}
+            };
+    }
+
+    public TrayIconPeer createTrayIcon(TrayIcon target)
+      throws HeadlessException {
+        throw new HeadlessException();
+    }
+
+    public SystemTrayPeer createSystemTray(SystemTray target)
+      throws HeadlessException {
+        throw new HeadlessException();
+    }
+
+    public boolean isTraySupported() {
+        return false;
+    }
+
+    public GlobalCursorManager getGlobalCursorManager()
+        throws HeadlessException {
+        throw new HeadlessException();
+    }
+
+    /*
+     * Headless toolkit - unsupported.
+     */
+    protected void loadSystemColors(int[] systemColors)
+        throws HeadlessException {
+        throw new HeadlessException();
+    }
+
+    public ColorModel getColorModel()
+        throws HeadlessException {
+        throw new HeadlessException();
+    }
+
+    public int getScreenResolution()
+        throws HeadlessException {
+        throw new HeadlessException();
+    }
+
+    public Map mapInputMethodHighlight(InputMethodHighlight highlight)
+        throws HeadlessException {
+        throw new HeadlessException();
+    }
+
+    public int getMenuShortcutKeyMask()
+        throws HeadlessException {
+        throw new HeadlessException();
+    }
+
+    public boolean getLockingKeyState(int keyCode)
+        throws UnsupportedOperationException {
+        throw new HeadlessException();
+    }
+
+    public void setLockingKeyState(int keyCode, boolean on)
+        throws UnsupportedOperationException {
+        throw new HeadlessException();
+    }
+
+    public Cursor createCustomCursor(Image cursor, Point hotSpot, String name)
+        throws IndexOutOfBoundsException, HeadlessException {
+        throw new HeadlessException();
+    }
+
+    public Dimension getBestCursorSize(int preferredWidth, int preferredHeight)
+        throws HeadlessException {
+        throw new HeadlessException();
+    }
+
+    public int getMaximumCursorColors()
+        throws HeadlessException {
+        throw new HeadlessException();
+    }
+
+    public <T extends DragGestureRecognizer> T
+        createDragGestureRecognizer(Class<T> abstractRecognizerClass,
+                                    DragSource ds, Component c,
+                                    int srcActions, DragGestureListener dgl)
+    {
+        return null;
+    }
+
+    public int getScreenHeight()
+        throws HeadlessException {
+        throw new HeadlessException();
+    }
+
+    public int getScreenWidth()
+        throws HeadlessException {
+        throw new HeadlessException();
+    }
+
+    public Dimension getScreenSize()
+        throws HeadlessException {
+        throw new HeadlessException();
+    }
+
+    public Insets getScreenInsets(GraphicsConfiguration gc)
+        throws HeadlessException {
+        throw new HeadlessException();
+    }
+
+    public void setDynamicLayout(boolean dynamic)
+        throws HeadlessException {
+        throw new HeadlessException();
+    }
+
+    protected boolean isDynamicLayoutSet()
+        throws HeadlessException {
+        throw new HeadlessException();
+    }
+
+    public boolean isDynamicLayoutActive()
+        throws HeadlessException {
+        throw new HeadlessException();
+    }
+
+    public Clipboard getSystemClipboard()
+        throws HeadlessException {
+        throw new HeadlessException();
+    }
+
+    /*
+     * Printing
+     */
+    public PrintJob getPrintJob(Frame frame, String jobtitle,
+        JobAttributes jobAttributes,
+        PageAttributes pageAttributes) {
+        if (frame != null) {
+            // Should never happen
+            throw new HeadlessException();
+        }
+        throw new IllegalArgumentException(
+                "PrintJob not supported in a headless environment");
+    }
+
+    public PrintJob getPrintJob(Frame frame, String doctitle, Properties props)
+    {
+        if (frame != null) {
+            // Should never happen
+            throw new HeadlessException();
+        }
+        throw new IllegalArgumentException(
+                "PrintJob not supported in a headless environment");
+    }
+
+    /*
+     * Headless toolkit - supported.
+     */
+
+    public void sync() {
+        // Do nothing
+    }
+
+    protected boolean syncNativeQueue(final long timeout) {
+        return false;
+    }
+
+    public void beep() {
+        // Send alert character
+        System.out.write(0x07);
+    }
+
+
+    /*
+     * Fonts
+     */
+    public FontPeer getFontPeer(String name, int style) {
+        return (FontPeer)null;
+    }
+
+    /*
+     * Modality
+     */
+    public boolean isModalityTypeSupported(Dialog.ModalityType modalityType) {
+        return false;
+    }
+
+    public boolean isModalExclusionTypeSupported(Dialog.ModalExclusionType exclusionType) {
+        return false;
+    }
+
+    public boolean isDesktopSupported() {
+        return false;
+    }
+
+    public DesktopPeer createDesktopPeer(Desktop target)
+    throws HeadlessException{
+        throw new HeadlessException();
+    }
+
+    public boolean isWindowOpacityControlSupported() {
+        return false;
+    }
+
+    public boolean isWindowShapingSupported() {
+        return false;
+    }
+
+    public boolean isWindowTranslucencySupported() {
+        return false;
+    }
+
+    public  void grab(Window w) { }
+
+    public void ungrab(Window w) { }
+
+    protected boolean syncNativeQueue() { return false; }
+
+    public InputMethodDescriptor getInputMethodAdapterDescriptor()
+        throws AWTException
+    {
+        return (InputMethodDescriptor)null;
+    }
+}
--- a/src/share/classes/sun/awt/HeadlessToolkit.java	Thu Apr 07 15:21:10 2011 -0700
+++ b/src/share/classes/sun/awt/HeadlessToolkit.java	Sun Apr 10 10:23:28 2011 -0700
@@ -320,8 +320,7 @@
             // Should never happen
             throw new HeadlessException();
         }
-        throw new IllegalArgumentException(
-                "PrintJob not supported in a headless environment");
+        throw new NullPointerException("frame must not be null");
     }
 
     public PrintJob getPrintJob(Frame frame, String doctitle, Properties props)
@@ -330,8 +329,7 @@
             // Should never happen
             throw new HeadlessException();
         }
-        throw new IllegalArgumentException(
-                "PrintJob not supported in a headless environment");
+        throw new NullPointerException("frame must not be null");
     }
 
     /*
--- a/src/share/classes/sun/font/FontManagerForSGE.java	Thu Apr 07 15:21:10 2011 -0700
+++ b/src/share/classes/sun/font/FontManagerForSGE.java	Sun Apr 10 10:23:28 2011 -0700
@@ -54,4 +54,11 @@
     public Font[] getAllInstalledFonts();
 
     public String[] getInstalledFontFamilyNames(Locale requestedLocale);
+
+    /* Modifies the behaviour of a subsequent call to preferLocaleFonts()
+     * to use Mincho instead of Gothic for dialoginput in JA locales
+     * on windows. Not needed on other platforms.
+     */
+    public void useAlternateFontforJALocales();
+
 }
--- a/src/share/classes/sun/font/SunFontManager.java	Thu Apr 07 15:21:10 2011 -0700
+++ b/src/share/classes/sun/font/SunFontManager.java	Sun Apr 10 10:23:28 2011 -0700
@@ -2874,7 +2874,10 @@
      * on windows. Not needed on other platforms.
      */
     public synchronized void useAlternateFontforJALocales() {
-
+        if (FontUtilities.isLogging()) {
+            FontUtilities.getLogger()
+                .info("Entered useAlternateFontforJALocales().");
+        }
         if (!FontUtilities.isWindows) {
             return;
         }
@@ -2897,7 +2900,9 @@
     }
 
     public synchronized void preferLocaleFonts() {
-
+        if (FontUtilities.isLogging()) {
+            FontUtilities.getLogger().info("Entered preferLocaleFonts().");
+        }
         /* Test if re-ordering will have any effect */
         if (!FontConfiguration.willReorderForStartupLocale()) {
             return;
@@ -2928,7 +2933,10 @@
     }
 
     public synchronized void preferProportionalFonts() {
-
+        if (FontUtilities.isLogging()) {
+            FontUtilities.getLogger()
+                .info("Entered preferProportionalFonts().");
+        }
         /* If no proportional fonts are configured, there's no need
          * to take any action.
          */
@@ -3456,6 +3464,11 @@
         initCompositeFonts(FontConfiguration fontConfig,
                            ConcurrentHashMap<String, Font2D>  altNameCache) {
 
+        if (FontUtilities.isLogging()) {
+            FontUtilities.getLogger()
+                            .info("Initialising composite fonts");
+        }
+
         int numCoreFonts = fontConfig.getNumberCoreFonts();
         String[] fcFonts = fontConfig.getPlatformFontNames();
         for (int f=0; f<fcFonts.length; f++) {
--- a/src/share/classes/sun/java2d/SunGraphicsEnvironment.java	Thu Apr 07 15:21:10 2011 -0700
+++ b/src/share/classes/sun/java2d/SunGraphicsEnvironment.java	Sun Apr 10 10:23:28 2011 -0700
@@ -185,6 +185,18 @@
         FontManager fm = FontManagerFactory.getInstance();
         return (FontManagerForSGE) fm;
     }
+
+    /* Modifies the behaviour of a subsequent call to preferLocaleFonts()
+     * to use Mincho instead of Gothic for dialoginput in JA locales
+     * on windows. Not needed on other platforms.
+     *
+     * DO NOT MOVE OR RENAME OR OTHERWISE ALTER THIS METHOD.
+     * ITS USED BY SOME NON-JRE INTERNAL CODE.
+     */
+    public static void useAlternateFontforJALocales() {
+        getFontManagerForSGE().useAlternateFontforJALocales();
+    }
+
      /**
      * Returns all fonts available in this environment.
      */
--- a/src/share/classes/sun/management/ManagementFactoryHelper.java	Thu Apr 07 15:21:10 2011 -0700
+++ b/src/share/classes/sun/management/ManagementFactoryHelper.java	Sun Apr 10 10:23:28 2011 -0700
@@ -27,20 +27,18 @@
 
 import java.lang.management.*;
 
-import javax.management.MBeanServer;
-import javax.management.ObjectName;
 import javax.management.InstanceAlreadyExistsException;
 import javax.management.InstanceNotFoundException;
+import javax.management.MBeanServer;
 import javax.management.MBeanRegistrationException;
 import javax.management.NotCompliantMBeanException;
+import javax.management.ObjectName;
 import javax.management.RuntimeOperationsException;
-import java.nio.BufferPoolMXBean;
 import java.security.AccessController;
 import java.security.PrivilegedActionException;
 import java.security.PrivilegedExceptionAction;
 import sun.security.action.LoadLibraryAction;
 
-import java.util.logging.PlatformLoggingMXBean;
 import sun.util.logging.LoggingSupport;
 
 import java.util.ArrayList;
@@ -139,61 +137,80 @@
         return result;
     }
 
-    public static List<PlatformLoggingMXBean> getLoggingMXBean() {
+    public static PlatformLoggingMXBean getPlatformLoggingMXBean() {
         if (LoggingSupport.isAvailable()) {
-            return Collections.singletonList(createPlatformLoggingMXBean());
+            return PlatformLoggingImpl.instance;
         } else {
-            return Collections.emptyList();
+            return null;
         }
     }
 
-    private final static String LOGGING_MXBEAN_NAME = "java.util.logging:type=Logging";
-    private static PlatformLoggingMXBean createPlatformLoggingMXBean() {
-        return new PlatformLoggingMXBean() {
-            private volatile ObjectName objname;  // created lazily
-            @Override
-            public ObjectName getObjectName() {
-                ObjectName result = objname;
-                if (result == null) {
-                    synchronized (this) {
-                        if (objname == null) {
-                            result = Util.newObjectName(LOGGING_MXBEAN_NAME);
-                            objname = result;
-                        }
+    // The logging MXBean object is an instance of
+    // PlatformLoggingMXBean and java.util.logging.LoggingMXBean
+    // but it can't directly implement two MXBean interfaces
+    // as a compliant MXBean implements exactly one MXBean interface,
+    // or if it implements one interface that is a subinterface of
+    // all the others; otherwise, it is a non-compliant MXBean
+    // and MBeanServer will throw NotCompliantMBeanException.
+    // See the Definition of an MXBean section in javax.management.MXBean spec.
+    //
+    // To create a compliant logging MXBean, define a LoggingMXBean interface
+    // that extend PlatformLoggingMXBean and j.u.l.LoggingMXBean
+    interface LoggingMXBean
+        extends PlatformLoggingMXBean, java.util.logging.LoggingMXBean {
+    }
+
+    static class PlatformLoggingImpl implements LoggingMXBean
+    {
+        final static PlatformLoggingMXBean instance = new PlatformLoggingImpl();
+        final static String LOGGING_MXBEAN_NAME = "java.util.logging:type=Logging";
+
+        private volatile ObjectName objname;  // created lazily
+        @Override
+        public ObjectName getObjectName() {
+            ObjectName result = objname;
+            if (result == null) {
+                synchronized (this) {
+                    if (objname == null) {
+                        result = Util.newObjectName(LOGGING_MXBEAN_NAME);
+                        objname = result;
                     }
                 }
-                return result;
             }
+            return result;
+        }
 
-            @Override
-            public java.util.List<String> getLoggerNames() {
-                return LoggingSupport.getLoggerNames();
-            }
+        @Override
+        public java.util.List<String> getLoggerNames() {
+            return LoggingSupport.getLoggerNames();
+        }
 
-            @Override
-            public String getLoggerLevel(String loggerName) {
-                return LoggingSupport.getLoggerLevel(loggerName);
-            }
+        @Override
+        public String getLoggerLevel(String loggerName) {
+            return LoggingSupport.getLoggerLevel(loggerName);
+        }
 
-            @Override
-            public void setLoggerLevel(String loggerName, String levelName) {
-                LoggingSupport.setLoggerLevel(loggerName, levelName);
-            }
+        @Override
+        public void setLoggerLevel(String loggerName, String levelName) {
+            LoggingSupport.setLoggerLevel(loggerName, levelName);
+        }
 
-            @Override
-            public String getParentLoggerName(String loggerName) {
-                return LoggingSupport.getParentLoggerName(loggerName);
-            }
-        };
+        @Override
+        public String getParentLoggerName(String loggerName) {
+            return LoggingSupport.getParentLoggerName(loggerName);
+        }
     }
 
-    public static List<BufferPoolMXBean> getBufferPoolMXBeans() {
-        List<BufferPoolMXBean> pools = new ArrayList<BufferPoolMXBean>(2);
-        pools.add(createBufferPoolMXBean(sun.misc.SharedSecrets.getJavaNioAccess()
-            .getDirectBufferPool()));
-        pools.add(createBufferPoolMXBean(sun.nio.ch.FileChannelImpl
-            .getMappedBufferPool()));
-        return pools;
+    private static List<BufferPoolMXBean> bufferPools = null;
+    public static synchronized List<BufferPoolMXBean> getBufferPoolMXBeans() {
+        if (bufferPools == null) {
+            bufferPools = new ArrayList<>(2);
+            bufferPools.add(createBufferPoolMXBean(sun.misc.SharedSecrets.getJavaNioAccess()
+                .getDirectBufferPool()));
+            bufferPools.add(createBufferPoolMXBean(sun.nio.ch.FileChannelImpl
+                .getMappedBufferPool()));
+        }
+        return bufferPools;
     }
 
     private final static String BUFFER_POOL_MXBEAN_NAME = "java.nio:type=BufferPool";
--- a/src/share/classes/sun/misc/Version.java.template	Thu Apr 07 15:21:10 2011 -0700
+++ b/src/share/classes/sun/misc/Version.java.template	Sun Apr 10 10:23:28 2011 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -36,8 +36,8 @@
         "@@java_version@@";
 
     private static final String java_runtime_name =
-        "@@java_runtime_name@@";
-
+	"@@java_runtime_name@@";
+ 
     private static final String java_runtime_version =
         "@@java_runtime_version@@";
 
@@ -87,12 +87,26 @@
      * Give a stream, it will print version info on it.
      */
     public static void print(PrintStream ps) {
+        boolean isHeadless = false;
+
+        /* Report that we're running headless if the property is true */
+	String headless = System.getProperty("java.awt.headless");
+	if ( (headless != null) && (headless.equalsIgnoreCase("true")) ) {
+            isHeadless = true;
+	} 
+
         /* First line: platform version. */
         ps.println(launcher_name + " version \"" + java_version + "\"");
 
         /* Second line: runtime version (ie, libraries). */
-        ps.println(java_runtime_name + " (build " +
-                           java_runtime_version + ")");
+
+	ps.print(java_runtime_name + " (build " + java_runtime_version);
+
+	if (java_runtime_name.indexOf("Embedded") != -1 && isHeadless) {
+	    // embedded builds report headless state
+	    ps.print(", headless");
+	}
+	ps.println(')');
 
         /* Third line: JVM information. */
         String java_vm_name    = System.getProperty("java.vm.name");
--- a/src/share/classes/sun/nio/fs/Util.java	Thu Apr 07 15:21:10 2011 -0700
+++ b/src/share/classes/sun/nio/fs/Util.java	Sun Apr 10 10:23:28 2011 -0700
@@ -26,6 +26,7 @@
 package sun.nio.fs;
 
 import java.util.*;
+import java.nio.file.*;
 
 /**
  * Utility methods
@@ -80,4 +81,21 @@
         }
         return set;
     }
+
+    /**
+     * Returns {@code true} if symbolic links should be followed
+     */
+    static boolean followLinks(LinkOption... options) {
+        boolean followLinks = true;
+        for (LinkOption option: options) {
+            if (option == LinkOption.NOFOLLOW_LINKS) {
+                followLinks = false;
+            } else if (option == null) {
+                throw new NullPointerException();
+            } else {
+                throw new AssertionError("Should not get here");
+            }
+        }
+        return followLinks;
+    }
 }
--- a/src/share/classes/sun/security/krb5/Realm.java	Thu Apr 07 15:21:10 2011 -0700
+++ b/src/share/classes/sun/security/krb5/Realm.java	Sun Apr 10 10:23:28 2011 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -362,19 +362,15 @@
         Stack<String> iStack = new Stack<>();
 
         /*
-         * I don't expect any more than a handful of intermediaries.
+         * The half-established reversed-path, starting from the final target
+         * (sRealm), each item can be connected to by the next one.
+         * Might contains wrong item, if found, a bad track is performed
          */
         Vector<String> tempList = new Vector<>(8, 8);
-
-        /*
-         * The initiator at first location.
-         */
-        tempList.add(cRealm);
+        tempList.add(sRealm);
 
         int count = 0; // For debug only
-        if (DEBUG) {
-            tempTarget = sRealm;
-        }
+        tempTarget = sRealm;
 
         out: do {
             if (DEBUG) {
@@ -384,8 +380,8 @@
             }
 
             if (intermediaries != null &&
-                !intermediaries.equals(PrincipalName.REALM_COMPONENT_SEPARATOR_STR))
-            {
+                !intermediaries.equals(".") &&
+                !intermediaries.equals(cRealm)) {
                 if (DEBUG) {
                     System.out.println(">>> Realm parseCapaths: loop " +
                                        count + ": intermediaries=[" +
@@ -466,11 +462,15 @@
 
         } while (true);
 
+        if (tempList.isEmpty()) {
+            return null;
+        }
+
+        // From (SREALM, T1, T2) to (CREALM, T2, T1)
         retList = new String[tempList.size()];
-        try {
-            retList = tempList.toArray(retList);
-        } catch (ArrayStoreException exc) {
-            retList = null;
+        retList[0] = cRealm;
+        for (int i=1; i<tempList.size(); i++) {
+            retList[i] = tempList.elementAt(tempList.size()-i);
         }
 
         if (DEBUG && retList != null) {
--- a/src/share/classes/sun/security/ssl/HandshakeMessage.java	Thu Apr 07 15:21:10 2011 -0700
+++ b/src/share/classes/sun/security/ssl/HandshakeMessage.java	Sun Apr 10 10:23:28 2011 -0700
@@ -1,5 +1,5 @@
 /*
- * copyright (c) 1996, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1996, 2011, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -694,47 +694,6 @@
     // the preferable signature algorithm used by this ServerKeyExchange message
     private SignatureAndHashAlgorithm preferableSignatureAlgorithm;
 
-    /* Return the Diffie-Hellman modulus */
-    BigInteger getModulus() {
-        return new BigInteger(1, dh_p);
-    }
-
-    /* Return the Diffie-Hellman base/generator */
-    BigInteger getBase() {
-        return new BigInteger(1, dh_g);
-    }
-
-    /* Return the server's Diffie-Hellman public key */
-    BigInteger getServerPublicKey() {
-        return new BigInteger(1, dh_Ys);
-    }
-
-    /*
-     * Update sig with nonces and Diffie-Hellman public key.
-     */
-    private void updateSignature(Signature sig, byte clntNonce[],
-            byte svrNonce[]) throws SignatureException {
-        int tmp;
-
-        sig.update(clntNonce);
-        sig.update(svrNonce);
-
-        tmp = dh_p.length;
-        sig.update((byte)(tmp >> 8));
-        sig.update((byte)(tmp & 0x0ff));
-        sig.update(dh_p);
-
-        tmp = dh_g.length;
-        sig.update((byte)(tmp >> 8));
-        sig.update((byte)(tmp & 0x0ff));
-        sig.update(dh_g);
-
-        tmp = dh_Ys.length;
-        sig.update((byte)(tmp >> 8));
-        sig.update((byte)(tmp & 0x0ff));
-        sig.update(dh_Ys);
-    }
-
     /*
      * Construct from initialized DH key object, for DH_anon
      * key exchange.
@@ -779,12 +738,6 @@
         signature = sig.sign();
     }
 
-    private void setValues(DHCrypt obj) {
-        dh_p = toByteArray(obj.getModulus());
-        dh_g = toByteArray(obj.getBase());
-        dh_Ys = toByteArray(obj.getPublicKey());
-    }
-
     /*
      * Construct a DH_ServerKeyExchange message from an input
      * stream, as if sent from server to client for use with
@@ -875,6 +828,53 @@
         }
     }
 
+    /* Return the Diffie-Hellman modulus */
+    BigInteger getModulus() {
+        return new BigInteger(1, dh_p);
+    }
+
+    /* Return the Diffie-Hellman base/generator */
+    BigInteger getBase() {
+        return new BigInteger(1, dh_g);
+    }
+
+    /* Return the server's Diffie-Hellman public key */
+    BigInteger getServerPublicKey() {
+        return new BigInteger(1, dh_Ys);
+    }
+
+    /*
+     * Update sig with nonces and Diffie-Hellman public key.
+     */
+    private void updateSignature(Signature sig, byte clntNonce[],
+            byte svrNonce[]) throws SignatureException {
+        int tmp;
+
+        sig.update(clntNonce);
+        sig.update(svrNonce);
+
+        tmp = dh_p.length;
+        sig.update((byte)(tmp >> 8));
+        sig.update((byte)(tmp & 0x0ff));
+        sig.update(dh_p);
+
+        tmp = dh_g.length;
+        sig.update((byte)(tmp >> 8));
+        sig.update((byte)(tmp & 0x0ff));
+        sig.update(dh_g);
+
+        tmp = dh_Ys.length;
+        sig.update((byte)(tmp >> 8));
+        sig.update((byte)(tmp & 0x0ff));
+        sig.update(dh_Ys);
+    }
+
+    private void setValues(DHCrypt obj) {
+        dh_p = toByteArray(obj.getModulus());
+        dh_g = toByteArray(obj.getBase());
+        dh_Ys = toByteArray(obj.getPublicKey());
+    }
+
     int messageLength() {
         int temp = 6;   // overhead for p, g, y(s) values.
 
@@ -945,8 +945,7 @@
  * We support named curves only, no explicitly encoded curves.
  */
 static final
-class ECDH_ServerKeyExchange extends ServerKeyExchange
-{
+class ECDH_ServerKeyExchange extends ServerKeyExchange {
 
     // constants for ECCurveType
     private final static int CURVE_EXPLICIT_PRIME = 1;
@@ -1120,10 +1119,12 @@
     }
 
     int messageLength() {
-        int sigLen = (signatureBytes == null) ? 0 : 2 + signatureBytes.length;
-
-        if (protocolVersion.v >= ProtocolVersion.TLS12.v) {
-            sigLen += SignatureAndHashAlgorithm.sizeInRecord();
+        int sigLen = 0;
+        if (signatureBytes != null) {
+            sigLen = 2 + signatureBytes.length;
+            if (protocolVersion.v >= ProtocolVersion.TLS12.v) {
+                sigLen += SignatureAndHashAlgorithm.sizeInRecord();
+            }
         }
 
         return 4 + pointBytes.length + sigLen;
@@ -1133,12 +1134,13 @@
         s.putInt8(CURVE_NAMED_CURVE);
         s.putInt16(curveId);
         s.putBytes8(pointBytes);
-        if (protocolVersion.v >= ProtocolVersion.TLS12.v) {
-            s.putInt8(preferableSignatureAlgorithm.getHashValue());
-            s.putInt8(preferableSignatureAlgorithm.getSignatureValue());
-        }
 
         if (signatureBytes != null) {
+            if (protocolVersion.v >= ProtocolVersion.TLS12.v) {
+                s.putInt8(preferableSignatureAlgorithm.getHashValue());
+                s.putInt8(preferableSignatureAlgorithm.getSignatureValue());
+            }
+
             s.putBytes16(signatureBytes);
         }
     }
@@ -1147,9 +1149,13 @@
         s.println("*** ECDH ServerKeyExchange");
 
         if (debug != null && Debug.isOn("verbose")) {
-            if (protocolVersion.v >= ProtocolVersion.TLS12.v) {
-                s.println("Signature Algorithm " +
-                        preferableSignatureAlgorithm.getAlgorithmName());
+            if (signatureBytes == null) {
+                s.println("Anonymous");
+            } else {
+                if (protocolVersion.v >= ProtocolVersion.TLS12.v) {
+                    s.println("Signature Algorithm " +
+                            preferableSignatureAlgorithm.getAlgorithmName());
+                }
             }
 
             s.println("Server key: " + publicKey);
--- a/src/share/classes/sun/security/tools/JarSigner.java	Thu Apr 07 15:21:10 2011 -0700
+++ b/src/share/classes/sun/security/tools/JarSigner.java	Sun Apr 10 10:23:28 2011 -0700
@@ -1238,10 +1238,11 @@
                 // Provide a helpful message when TSA is beyond a firewall
                 error(rb.getString("unable.to.sign.jar.") +
                 rb.getString("no.response.from.the.Timestamping.Authority.") +
-                rb.getString("When.connecting.from.behind.a.firewall.then.an.HTTP.proxy.may.need.to.be.specified.") +
-                rb.getString("Supply.the.following.options.to.jarsigner.") +
-                "\n  -J-Dhttp.proxyHost=<hostname> " +
-                "\n  -J-Dhttp.proxyPort=<portnumber> ", e);
+                "\n  -J-Dhttp.proxyHost=<hostname>" +
+                "\n  -J-Dhttp.proxyPort=<portnumber>\n" +
+                rb.getString("or") +
+                "\n  -J-Dhttps.proxyHost=<hostname> " +
+                "\n  -J-Dhttps.proxyPort=<portnumber> ", e);
             }
 
             sfFilename = sf.getMetaName();
--- a/src/share/classes/sun/security/tools/JarSignerResources.java	Thu Apr 07 15:21:10 2011 -0700
+++ b/src/share/classes/sun/security/tools/JarSignerResources.java	Sun Apr 10 10:23:28 2011 -0700
@@ -181,11 +181,10 @@
         {"TSA.location.", "TSA location: "},
         {"TSA.certificate.", "TSA certificate: "},
         {"no.response.from.the.Timestamping.Authority.",
-                "no response from the Timestamping Authority. "},
-        {"When.connecting.from.behind.a.firewall.then.an.HTTP.proxy.may.need.to.be.specified.",
-                "When connecting from behind a firewall then an HTTP proxy may need to be specified. "},
-        {"Supply.the.following.options.to.jarsigner.",
-                "Supply the following options to jarsigner: "},
+                "no response from the Timestamping Authority. When connecting"
+                + " from behind a firewall an HTTP or HTTPS proxy may need to"
+                + " be specified. Supply the following options to jarsigner:"},
+        {"or", "or"},
         {"Certificate.not.found.for.alias.alias.must.reference.a.valid.KeyStore.entry.containing.an.X.509.public.key.certificate.for.the",
                 "Certificate not found for: {0}.  {1} must reference a valid KeyStore entry containing an X.509 public key certificate for the Timestamping Authority."},
         {"using.an.alternative.signing.mechanism",
--- a/src/share/classes/sun/security/tools/KeyTool.java	Thu Apr 07 15:21:10 2011 -0700
+++ b/src/share/classes/sun/security/tools/KeyTool.java	Sun Apr 10 10:23:28 2011 -0700
@@ -1740,16 +1740,19 @@
                 KeyStore.TrustedCertificateEntry.class)) {
             // We have a trusted certificate entry
             Certificate cert = keyStore.getCertificate(alias);
+            Object[] source = {"trustedCertEntry"};
+            String mf = new MessageFormat(
+                    rb.getString("Entry.type.type.")).format(source) + "\n";
             if (verbose && (cert instanceof X509Certificate)) {
-                out.println(rb.getString("Entry.type.trustedCertEntry."));
+                out.println(mf);
                 printX509Cert((X509Certificate)cert, out);
             } else if (rfc) {
-                out.println(rb.getString("Entry.type.trustedCertEntry."));
+                out.println(mf);
                 dumpCert(cert, out);
             } else if (debug) {
                 out.println(cert.toString());
             } else {
-                out.println(rb.getString("trustedCertEntry."));
+                out.println("trustedCertEntry, ");
                 out.println(rb.getString("Certificate.fingerprint.SHA1.")
                             + getCertFingerPrint("SHA1", cert));
             }
@@ -1837,10 +1840,6 @@
             System.err.println(rb.getString
                 (".The.integrity.of.the.information.stored.in.the.srckeystore."));
             System.err.println(rb.getString
-                (".has.NOT.been.verified.In.order.to.verify.its.integrity."));
-            System.err.println(rb.getString
-                (".you.must.provide.the.srckeystore.password."));
-            System.err.println(rb.getString
                 (".WARNING.WARNING.WARNING."));
             System.err.println();
         }
@@ -3187,10 +3186,6 @@
         System.err.println(rb.getString
             (".The.integrity.of.the.information.stored.in.your.keystore."));
         System.err.println(rb.getString
-            (".has.NOT.been.verified.In.order.to.verify.its.integrity."));
-        System.err.println(rb.getString
-            (".you.must.provide.your.keystore.password."));
-        System.err.println(rb.getString
             (".WARNING.WARNING.WARNING."));
         System.err.println();
     }
--- a/src/share/classes/sun/security/tools/TimestampedSigner.java	Thu Apr 07 15:21:10 2011 -0700
+++ b/src/share/classes/sun/security/tools/TimestampedSigner.java	Sun Apr 10 10:23:28 2011 -0700
@@ -250,10 +250,10 @@
      * (<a href="http://www.ietf.org/rfc/rfc3280.txt">RFC 3280</a>).
      * The extension's <tt>accessMethod</tt> field should contain the object
      * identifier defined for timestamping: 1.3.6.1.5.5.7.48.3 and its
-     * <tt>accessLocation</tt> field should contain an HTTP URL.
+     * <tt>accessLocation</tt> field should contain an HTTP or HTTPS URL.
      *
      * @param tsaCertificate An X.509 certificate for the TSA.
-     * @return An HTTP URL or null if none was found.
+     * @return An HTTP or HTTPS URL or null if none was found.
      */
     public static String getTimestampingUrl(X509Certificate tsaCertificate) {
 
@@ -279,7 +279,8 @@
                     location = description.getAccessLocation();
                     if (location.getType() == GeneralNameInterface.NAME_URI) {
                         uri = (URIName) location.getName();
-                        if (uri.getScheme().equalsIgnoreCase("http")) {
+                        if (uri.getScheme().equalsIgnoreCase("http") ||
+                                uri.getScheme().equalsIgnoreCase("https")) {
                             return uri.getName();
                         }
                     }
--- a/src/share/classes/sun/security/util/AuthResources.java	Thu Apr 07 15:21:10 2011 -0700
+++ b/src/share/classes/sun/security/util/AuthResources.java	Sun Apr 10 10:23:28 2011 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -111,17 +111,15 @@
 
         // com.sun.security.auth.PolicyParser
         {"expected.keystore.type", "expected keystore type"},
-        {"can.not.specify.Principal.with.a.",
-                "can not specify Principal with a "},
-        {"wildcard.class.without.a.wildcard.name",
-                "wildcard class without a wildcard name"},
+        {"can.not.specify.Principal.with.a.wildcard.class.without.a.wildc